:root {
    --sidebar-w: 240px;
    --sidebar-bg: #1a2035;
    --sidebar-text: #9aa0b5;
    --sidebar-active: #ffffff;
    --primary: #0d6efd;
}

/* ── Layout ─────────────────────────────────────── */
body { background: #f0f2f5; font-family: 'Segoe UI', system-ui, sans-serif; }

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

/* ── Sidebar ─────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
}

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

.brand-icon { font-size: 1.8rem; color: #4db8ff; }
.brand-name { font-size: 1.2rem; font-weight: 700; color: #fff; letter-spacing: .02em; }

.sidebar-menu {
    list-style: none;
    padding: .75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .72rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a i { font-size: 1.05rem; width: 1.2rem; }

.sidebar-menu li a:hover {
    color: var(--sidebar-active);
    background: rgba(255,255,255,.06);
}

.sidebar-menu li a.active {
    color: var(--sidebar-active);
    background: rgba(77,184,255,.12);
    border-left-color: #4db8ff;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: .825rem;
}

.user-info { color: var(--sidebar-text); margin-bottom: .5rem; }

.btn-logout {
    color: #ff7b7b;
    text-decoration: none;
    font-size: .82rem;
    transition: color .15s;
}
.btn-logout:hover { color: #ff4444; }

/* ── Main content ────────────────────────────────── */
#content { margin-left: var(--sidebar-w); flex: 1; }
.content-inner { padding: 1.5rem; }

/* ── Page header ─────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #1a2035;
}

/* ── Stat cards ──────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: .875rem;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border-top: 3px solid transparent;
    transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-primary  { border-top-color: #0d6efd; }
.stat-danger   { border-top-color: #dc3545; }
.stat-info     { border-top-color: #0dcaf0; }
.stat-success  { border-top-color: #198754; }
.stat-warning  { border-top-color: #ffc107; }

.stat-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.stat-primary  .stat-icon { color: #0d6efd; }
.stat-danger   .stat-icon { color: #dc3545; }
.stat-info     .stat-icon { color: #0dcaf0; }
.stat-success  .stat-icon { color: #198754; }
.stat-warning  .stat-icon { color: #ffc107; }

.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; color: #1a2035; }
.stat-label { font-size: .75rem; color: #6c757d; margin-top: .35rem; text-transform: uppercase; letter-spacing: .04em; }

/* ── Cards ───────────────────────────────────────── */
.card {
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border-radius: .875rem;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eff0f4;
    padding: .9rem 1.25rem;
    font-weight: 600;
    font-size: .9rem;
    border-radius: .875rem .875rem 0 0 !important;
}

/* ── Tables ──────────────────────────────────────── */
.table th {
    background: #f8f9fc;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    border-bottom: 1px solid #eff0f4;
    padding: .6rem 1rem;
}
.table td { padding: .7rem 1rem; font-size: .875rem; }
.table-hover tbody tr:hover { background: #f8f9fc; }

/* ── Empty state ─────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem; color: #9aa0b5; }

/* ── Buttons ─────────────────────────────────────── */
.btn-xs {
    padding: .15rem .4rem;
    font-size: .75rem;
    border-radius: .35rem;
}

/* ── Login page ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2035 0%, #0d4fa3 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 1.25rem !important;
    border: none !important;
}

/* ── Sticky table header ─────────────────────────── */
.table thead.sticky-top th { top: 0; z-index: 1; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #content { margin-left: 0; }
}
