﻿/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MERIDIAN — Styles maquette (version nettoyée)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ─── Variables ─── */
:root {
    --ink: #0F1F35;
    --ink-2: #16294A;
    --paper: #F4F6F8;
    --card: #FFFFFF;
    --line: #E1E6EB;
    --line-2: #CBD3DA;
    --teal: #0E7C7B;
    --teal-dark: #0A5F5E;
    --teal-bg: #E4F2F1;
    --urgent: #C8313D;
    --urgent-bg: #FCEAEB;
    --amber: #B4780A;
    --amber-bg: #FBF1DF;
    --calm: #2E7D5B;
    --calm-bg: #E7F3ED;
    --text: #182430;
    --muted: #66727E;
    --muted-2: #8C97A2;
    --radius: 10px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
}

/* ─── Reset & base ─── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--paper);
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */
.meridian-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--paper);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.meridian-sidebar {
    width: var(--sidebar-width, 260px);
    background: var(--ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    z-index: 10;
    box-shadow: 2px 0 12px rgba(15, 31, 53, 0.12);
}

    .meridian-sidebar.collapsed {
        width: var(--sidebar-collapsed, 72px) !important;
    }

/* Header sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .logo-icon svg {
        width: 18px;
        height: 18px;
        stroke: #fff;
    }

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: opacity 0.25s ease;
}

.meridian-sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Toggle button */
.sidebar-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sidebar-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .sidebar-toggle svg {
        width: 20px;
        height: 20px;
    }

.meridian-sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
}

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

    .nav-link.active {
        background: rgba(255, 255, 255, 0.10);
        color: #fff;
    }

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-label {
    transition: opacity 0.25s ease;
}

.meridian-sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip en mode collapsed */
.meridian-sidebar.collapsed .nav-link .nav-label {
    display: none;
}

.meridian-sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink-2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.nav-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 8px 8px;
}

/* Footer sidebar */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2A3E5A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    transition: opacity 0.25s ease;
}

.meridian-sidebar.collapsed .user-details {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.meridian-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Header */
.main-header {
    height: 64px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}

    .mobile-toggle:hover {
        background: var(--paper);
        color: var(--text);
    }

    .mobile-toggle svg {
        width: 22px;
        height: 22px;
    }

.main-header .page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--calm);
    box-shadow: 0 0 0 3px rgba(46, 125, 91, 0.20);
}

.status-dot-red {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--urgent);
    box-shadow: 0 0 0 3px rgba(200, 49, 61, 0.20);
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

/* Body */
.main-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 40px;
    background: var(--paper);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HOME
   ═══════════════════════════════════════════════════════════════ */
.meridian-home {
    max-width: 1200px;
    margin: 0 auto;
}

    /* ⚠️ ICI : .page-title et .page-subtitle pour la page Home */
    .meridian-home .page-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 24px;
        font-weight: 600;
        color: var(--text);
        margin: 0 0 4px 0;
    }

    .meridian-home .page-subtitle {
        font-size: 14px;
        color: var(--muted);
        margin: 0;
    }

.page-header {
    margin-bottom: 28px;
}

/* Statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: box-shadow 0.2s;
}

    .stat-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    }

.stat-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin: 0;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 4px 0 0 0;
}

    .stat-value.urgent {
        color: var(--urgent);
    }

    .stat-value.success {
        color: var(--calm);
    }

.stat-unit {
    font-size: 16px;
    font-weight: 400;
    color: var(--muted-2);
    margin-left: 2px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .stat-icon svg {
        width: 22px;
        height: 22px;
    }

    .stat-icon.blue {
        background: #E8F0FE;
    }

        .stat-icon.blue svg {
            stroke: #2D4E9C;
        }

    .stat-icon.red {
        background: #FCEAEB;
    }

        .stat-icon.red svg {
            stroke: var(--urgent);
        }

    .stat-icon.green {
        background: #E7F3ED;
    }

        .stat-icon.green svg {
            stroke: var(--calm);
        }

    .stat-icon.purple {
        background: #EDE7F6;
    }

        .stat-icon.purple svg {
            stroke: #7C4DFF;
        }

/* Dossiers récents */
.recent-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

/*.recent-section-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: #FAFBFC;
}*/
.recent-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: #FAFBFC;
}

.recent-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
    cursor: default;
}

    .recent-item:last-child {
        border-bottom: none;
    }

    .recent-item:hover {
        background: #FAFBFC;
    }

.recent-item-left {
    flex: 1;
    min-width: 0;
}

.recent-item-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.patient-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.recent-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.meta-id {
    font-family: 'IBM Plex Mono', monospace;
}

.meta-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-xs {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.recent-item-date {
    font-size: 12px;
    color: var(--muted-2);
    flex-shrink: 0;
    margin-left: 16px;
}

/* Empty state Home */
.empty-state-home {
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--muted-2);
    margin: 0 auto 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.empty-sub {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 20px 0;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE NOUVELLE DEMANDE
   ═══════════════════════════════════════════════════════════════ */
.meridian-page-layout {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 80px);
}

.meridian-page-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 16px;
}

.meridian-page-main {
    flex: 1;
    min-width: 0;
}

    /* Titres de la page Nouvelle Demande */
    .meridian-page-main .page-main-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 24px;
        margin: 0 0 4px 0;
    }

    .meridian-page-main .page-main-sub {
        font-size: 13.5px;
        color: var(--muted);
        margin: 0 0 26px 0;
    }

/* Sidebar de la page */
.sidebar-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 14px 0;
}

.recent-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}

    .recent-card:hover {
        border-color: var(--teal);
    }

.recent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.recent-card-name {
    font-weight: 600;
    font-size: 14px;
}

.recent-card-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    color: var(--muted);
}

.recent-card-location {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* Formulaire */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
}

.form-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--teal-dark);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grilles */
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px 16px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .field.full-width {
        grid-column: 1 / -1;
    }

    .field label {
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
    }

    .field input,
    .field select,
    .field textarea {
        font-family: 'Inter', sans-serif;
        font-size: 13.5px;
        padding: 9px 11px;
        border: 1px solid var(--line-2);
        border-radius: 7px;
        background: #fff;
        color: var(--text);
        width: 100%;
    }

        .field input:focus,
        .field select:focus,
        .field textarea:focus {
            outline: 2px solid var(--teal);
            outline-offset: 1px;
            border-color: var(--teal);
        }

        .field input.disabled {
            background: #f5f6f8;
            color: var(--muted);
            cursor: not-allowed;
        }

    .field textarea {
        resize: vertical;
        min-height: 70px;
    }

/* Priorité */
.priority-group {
    display: flex;
    gap: 10px;
}

.priority-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    border: 1.5px solid var(--line-2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
}

    .priority-option input {
        display: none;
    }

    .priority-option.active.urgent {
        border-color: var(--urgent);
        background: var(--urgent-bg);
        color: var(--urgent);
    }

    .priority-option.active.standard {
        border-color: var(--amber);
        background: var(--amber-bg);
        color: var(--amber);
    }

    .priority-option.active.calme {
        border-color: var(--calm);
        background: var(--calm-bg);
        color: var(--calm);
    }

    .priority-option:hover:not(.active) {
        border-color: var(--muted-2);
    }

/* Boutons */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    padding: 11px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--teal-dark);
    }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line-2);
}

    .btn-ghost:hover {
        border-color: var(--muted-2);
    }

/* Icônes */
.icon-sm {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon-md {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

/* ═══════════════════════════════════════════════════════════════
   TAGS (utilisés partout)
   ═══════════════════════════════════════════════════════════════ */
.tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.tag-attente {
    background: #EEF1F4;
    color: var(--muted);
}

.tag-contacte {
    background: var(--teal-bg);
    color: var(--teal-dark);
}

.tag-consultation {
    background: #E7EEFB;
    color: #2D4E9C;
}

.tag-termine {
    background: var(--calm-bg);
    color: var(--calm);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .meridian-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        transform: translateX(0);
        transition: transform 0.3s ease, width 0.3s ease;
        width: var(--sidebar-width);
    }

        .meridian-sidebar.collapsed {
            transform: translateX(-100%);
            width: var(--sidebar-width);
        }

    .mobile-toggle {
        display: flex !important;
    }

    .main-header {
        padding: 0 16px;
    }

    .main-body {
        padding: 16px;
    }

    .main-header .page-title {
        font-size: 17px;
    }

    .meridian-page-layout {
        flex-direction: column;
    }

    .meridian-page-sidebar {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .priority-group {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

        .form-actions .btn {
            justify-content: center;
        }

    .recent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .recent-item-date {
        margin-left: 0;
        font-size: 11px;
        color: var(--muted-2);
    }

    .stat-value {
        font-size: 22px;
    }

    .meridian-home .page-title {
        font-size: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE UTILISATEURS
   ═══════════════════════════════════════════════════════════════ */

.page-utilisateurs {
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── En-tête ─── */
.page-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

    .page-header-with-actions .page-main-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 24px;
        font-weight: 600;
        color: var(--text);
        margin: 0 0 4px 0;
    }

    .page-header-with-actions .page-main-sub {
        font-size: 14px;
        color: var(--muted);
        margin: 0;
    }

/* ─── Filtres ─── */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

    .filters-bar .filter-group {
        flex: 1;
        min-width: 180px;
    }

    .filters-bar .search-input,
    .filters-bar .filter-select {
        width: 100%;
        padding: 9px 11px;
        border: 1px solid var(--line-2);
        border-radius: 7px;
        font-size: 13.5px;
        background: #fff;
        color: var(--text);
    }

        .filters-bar .search-input:focus,
        .filters-bar .filter-select:focus {
            outline: 2px solid var(--teal);
            outline-offset: 1px;
            border-color: var(--teal);
        }

/* ─── Tableau ─── */
.table-container {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

    .table-container .meridian-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13.5px;
    }

        .table-container .meridian-table thead {
            background: #FAFBFC;
            border-bottom: 1px solid var(--line);
        }

        .table-container .meridian-table th {
            padding: 12px 16px;
            text-align: left;
            font-weight: 600;
            color: var(--muted);
            text-transform: uppercase;
            font-size: 11px;
            letter-spacing: 0.05em;
        }

        .table-container .meridian-table td {
            padding: 14px 16px;
            border-bottom: 1px solid var(--line);
            color: var(--text);
            vertical-align: middle;
        }

        .table-container .meridian-table tbody tr:hover {
            background: #FAFBFC;
        }

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

    .table-container .text-right {
        text-align: right;
    }

    .table-container .text-muted {
        color: var(--muted-2);
    }

/* ─── Cellule utilisateur ─── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--teal-bg);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.user-cell .user-name {
    font-weight: 600;
    color: var(--text);
}

.user-cell .user-meta {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

/* ─── Status badge ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

    .status-badge.active {
        background: var(--calm-bg);
        color: var(--calm);
    }

    .status-badge.inactive {
        background: #EEF1F4;
        color: var(--muted);
    }

    .status-badge .status-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }

    .status-badge.active .status-dot {
        background: var(--calm);
    }

    .status-badge.inactive .status-dot {
        background: var(--muted-2);
    }

/* ─── Action buttons ─── */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.btn-icon {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-icon:hover {
        background: var(--paper);
        color: var(--text);
    }

/* ─── Tags par rôle ─── */
.tag-admin {
    background: var(--urgent-bg);
    color: var(--urgent);
}

.tag-medecin {
    background: #E8F0FE;
    color: #2D4E9C;
}

.tag-assisteur {
    background: var(--teal-bg);
    color: var(--teal-dark);
}

.tag-lecteur {
    background: #EEF1F4;
    color: var(--muted);
}

/* ─── Empty state ─── */
.empty-state {
    padding: 48px 24px;
    text-align: center;
}

    .empty-state .empty-icon {
        width: 48px;
        height: 48px;
        color: var(--muted-2);
        margin: 0 auto 12px;
    }

    .empty-state .empty-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--text);
        margin: 0 0 4px 0;
    }

    .empty-state .empty-sub {
        font-size: 14px;
        color: var(--muted);
        margin: 0;
    }

/* ═══════════════════════════════════════════════════════════════
   MODAL UTILISATEURS
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 31, 53, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: #FAFBFC;
}

    .modal-header .modal-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: var(--text);
        margin: 0 0 4px 0;
    }

    .modal-header .modal-subtitle {
        font-size: 13px;
        color: var(--muted);
        margin: 0;
    }

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}

    .modal-close:hover {
        background: var(--paper);
        color: var(--text);
    }

.modal-body {
    padding: 24px;
}

    /* ─── Form sections ─── */
    .modal-body .form-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--line);
    }

        .modal-body .form-section:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

    .modal-body .form-subtitle {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 13px;
        font-weight: 600;
        color: var(--teal-dark);
        margin: 0 0 14px 0;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* ─── Form grid ─── */
    .modal-body .form-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px 16px;
    }

    /* ─── Fields ─── */
    .modal-body .field {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

        .modal-body .field label {
            font-size: 12px;
            font-weight: 600;
            color: var(--muted);
        }

        .modal-body .field input,
        .modal-body .field select,
        .modal-body .field textarea {
            font-family: 'Inter', sans-serif;
            font-size: 13.5px;
            padding: 9px 11px;
            border: 1px solid var(--line-2);
            border-radius: 7px;
            background: #fff;
            color: var(--text);
            width: 100%;
        }

            .modal-body .field input:focus,
            .modal-body .field select:focus,
            .modal-body .field textarea:focus {
                outline: 2px solid var(--teal);
                outline-offset: 1px;
                border-color: var(--teal);
            }

    .modal-body .field-help {
        font-size: 11.5px;
        color: var(--muted);
    }

    .modal-body .required {
        color: var(--urgent);
    }

/* ─── Password input ─── */
.password-input-group {
    display: flex;
    gap: 8px;
}

    .password-input-group input {
        flex: 1;
    }

.btn-icon-toggle {
    padding: 9px 11px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-icon-toggle:hover {
        background: var(--paper);
    }

.password-generated {
    margin-top: 12px;
}

.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.alert-info {
    background: #E8F0FE;
    border: 1px solid #BFD4FE;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2D4E9C;
}

.alert-text {
    font-size: 12px;
    color: #5A7BB5;
    margin: 0;
}

.generated-password-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

    .generated-password-display code {
        flex: 1;
        font-family: 'IBM Plex Mono', monospace;
        font-size: 14px;
        font-weight: 600;
        color: var(--teal-dark);
        letter-spacing: 0.05em;
    }

.btn-copy {
    padding: 6px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-copy:hover {
        background: var(--paper);
    }

/* ─── Actions ─── */
.modal-body .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line-2);
}

    .btn-secondary:hover {
        background: var(--paper);
    }

/* ─── Animations ─── */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.opacity-25 {
    opacity: 0.25;
}

.opacity-75 {
    opacity: 0.75;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .page-header-with-actions {
        flex-direction: column;
    }

    .filters-bar {
        flex-direction: column;
    }

        .filters-bar .filter-group {
            min-width: 100%;
        }

    .table-container .meridian-table thead {
        display: none;
    }

    .table-container .meridian-table tbody tr {
        display: block;
        border-bottom: 1px solid var(--line);
        padding: 12px;
    }

    .table-container .meridian-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
    }

        .table-container .meridian-table td::before {
            content: attr(data-label);
            font-weight: 600;
            color: var(--muted);
            font-size: 11px;
            text-transform: uppercase;
        }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .modal-body .form-actions {
        flex-direction: column-reverse;
    }

        .modal-body .form-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .password-input-group {
        flex-direction: column;
    }

    .btn-icon-toggle {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PAGE VIEW USER
   ═══════════════════════════════════════════════════════════════ */

/* ─── Breadcrumb ─── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}

.breadcrumb-link {
    color: var(--teal);
    text-decoration: none;
}

    .breadcrumb-link:hover {
        text-decoration: underline;
    }

.breadcrumb-separator {
    color: var(--muted-2);
}

.breadcrumb-current {
    color: var(--muted);
}

/* ─── Header actions ─── */
.header-actions {
    display: flex;
    gap: 10px;
}

/* ─── Grille de détails ─── */
.user-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.user-details-card,
.user-stats-card,
.user-history-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

    .user-details-card .card-header,
    .user-stats-card .card-header,
    .user-history-card .card-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--line);
        background: #FAFBFC;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* ─── Info rows ─── */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

    .info-row:last-child {
        border-bottom: none;
    }

.info-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
}

.info-value {
    color: var(--text);
    font-size: 13px;
}

/* ─── Stats ─── */
.stat-item {
    text-align: center;
    padding: 8px 0;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--teal);
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

/* ─── Full width buttons ─── */
.full-width {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

    .full-width:last-child {
        margin-bottom: 0;
    }

.btn-danger {
    background: var(--urgent);
    color: #fff;
}

    .btn-danger:hover {
        background: #a8232d;
    }

.btn-success {
    background: var(--calm);
    color: #fff;
}

    .btn-success:hover {
        background: #1f5e45;
    }

/* ─── History timeline ─── */
.history-timeline {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

    .history-item:last-child {
        border-bottom: none;
    }

.history-time {
    font-size: 12px;
    color: var(--muted-2);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.history-description {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}

.history-count {
    font-size: 12px;
    color: var(--muted);
}

/* ─── User role badge ─── */
.user-role-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ─── TOTP ─── */
.totp-active {
    color: var(--calm);
    font-weight: 600;
}

.totp-inactive {
    color: var(--muted-2);
    font-weight: 600;
}

/* ─── Loading ─── */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--line);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ─── Confirm Modal ─── */
.confirm-modal {
    max-width: 480px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .user-details-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

        .header-actions .btn {
            justify-content: center;
        }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .history-item {
        flex-direction: column;
        gap: 4px;
    }
}


/*** Recovery Codes ****/
/* Recovery Codes */
.recovery-codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
    padding: 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.recovery-code-item {
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    text-align: center;
}

    .recovery-code-item code {
        font-family: 'IBM Plex Mono', monospace;
        font-size: 14px;
        font-weight: 600;
        color: var(--teal-dark);
        letter-spacing: 0.05em;
    }

.alert-warning {
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    padding: 16px;
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

    .alert-warning svg {
        width: 24px;
        height: 24px;
        color: var(--amber);
        flex-shrink: 0;
    }

    .alert-warning strong {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        margin-bottom: 4px;
    }

    .alert-warning p {
        font-size: 13px;
        color: var(--muted);
        margin: 0;
    }

/* ═══════════════════════════════════════════════════════════════
AUTH LAYOUT (Login, Register, etc.)
═══════════════════════════════════════════════════════════════ */
.auth-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
    color: #fff;
}

.auth-logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--teal);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .auth-logo-icon svg {
        width: 32px;
        height: 32px;
        stroke: #fff;
    }

.auth-logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 4px 0;
}

.auth-logo-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Card */
.auth-card {
    width: 100%;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.auth-section {
    padding: 32px;
}

.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 6px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 24px 0;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    .auth-form .field {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

        .auth-form .field label {
            font-size: 12.5px;
            font-weight: 600;
            color: var(--muted);
        }

        .auth-form .field input {
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            padding: 10px 12px;
            border: 1px solid var(--line-2);
            border-radius: 8px;
            background: #fff;
            color: var(--text);
            width: 100%;
            transition: all 0.15s;
        }

            .auth-form .field input:focus {
                outline: 2px solid var(--teal);
                outline-offset: 1px;
                border-color: var(--teal);
            }

/* Password field with toggle */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

    .password-field input {
        padding-right: 40px !important;
    }

.btn-toggle-password {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-toggle-password:hover {
        background: var(--paper);
        color: var(--text);
    }

/* Options (Remember me + Forgot password) */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
}

    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--teal);
    }

.auth-link {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}

    .auth-link:hover {
        text-decoration: underline;
    }

/* Buttons */
.btn-full {
    width: 100%;
    justify-content: center;
}

/* Alert */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    align-items: flex-start;
}

.alert-error {
    background: var(--urgent-bg);
    border: 1px solid var(--urgent);
    color: var(--urgent);
}

    .alert-error svg {
        flex-shrink: 0;
        margin-top: 1px;
    }

/* TOTP specific */
.totp-input {
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 20px !important;
    letter-spacing: 0.3em;
    text-align: center;
    padding: 14px !important;
}

.field-help {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 4px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--muted-2);
    font-size: 12px;
}

    .auth-divider::before,
    .auth-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--line);
    }

    .auth-divider span {
        padding: 0 12px;
    }

/* Back button */
.btn-back {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin-bottom: 16px;
    transition: color 0.15s;
}

    .btn-back:hover {
        color: var(--text);
    }

/* Footer */
.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.opacity-25 {
    opacity: 0.25;
}

.opacity-75 {
    opacity: 0.75;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-section {
        padding: 24px 20px;
    }

    .auth-logo-text {
        font-size: 24px;
    }

    .auth-logo-icon {
        width: 48px;
        height: 48px;
    }

        .auth-logo-icon svg {
            width: 28px;
            height: 28px;
        }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE LOGIN
   ═══════════════════════════════════════════════════════════════ */

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--paper);
}

.auth-section {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

    .auth-logo .logo-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: var(--teal);
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .auth-logo .logo-icon svg {
            width: 24px;
            height: 24px;
            stroke: #fff;
        }

    .auth-logo .logo-text {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 22px;
        font-weight: 700;
        color: var(--text);
        letter-spacing: 0.02em;
    }

.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 24px 0;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.password-field {
    display: flex;
    gap: 8px;
}

    .password-field input {
        flex: 1;
    }

.btn-toggle-password {
    padding: 9px 12px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-toggle-password:hover {
        background: var(--paper);
    }

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

    .auth-options .checkbox-label {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
    }

.auth-link {
    color: var(--teal);
    text-decoration: none;
}

    .auth-link:hover {
        text-decoration: underline;
    }

.btn-full {
    width: 100%;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 16px;
    color: var(--muted-2);
    font-size: 12px;
}

    .auth-divider::before,
    .auth-divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--line);
    }

    .auth-divider span {
        padding: 0 16px;
    }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    padding: 0 0 16px 0;
}

    .btn-back:hover {
        color: var(--text);
    }

.totp-input {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 22px;
    letter-spacing: 6px;
    text-align: center;
    padding: 12px;
}

.btn-logout-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-logout-header:hover {
        background: var(--paper);
        color: var(--text);
        border-color: var(--muted-2);
    }

.header-avatar-link {
    text-decoration: none;
}

    .header-avatar-link .header-avatar {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--line);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 600;
        color: var(--muted);
        transition: all 0.15s;
    }

    .header-avatar-link:hover .header-avatar {
        background: var(--teal-bg);
        color: var(--teal-dark);
    }

.alert-error {
    background: var(--urgent-bg);
    border: 1px solid var(--urgent);
    color: var(--urgent);
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

    .alert-error svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

.auth-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted-2);
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-section {
        padding: 28px 20px;
    }

    .auth-title {
        font-size: 18px;
    }

    .auth-options {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .btn-logout-header .btn-logout-text {
        display: none;
    }

    .btn-logout-header {
        padding: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
ACCESS DENIED
═══════════════════════════════════════════════════════════════ */
    .access-denied-page {
    text-align: center;
    padding: 20px 0;
}

.access-denied-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: var(--urgent-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .access-denied-icon svg {
        width: 40px;
        height: 40px;
        stroke: var(--urgent);
    }

.access-denied-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.access-denied-message {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 28px 0;
    line-height: 1.5;
}

.access-denied-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 280px;
    margin: 0 auto;
}

    .access-denied-actions .btn {
        justify-content: center;
    }

/* ═══════════════════════════════════════════════════════════════
USER MENU (Sidebar Footer)
═══════════════════════════════════════════════════════════════ */
.user-menu-container {
    position: relative;
    width: 100%;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

    .user-menu-trigger:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .user-menu-trigger .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #2A3E5A;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 600;
        font-size: 12px;
        flex-shrink: 0;
    }

    .user-menu-trigger .user-details {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
    }

    .user-menu-trigger .user-name {
        font-size: 13px;
        font-weight: 500;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-menu-trigger .user-role {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
    }

.user-menu-arrow {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.15s;
    flex-shrink: 0;
}

    .user-menu-arrow.hidden {
        display: none;
    }

/* Dropdown menu */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
    animation: dropdownSlideUp 0.15s ease-out;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FAFBFC;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--teal-bg);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.user-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-dropdown-email {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--line);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    text-decoration: none;
}

    .user-dropdown-item:hover {
        background: var(--paper);
    }

    .user-dropdown-item svg {
        width: 16px;
        height: 16px;
        color: var(--muted);
    }

/* Login button in sidebar */
.btn-login-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--teal);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

    .btn-login-sidebar:hover {
        background: var(--teal-dark);
    }

    .btn-login-sidebar svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

/* Responsive */
@media (max-width: 768px) {
    .user-dropdown {
        position: fixed;
        bottom: 80px;
        left: 16px;
        right: 16px;
        width: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════
HEADER AVATAR LINK (clic vers profil)
═══════════════════════════════════════════════════════════════ */
.header-avatar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.15s;
}

    .header-avatar-link:hover {
        background: var(--paper);
    }

    .header-avatar-link .status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--calm);
        box-shadow: 0 0 0 3px rgba(46, 125, 91, 0.20);
    }

/* Bouton Se connecter dans le header */
.btn-login-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--teal);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

    .btn-login-header:hover {
        background: var(--teal-dark);
    }

    .btn-login-header svg {
        width: 16px;
        height: 16px;
    }

/* Bouton Se connecter dans la sidebar */
.btn-login-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--teal);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    width: 100%;
}

    .btn-login-sidebar:hover {
        background: var(--teal-dark);
    }

    .btn-login-sidebar svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

/* ═══════════════════════════════════════════════════════════════
BOUTON DÉCONNEXION (Header)
═══════════════════════════════════════════════════════════════ */
.btn-logout-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

    .btn-logout-header:hover {
        background: var(--urgent-bg);
        border-color: var(--urgent);
        color: var(--urgent);
    }

    .btn-logout-header svg {
        width: 16px;
        height: 16px;
    }

/* Masquer le texte sur petit écran, garder l'icône */
.btn-logout-text {
    display: inline;
}

@media (max-width: 768px) {
    .btn-logout-text {
        display: none;
    }

    .btn-logout-header {
        padding: 6px;
    }
}

/* Lien avatar dans le header */
.header-avatar-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--teal-bg);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.15s;
}

.header-avatar-link:hover .header-avatar {
    background: var(--teal);
    color: #fff;
}

/* ─── Gestion des rôles ─── */
.roles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.role-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    user-select: none;
}

    .role-checkbox input[type="checkbox"] {
        display: none;
    }

    .role-checkbox .role-tag {
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        transition: all 0.15s ease;
        opacity: 0.6;
        cursor: pointer;
    }

    .role-checkbox.selected .role-tag {
        opacity: 1;
        box-shadow: 0 0 0 2px var(--teal);
    }

    .role-checkbox:hover .role-tag {
        opacity: 0.9;
    }

    .role-checkbox.selected .tag-admin {
        box-shadow: 0 0 0 2px var(--urgent);
    }

    .role-checkbox.selected .tag-medecin {
        box-shadow: 0 0 0 2px #2D4E9C;
    }

    .role-checkbox.selected .tag-assisteur {
        box-shadow: 0 0 0 2px var(--teal-dark);
    }

    .role-checkbox.selected .tag-lecteur {
        box-shadow: 0 0 0 2px var(--muted-2);
    }
/* ─── Cellule des rôles ─── */
.roles-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ─── Conteneur des rôles dans la modale ─── */
.roles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    align-items: center;
}

.role-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    user-select: none;
    min-height: 32px;
}

    .role-checkbox input[type="checkbox"] {
        display: none;
    }

    .role-checkbox .role-tag {
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        transition: all 0.15s ease;
        opacity: 0.6;
        cursor: pointer;
        line-height: 1.4;
    }

    .role-checkbox.selected .role-tag {
        opacity: 1;
        box-shadow: 0 0 0 2px var(--teal);
    }

    .role-checkbox:hover .role-tag {
        opacity: 0.9;
    }

    /* Couleurs spécifiques quand sélectionné */
    .role-checkbox.selected .tag-admin {
        box-shadow: 0 0 0 2px var(--urgent);
    }

    .role-checkbox.selected .tag-medecin {
        box-shadow: 0 0 0 2px #2D4E9C;
    }

    .role-checkbox.selected .tag-assisteur {
        box-shadow: 0 0 0 2px var(--teal-dark);
    }

    .role-checkbox.selected .tag-lecteur {
        box-shadow: 0 0 0 2px var(--muted-2);
    }

/* ─── Tags par rôle ─── */
.tag-admin {
    background: var(--urgent-bg);
    color: var(--urgent);
}

.tag-medecin {
    background: #E8F0FE;
    color: #2D4E9C;
}

.tag-assisteur {
    background: var(--teal-bg);
    color: var(--teal-dark);
}

.tag-lecteur {
    background: #EEF1F4;
    color: var(--muted);
}

/* ─── Alert Info ─── */
.alert-info {
    background: #E8F0FE;
    border: 1px solid #BFD4FE;
    color: #2D4E9C;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 13px;
}

    .alert-info svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        stroke: #2D4E9C;
    }

/* ═══════════════════════════════════════════════════════════════
   OTP SETUP PAGE
   ═══════════════════════════════════════════════════════════════ */

.otp-setup-page {
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

.otp-setup-container {
    max-width: 560px;
    width: 100%;
}

/* ─── Header ─── */
.otp-header {
    margin-bottom: 24px;
}

.otp-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.otp-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

/* ─── Card ─── */
.otp-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.otp-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: #FAFBFC;
}

.otp-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.otp-card-body {
    padding: 24px;
}

/* ─── QR Code ─── */
.qr-code-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 16px 0;
    margin-bottom: 16px;
}

.qr-code-image {
    width: 180px; /* ⭐ Taille fixe */
    height: 180px; /* ⭐ Taille fixe */
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    background: #fff;
}

.qr-code-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px 0;
    color: var(--muted);
}

.loading-spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.qr-instructions {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
    text-align: center;
    max-width: 320px;
}

/* ─── Manual Key ─── */
.manual-key-section {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.manual-key-container {
    display: flex;
    gap: 8px;
}

.manual-key-input {
    flex: 1;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    padding: 9px 12px;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: var(--paper);
    color: var(--text);
    letter-spacing: 0.05em;
}

.btn-copy {
    padding: 9px 14px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-copy:hover {
        background: var(--paper);
        border-color: var(--muted-2);
    }

/* ─── TOTP Input ─── */
.totp-code-section {
    margin-bottom: 16px;
}

.totp-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.totp-input {
    flex: 1;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 22px;
    letter-spacing: 6px;
    text-align: center;
    padding: 12px 16px;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    max-width: 200px;
}

    .totp-input:focus {
        outline: 2px solid var(--teal);
        outline-offset: 1px;
        border-color: var(--teal);
    }

.totp-input-hint {
    font-size: 12px;
    color: var(--muted-2);
}

.field-help {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--muted);
}

/* ─── Alerts ─── */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
}

.alert-info {
    background: #E8F0FE;
    border: 1px solid #BFD4FE;
    color: #2D4E9C;
}

    .alert-info svg {
        stroke: #2D4E9C;
    }

.alert-danger {
    background: var(--urgent-bg);
    border: 1px solid var(--urgent);
    color: var(--urgent);
}

    .alert-danger svg {
        stroke: var(--urgent);
    }

.alert-warning {
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    color: var(--amber);
}

    .alert-warning svg {
        stroke: var(--amber);
    }

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ─── Actions ─── */
.otp-actions {
    margin-top: 8px;
}

.btn-verify {
    width: 100%;
    justify-content: center;
}

/* ─── Recovery Codes ─── */
.recovery-codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0 20px;
    padding: 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.recovery-code-item {
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    text-align: center;
}

    .recovery-code-item code {
        font-family: 'IBM Plex Mono', monospace;
        font-size: 13px;
        font-weight: 600;
        color: var(--teal-dark);
        letter-spacing: 0.05em;
    }

.recovery-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .otp-card-body {
        padding: 16px;
    }

    .qr-code-image {
        width: 140px;
        height: 140px;
    }

    .totp-input {
        font-size: 18px;
        letter-spacing: 4px;
        padding: 10px 12px;
        max-width: 160px;
    }

    .recovery-codes-grid {
        grid-template-columns: 1fr 1fr;
        padding: 12px;
    }

    .recovery-actions {
        flex-direction: column;
    }

        .recovery-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .manual-key-container {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .qr-code-image {
        width: 120px;
        height: 120px;
    }

    .totp-input {
        font-size: 16px;
        letter-spacing: 3px;
        max-width: 140px;
    }

    .recovery-codes-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Recovery Code Input ─── */
.recovery-code-input {
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 18px !important;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 12px !important;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
PAGE LOGS ADMIN
═══════════════════════════════════════════════════════════════ */

/* Stats grid 4 colonnes */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-value.info {
    color: #2D4E9C;
}

.stat-value.warning {
    color: var(--amber);
}

.stat-icon.orange {
    background: var(--amber-bg);
}

    .stat-icon.orange svg {
        stroke: var(--amber);
    }

/* Header info du tableau */
.table-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #FAFBFC;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}

.btn-icon-text {
    background: transparent;
    border: none;
    color: var(--teal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

    .btn-icon-text:hover {
        background: var(--teal-bg);
    }

    .btn-icon-text.danger {
        color: var(--urgent);
    }

        .btn-icon-text.danger:hover {
            background: var(--urgent-bg);
        }

/* Lignes de logs */
.row-selected {
    background: var(--teal-bg) !important;
}

.row-error {
    background: var(--urgent-bg);
}

.row-warning {
    background: var(--amber-bg);
}

.log-date {
    font-size: 12px;
    color: var(--text);
}

.log-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--muted-2);
    margin-top: 2px;
}

.log-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.05em;
}

.badge-info {
    background: #E8F0FE;
    color: #2D4E9C;
}

.badge-warning {
    background: var(--amber-bg);
    color: var(--amber);
}

.badge-error {
    background: var(--urgent-bg);
    color: var(--urgent);
}

.badge-critical {
    background: var(--urgent);
    color: #fff;
}

.badge-debug {
    background: #EEF1F4;
    color: var(--muted);
}

.log-message {
    font-size: 13px;
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    word-break: break-word;
    line-height: 1.4;
}

/* Liste de fichiers dans la modale */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin: 16px 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

    .file-item:hover {
        background: var(--paper);
    }

    .file-item.selected {
        border-color: var(--urgent);
        background: var(--urgent-bg);
    }

    .file-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--urgent);
    }

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.file-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .table-container .meridian-table thead {
        display: none;
    }

    .table-container .meridian-table tbody tr {
        display: block;
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .table-container .meridian-table td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border: none;
    }

    .log-message {
        font-size: 12px;
    }
}

/* Styles spécifiques pour la page Audit Logs */
.log-date {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}

.log-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--muted-2);
}

.log-details {
    font-size: 12px;
    color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
    word-break: break-word;
}

.row-warning {
    background: var(--amber-bg);
}

/* ═══════════════════════════════════════════════════════════════
PAGE PROFIL UTILISATEUR
═══════════════════════════════════════════════════════════════ */
.profile-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.profile-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

    .profile-card .card-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--line);
        background: #FAFBFC;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .profile-card .card-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .profile-card .card-body {
        padding: 20px;
    }

/* Bouton édition inline */
.btn-edit {
    background: transparent;
    border: none;
    color: var(--teal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

    .btn-edit:hover {
        background: var(--teal-bg);
    }

/* Info rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    gap: 16px;
}

    .info-row:last-child {
        border-bottom: none;
    }

.info-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    flex-shrink: 0;
}

.info-value {
    color: var(--text);
    font-size: 13px;
    text-align: right;
}

.info-value-with-hint {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.info-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--muted-2);
    font-style: italic;
}

.icon-xs {
    width: 12px;
    height: 12px;
}

/* Actions rows */
.profile-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    gap: 16px;
}

.action-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.action-subtitle {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

/* Form inputs dans le profil */
.profile-card .form-input,
.profile-card .form-select {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    padding: 9px 11px;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    width: 100%;
}

    .profile-card .form-input:focus,
    .profile-card .form-select:focus {
        outline: 2px solid var(--teal);
        outline-offset: 1px;
        border-color: var(--teal);
    }

.profile-card .field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

    .profile-card .field label {
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
    }

.profile-card .field-help {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

.profile-card .form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.profile-card .field.full-width {
    grid-column: 1 / -1;
}

.profile-card .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* Stats */
.stat-item {
    text-align: center;
    padding: 8px 0;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--teal);
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* Alertes */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}

.alert-info {
    background: #E8F0FE;
    border: 1px solid #BFD4FE;
    color: #2D4E9C;
}

    .alert-info svg {
        stroke: #2D4E9C;
        flex-shrink: 0;
    }

    .alert-info strong {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 2px;
    }

    .alert-info p {
        font-size: 12px;
        margin: 0;
        color: #5A7BB5;
    }

.alert-error {
    background: var(--urgent-bg);
    border: 1px solid var(--urgent);
    color: var(--urgent);
}

    .alert-error svg {
        flex-shrink: 0;
    }

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}

    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--teal);
    }

.required {
    color: var(--urgent);
}

/* Responsive */
@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-card .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-value {
        text-align: left;
    }

    .profile-action-row {
        flex-direction: column;
        align-items: flex-start;
    }

        .profile-action-row .btn {
            width: 100%;
            justify-content: center;
        }
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--teal-bg);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

/*Pour la selection des assurances*/
.form-select[disabled] {
    background: #F5F7FA;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
PAGE ADMIN - ASSURANCES
═════════════════════════════════════════════════════════════════ */

/* Stats */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* Tableau */
.meridian-table td.actions-cell,
.meridian-table th.actions-cell {
    width: 40px;
    text-align: right;
    white-space: nowrap;
}

/* Alertes */
.row-inactive {
    opacity: 0.7;
}

/* Barre de filtre */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.filter-select,
.search-input {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    padding: 9px 11px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    width: 100%;
}

    .filter-select:focus,
    .search-input:focus {
        outline: 2px solid var(--teal);
        border-color: var(--teal);
        outline-offset: -1px;
    }

.contact-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 2px;
}

    .contact-line svg {
        flex-shrink: 0;
        color: var(--muted-2);
    }

/* ═══════════════════════════════════════════════════════════════
   PAGE ADMIN - PARAMÈTRES
   ═══════════════════════════════════════════════════════════════ */

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
}

.settings-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.settings-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: #FAFBFC;
}

.settings-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .settings-card-title svg {
        color: var(--teal);
        flex-shrink: 0;
    }

.settings-card-body {
    padding: 24px;
}

    .settings-card-body .form-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 20px;
    }

    .settings-card-body .field {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

        .settings-card-body .field.full-width {
            grid-column: 1 / -1;
        }

        .settings-card-body .field label {
            font-size: 12.5px;
            font-weight: 600;
            color: var(--muted);
        }

        .settings-card-body .field input,
        .settings-card-body .field select {
            font-family: 'Inter', sans-serif;
            font-size: 13.5px;
            padding: 9px 12px;
            border: 1px solid var(--line-2);
            border-radius: 7px;
            background: #fff;
            color: var(--text);
            width: 100%;
            transition: all 0.15s;
        }

            .settings-card-body .field input:focus,
            .settings-card-body .field select:focus {
                outline: 2px solid var(--teal);
                outline-offset: 1px;
                border-color: var(--teal);
            }

    .settings-card-body .field-help {
        font-size: 11.5px;
        color: var(--muted);
    }

    .settings-card-body .checkbox-label {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        font-size: 13px;
        color: var(--text);
    }

        .settings-card-body .checkbox-label input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--teal);
        }

/* Info de mise à jour */
.settings-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #FAFBFC;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--muted);
}

    .settings-info svg {
        color: var(--muted-2);
        flex-shrink: 0;
    }

    .settings-info strong {
        color: var(--text);
        font-weight: 600;
    }

/* Responsive */
@media (max-width: 768px) {
    .settings-card-body .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

        .header-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .settings-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LISTE DES DEMANDES
   ═══════════════════════════════════════════════════════════════ */

.meridian-page-main.full-width {
    max-width: 100%;
}

/* Cellule ID */
.cell-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
}

/* Cellule localisation */
.cell-loc {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12.5px;
}

    .cell-loc .city {
        color: var(--text);
        font-weight: 500;
        font-size: 13px;
    }

    .cell-loc .country {
        color: var(--muted);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cell-loc .flag {
        font-size: 14px;
    }

/* Cellule motif */
.cell-motif {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-motif {
    background: #E8F0FE;
    color: #2D4E9C;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Médecin assigné */
.medecin-assigne {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

/* Date */
.date-cell {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* Tag annulé */
.tag-annule {
    background: #EEF1F4;
    color: var(--muted-2);
    text-decoration: line-through;
}

/* Responsive */
@media (max-width: 1200px) {
    .meridian-table {
        font-size: 12.5px;
    }

        .meridian-table th,
        .meridian-table td {
            padding: 10px 12px;
        }
}

@media (max-width: 768px) {
    .cell-id,
    .date-cell {
        font-size: 11px;
    }

    .tag-motif {
        font-size: 10px;
    }
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}