/* ============================================================
   MAN SARL — Design system
   Layout sidebar + main. Inter font. Composants premium.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Palette principale */
    --brand: #1e40af;
    --brand-hover: #1e3a8a;
    --brand-tint: #eff6ff;
    --brand-dark: #172554;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-bg-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --sidebar-text-muted: #64748b;
    --sidebar-border: #1e293b;
    --sidebar-width: 240px;

    /* Neutres */
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Sémantique */
    --success: #10b981;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    --info-text: #1e40af;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

    /* Spacing scale */
    --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
    --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
    --s12: 48px; --s16: 64px;

    /* Radius */
    --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);

    /* Transitions */
    --transition-fast: 120ms ease;
    --transition: 200ms ease;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.25; color: var(--text); }
p { margin: 0 0 var(--s3); }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-hover); }
code, pre { font-family: var(--font-mono); font-size: 13px; }

/* ============================================================
   Layout — Sidebar + Main
   ============================================================ */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 20;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s5) var(--s5);
    border-bottom: 1px solid var(--sidebar-border);
    color: white;
    font-weight: 700;
}
.sidebar__brand:hover { color: white; }
.sidebar__logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: var(--r);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.sidebar__brand-text { font-size: 15px; letter-spacing: -0.01em; }
.sidebar__brand-sub { font-size: 11px; color: var(--sidebar-text-muted); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar__nav {
    padding: var(--s4) var(--s3);
    flex: 1;
}
.sidebar__section {
    margin: var(--s5) 0 var(--s2);
    padding: 0 var(--s3);
    font-size: 11px;
    font-weight: 600;
    color: var(--sidebar-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sidebar__section:first-child { margin-top: 0; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s2) var(--s3);
    color: var(--sidebar-text);
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
    margin-bottom: 2px;
}
.sidebar__link:hover { background: var(--sidebar-bg-hover); color: white; text-decoration: none; }
.sidebar__link.is-active {
    background: var(--sidebar-active);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.sidebar__link.is-active .icon { color: white; }
.sidebar__link .icon {
    width: 18px; height: 18px;
    color: var(--sidebar-text-muted);
    flex-shrink: 0;
}
.sidebar__link:hover .icon { color: white; }

.sidebar__user {
    padding: var(--s4);
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: var(--s3);
}
.sidebar__user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { color: white; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-role { color: var(--sidebar-text-muted); font-size: 11px; }
.sidebar__logout {
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--sidebar-text-muted);
    display: grid;
    place-items: center;
    transition: all var(--transition-fast);
}
.sidebar__logout:hover { background: var(--sidebar-bg-hover); color: var(--danger); }
.sidebar__logout .icon { width: 16px; height: 16px; }

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--s4) var(--s8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar__title { font-size: 18px; font-weight: 600; color: var(--text); }
.topbar__breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }

.page {
    padding: var(--s8);
    max-width: 1400px;
}

/* ============================================================
   Composants
   ============================================================ */

/* Flash messages */
.flash {
    padding: var(--s3) var(--s4);
    border-radius: var(--r);
    margin-bottom: var(--s4);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: var(--s2);
    border-left: 3px solid;
    box-shadow: var(--shadow-xs);
}
.flash--success { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.flash--error   { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger); }
.flash--warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning); }
.flash--info    { background: var(--info-bg);    color: var(--info-text);    border-color: var(--info); }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding: 8px 16px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }

.btn--primary { background: var(--brand); color: white; border-color: var(--brand); box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: white; box-shadow: 0 2px 5px rgba(30, 64, 175, 0.3); }
.btn--danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn--danger:hover { background: #dc2626; color: white; }
.btn--success { background: var(--success); color: white; border-color: var(--success); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-alt); }
.btn--link { background: transparent; color: var(--brand); padding: 4px 8px; }
.btn--link:hover { background: var(--brand-tint); color: var(--brand-hover); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--lg { padding: 12px 20px; font-size: 15px; }
.btn--block { width: 100%; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    padding: var(--s6);
    margin-bottom: var(--s5);
}
.card--flush { padding: 0; }
.card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s4) var(--s6);
    border-bottom: 1px solid var(--border);
}
.card--flush > .table { margin: 0; }
.card__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.card__body { padding: var(--s6); }

/* Page head */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--s6);
    gap: var(--s4);
    flex-wrap: wrap;
}
.page-head__left { min-width: 0; }
.page-head__title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.page-head__subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: 13.5px; }
.page-head__actions { display: flex; gap: var(--s2); align-items: center; }

/* Sections dans forms */
.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    margin: var(--s6) 0 var(--s3);
    padding-bottom: var(--s2);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.section-title:first-of-type { margin-top: 0; }

/* Forms */
.form-group { margin-bottom: var(--s4); }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--s2);
}
.form-label--required::after { content: " *"; color: var(--danger); font-weight: 700; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:hover { border-color: var(--text-subtle); }
.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}
.form-control:disabled { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s4);
}
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-grid .form-group { margin-bottom: 0; }
.form-grid .form-group--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } }

.form-actions {
    display: flex;
    gap: var(--s2);
    margin-top: var(--s6);
    padding-top: var(--s5);
    border-top: 1px solid var(--border);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table th, .table td {
    padding: 12px 20px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.table th {
    background: var(--surface-alt);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--brand-tint); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.text-right { text-align: right; }
.table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.table__empty {
    text-align: center;
    padding: var(--s10);
    color: var(--text-muted);
    font-style: italic;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}
.badge--success { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.badge--danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: transparent; }
.badge--warning { background: var(--warning-bg); color: var(--warning-text); border-color: transparent; }
.badge--info    { background: var(--info-bg);    color: var(--info-text);    border-color: transparent; }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Stat cards (dashboard) */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--s4);
    margin-bottom: var(--s6);
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s5);
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat__label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-bottom: var(--s2); }
.stat__value { font-size: 28px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat__value--sm { font-size: 20px; }
.stat__trend { font-size: 12px; color: var(--text-muted); margin-top: var(--s2); display: flex; align-items: center; gap: 4px; }
.stat__trend--up { color: var(--success); }
.stat__trend--down { color: var(--danger); }
.stat__icon {
    width: 40px; height: 40px;
    background: var(--brand-tint);
    color: var(--brand);
    border-radius: var(--r);
    display: grid; place-items: center;
    margin-bottom: var(--s3);
}
.stat__icon .icon { width: 20px; height: 20px; }

/* ---- Dashboard : cartes KPI héros + variantes ---- */
.kpi-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--s4);
    margin-bottom: var(--s5);
}
.kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px 22px;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.kpi::before {
    content: '';
    position: absolute; inset: 0 auto 0 0;
    width: 4px;
    background: var(--kpi-color, var(--brand));
    border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -8px rgba(15,23,42,0.12); }
.kpi__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px; }
.kpi__label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi__icon {
    width: 36px; height: 36px;
    background: color-mix(in srgb, var(--kpi-color, var(--brand)) 12%, transparent);
    color: var(--kpi-color, var(--brand));
    border-radius: 10px;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.kpi__icon .icon { width: 18px; height: 18px; }
.kpi__value {
    font-size: 26px; font-weight: 700; color: var(--text);
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
    line-height: 1.15;
}
.kpi__unit { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.kpi__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.kpi--brand   { --kpi-color: #2563eb; }
.kpi--success { --kpi-color: #059669; }
.kpi--warning { --kpi-color: #d97706; }
.kpi--danger  { --kpi-color: #dc2626; }
.kpi--violet  { --kpi-color: #7c3aed; }
.kpi--cyan    { --kpi-color: #0891b2; }

.delta {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    background: var(--surface-alt); color: var(--text-muted);
}
.delta--up   { background: #dcfce7; color: #15803d; }
.delta--down { background: #fee2e2; color: #b91c1c; }

/* Filtre période chips */
.period-chips { display: inline-flex; gap: 4px; margin-right: 8px; padding: 3px; background: var(--surface-alt); border-radius: 10px; }
.period-chips a {
    padding: 6px 12px;
    font-size: 12px; font-weight: 500;
    border-radius: 7px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.period-chips a:hover { color: var(--text); }
.period-chips a.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Grid dashboard 2/3 - 1/3 */
.dash-grid { display: grid; gap: var(--s5); grid-template-columns: 2fr 1fr; align-items: stretch; margin-bottom: var(--s5); }
.dash-grid--equal { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .dash-grid, .dash-grid--equal { grid-template-columns: 1fr; } }

/* Item list (used in dashboard aside blocks) */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-list__row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    color: var(--text);
    text-decoration: none;
}
.item-list__row:hover { background: var(--surface-alt); border-color: var(--border-strong); color: var(--text); }
.item-list__main { min-width: 0; flex: 1; }
.item-list__title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.item-list__sub { color: var(--text-muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }
.item-list__meta { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; white-space: nowrap; }

/* Table triable */
.table--sortable th[data-sort]:not([data-sort="none"]) {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background var(--transition-fast);
}
.table--sortable th[data-sort]:not([data-sort="none"]):hover {
    background: var(--surface-alt);
    color: var(--brand);
}
.sort-ind { color: var(--brand); font-weight: bold; }

/* Card header contextuel */
.card__head--dash { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s4); }
.card__head--dash h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card__head--dash .card__hint { font-size: 12px; color: var(--text-muted); }

/* Modal (léger, HTML5 dialog) */
dialog.modal {
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: calc(100% - 32px);
    background: var(--surface);
}
dialog.modal::backdrop { background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); }
.modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
}
.modal__title { margin: 0; font-size: 15px; font-weight: 600; }
.modal__body { padding: var(--s5); }
.modal__foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--border); background: var(--surface-alt); display: flex; justify-content: flex-end; gap: var(--s2); }
.modal__close { color: var(--text-muted); }
.modal__close:hover { color: var(--danger); }

/* Upload preview */
.upload-preview {
    padding: var(--s3);
    background: var(--surface-alt);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-sm);
    margin-bottom: var(--s2);
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
}

/* Empty state */
.empty {
    text-align: center;
    padding: var(--s16) var(--s4);
    color: var(--text-muted);
}
.empty__icon {
    width: 56px; height: 56px;
    background: var(--surface-alt);
    color: var(--text-subtle);
    border-radius: var(--r-full);
    display: grid; place-items: center;
    margin: 0 auto var(--s4);
}
.empty__icon .icon { width: 28px; height: 28px; }
.empty__title { font-size: 15px; color: var(--text); margin-bottom: var(--s1); }
.empty__desc { font-size: 13px; margin-bottom: var(--s4); }

/* Utilities */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s2); } .mb-4 { margin-bottom: var(--s4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); } .gap-4 { gap: var(--s4); }
.hidden { display: none; }
.grow { flex: 1; }

/* Icons */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; stroke-width: 2; }

/* ============================================================
   Auth (layout centré)
   ============================================================ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.15) 0, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.15) 0, transparent 40%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: var(--s4);
}
.auth-shell { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; color: white; margin-bottom: var(--s6); }
.auth-brand__logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    border-radius: var(--r-lg);
    display: grid;
    place-items: center;
    margin: 0 auto var(--s4);
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}
.auth-brand__title { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand__subtitle { margin: 0; opacity: 0.6; font-size: 13px; }

.auth-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: var(--s8);
    box-shadow: var(--shadow-xl);
}
.auth-card__title { margin: 0 0 var(--s6); font-size: 18px; color: var(--text); font-weight: 600; }
.auth-card__hint {
    margin: var(--s5) 0 0;
    padding-top: var(--s5);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.auth-card__hint code {
    font-family: var(--font-mono);
    background: var(--surface-alt);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text);
    font-size: 11.5px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
    .sidebar.is-open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: var(--s3) var(--s4); }
    .page { padding: var(--s4); }
    .topbar__menu-btn { display: inline-flex !important; }
}
.topbar__menu-btn { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface-alt); }
