@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   1. TOKENS — Style inspiré de family_agenda (Glassmorphic)
   ============================================================ */
:root {
    /* Couleurs de fond */
    --bg-gradient: radial-gradient(circle at top right, #e0e7ff 0%, #f1f5f9 50%, #f8fafc 100%);
    --bg:             #f8fafc;
    --bg-app:         #f8fafc;
    --bg-soft:        #f1f5f9;
    --surface:        rgba(255, 255, 255, 0.55);
    --surface-strong: #ffffff;
    --surface-soft:   rgba(255, 255, 255, 0.35);

    /* Texte */
    --text:           #0f172a;
    --text-main:      #0f172a;
    --muted:          #64748b;
    --text-muted:     #64748b;

    /* Bordures */
    --border:         rgba(15, 23, 42, 0.08);
    --border-soft:    rgba(15, 23, 42, 0.05);
    --border-strong:  rgba(99, 102, 241, 0.20);

    /* Couleur primaire (Indigo comme family_agenda) */
    --primary:        #6366f1;
    --primary-dark:   #4f46e5;
    --primary-soft:   rgba(99, 102, 241, 0.12);

    /* Ombres */
    --shadow-sm:      0 4px 14px rgba(15, 23, 42, 0.04);
    --shadow-md:      0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg:      0 22px 50px rgba(15, 23, 42, 0.08);
    --shadow-panel:   0 24px 50px rgba(15, 23, 42, 0.08);
    --shadow-soft:    0 8px 28px rgba(15, 23, 42, 0.04);

    /* Sémantique */
    --success:        #10b981;
    --danger:         #f43f5e;
    --warning:        #f59e0b;

    /* Rayons */
    --radius-sm:      10px;
    --radius-md:      18px;
    --radius-lg:      20px;
    --radius-xl:      24px;

    /* Layout */
    --sidebar-width:  300px;
}

html[data-theme="dark"] {
    --bg-gradient: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 50%, #020617 100%);
    --bg:             #090d16;
    --bg-app:         #090d16;
    --bg-soft:        #0f172a;
    --surface:        rgba(15, 23, 42, 0.55);
    --surface-strong: #0f172a;
    --surface-soft:   rgba(30, 41, 59, 0.4);

    --text:           #f8fafc;
    --text-main:      #f8fafc;
    --muted:          #94a3b8;
    --text-muted:     #94a3b8;

    --border:         rgba(255, 255, 255, 0.08);
    --border-soft:    rgba(255, 255, 255, 0.05);
    --border-strong:  rgba(99, 102, 241, 0.30);

    --primary:        #6366f1;
    --primary-dark:   #818cf8;
    --primary-soft:   rgba(99, 102, 241, 0.20);

    --shadow-sm:      0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-md:      0 12px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg:      0 22px 50px rgba(0, 0, 0, 0.5);
    --shadow-panel:   0 24px 50px rgba(0, 0, 0, 0.5);
    --shadow-soft:    0 8px 28px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-gradient: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 50%, #020617 100%);
        --bg:             #090d16;
        --bg-app:         #090d16;
        --bg-soft:        #0f172a;
        --surface:        rgba(15, 23, 42, 0.55);
        --surface-strong: #0f172a;
        --surface-soft:   rgba(30, 41, 59, 0.4);

        --text:           #f8fafc;
        --text-main:      #f8fafc;
        --muted:          #94a3b8;
        --text-muted:     #94a3b8;

        --border:         rgba(255, 255, 255, 0.08);
        --border-soft:    rgba(255, 255, 255, 0.05);
        --border-strong:  rgba(99, 102, 241, 0.30);

        --primary:        #6366f1;
        --primary-dark:   #818cf8;
        --primary-soft:   rgba(99, 102, 241, 0.20);

        --shadow-sm:      0 4px 14px rgba(0, 0, 0, 0.3);
        --shadow-md:      0 12px 30px rgba(0, 0, 0, 0.4);
        --shadow-lg:      0 22px 50px rgba(0, 0, 0, 0.5);
        --shadow-panel:   0 24px 50px rgba(0, 0, 0, 0.5);
        --shadow-soft:    0 8px 28px rgba(0, 0, 0, 0.3);
    }
}


/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
}

html, body {
    color: var(--text-main);
}


/* ============================================================
   3. LAYOUT
   ============================================================ */
.app-layout {
    min-height: 100vh;
    display: flex;
}

.app-shell,
.dashboard-shell,
.page-shell {
    min-height: 100vh;
}


/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 18px;
    background: var(--bg-soft);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border-soft);
    box-shadow: var(--shadow-panel);
    overflow-y: auto;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.sidebar-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f766e, #159895);
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.sidebar-brand strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.1;
}

.sidebar-brand small {
    display: block;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8b8f97;
    font-weight: 800;
    padding: 0 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #334155;
    padding: 14px 14px;
    border-radius: 16px;
    font-weight: 700;
    transition: all 180ms ease;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-dark);
    transform: translateX(3px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0.08));
    border-color: rgba(15, 118, 110, 0.16);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.05);
}

.sidebar-actions {
    display: grid;
    gap: 10px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 14px 14px;
    border-radius: 18px;
    font-weight: 700;
    transition: all 180ms ease;
}

.quick-action span:first-child {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.quick-action-soft {
    background: rgba(255, 255, 255, 0.72);
    color: #374151;
    border: 1px solid var(--border-soft);
}

.quick-action-soft span:first-child {
    background: rgba(15, 118, 110, 0.10);
    color: var(--primary-dark);
}

.quick-action-primary {
    background: linear-gradient(135deg, var(--primary), #11858f);
    color: white;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.quick-action-primary span:first-child {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.quick-action:hover {
    transform: translateY(-1px);
}

.sidebar-widget {
    background: linear-gradient(180deg, rgba(240, 249, 248, 0.95), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(15, 118, 110, 0.10);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.sidebar-widget-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--text-muted);
    padding: 8px 0;
    font-size: 0.95rem;
}

.sidebar-widget-row strong {
    color: var(--text-main);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 8px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--border-soft);
}

.user-chip-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dff4f2, #effaf9);
    color: var(--primary-dark);
    font-weight: 800;
}

.user-chip strong {
    display: block;
    font-size: 0.95rem;
}

.user-chip small {
    display: block;
    color: var(--text-muted);
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    text-decoration: none;
    text-align: center;
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 700;
    color: #7c2d12;
    background: rgba(255, 247, 237, 0.96);
    border: 1px solid rgba(194, 65, 12, 0.10);
}

.sidebar-toggle,
.sidebar-close {
    border: none;
    background: rgba(255, 255, 255, 0.88);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.sidebar-close {
    display: none;
}

.sidebar-backdrop {
    display: none;
}


/* ============================================================
   5. TOPBAR
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px;
    background: var(--surface);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.topbar-text strong {
    display: block;
    font-size: 1rem;
}

.topbar-text small {
    color: var(--text-muted);
}

.brand-link {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    text-decoration: none;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.top-nav a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
}

.top-nav a:hover {
    color: #0f766e;
}

.page-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
}


/* ============================================================
   6. PAGE CONTENT
   ============================================================ */
.page-content {
    padding: 28px;
}

.main-content {
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: clamp(2rem, 2.8vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}


/* ============================================================
   7. FLASH MESSAGES
   ============================================================ */
.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.flash-wrapper,
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.flash-success { background: #dcfce7; color: #166534; }
.flash-danger  { background: #fee2e2; color: #991b1b; }
.flash-info    { background: #e0f2fe; color: #075985; }
.flash-warning { background: #fef3c7; color: #92400e; }


/* ============================================================
   8. BOUTONS
   ============================================================ */
.btn {
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 180ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #127c84);
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(15, 118, 110, 0.28);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    color: #374151;
    border: 1px solid rgba(31, 41, 55, 0.08);
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-1px);
}

.btn-danger {
    background: #a3394b;
    color: #fff;
}

.btn-danger:hover {
    background: #872d3d;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}


/* ============================================================
   9. CARTES / PANNEAUX
   ============================================================ */
.stat-card,
.panel,
.form-card,
.empty-state {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px 22px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.stat-card:hover,
.panel:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.stat-card {
    padding: 22px;
}

.stat-card h3 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.stat-value {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
}

.stat-note {
    margin-top: 8px;
    color: #6f6a63;
    font-size: 0.92rem;
}

.stat-card-highlight {
    border: 1px solid rgba(10, 126, 115, 0.16);
    background: #f3fbf9;
}

.panel {
    padding: 24px;
}

.form-panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.form-card {
    margin-top: 20px;
}

.empty-state {
    padding: 40px;
    text-align: center;
}

.compact-empty {
    padding: 28px;
    text-align: center;
}

.empty-inline {
    color: #7b756d;
    margin: 0;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.text-link {
    color: #0b7f73;
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}


/* ============================================================
   10. FORMULAIRES
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--surface-strong);
    color: var(--text-main);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.form-control:focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.10);
    background: white;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #4a453e;
    font-size: 0.95rem;
}


/* ============================================================
   11. GRILLES DE STATS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}


/* ============================================================
   12. TABLEAUX
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 8px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 14px;
    color: var(--muted);
    background: var(--surface-soft);
}

.actions-cell {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.actions-cell .btn {
    margin-right: 6px;
}

.inline-form {
    display: inline;
}


/* ============================================================
   13. FILTRES
   ============================================================ */
.filter-panel {
    margin-bottom: 24px;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 18px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


/* ============================================================
   14. BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.badge-work     { background: #d9efe3; color: #1f6a46; }
.badge-half     { background: #e7f0fb; color: #295c9a; }
.badge-rest     { background: #ece9e4; color: #5f5548; }
.badge-leave    { background: #f7ead8; color: #9a5b16; }
.badge-rtt      { background: #efe6fb; color: #6a35a0; }
.badge-sick     { background: #f8dfe5; color: #9a2943; }
.badge-training { background: #dff3f0; color: #1f726d; }
.badge-holiday  { background: #fff0cc; color: #8e6400; }
.badge-other    { background: #e8e8e8; color: #4b4b4b; }
.badge-garde    { background: #d8e8fb; color: #295c9a; }
.badge-astreinte { background: #efe6fb; color: #6a35a0; }

.mini-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.mini-status.yes { background: #d9efe3; color: #1f6a46; }
.mini-status.no  { background: #f1e3e7; color: #8f2d45; }

.premium-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(40, 37, 29, 0.08);
    font-size: 0.9rem;
    font-weight: 600;
}


/* ============================================================
   15. MINI-LISTE (dashboard)
   ============================================================ */
.mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e7e1d8;
    border-radius: 14px;
    background: #faf8f4;
}

.mini-item p {
    margin: 4px 0 0;
    color: #6f6a63;
    font-size: 0.95rem;
}

.mini-meta {
    white-space: nowrap;
    font-weight: 700;
    color: #1d1b18;
}


/* ============================================================
   16. DASHBOARD — grilles et graphiques
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.dashboard-panel {
    min-height: 280px;
}

.quick-links-panel {
    margin-top: 24px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.quick-link-card {
    display: block;
    padding: 20px;
    border-radius: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.quick-link-title {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.quick-link-text {
    display: block;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.chart-panel {
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.chart-panel-wide {
    grid-column: 1 / -1;
}

.chart-panel canvas {
    width: 100% !important;
    height: 280px !important;
}


/* ============================================================
   17. ALERTE PREMIUM / SCORE VIGILANCE
   ============================================================ */
.premium-alert {
    margin: 0 0 24px;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #e6dfd5;
    background: linear-gradient(135deg, #fbfaf7 0%, #f6f3ee 100%);
    box-shadow: 0 12px 28px rgba(25, 22, 17, 0.04);
}

.premium-alert-high   { border-color: rgba(176, 61, 61, 0.22);    background: linear-gradient(135deg, #fff5f4 0%, #fdf0ee 100%); }
.premium-alert-medium { border-color: rgba(184, 126, 37, 0.22);   background: linear-gradient(135deg, #fff9f1 0%, #fcf4e8 100%); }
.premium-alert-ok     { border-color: rgba(11, 127, 115, 0.18);   background: linear-gradient(135deg, #f4fbf9 0%, #eef8f5 100%); }

.status-ok      { border-left: 4px solid #3f8a68; }
.status-warning { border-left: 4px solid #c08a2b; }
.status-alert   { border-left: 4px solid #b14b4b; }

.premium-alert-main {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.premium-alert-kicker {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b655d;
}

.premium-alert-text h2 {
    margin: 0 0 8px;
    font-size: 1.75rem;
}

.premium-alert-text p {
    margin: 0;
    color: #5f5a52;
    max-width: 70ch;
}

.premium-alert-score {
    min-width: 180px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(40, 37, 29, 0.08);
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.85rem;
    color: #6b655d;
    margin-bottom: 6px;
}

.score-value {
    display: block;
    font-size: 1.9rem;
    font-weight: 800;
    color: #1f1c17;
}

.premium-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.premium-alert-list {
    margin: 18px 0 0;
    padding-left: 18px;
    color: #4e4942;
}

.premium-alert-list li + li {
    margin-top: 8px;
}

.premium-panel {
    margin-top: 24px;
}

.premium-check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.premium-check-card {
    padding: 18px;
    border-radius: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
}

.premium-check-card h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--text-main);
}

.premium-check-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}


/* ============================================================
   18. AUTHENTIFICATION
   ============================================================ */
.auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 12px 30px rgba(22, 18, 12, 0.06);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.auth-alt {
    margin-top: 18px;
    color: #6f685f;
}


/* ============================================================
   19. CALENDRIER
   ============================================================ */
.calendar-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calendar-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.summary-mini-card {
    background: #fbfaf8;
    border: 1px solid #e8e2d9;
    border-radius: 18px;
    padding: 18px;
}

.summary-mini-card h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #6c655d;
}

.summary-mini-card p {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    color: #1f1c17;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) 380px;
    gap: 24px;
    align-items: start;
}

.calendar-main {
    min-width: 0;
}

.calendar-sidepanel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 24px;
}

.calendar-shell {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(28, 24, 18, 0.04);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f1ea;
    border-bottom: 1px solid #e8e2d9;
}

.calendar-weekday {
    padding: 14px 10px;
    text-align: center;
    font-weight: 700;
    color: #5f5a52;
    font-size: 0.92rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 150px;
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    padding: 12px;
    background: var(--surface-strong);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: var(--bg-soft);
    transform: translateY(-1px);
}

.calendar-day-empty {
    background: var(--bg);
}

.calendar-day.is-today {
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--surface-soft) 100%);
}

.calendar-day.is-today .calendar-day-number {
    color: #0b7f73;
}

.calendar-day.is-selected {
    background: linear-gradient(180deg, #f9fcfb 0%, #f2faf7 100%);
    outline: 2px solid rgba(11, 127, 115, 0.22);
    outline-offset: -2px;
}

.calendar-day.is-selected .calendar-day-number {
    color: #0b7f73;
}

.calendar-day.has-worked    { box-shadow: inset 3px 0 0 #2e8a67; }
.calendar-day.has-garde     { box-shadow: inset 3px 0 0 #4e79c8; }
.calendar-day.has-astreinte { box-shadow: inset 3px 0 0 #8a5bd1; }
.calendar-day.has-intervention { box-shadow: inset 3px 0 0 #d07a18; }

.calendar-day.has-worked.has-garde,
.calendar-day.has-worked.has-astreinte,
.calendar-day.has-worked.has-intervention,
.calendar-day.has-garde.has-astreinte,
.calendar-day.has-garde.has-intervention,
.calendar-day.has-astreinte.has-intervention {
    box-shadow: inset 4px 0 0 #0b7f73;
}

.calendar-day-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-day-number {
    font-size: 1rem;
    font-weight: 700;
    color: #241f19;
}

.calendar-day-add {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1ece4;
    color: #0b7f73;
    font-weight: 800;
    text-decoration: none;
}

.calendar-day-add:hover {
    background: #0b7f73;
    color: white;
}

.calendar-day-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-worked       { background: #e8f7f1; color: #156b59; }
.badge-intervention { background: #fff1e5; color: #ab6515; }


/* ============================================================
   20. SIDE PANEL (calendrier)
   ============================================================ */
.sidepanel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(28, 24, 18, 0.04);
}

.sidepanel-head h2 {
    margin: 4px 0 0;
    font-size: 1.5rem;
}

.sidepanel-kicker {
    display: inline-block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a736b;
    font-weight: 700;
}

.sidepanel-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.sidepanel-stat {
    padding: 12px;
    border-radius: 16px;
    background: #faf8f4;
    border: 1px solid #ece5db;
}

.sidepanel-stat span {
    display: block;
    font-size: 0.85rem;
    color: #706960;
    margin-bottom: 6px;
}

.sidepanel-stat strong {
    font-size: 1.3rem;
    color: #1f1c17;
}

.sidepanel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.sidepanel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.sidepanel-item {
    padding: 12px;
    border-radius: 14px;
    background: #fcfbf8;
    border: 1px solid #ece5db;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidepanel-item strong { color: #1f1c17; }
.sidepanel-item span   { color: #5f5a52; font-size: 0.95rem; }
.sidepanel-item small  { color: #847d74; font-size: 0.85rem; }

.sidepanel-empty {
    margin: 0;
    color: #7c756d;
}

.sidepanel-help {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #7a736b;
    line-height: 1.5;
}


/* ============================================================
   21. IMPRESSION
   ============================================================ */
@media print {
    body { background: #fff !important; }
    .actions { display: none !important; }
    .page { max-width: 100%; margin: 0; padding: 0; box-shadow: none; }
}


/* ============================================================
   22. RESPONSIVE — un seul bloc par breakpoint
   ============================================================ */
@media (max-width: 1280px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .calendar-sidepanel {
        position: static;
    }
}

@media (max-width: 1100px) {
    .dashboard-grid          { grid-template-columns: 1fr; }
    .dashboard-charts-grid   { grid-template-columns: 1fr; }
    .chart-panel-wide        { grid-column: auto; }
    .quick-links-grid        { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-summary-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .premium-alert-main      { flex-direction: column; }
    .premium-alert-score     { min-width: auto; width: 100%; }
    .premium-check-grid      { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-day            { min-height: 130px; padding: 10px; }
}

@media (max-width: 992px) {
    .stats-grid,
    .details-grid    { grid-template-columns: 1fr; }
    .form-grid       { grid-template-columns: 1fr; }
    .page-header-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
    /* Sidebar mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .app-main     { margin-left: 0; }
    .sidebar-close {
        display: inline-grid;
        place-items: center;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.34);
        z-index: 40;
    }
    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    /* Contenu */
    .topbar      { padding: 16px 18px; }
    .page-content { padding: 18px; }
    .main-content { padding: 20px; }
    .page-header  { flex-direction: column; align-items: stretch; }
    .filters-row  { grid-template-columns: 1fr; }
}

@media (min-width: 901px) {
    .sidebar-toggle { display: none; }
}

@media (max-width: 760px) {
    .calendar-weekdays,
    .calendar-grid { grid-template-columns: repeat(7, minmax(120px, 1fr)); min-width: 840px; }
    .calendar-shell { overflow-x: auto; }
    .calendar-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .quick-links-grid  { grid-template-columns: 1fr; }
    .premium-check-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   21. LANDING PAGE
   ============================================================ */
.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}

.landing-hero-copy,
.landing-hero-side {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.landing-kicker {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.landing-hero-copy h1 {
    margin: 0 0 14px;
    max-width: 16ch;
}

.landing-lead {
    margin: 0;
    max-width: 64ch;
    color: var(--text-muted);
    font-size: 1.03rem;
    line-height: 1.7;
}

.landing-hero-actions,
.landing-cta-actions,
.landing-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.landing-hero-actions {
    margin-top: 22px;
}

.landing-pill-row {
    margin-top: 18px;
}

.landing-hero-side {
    display: grid;
    gap: 16px;
    background: linear-gradient(135deg, var(--surface-soft) 0%, var(--surface) 100%);
}

.landing-metric-card {
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 18px;
}

.landing-metric-card h3 {
    margin: 0 0 8px;
}

.landing-metric-card .stat-value {
    font-size: 2.2rem;
    color: var(--primary);
}

.landing-metric-card p {
    margin: 0;
    color: var(--text-muted);
}

.landing-section {
    margin-top: 24px;
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.landing-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 20px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
}

.landing-step-number {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 800;
    flex-shrink: 0;
}

.landing-step h3,
.landing-advice-card h3 {
    margin: 0 0 8px;
}

.landing-step p,
.landing-advice-card p {
    margin: 0;
    color: var(--text-muted);
}

.landing-advice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.landing-advice-card {
    padding: 20px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
}

.landing-cta {
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

@media (max-width: 1100px) {
    .landing-hero,
    .landing-steps,
    .landing-advice-grid {
        grid-template-columns: 1fr;
    }

    .landing-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}

.checkbox-card {
    display: flex;
    align-items: center;
    min-height: 74px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-strong);
}

.checkbox-card-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

/* ============================================================
   22. SPECIFIC DARK THEME BUTTONS & FIELDS
   ============================================================ */
html[data-theme="dark"] .badge-user,
html[data-theme="dark"] .badge-admin,
html[data-theme="dark"] .badge-active,
html[data-theme="dark"] .contract-chip,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .badge-user,
    html[data-theme="system"] .badge-admin,
    html[data-theme="system"] .badge-active,
    html[data-theme="system"] .contract-chip
} {
    background: #24312d !important;
    color: #d8e3dd !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .btn-neutral,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .btn-neutral
} {
    background: #24312d !important;
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .btn-teal,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .btn-teal
} {
    background: rgba(20, 184, 166, 0.18) !important;
    color: #7ce7d9 !important;
}

html[data-theme="dark"] .btn-dark,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .btn-dark
} {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

html[data-theme="dark"] .form-row input,
html[data-theme="dark"] .form-row select,
html[data-theme="dark"] .form-control,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .form-row input,
    html[data-theme="system"] .form-row select,
    html[data-theme="system"] .form-control
} {
    background: #111827 !important;
    color: #f3f4f6 !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

html[data-theme="dark"] .form-row input:focus,
html[data-theme="dark"] .form-row select:focus,
html[data-theme="dark"] .form-control:focus,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .form-row input:focus,
    html[data-theme="system"] .form-row select:focus,
    html[data-theme="system"] .form-control:focus
} {
    border-color: rgba(94, 234, 212, 0.35) !important;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.10) !important;
}

html[data-theme="dark"] .validation-message,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .validation-message
} {
    color: #fda4af !important;
}

/* Custom scrollbar styling for a cleaner look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(120, 113, 101, 0.22);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 113, 101, 0.44);
}

/* ============================================================
   Surcharges Mode Sombre pour le Pilotage Intelligent
   ============================================================ */
html[data-theme="dark"] .premium-alert,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert {
        background: rgba(15, 23, 42, 0.45);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: var(--shadow-md);
    }
}

html[data-theme="dark"] .premium-alert-high,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-high {
        background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(244, 63, 94, 0.04) 100%) !important;
        border-color: rgba(244, 63, 94, 0.3) !important;
    }
}

html[data-theme="dark"] .premium-alert-medium,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-medium {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%) !important;
        border-color: rgba(245, 158, 11, 0.3) !important;
    }
}

html[data-theme="dark"] .premium-alert-ok,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-ok {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.04) 100%) !important;
        border-color: rgba(99, 102, 241, 0.3) !important;
    }
}

html[data-theme="dark"] .premium-alert-kicker,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-kicker {
        color: var(--primary-dark) !important;
    }
}

html[data-theme="dark"] .premium-alert-text h2,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-text h2 {
        color: var(--text-main) !important;
    }
}

html[data-theme="dark"] .premium-alert-text p,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-text p {
        color: var(--muted) !important;
    }
}

html[data-theme="dark"] .premium-alert-score,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-score {
        background: rgba(15, 23, 42, 0.6) !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
    }
}

html[data-theme="dark"] .premium-alert-score .score-value,
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .premium-alert-score .score-value {
        color: var(--text-main) !important;
    }
}