:root {
    --av-bg: #f4f6fb;
    --av-sidebar: #0f172a;
    --av-sidebar-hover: #1e293b;
    --av-accent: #2563eb;
    --av-accent-dark: #1d4ed8;
    --av-text: #1e293b;
    --av-border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--av-bg);
    color: var(--av-text);
}

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

/* Sidebar ------------------------------------------------------------------ */
.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--av-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem 1.25rem;
    text-decoration: none;
    color: #fff;
}

.app-brand-mark {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-brand-text { font-weight: 600; font-size: 1.02rem; line-height: 1.1; }

.app-nav { display: flex; flex-direction: column; gap: 0.2rem; }

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.94rem;
    transition: background .15s, color .15s;
}

.app-nav-link:hover { background: var(--av-sidebar-hover); color: #fff; }
.app-nav-link.active { background: var(--av-accent); color: #fff; }
.app-nav-link i { font-size: 1.05rem; }

.app-nav-sep {
    margin: 1rem 0.75rem 0.35rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

/* Main area ---------------------------------------------------------------- */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--av-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-page-title { font-size: 1.15rem; margin: 0; font-weight: 600; }

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

.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    font-size: 0.82rem;
    color: #64748b;
    border-top: 1px solid var(--av-border);
    background: #fff;
}

/* Cards & tables ----------------------------------------------------------- */
.card { border: 1px solid var(--av-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--av-border); font-weight: 600; }

.stat-card { border-radius: 14px; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: #64748b; font-size: 0.85rem; }
.stat-icon {
    display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 12px;
    font-size: 1.35rem;
}

.table > :not(caption) > * > * { padding: 0.7rem 0.9rem; }
.table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }

/* Login -------------------------------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(1200px 600px at 20% 10%, #1e3a8a, #0f172a 60%);
    padding: 1.5rem;
}
.login-card { width: 100%; max-width: 400px; border-radius: 18px; border: none; box-shadow: 0 24px 60px rgba(2,6,23,.45); }
.login-logo { font-size: 1.4rem; font-weight: 700; }
