:root {
    --re-primary: #062B5C;
    --re-secondary: #0B3D78;
    --re-green: #39A900;
    --re-green-light: #6BCB2A;
    --re-white: #FFFFFF;
    --re-bg: #F5F8FC;
    --re-sidebar-width: 270px;
    --re-topbar-height: 64px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--re-bg);
    color: #1a2b4a;
    margin: 0;
}

.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--re-primary) 0%, var(--re-secondary) 60%, #0a4d8c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(6, 43, 92, 0.35);
}

.auth-brand { text-align: center; color: #fff; margin-bottom: 1.5rem; }
.auth-brand .logo-icon { font-size: 3rem; color: var(--re-green-light); }
.auth-brand h1 { font-size: 1.75rem; font-weight: 700; margin: .5rem 0 0; }
.auth-brand p { opacity: .75; margin: 0; }

.btn-re-primary {
    background: var(--re-green);
    border-color: var(--re-green);
    color: #fff;
    font-weight: 600;
}
.btn-re-primary:hover {
    background: var(--re-green-light);
    border-color: var(--re-green-light);
    color: #fff;
}

.admin-wrapper { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--re-sidebar-width);
    background: var(--re-primary);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .3s ease, width .3s;
}

.admin-sidebar.collapsed { width: 72px; }
.admin-sidebar.collapsed .sidebar-text,
.admin-sidebar.collapsed .sidebar-label,
.admin-sidebar.collapsed .submenu-arrow { display: none !important; }
.admin-sidebar.collapsed .sidebar-brand-text { display: none; }

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--re-green);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-brand h6 { margin: 0; font-weight: 700; font-size: .95rem; line-height: 1.2; }
.sidebar-brand small { opacity: .65; font-size: .7rem; }

.sidebar-nav { padding: .75rem .5rem 2rem; }

.sidebar-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.4);
    padding: .75rem 1rem .25rem;
}

.nav-item-re > .nav-link {
    color: rgba(255,255,255,.75);
    border-radius: 8px;
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .875rem;
    text-decoration: none;
    transition: all .15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item-re > .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item-re > .nav-link.active { background: var(--re-green); color: #fff; font-weight: 600; }
.nav-item-re > .nav-link i { width: 20px; text-align: center; }

.submenu {
    list-style: none;
    padding: .25rem 0 .25rem 2rem;
    margin: 0;
    display: none;
}
.submenu.show { display: block; }
.submenu .nav-link {
    color: rgba(255,255,255,.6);
    font-size: .8rem;
    padding: .4rem .75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
}
.submenu .nav-link:hover, .submenu .nav-link.active { color: var(--re-green-light); background: rgba(255,255,255,.05); }

.submenu-arrow { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.submenu-arrow.open { transform: rotate(90deg); }

.admin-main {
    flex: 1;
    margin-left: var(--re-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .3s;
}

body.sidebar-collapsed .admin-main { margin-left: 72px; }

.admin-topbar {
    height: var(--re-topbar-height);
    background: var(--re-white);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-toggle {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    color: var(--re-primary);
}

.topbar-company { font-weight: 600; color: var(--re-primary); font-size: .9rem; }

.admin-content { padding: 1.5rem; flex: 1; }

.stat-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(6,43,92,.06);
    transition: transform .15s;
    height: 100%;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.chart-card, .table-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(6,43,92,.06);
}

.table-card { overflow: hidden; }

.page-title { font-size: 1.35rem; font-weight: 700; color: var(--re-primary); margin: 0; }
.page-subtitle { color: #64748b; font-size: .875rem; margin: 0; }

.breadcrumb-re { background: none; padding: 0; margin: 0 0 1rem; font-size: .8rem; }
.breadcrumb-re a { color: var(--re-secondary); text-decoration: none; }

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .85rem .5rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: var(--re-primary);
    font-size: .75rem;
    font-weight: 500;
    transition: all .15s;
}
.quick-btn:hover { border-color: var(--re-green); color: var(--re-green); background: #f0fdf0; }
.quick-btn i { font-size: 1.4rem; margin-bottom: .35rem; }

.toast-container-re { position: fixed; top: 1rem; right: 1rem; z-index: 9999; }
.badge-soon { font-size: .6rem; background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-main, body.sidebar-collapsed .admin-main { margin-left: 0 !important; }
}
