/* ============================================================
   parcours.css — Styles de la page de suivi des prestations
   Extrait et dédupliqué depuis parcours.php (refactoring)
   ============================================================ */

/* ── Variables & Thème ─────────────────────────────────────────── */
:root {
    /* Couleurs principales */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;

    /* Fonds et textes - Mode Clair */
    --bg-body: #f4f7fb;
    --bg-container: #ffffff;
    --bg-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-controls: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #f8f9fa;
    --bg-input-focus: #ffffff;
    
    --text-main: #212529;
    --text-muted: #6c757d;
    --text-header: #ffffff;
    
    --border-color: #e9ecef;
    --border-focus: #ccd5ff;
    
    /* Statuts */
    --status-rembourse-bg: #d4edda;
    --status-rembourse-text: #155724;
    --status-encours-bg: #fff3cd;
    --status-encours-text: #856404;
    --status-rejete-bg: #f8d7da;
    --status-rejete-text: #721c24;
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(102, 126, 234, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
    
    /* Login Glassmorphism */
    --login-bg: rgba(255, 255, 255, 0.85);
    --login-border: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] {
    /* Fonds et textes - Mode Sombre */
    --bg-body: #121212;
    --bg-container: #1e1e1e;
    --bg-header: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    --bg-controls: #252525;
    --bg-card: #2a2a2a;
    --bg-input: #333333;
    --bg-input-focus: #404040;
    
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-header: #ffffff;
    
    --border-color: #3d3d3d;
    --border-focus: #667eea;
    
    /* Statuts sombres assortis */
    --status-rembourse-bg: rgba(40, 167, 69, 0.2);
    --status-rembourse-text: #4dbd74;
    --status-encours-bg: rgba(255, 193, 7, 0.2);
    --status-encours-text: #ffc107;
    --status-rejete-bg: rgba(220, 53, 69, 0.2);
    --status-rejete-text: #fa5c7c;
    
    /* Ombres mode sombre */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    /* Login Glassmorphism Dark */
    --login-bg: rgba(30, 30, 30, 0.85);
    --login-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Container ────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-container);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
    background: var(--bg-header);
    color: var(--text-header);
    padding: 20px;
    position: relative;
    transition: background 0.3s ease;
}

.header h1 {
    font-size: 18px;
    margin: 0 0 14px 0;
}

/* Mini toggle thème — coin haut-droit de la carte */
.theme-toggle-mini {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}

.theme-toggle-mini:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-header);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.btn-close:hover {
    background: rgba(255, 80, 80, 0.7);
}

/* ── Profile Card (Premium) ──────────────────────────────── */
.profile-card {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 18px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.profile-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

/* ── Identity Row (Avatar + Name) ────────────────────────── */
.profile-identity-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

/* Avatar avec ring lumineux */
.profile-avatar-ring {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.1));
    padding: 3px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2), 0 0 30px rgba(102, 126, 234, 0.15);
    animation: avatarGlow 3s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
    0%   { box-shadow: 0 0 10px rgba(255, 255, 255, 0.15), 0 0 20px rgba(102, 126, 234, 0.1); }
    100% { box-shadow: 0 0 18px rgba(255, 255, 255, 0.3), 0 0 35px rgba(102, 126, 234, 0.2); }
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.profile-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.7);
}

/* Identité textuelle */
.profile-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* pour text-overflow */
}

.profile-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    word-break: break-word;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    width: fit-content;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.profile-badge i {
    font-size: 10px;
    opacity: 0.8;
}

/* ── Métadonnées Row ─────────────────────────────────────── */
.profile-meta-row {
    display: flex;
    gap: 10px;
}

.meta-chip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s;
}

.meta-chip i {
    font-size: 14px;
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.8);
}

/* ── Family Dots & Swipe Hint ────────────────────────────── */
.family-dots {
    display: flex;
    gap: 5px;
    margin-top: 2px;
    align-items: center;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.dot.active {
    background: white;
    transform: scale(1.4);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.swipe-hint {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
    animation: pulseHint 2.5s infinite;
}

@keyframes pulseHint {
    0%   { opacity: 0.4; transform: translateX(0); }
    50%  { opacity: 0.8; transform: translateX(4px); }
    100% { opacity: 0.4; transform: translateX(0); }
}

/* ── Dark Theme Overrides ────────────────────────────────── */
[data-theme="dark"] .profile-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .profile-avatar-ring {
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.3), 0 0 25px rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .meta-chip {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .dot { background: rgba(255, 255, 255, 0.2); }
[data-theme="dark"] .dot.active { background: var(--primary-color); box-shadow: 0 0 6px rgba(102, 126, 234, 0.5); }
[data-theme="dark"] .swipe-hint { color: var(--text-muted); }

/* ── Filtres Toolbar ────────────────────────────────────────── */
.controls-toolbar {
    margin: 20px 30px;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.filters-form {
    display: flex;
    width: 100%;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.filter-icon {
    width: 40px;
    height: 40px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.filter-input-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.filter-input-wrapper label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.filter-input-wrapper select {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.filter-input-wrapper select:focus {
    outline: none;
}

.filter-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    margin: 0 10px;
}

/* ── Metrics Dashboard (Compact Premium) ──────────────────────── */
.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 30px 25px;
}

.metric-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.metric-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.metric-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    white-space: nowrap;
}

/* Thèmes spécifiques pour les métriques */
.theme-primary .metric-icon { background: rgba(102, 126, 234, 0.15); color: var(--primary-color); }
.theme-gradient { 
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); 
    color: white; 
    border: none; 
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}
.theme-gradient .metric-icon { background: rgba(255, 255, 255, 0.2); color: white; }
.theme-gradient .metric-label { color: rgba(255, 255, 255, 0.85); }
.theme-gradient .metric-value { color: white; }

.theme-warning .metric-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning-color); }
.theme-success .metric-icon { background: rgba(16, 185, 129, 0.15); color: var(--success-color); }

/* Adaptation mobile parfaite (2 par ligne) */
@media (max-width: 550px) {
    .metrics-dashboard {
        grid-template-columns: repeat(2, 1fr);
        padding: 5px 15px 20px;
        gap: 10px;
    }

    .metric-card {
        padding: 10px;
        gap: 8px;
    }

    .metric-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }

    .metric-label {
        font-size: 9px;
        letter-spacing: 0;
    }

    .metric-value {
        font-size: 14px;
    }
    
    .controls-toolbar {
        margin: 15px;
        padding: 10px;
    }
}

/* ── Zone contenu ─────────────────────────────────────────── */
.content {
    padding: 30px;
}

/* ── Content Header (Titre + Options) ─────────────────────── */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.content h2 {
    font-size: 22px;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Badge de résumé en ligne (Inline Stats) ──────────────── */
.history-summary-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-controls);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.badge-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--primary-color);
}

.badge-dot {
    color: var(--border-color);
    font-size: 10px;
}

.badge-count strong, .badge-sum strong {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
}

.badge-sum strong {
    color: var(--warning-color);
}

[data-theme="dark"] .badge-sum strong {
    color: #ffd166; /* Un peu plus brillant en mode sombre */
}

@media (max-width: 550px) {
    .history-summary-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 14px;
        width: 100%;
    }
    .badge-dot {
        display: none;
    }
}

/* ── Menu Export (Dropdown) ───────────────────────────────── */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-controls);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.export-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

/* Affichage du menu au hover ou focus-within */
.export-dropdown:hover .export-menu,
.export-dropdown:focus-within .export-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.export-menu a:last-child {
    border-bottom: none;
}

.export-menu a:hover {
    background: var(--bg-controls);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s;
    min-width: 36px;
    text-align: center;
}

.pagination a:hover { background: var(--primary-color); color: white; }
.pagination .current { background: var(--primary-color); color: white; }
.pagination .disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; border-color: var(--text-muted); color: var(--text-muted); }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.timeline-group {
    margin-bottom: 20px;
}

.timeline-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 14px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date::before {
    content: '📅';
    font-size: 18px;
}

/* ── Item prestation ──────────────────────────────────────── */
.timeline-item {
    position: relative;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    margin-left: 10px;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s, background-color 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 3px var(--bg-body);
}

.timeline-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

/* Accordéon ouvert */
.timeline-item.expanded {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

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

.prestation-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prestation-type {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.prestation-prestataire {
    font-size: 13px;
    color: var(--text-muted);
}

.numero-bon {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

/* ── Montant ──────────────────────────────────────────────── */
.prestation-montant-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.montant-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.prestation-montant {
    font-size: 20px;
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
}

/* ── Toggle accordéon ─────────────────────────────────────── */
/* Tout le header de prestation est cliquable */
.prestation-header {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}

.prestation-header:active {
    opacity: 0.7;
}

.prestation-type {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.toggle-icon {
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.25s ease;
}

.timeline-item:not(.expanded) .toggle-icon { transform: rotate(0deg); }
.timeline-item.expanded .toggle-icon       { transform: rotate(180deg); }

/* ── Wrapper détails (caché par défaut) ───────────────────── */
.prestation-details-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, opacity 0.3s ease;
    opacity: 0;
}

.timeline-item.expanded .prestation-details-wrapper {
    max-height: 1200px;
    opacity: 1;
}

/* ── Détails prestation ───────────────────────────────────── */
.prestation-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    padding: 8px;
    background: var(--bg-input);
    border-radius: 8px;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* ── Badges statut ────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-rembourse { background: var(--status-rembourse-bg); color: var(--status-rembourse-text); }
.status-encours   { background: var(--status-encours-bg); color: var(--status-encours-text); }
.status-rejete    { background: var(--status-rejete-bg); color: var(--status-rejete-text); }

/* ── Table détails (examens / pharmacie) ──────────────────── */
.details-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-main);
}

.details-table th {
    background: var(--bg-controls);
    padding: 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-focus);
    color: var(--text-muted);
}

.details-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.details-table tr:hover { background: var(--bg-controls); }

/* ── Ligne motif de refus examens ─────────────────────────── */
.refus-motif-row td {
    padding: 6px 10px !important;
    border-bottom: 1px solid var(--border-color);
}

.refus-motif-row:hover {
    background: transparent !important;
}

.refus-motifs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--status-rejete-text);
    background: var(--status-rejete-bg);
    padding: 6px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--danger-color);
}

.refus-motifs i {
    color: var(--danger-color);
    font-size: 13px;
}

/* ── État vide ────────────────────────────────────────────── */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-data-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.no-data-text { font-size: 17px; }

/* ── Responsive tablette (≥ 768px) ───────────────────────── */
@media (min-width: 768px) {
    body { padding: 20px; }

    .summary-value { font-size: 28px; }

    .prestation-details {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .action-buttons .btn { width: auto; }
}

/* ── Mobile (< 768px) ─────────────────────────────────────── */
@media (max-width: 767px) {
    body { padding: 8px; }

    .header { padding: 14px; }
    .header h1 { font-size: 17px; }

    .header-actions { gap: 6px; }
    .header-btn { width: 34px; height: 34px; font-size: 14px; }

    .profile-card { padding: 14px; border-radius: 14px; }
    .profile-identity-row { gap: 12px; margin-bottom: 12px; }

    .profile-avatar-ring { width: 52px; height: 52px; }
    .profile-name { font-size: 15px; }
    .profile-badge { font-size: 10px; padding: 2px 8px; }

    .profile-meta-row { gap: 8px; }
    .meta-chip { padding: 8px 10px; font-size: 12px; border-radius: 10px; }
    .meta-chip i { font-size: 12px; }

    .controls { padding: 16px; }
    .controls-grid { display: flex; flex-direction: column; gap: 14px; }
    .control-group select { font-size: 16px; padding: 12px 14px; }

    .summary-cards { gap: 10px; padding: 16px; }
    .summary-value { font-size: 20px; }

    .content { padding: 16px; }
    .content h2 { font-size: 18px; }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 4px;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 14px;
        font-size: 15px;
        border-radius: 12px;
    }

    .timeline { padding-left: 28px; }
    .timeline::before { left: 12px; width: 2px; }

    .timeline-date { font-size: 14px; }

    .timeline-item {
        margin-left: 6px;
        padding: 12px;
    }

    .timeline-item::before { left: -20px; width: 10px; height: 10px; top: 18px; }

    .prestation-type { font-size: 16px; }

    .prestation-montant { font-size: 18px; }

    .prestation-details { grid-template-columns: 1fr; }

    .details-table { font-size: 11px; }
    .details-table th, .details-table td { padding: 7px 5px; }

    .pagination { gap: 5px; }
    .pagination a, .pagination span { padding: 7px 10px; font-size: 13px; }

    .no-data { padding: 40px 15px; }
    .no-data-icon { font-size: 44px; }
    .no-data-text { font-size: 14px; }
}

/* ── Login / Accueil ──────────────────────────────────────── */
.login-container {
    max-width: 450px;
    margin: 80px auto;
    background: var(--login-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--login-border);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.theme-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-header);
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s, transform 0.3s;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

@media (max-width: 767px) {
    .login-container {
        margin: 40px 15px;
    }
}

.login-header {
    background: var(--bg-header);
    color: var(--text-header);
    padding: 30px;
    text-align: center;
    transition: background 0.3s ease;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.login-header .icon-big {
    font-size: 40px;
    margin-bottom: 15px;
}

.login-body {
    padding: 40px 30px;
}

.login-body label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-main);
}

.login-input-group {
    position: relative;
    margin-bottom: 25px;
}

.login-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 18px;
}

.login-input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-input);
    color: var(--text-main);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    background: var(--bg-header);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
