/* ==========================================================
   MonCentre — thème "poste de contrôle"
   Panneaux vitrés, halos duotone cyan/violet, lecture chiffrée
   en monospace. Un seul geste graphique tenu du bout à l'autre.
   ========================================================== */

:root {
    --void: #05070d;
    --void-2: #090c16;
    --panel: rgba(20, 24, 38, 0.55);
    --panel-solid: #12141f;
    --panel-border: rgba(143, 163, 255, 0.14);
    --panel-border-strong: rgba(143, 163, 255, 0.32);
    --text: #e9edfa;
    --text-muted: #8892ab;

    --cyan: #4ff0ff;
    --violet: #8b6bff;
    --gradient: linear-gradient(120deg, var(--cyan), var(--violet));

    --success: #33e6a0;
    --warning: #ffb648;
    --danger: #ff5d7a;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-glow: 0 0 0 1px var(--panel-border), 0 20px 40px -20px rgba(0, 0, 0, 0.7);

    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--void);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; font-family: var(--font-display); letter-spacing: .2px; }
p { color: var(--text-muted); line-height: 1.55; }

/* ---------- Fond animé : grille + halo ---------- */
.hud-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(79, 240, 255, 0.10), transparent 60%),
        radial-gradient(ellipse 900px 600px at 100% 10%, rgba(139, 107, 255, 0.10), transparent 60%),
        repeating-linear-gradient(0deg, rgba(143, 163, 255, 0.05) 0, rgba(143, 163, 255, 0.05) 1px, transparent 1px, transparent 64px),
        repeating-linear-gradient(90deg, rgba(143, 163, 255, 0.05) 0, rgba(143, 163, 255, 0.05) 1px, transparent 1px, transparent 64px),
        var(--void);
    background-size: auto, auto, auto, auto, auto;
    animation: gridDrift 40s linear infinite;
}
@keyframes gridDrift {
    0%   { background-position: 0% 0%, 100% 0%, 0 0, 0 0, 0 0; }
    100% { background-position: 0% 0%, 100% 0%, 0 640px, 640px 0, 0 0; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-border-strong); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 12, 22, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-border);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
}
.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px 2px var(--cyan);
    animation: pulseDot 2.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.75); }
}
.live-clock {
    font-family: var(--font-mono);
    font-size: .82rem;
    color: var(--text-muted);
    letter-spacing: .5px;
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
}
.burger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}
.user-area { display: flex; align-items: center; gap: 12px; }
.username { color: var(--text-muted); font-size: .85rem; font-family: var(--font-mono); }

/* ---------- Sidenav ---------- */
.sidenav {
    background: rgba(9, 12, 22, 0.55);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--panel-border);
}
.sidenav ul {
    list-style: none;
    margin: 0;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}
.sidenav a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 13px 15px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: .88rem;
    font-weight: 500;
    transition: color .15s ease;
    position: relative;
}
.sidenav a:hover { color: var(--text); }
.sidenav a.active {
    color: var(--cyan);
    border-bottom-color: transparent;
}
.sidenav a.active::after {
    content: '';
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: -2px;
    height: 2px;
    background: var(--gradient);
    box-shadow: 0 0 8px 0 var(--cyan);
}
.nav-icon { font-size: .95rem; }

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 3, 8, .6);
    backdrop-filter: blur(2px);
    z-index: 90;
}

/* ---------- Layout ---------- */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    animation: contentIn .5s ease both;
}
@keyframes contentIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards / widgets ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-glow);
    position: relative;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    animation: cardIn .45s ease both;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--panel-border-strong);
    box-shadow: 0 0 0 1px var(--panel-border-strong), 0 24px 48px -20px rgba(79, 240, 255, 0.15), 0 24px 48px -20px rgba(139, 107, 255, 0.1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.card h3 {
    font-size: .74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    font-family: var(--font-mono);
}
.card .big-number {
    font-family: var(--font-mono);
    font-size: 2.1rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}
.page-header h1 { font-size: 1.4rem; }

/* ---------- Dashboard : accueil + résumé intelligent ---------- */
.dash-hero { margin-bottom: 16px; }
.dash-greeting { font-size: 1.7rem; margin-bottom: 2px; }
.dash-date { color: var(--text-muted); font-size: .88rem; text-transform: capitalize; margin: 0; }

.dash-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 182, 72, 0.06);
    border: 1px solid rgba(255, 182, 72, 0.25);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    margin-bottom: 24px;
    font-size: .9rem;
    color: var(--text);
}
.dash-summary-calm { background: rgba(51, 230, 160, 0.06); border-color: rgba(51, 230, 160, 0.25); }
.dash-summary-icon { font-size: 1.1rem; flex-shrink: 0; }

.kpi-card { position: relative; }
.kpi-flag {
    display: inline-block;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.kpi-flag.danger { color: var(--danger); }

.card-footer-link { margin-top: 14px; margin-bottom: 0; }

/* Accents de module : liseré discret en haut de carte pour repérer d'un coup d'œil */
.card.accent-cyan { border-top: 2px solid rgba(79, 240, 255, .4); }
.card.accent-violet { border-top: 2px solid rgba(139, 107, 255, .4); }
.card.accent-warning { border-top: 2px solid rgba(255, 182, 72, .4); }
.card.accent-success { border-top: 2px solid rgba(51, 230, 160, .4); }

.item-row.item-row-alert {
    border-color: rgba(255, 93, 122, .35);
    background: rgba(255, 93, 122, 0.04);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    font-family: var(--font-body);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary {
    background: var(--gradient);
    color: #05070d;
}
.btn-primary:hover {
    box-shadow: 0 0 24px -4px var(--cyan);
    transform: translateY(-1px);
}
.btn-outline {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 16px -6px var(--cyan);
}
.btn-danger { background: rgba(255, 93, 122, 0.15); color: var(--danger); border: 1px solid rgba(255, 93, 122, 0.3); }
.btn-danger:hover { box-shadow: 0 0 16px -6px var(--danger); }
.btn-small { padding: 6px 12px; font-size: .78rem; }
.btn-icon { padding: 7px 10px; font-size: .9rem; }

/* ---------- Forms ---------- */
form.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
label { display: block; margin: 10px 0 5px; font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-family: var(--font-mono); }
input, select, textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    width: 100%;
    font-family: var(--font-body);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(79, 240, 255, 0.12);
}

/* ---------- Tables / lists ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--panel-border); text-align: left; font-size: .88rem; }
th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: .7rem; font-family: var(--font-mono); letter-spacing: .5px; }
tr { transition: background .15s ease; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 15px 18px;
    flex-wrap: wrap;
    gap: 10px;
    transition: border-color .15s ease, transform .15s ease;
}
.item-row:hover { border-color: var(--panel-border-strong); transform: translateX(2px); }
.item-main { display: flex; flex-direction: column; gap: 4px; }
.item-title { font-weight: 600; }
.item-sub { font-size: .78rem; color: var(--text-muted); font-family: var(--font-mono); }
.item-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: var(--font-mono);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.badge-low, .badge-todo, .badge-ok { background: rgba(51, 230, 160, .12); color: var(--success); }
.badge-medium, .badge-doing, .badge-pending { background: rgba(255, 182, 72, .12); color: var(--warning); }
.badge-high, .badge-done, .badge-confirmed { background: rgba(79, 240, 255, .12); color: var(--cyan); }
.badge-low-stock { background: rgba(255, 182, 72, .12); color: var(--warning); }
.badge-out-of-stock, .badge-cancelled { background: rgba(255, 93, 122, .12); color: var(--danger); }
.badge-auto { background: rgba(139, 107, 255, .15); color: var(--violet); }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .88rem; border: 1px solid transparent; }
.alert-error { background: rgba(255, 93, 122, .1); color: #ff8fa3; border-color: rgba(255, 93, 122, .25); }
.alert-success { background: rgba(51, 230, 160, .1); color: #7cf0c2; border-color: rgba(51, 230, 160, .25); }

/* ---------- Auth pages ---------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 800px 500px at 20% 0%, rgba(79, 240, 255, 0.12), transparent 60%),
        radial-gradient(ellipse 800px 500px at 100% 100%, rgba(139, 107, 255, 0.12), transparent 60%),
        var(--void);
    padding: 20px;
}
.auth-card {
    background: var(--panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-glow);
    animation: cardIn .5s ease both;
}
.auth-card h1 {
    text-align: center;
    font-size: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-card h2 { text-align: center; color: var(--text-muted); font-size: .92rem; font-weight: 400; font-family: var(--font-body); margin-bottom: 22px; }
.auth-form .btn { width: 100%; margin-top: 20px; }
.auth-link { text-align: center; margin-top: 18px; font-size: .84rem; color: var(--text-muted); }
.auth-link a { color: var(--cyan); font-weight: 600; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); font-family: var(--font-mono); font-size: .88rem; }

/* ---------- Progress bar ---------- */
.progress-bar { background: rgba(255, 255, 255, 0.04); border-radius: 20px; overflow: hidden; height: 10px; border: 1px solid var(--panel-border); }
.progress-fill {
    background: var(--gradient);
    height: 100%;
    position: relative;
    transition: width .4s ease;
    box-shadow: 0 0 10px 0 var(--cyan);
}
.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.progress-fill.level-safe { background: linear-gradient(120deg, var(--success), var(--cyan)); box-shadow: 0 0 10px 0 var(--success); }
.progress-fill.level-warning { background: linear-gradient(120deg, var(--warning), #ff8a3d); box-shadow: 0 0 10px 0 var(--warning); }
.progress-fill.level-danger { background: linear-gradient(120deg, var(--danger), #ff3d6e); box-shadow: 0 0 10px 0 var(--danger); }

/* ---------- Budget ---------- */
.budget-hero {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.budget-hero-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.budget-amount { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; }
.budget-amount.over { color: var(--danger); }
.budget-sub { font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); }
.income-inline { display: flex; align-items: center; gap: 8px; }
.income-inline input { width: 130px; }
.category-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.category-row .cat-label { width: 110px; font-size: .82rem; color: var(--text-muted); flex-shrink: 0; }
.category-row .progress-bar { flex: 1; height: 8px; }
.category-row .cat-amount { font-family: var(--font-mono); font-size: .78rem; width: 70px; text-align: right; flex-shrink: 0; }
.month-nav { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); }

/* ---------- Modale d'import (courses -> budget) ---------- */
.import-modal-box {
    background: var(--panel-solid);
    border: 1px solid var(--panel-border-strong);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-glow);
    transform: scale(.95);
    transition: transform .2s ease;
}
.modal-overlay.show .import-modal-box { transform: scale(1); }
.import-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--panel-border); }
.import-row:last-child { border-bottom: none; }
.import-row .import-name { flex: 1; font-size: .88rem; }
.import-row input[type="number"] { width: 90px; }

/* ---------- Notifications (cloche + panneau) ---------- */
.notif-bell {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.notif-bell:hover { border-color: var(--cyan); box-shadow: 0 0 14px -6px var(--cyan); }
.notif-badge {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-family: var(--font-mono);
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(255, 93, 122, .6);
}
.notif-panel {
    display: none;
    position: absolute;
    top: 54px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--panel-solid);
    border: 1px solid var(--panel-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-glow);
    z-index: 200;
    flex-direction: column;
}
.notif-panel.open { display: flex; animation: cardIn .2s ease both; }
.notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    font-size: .84rem;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text);
    transition: background .15s ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255, 255, 255, 0.03); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.notif-danger .notif-dot { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.notif-warning .notif-dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.notif-info .notif-dot { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-solid);
    border: 1px solid var(--panel-border-strong);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    box-shadow: var(--shadow-glow);
    font-size: .87rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-icon { font-weight: 700; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; }
.toast-success .toast-icon { background: rgba(51, 230, 160, .15); color: var(--success); }
.toast-error .toast-icon { background: rgba(255, 93, 122, .15); color: var(--danger); }
.toast-warning .toast-icon { background: rgba(255, 182, 72, .15); color: var(--warning); }
.toast-info .toast-icon { background: rgba(79, 240, 255, .15); color: var(--cyan); }

/* ---------- Modale de confirmation ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 3, 8, .65);
    backdrop-filter: blur(4px);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
    padding: 20px;
}
.modal-overlay.show { opacity: 1; }
.modal-box {
    background: var(--panel-solid);
    border: 1px solid var(--panel-border-strong);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 360px;
    width: 100%;
    box-shadow: var(--shadow-glow);
    transform: scale(.95);
    transition: transform .2s ease;
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-message { color: var(--text); font-size: .92rem; margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Steppers (ajustement rapide de quantité) ---------- */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.stepper-btn:hover { border-color: var(--cyan); box-shadow: 0 0 10px -4px var(--cyan); }
.stepper-btn.minus:hover { border-color: var(--danger); box-shadow: 0 0 10px -4px var(--danger); }

/* ---------- Skeleton loading ---------- */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.07) 37%, rgba(255,255,255,.03) 63%);
    background-size: 400% 100%;
    animation: skeletonWave 1.4s ease infinite;
    border-radius: var(--radius-sm);
    height: 60px;
}
@keyframes skeletonWave {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .live-clock { display: none; }
}

@media (max-width: 720px) {
    .burger { display: block; }
    .sidenav {
        position: fixed;
        top: 0;
        left: -260px;
        width: 250px;
        height: 100vh;
        border-right: 1px solid var(--panel-border);
        border-bottom: none;
        z-index: 95;
        transition: left .25s ease;
        overflow-y: auto;
        background: rgba(9, 12, 22, 0.92);
    }
    .sidenav.open { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
    .sidenav ul { flex-direction: column; padding: 70px 10px 10px; }
    .sidenav a { border-bottom: none; border-left: 2px solid transparent; border-radius: 6px; }
    .sidenav a.active { border-left-color: var(--cyan); background: rgba(79, 240, 255, .06); }
    .sidenav a.active::after { display: none; }
    .overlay.open { display: block; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .topbar-inner { padding: 12px 16px; }
    .username { display: none; }
    .notif-panel { width: calc(100vw - 32px); right: 16px; }
}

@media (max-width: 480px) {
    .content { padding: 20px 14px 50px; }
    .card { padding: 16px; }
    .dash-greeting { font-size: 1.35rem; }
    .page-header h1 { font-size: 1.2rem; }
    .btn { padding: 9px 14px; }
    .item-row { padding: 12px 14px; }
}
