/**
 * BilYan - Modern Enterprise UI Layer (2026)
 * Chargé en dernier : surcharge visuelle uniquement (aucune logique).
 */

/* =====================================================
   1. DESIGN TOKENS
   ===================================================== */
:root {
    --navy: #0b1f3a;
    --sidebar-bg: #111e34;
    --sidebar-bg-2: #172640;
    --sidebar-text: #a9b6cc;
    --sidebar-muted: #64748b;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff4ff;
    --primary-glow: rgba(37, 99, 235, 0.10);
    --cyan: #06b6d4;
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --purple: #8b5cf6;
    --purple-soft: #f5f3ff;
    --info: #0891b2;
    --info-soft: #ecfeff;

    --background: #f5f7fb;
    --bg-main: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --bg-sidebar: var(--sidebar-bg);
    --bg-sidebar-hover: var(--sidebar-bg-2);

    --text-primary: #0f172a;
    --text-heading: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-soft: #edf1f6;
    --border-input: #dce3ec;
    --border-light: #e2e8f0;

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, .10);
    --shadow-primary: 0 1px 2px rgba(37, 99, 235, .25);

    --sidebar-width: 256px;
    --topbar-height: 64px;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.dark-theme {
    --surface: #1e293b;
    --surface-2: #172033;
    --background: #0f172a;
    --border: #334155;
    --border-soft: #273449;
    --border-input: #3b4a61;
    --text-primary: #f1f5f9;
    --text-heading: #ffffff;
    --text-secondary: #94a3b8;
    --primary-soft: rgba(37, 99, 235, .16);
    --success-soft: rgba(16, 185, 129, .14);
    --warning-soft: rgba(245, 158, 11, .14);
    --danger-soft: rgba(239, 68, 68, .14);
    --purple-soft: rgba(139, 92, 246, .16);
    --info-soft: rgba(6, 182, 212, .14);
    --sidebar-bg: #0b1424;
    --sidebar-bg-2: #15213a;
}

/* =====================================================
   2. BASE / TYPOGRAPHY
   ===================================================== */
body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    background-color: var(--background);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.login-title, .sidebar-logo-text, .card-header-title {
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
}

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 650; }
h4 { font-size: 16px; font-weight: 600; }
h5 { font-size: 15px; font-weight: 600; }

input, select, textarea, button { font-family: inherit; }

::selection { background: rgba(37, 99, 235, .18); }

/* Transitions légères ciblées (le reste reste désactivé par style.css) */
.nav-item, .btn, .form-control, .tb-btn, .tb-chip, .page-link,
.dropdown-item, .quick-btn, .header-btn, .tb-menu a, .auth-input {
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease !important;
}

/* =====================================================
   3. SIDEBAR
   ===================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, .04);
}

.sidebar-header {
    padding: 18px 20px;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-logo img {
    max-height: 36px !important;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    box-shadow: none;
}

.sidebar-logo-icon svg { width: 20px; height: 20px; }
.sidebar-logo-text { font-size: 20px; color: #fff; }

.sidebar-nav { padding: 16px 12px; }
.nav-section { margin-bottom: 18px; }

.nav-section-title {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--sidebar-muted);
    padding: 0 12px;
    margin-bottom: 6px;
}

.nav-item {
    height: 40px;
    padding: 0 12px;
    margin-bottom: 2px;
    border-radius: 9px;
    color: var(--sidebar-text);
    gap: 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    opacity: .85;
}

.nav-item-text { font-size: 13.5px; font-weight: 500; }

.nav-item:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.nav-item.active svg { opacity: 1; }
.nav-item.active::before { display: none; }

.nav-badge {
    background: var(--danger);
    font-size: 10.5px;
    min-width: 20px;
    padding: 1px 7px;
}

/* Sélecteur entreprise */
.company-selector { margin: 4px 0 8px; }

.company-current {
    padding: 10px;
    background: var(--sidebar-bg-2);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 11px;
}

.company-current:hover {
    background: #1d2e4d;
    border-color: rgba(255, 255, 255, .12);
}

.company-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(37, 99, 235, .18);
}

.company-icon svg { width: 18px; height: 18px; color: #93b4ff; }
.company-name { font-size: 13px; }
.company-code { font-size: 11px; color: var(--sidebar-muted); letter-spacing: .03em; }

/* Pied de sidebar */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-footer .theme-toggle-btn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 8px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: transparent;
    color: var(--sidebar-text);
    font-size: 13px;
    cursor: pointer;
}

.sidebar-footer .theme-toggle-btn:hover { background: rgba(255, 255, 255, .05); color: #fff; }

.user-card {
    padding: 10px;
    background: var(--sidebar-bg-2);
    border-radius: 11px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    font-family: var(--font-sans);
    font-size: 13px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.user-name { font-size: 13px; }
.user-role { font-size: 11.5px; color: var(--sidebar-muted); }

/* =====================================================
   4. TOPBAR
   ===================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 0;
    min-width: 0;
    background: var(--background);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.app-topbar .mobile-menu-toggle {
    position: static;
    display: none;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    box-shadow: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.app-topbar .mobile-menu-toggle svg { width: 20px; height: 20px; }

.tb-context { min-width: 0; flex: 1; }

.tb-title {
    font-size: 16px;
    font-weight: 650;
    color: var(--text-heading);
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-actions { display: flex; align-items: center; gap: 8px; }

.tb-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    max-width: 240px;
    text-decoration: none;
}

.tb-chip:hover { border-color: #c7d2e1; background: var(--surface-2); color: var(--text-primary); }

.tb-chip-dot {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.tb-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-chip i.fa-exchange-alt { color: var(--text-muted); font-size: 11px; }

.tb-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    padding: 0;
}

.tb-btn:hover { color: var(--primary); border-color: #c7d2e1; background: var(--surface-2); }
.tb-btn svg { width: 18px; height: 18px; }

.tb-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--surface);
}

.tb-dropdown { position: relative; }

.tb-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 1200;
}

.tb-dropdown.open .tb-menu { display: block; }

.tb-menu-header {
    padding: 10px 12px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tb-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
}

.tb-menu a:hover { background: var(--surface-2); color: var(--primary); }
.tb-menu a i { width: 16px; text-align: center; color: var(--text-muted); }
.tb-menu a:hover i { color: var(--primary); }
.tb-menu .tb-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.tb-menu a.tb-danger, .tb-menu a.tb-danger i { color: var(--danger); }

.tb-notif-menu { width: 340px; }
.tb-notif-item { align-items: flex-start !important; }
.tb-notif-item strong { display: block; font-size: 13px; font-weight: 600; }
.tb-notif-item small { display: block; color: var(--text-secondary); font-size: 12px; line-height: 1.4; }
.tb-notif-empty { padding: 20px 12px; text-align: center; color: var(--text-secondary); font-size: 13px; }

.tb-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 10px 0 4px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
}

.tb-user:hover { background: var(--surface-2); border-color: var(--border); }

.tb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tb-user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.tb-user-meta strong { font-size: 13px; font-weight: 600; }
.tb-user-meta small { font-size: 11.5px; color: var(--text-secondary); }

.app-topbar .theme-toggle-btn .fa-sun,
.app-topbar .theme-toggle-btn .fa-moon { font-size: 15px; }

/* =====================================================
   5. MAIN CONTENT
   ===================================================== */
.main-container {
    max-width: none;
    margin: 0 auto;
    padding: 28px 32px 48px;
}

/* Conteneurs de page : pleine largeur de la zone de contenu */
.main-container .dashboard-wrapper,
.main-container .dashboard-container,
.main-container .projects-container,
.main-container .project-container,
.main-container .project-view-container,
.main-container .inventory-container,
.main-container .archives-container,
.main-container .archive-container,
.main-container .companies-container,
.main-container .users-container,
.main-container .company-edit-container {
    max-width: none;
}

/* En-têtes de page */
.page-header {
    margin-bottom: 24px;
    gap: 16px;
}

h1.page-header, .page-title, .page-header h1, .page-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

h1.page-header { margin-bottom: 24px; justify-content: flex-start; gap: 12px; }

.main-container .card-header:not(.d-flex):not(.justify-content-between) {
    justify-content: flex-start;
    gap: 8px;
}

h1.page-header > i, .page-header h1 > i, .page-header h2 > i {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.page-title-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); }
.page-title-icon svg { width: 20px; height: 20px; }

/* En-tête "modern" (ancien bandeau violet) -> en-tête clair entreprise */
.main-container .modern-page-header {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 24px;
    color: var(--text-heading);
    flex-wrap: wrap;
    gap: 16px;
}

.main-container .modern-page-header h1 {
    color: var(--text-heading);
    font-size: 26px;
    font-weight: 700;
    gap: 12px;
}

.main-container .modern-page-header p { color: var(--text-secondary); }

.main-container .modern-page-header .header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 16px;
}

.main-container .modern-page-header .header-btn,
.main-container .modern-page-header .btn-light {
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-primary);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.main-container .modern-page-header .header-btn:hover,
.main-container .modern-page-header .btn-light:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}

/* =====================================================
   6. CARDS / KPI
   ===================================================== */
.main-container .card,
.main-container .table-card,
.main-container .filter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.main-container .card.border-0 { border: 1px solid var(--border) !important; }

.main-container .card:hover { box-shadow: var(--shadow-sm) !important; }

.main-container .card-header,
.main-container .table-card-header {
    background: var(--surface);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 600;
    color: var(--text-heading);
}

.main-container .card-header h1,
.main-container .card-header h2,
.main-container .card-header h3,
.main-container .card-header h4,
.main-container .card-header h5 {
    font-size: 16px;
    font-weight: 650;
    margin: 0;
}

.main-container .card-body { padding: 20px; }
.main-container .card-body.p-0 { padding: 0; }
.main-container .card-body.p-3 { padding: 16px; }

.main-container .card-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
    padding: 14px 20px;
}

/* Arrondis homogènes même quand la page force "rounded-0" */
.main-container .card.rounded-0,
.main-container .btn.rounded-0,
.main-container .input-group.rounded-0,
.main-container .rounded-0 > .form-control,
.main-container a.btn-link > .rounded-0 { border-radius: 10px !important; }
.main-container .card.rounded-0 { border-radius: var(--radius-lg) !important; }

.main-container .stats-grid { gap: 16px; margin-bottom: 24px; }

.main-container .stat-card,
.main-container .stats-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    gap: 14px;
}

.main-container .stat-card:hover { box-shadow: var(--shadow-md); }

.main-container .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 17px;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: #d97706; }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }

.main-container .stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.main-container .stat-info p {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =====================================================
   7. BUTTONS
   ===================================================== */
.btn {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1.3;
    gap: 8px;
}

.btn i { font-size: 14px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .25) !important; }

.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-sm i { font-size: 12px; }
.btn-lg { min-height: 46px; padding: 10px 22px; font-size: 15px; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover, .btn-secondary:focus {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: #c7d2e1;
    box-shadow: var(--shadow-sm);
}

.btn-success { background: var(--success); border: 1px solid var(--success); color: #fff; box-shadow: none; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; box-shadow: none; }

.btn-danger { background: var(--danger); border: 1px solid var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; box-shadow: none; }

.btn-warning { background: var(--warning); border: 1px solid var(--warning); color: #fff; box-shadow: none; }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; box-shadow: none; }

.btn-info { background: var(--cyan); border: 1px solid var(--cyan); color: #fff; box-shadow: none; }
.btn-info:hover { background: #0891b2; border-color: #0891b2; color: #fff; box-shadow: none; }

.btn-light {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-light:hover { background: var(--surface-2); color: var(--text-primary); }
.btn-light.border-0 { border-color: transparent !important; background: transparent; }
.btn-light.border-0:hover { background: var(--surface-2); }

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, .35);
}
.btn-outline-primary:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.btn-outline-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
}
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--text-primary); }

.btn-outline-danger { background: transparent; color: var(--danger); border: 1px solid rgba(239, 68, 68, .35); }
.btn-outline-danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn-outline-success { background: transparent; color: var(--success); border: 1px solid rgba(16, 185, 129, .35); }
.btn-outline-success:hover { background: var(--success-soft); color: var(--success); }

.btn-link { min-height: auto; box-shadow: none; }

/* =====================================================
   8. FORMS
   ===================================================== */
.form-group { margin-bottom: 18px; }

.form-label,
.form-group > label,
.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.form-control,
.form-select,
.filter-group .form-control,
.filter-group .form-select {
    min-height: 44px;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--surface);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    box-shadow: none;
}

textarea.form-control { min-height: 96px; line-height: 1.5; }
.form-control-sm, .form-control.form-control-sm { min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 8px; }

.form-control:hover { border-color: #c7d2e1; }

.form-control:focus,
.form-select:focus,
.filter-group .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
}

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }

.form-control[readonly], .form-control:disabled { background-color: var(--surface-2); }

select.form-control, .form-select {
    background-position: right 12px center;
    padding-right: 36px;
}

.form-text { font-size: 12.5px; color: var(--text-secondary); }

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* Groupes de champs (barres de filtres) */
.input-group-text {
    background: transparent;
    border: 1px solid var(--border-input);
    color: var(--text-muted);
    font-size: 13px;
}

.main-container .input-group.bg-light {
    background: var(--surface) !important;
    border: 1px solid var(--border-input) !important;
    border-radius: 10px !important;
    align-items: center;
    overflow: hidden;
}

.main-container .input-group.bg-light:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* Barres de filtres : retour à la ligne plutôt que champs écrasés */
.main-container .card-body > form.d-flex.align-items-center { flex-wrap: wrap; row-gap: 10px; }
.main-container .input-group.bg-light input[type="date"] { min-width: 132px !important; }
.main-container .input-group.bg-light select.form-control { min-width: 120px; }
@media (max-width: 480px) {
    .main-container .input-group.bg-light input[type="date"] { min-width: 0 !important; flex: 1 1 0; }
}

.main-container .input-group.bg-light > .form-control,
.main-container .input-group.bg-light > .input-group-text {
    border: none !important;
    background: transparent !important;
    min-height: 0;
    box-shadow: none !important;
}

/* =====================================================
   9. TABLES
   ===================================================== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.main-container .table,
.main-container .modern-table {
    font-size: 13.5px;
    color: var(--text-primary);
    margin-bottom: 0;
}

.main-container .table thead,
.main-container .modern-table thead { background: var(--surface-2); }

.main-container .table thead th,
.main-container .table th,
.main-container .modern-table thead th {
    padding: 11px 16px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-top: none;
    white-space: nowrap;
    vertical-align: middle;
}

.main-container .table td,
.main-container .modern-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
    font-size: 13.5px;
}

.main-container .table tbody tr:last-child td { border-bottom: none; }

body:not(.dark-theme) .main-container .table tbody tr:hover,
body:not(.dark-theme) .main-container .table.table-hover tbody tr:hover,
body:not(.dark-theme) .main-container .modern-table tbody tr:hover {
    background-color: #f7f9fd !important;
}

.main-container .table tfoot td,
.main-container .table tfoot th {
    background: var(--surface-2);
    font-weight: 600;
    border-top: 1px solid var(--border);
}

/* Montants / statuts sur une seule ligne */
.main-container .table td > .font-weight-bold,
.main-container .table td > .fw-bold,
.main-container .table td > .text-success,
.main-container .table td > .text-danger,
.main-container .table td > .text-warning,
.main-container .table td.text-end,
.main-container .table td.text-right,
.main-container .table td .badge,
.main-container .table td .table-amount { white-space: nowrap; }

.main-container .table td:first-child { white-space: nowrap; }
.main-container .table td > div.font-weight-medium { min-width: 170px; }

.text-end, .text-right { text-align: right; }

/* Utilitaires Bootstrap 5 utilisés par les pages mais non définis */
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.gap-1 { gap: 4px !important; }
.gap-3 { gap: 16px !important; }
.flex-wrap { flex-wrap: wrap !important; }
.w-100 { width: 100% !important; }
.font-weight-bold, .fw-bold { font-weight: 650; }
.font-weight-medium { font-weight: 500; }

/* =====================================================
   10. BADGES / STATUS
   ===================================================== */
.badge, .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 999px;
    white-space: nowrap;
    text-transform: none;
}

.badge-success, .bg-success.badge, .status-badge.paid, .status-badge.accepted, .status-badge.delivered {
    background: var(--success-soft); color: #047857;
}
.badge-warning, .bg-warning.badge, .status-badge.partial {
    background: var(--warning-soft); color: #b45309;
}
.badge-danger, .bg-danger.badge, .status-badge.unpaid {
    background: var(--danger-soft); color: #b91c1c;
}
.badge-info, .bg-info.badge, .status-badge.sent, .status-badge.in-progress {
    background: var(--info-soft); color: #0e7490;
}
.badge-primary, .bg-primary.badge {
    background: var(--primary-soft); color: var(--primary-hover);
}
.badge-secondary, .badge-light, .bg-secondary.badge, .status-badge.cancelled, .status-badge.rejected, .status-badge.draft, .status-badge.pending {
    background: #f1f5f9; color: #475569;
}
.badge-purple { background: var(--purple-soft); color: #6d28d9; }

/* Surcharge de payment_status_badges.css (couleurs pleines en !important) */
html body span.badge,
html body .badge {
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
    line-height: 1.4 !important;
    display: inline-flex !important;
    align-items: center;
    border: none !important;
}

html body .badge.badge-success, html body span.badge-success { background-color: #dcfce7 !important; color: #047857 !important; }
html body .badge.badge-warning, html body span.badge-warning { background-color: #fef3c7 !important; color: #b45309 !important; }
html body .badge.badge-danger, html body span.badge-danger { background-color: #fee2e2 !important; color: #b91c1c !important; }
html body .badge.badge-primary, html body span.badge-primary { background-color: #dbeafe !important; color: #1d4ed8 !important; }
html body .badge.badge-secondary, html body span.badge-secondary { background-color: #f1f5f9 !important; color: #475569 !important; }
html body .badge.badge-info, html body span.badge-info { background-color: #cffafe !important; color: #0e7490 !important; }

html body.dark-theme .badge.badge-success, html body.dark-theme span.badge-success { background-color: rgba(16, 185, 129, .16) !important; color: #34d399 !important; }
html body.dark-theme .badge.badge-warning, html body.dark-theme span.badge-warning { background-color: rgba(245, 158, 11, .16) !important; color: #fbbf24 !important; }
html body.dark-theme .badge.badge-danger, html body.dark-theme span.badge-danger { background-color: rgba(239, 68, 68, .16) !important; color: #f87171 !important; }
html body.dark-theme .badge.badge-primary, html body.dark-theme span.badge-primary { background-color: rgba(37, 99, 235, .2) !important; color: #93b4ff !important; }
html body.dark-theme .badge.badge-secondary, html body.dark-theme span.badge-secondary { background-color: #334155 !important; color: #cbd5e1 !important; }
html body.dark-theme .badge.badge-info, html body.dark-theme span.badge-info { background-color: rgba(6, 182, 212, .16) !important; color: #22d3ee !important; }

body.dark-theme .badge-success { color: #34d399; }
body.dark-theme .badge-warning { color: #fbbf24; }
body.dark-theme .badge-danger { color: #f87171; }
body.dark-theme .badge-info { color: #22d3ee; }
body.dark-theme .badge-primary { color: #93b4ff; }
body.dark-theme .badge-secondary { background: #334155; color: #cbd5e1; }

/* =====================================================
   11. ALERTS
   ===================================================== */
.alert {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.alert svg { width: 18px; height: 18px; margin-top: 0; }
.alert-success { background: var(--success-soft); color: #065f46; border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-soft); color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--primary-soft); color: #1e40af; border: 1px solid #c7d7fe; }

/* =====================================================
   12. DROPDOWNS
   ===================================================== */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 190px;
    background: var(--surface);
    list-style: none;
    margin: 0;
}

.dropdown { position: relative; }

/* Bootstrap 4 (Popper) ignore la classe BS5 "dropdown-menu-end" : alignement à droite forcé */
.dropdown-menu-end.show,
.dropdown-menu-right.show {
    left: auto !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;
    transform: none !important;
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover { background: var(--surface-2); color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-soft); color: var(--danger); }
.dropdown-item i { width: 16px; text-align: center; color: var(--text-muted); }
.dropdown-item:hover i { color: inherit; }
.dropdown-divider { height: 1px; border: 0; background: var(--border); margin: 6px 4px; }

/* =====================================================
   13. PAGINATION
   ===================================================== */
.pagination { gap: 4px; }

.page-item .page-link,
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px !important;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.page-item:not(.active):not(.disabled) .page-link:hover,
.page-btn:hover { background: var(--surface-2); border-color: #c7d2e1; color: var(--primary); }

.page-item.active .page-link,
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.pagination-wrapper { border-top: 1px solid var(--border-soft); padding: 14px 20px; }
.pagination-info { color: var(--text-secondary); font-size: 13px; }

/* =====================================================
   14. MODALS / SWEETALERT
   ===================================================== */
.modal-content {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 650; margin: 0; }
.modal-body { padding: 20px; }

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-soft);
    background: var(--surface-2);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-backdrop { background-color: rgba(15, 23, 42, .5); }

.delete-modal-content { border-radius: 16px; }
.delete-modal-footer { background: var(--surface); border-top: none; }

.swal2-popup {
    border-radius: 16px !important;
    font-family: var(--font-sans) !important;
    padding: 24px !important;
}
.swal2-title { font-size: 20px !important; font-weight: 700 !important; color: var(--text-heading) !important; }
.swal2-html-container { font-size: 14px !important; color: var(--text-secondary) !important; }
.swal2-styled { border-radius: 10px !important; font-weight: 600 !important; font-size: 14px !important; padding: 10px 20px !important; box-shadow: none !important; }
body .swal2-popup .swal2-styled.swal2-confirm { background-color: var(--primary); }
body .swal2-popup .swal2-styled.swal2-cancel { background-color: #f1f5f9; color: #334155 !important; }
body.dark-theme .swal2-popup { background: #1e293b !important; color: #f1f5f9 !important; }

/* =====================================================
   15. LIST GROUP / EMPTY STATE / DIVERS
   ===================================================== */
.list-group-item { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }

.empty-state-icon {
    width: 72px;
    height: 72px;
    font-size: 28px;
    background: var(--primary-soft);
    color: var(--primary);
}

.empty-state-btn { background: var(--primary); border-radius: 10px; }

.table-ref { color: var(--primary); }
.table-count-badge { background: var(--primary-soft); color: var(--primary); }

.main-container .filter-btn { border-radius: 10px; min-height: 44px; }
.main-container .filter-btn.primary { background: var(--primary); }

/* Barres de défilement fines */
.main-content ::-webkit-scrollbar { height: 8px; width: 8px; }
.main-content ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.main-content ::-webkit-scrollbar-track { background: transparent; }

/* =====================================================
   16. DARK MODE (complément des thèmes existants)
   ===================================================== */
body.dark-theme .app-topbar {
    background: rgba(15, 23, 42, .92);
    border-bottom-color: #1e293b;
}

body.dark-theme .tb-chip,
body.dark-theme .tb-btn,
body.dark-theme .app-topbar .mobile-menu-toggle {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-theme .tb-user:hover { background: #1e293b; border-color: #334155; }
body.dark-theme .tb-menu { background: #1e293b; border-color: #334155; }
body.dark-theme .tb-menu a:hover { background: #273449; }
body.dark-theme .tb-badge { border-color: #0f172a; }
body.dark-theme .main-content { background: #0f172a; }

body.dark-theme .main-container .modern-page-header h1,
body.dark-theme h1.page-header { color: #fff; }

html body.dark-theme .main-container .page-header { background-color: transparent !important; }

body.dark-theme .main-container .input-group.bg-light {
    background: #1e293b !important;
    border-color: #3b4a61 !important;
}

body.dark-theme .page-item .page-link,
body.dark-theme .page-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }

body.dark-theme .btn-secondary,
body.dark-theme .btn-light,
body.dark-theme .btn-outline-secondary { background: #1e293b; border-color: #334155; color: #e2e8f0; }

body.dark-theme .alert-success { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .3); color: #6ee7b7; }
body.dark-theme .alert-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
body.dark-theme .alert-danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .3); color: #fca5a5; }
body.dark-theme .alert-info { background: rgba(37, 99, 235, .14); border-color: rgba(37, 99, 235, .3); color: #93c5fd; }

/* =====================================================
   17. RESPONSIVE
   ===================================================== */
@media (max-width: 1280px) {
    .main-container { padding: 24px 24px 40px; }
    .app-topbar { padding: 0 24px; }
}

/* Tablette & mobile : la sidebar devient un tiroir */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform .22s ease !important;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 20px 60px rgba(2, 6, 23, .45);
    }

    .sidebar-overlay { background: rgba(15, 23, 42, .5); }

    .main-content { margin-left: 0; padding: 0; }
    .app-topbar .mobile-menu-toggle { display: inline-flex; }
    body > .app-layout > .mobile-menu-toggle { display: none !important; }
    .tb-user-meta { display: none; }
}

@media (max-width: 768px) {
    .main-content { padding: 0 !important; }
    .main-container { padding: 16px 16px 32px; }
    .app-topbar { padding: 0 12px; gap: 10px; height: 58px; }
    .tb-chip-text { display: none; }
    .tb-chip { padding: 0 8px; }
    .tb-notif-menu { width: calc(100vw - 24px); right: -60px; }

    h1.page-header, .page-title, .page-header h1,
    .main-container .modern-page-header h1 { font-size: 21px; }

    .main-container .modern-page-header { flex-direction: column; align-items: stretch; text-align: left; }
    .main-container .modern-page-header .header-btn { justify-content: center; }

    .main-container .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .main-container .stat-card { padding: 14px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .main-container .stat-info h3 { font-size: 18px; }

    .main-container .card-body { padding: 16px; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .page-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 420px) {
    .main-container .stats-grid { grid-template-columns: 1fr; }
    .tb-subtitle { display: none; }
}

/* =====================================================
   18. IMPRESSION : on masque la coque
   ===================================================== */
@media print {
    .app-topbar, .sidebar, .sidebar-overlay { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; background: #fff !important; }
    .main-container { padding: 0 !important; max-width: none !important; }
}

/* =====================================================
   19. AUTHENTIFICATION (connexion / sélection entreprise)
   ===================================================== */
.auth-body,
.login-page.auth-body {
    margin: 0;
    padding: 0;
    display: block;
    min-height: 100vh;
    background: #f5f7fb;
    font-family: var(--font-sans);
    color: var(--text-primary);
    overflow-x: hidden;
}

.login-page.auth-body::before,
.login-page.auth-body::after { display: none; }

body.dark-theme.login-page.auth-body { background: #0f172a !important; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) 1fr;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(37, 99, 235, .35), transparent 60%),
        radial-gradient(700px 500px at 90% 100%, rgba(6, 182, 212, .18), transparent 60%),
        linear-gradient(160deg, #0b1f3a 0%, #111e34 55%, #0b1628 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
    pointer-events: none;
}

.auth-brand > * { position: relative; z-index: 1; }

.auth-logo { display: flex; align-items: center; gap: 12px; }

.auth-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 99, 235, .35);
}

.auth-logo-mark svg { width: 24px; height: 24px; color: #fff; }

.auth-logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.auth-logo-text span { color: #60a5fa; }
.auth-logo-sub { display: block; font-size: 12px; color: #94a3b8; font-weight: 500; letter-spacing: 0; }

.auth-pitch h2 {
    color: #fff;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.03em;
    max-width: 520px;
}

.auth-pitch h2 span { color: #22d3ee; }
.auth-pitch p { color: #b6c2d6; font-size: 15.5px; max-width: 480px; margin: 0 0 28px; }

.auth-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 520px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #dbe4f3;
    font-size: 13.5px;
    font-weight: 500;
}

.auth-features i {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(37, 99, 235, .22);
    color: #93c5fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.auth-visual { max-width: 520px; margin-top: 8px; }
.auth-visual svg { width: 100%; height: auto; display: block; }

.auth-brand-foot { font-size: 12.5px; color: #7f8ea8; }

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .08);
    padding: 36px 32px 28px;
}

.auth-card-logo { display: none; justify-content: center; margin-bottom: 20px; }

.auth-card h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-heading);
    text-align: center;
}

.auth-card .auth-lead { text-align: center; color: var(--text-secondary); margin: 0 0 26px; font-size: 14px; }

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.auth-input-wrap { position: relative; }

.auth-input-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 44px 0 40px;
    border: 1px solid var(--border-input);
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: var(--text-primary);
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
}

.auth-eye:hover { color: var(--primary); background: var(--primary-soft); }

.auth-submit {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
}

.auth-submit:hover { background: var(--primary-hover); }

.auth-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 13.5px;
    margin-bottom: 18px;
}

.auth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-secondary);
    font-size: 12.5px;
}

.auth-secure i { color: var(--success); }
.auth-support { text-align: center; color: var(--text-muted); font-size: 12.5px; margin-top: 8px; }
.auth-support a { color: var(--text-secondary); text-decoration: none; }

.auth-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Sombre */
body.dark-theme.auth-body { background: #0f172a !important; }
body.dark-theme .auth-card { background: #1e293b; border-color: #334155; box-shadow: none; }
body.dark-theme .auth-card h1 { color: #fff; }
body.dark-theme .auth-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark-theme .auth-field label { color: #e2e8f0; }
body.dark-theme .auth-theme-toggle { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.dark-theme .auth-secure { border-top-color: #334155; }

@media (max-width: 1024px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-card-logo { display: flex; }
    .auth-panel {
        min-height: 100vh;
        background:
            radial-gradient(600px 300px at 50% 0%, rgba(37, 99, 235, .10), transparent 70%),
            #f5f7fb;
    }
    body.dark-theme .auth-panel { background: #0f172a; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px 22px; border-radius: 16px; }
    .auth-card h1 { font-size: 23px; }
}
