/* ── Base ────────────────────────────────────────────── */
:root {
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    margin: 0;
    min-height: 100vh;
    background: #f1f5f9;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

/* ── Custom Scrollbar ─────────────────────────────── */
::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Sidebar ──────────────────────────────────────── */
#sidebar {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.30);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: color 0.2s;
}

/* ── Stat Cards ───────────────────────────────────── */
.stat-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    animation: fadeInUp 0.45s ease both;
}

.stat-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.09);
    transform: translateY(-3px);
}

.stat-card-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    border-radius: 0 0 1rem 1rem;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.stat-card:hover .stat-card-accent {
    transform: scaleX(1);
}

/* Staggered animation delays */
.stat-card:nth-child(1)  { animation-delay: 0.00s; }
.stat-card:nth-child(2)  { animation-delay: 0.06s; }
.stat-card:nth-child(3)  { animation-delay: 0.12s; }
.stat-card:nth-child(4)  { animation-delay: 0.18s; }
.stat-card:nth-child(5)  { animation-delay: 0.24s; }
.stat-card:nth-child(6)  { animation-delay: 0.30s; }
.stat-card:nth-child(7)  { animation-delay: 0.36s; }
.stat-card:nth-child(8)  { animation-delay: 0.42s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Status badge ─────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Mobile overlay ───────────────────────────────── */
#sidebar-overlay         { display: none; }
#sidebar-overlay.active  { display: block; }

/* ── Forms ────────────────────────────────────────── */
input, textarea, select {
    font-family: var(--font-sans);
    font-size: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    border-color: #2563eb !important;
}

button, input, select, textarea { font: inherit; }
table { border-collapse: collapse; }

/* ── Responsive helpers ───────────────────────────── */
@media (max-width: 1023px) {
    main { margin-left: 0 !important; }
}
