/*
 * app.css — Soraïa dashboard
 *
 * TABLE DES MATIÈRES
 * ──────────────────────────────────────────────────────────────
 *  1. Reset & Variables CSS
 *  2. Visibilité (panels, rôles)
 *  3. Coque (nav, layout, role-switcher)
 *  4. Contenu — cartes, stats, dashboard
 *  5. Boutons, tags, formulaires
 *  6. Dossiers, workflow, review
 *  7. Fugue, bibliothèque, génération
 *  8. Réunions, séjours, cahier de transmission
 *  9. Pilotage
 * 10. Territoire
 * 11. Secrétariat
 * 12. Dossiers d'admission
 * 13. Fiche signalétique
 * 14. Présences & modales
 * ──────────────────────────────────────────────────────────────
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #1a1a2e;
    --sage: #4a7c6f;
    --sage-light: #6aab9c;
    --sage-pale: #e8f4f1;
    --gold: #c9a84c;
    --gold-light: #fef3e2;
    --cream: #faf8f4;
    --warm-gray: #f2ede6;
    --text-muted: #7a7870;
    --border: #e0d9d0;
    --white: #ffffff;
    --red: #e05252;
    --red-pale: #fdf0f0;
    --blue: #3b7dd8;
    --blue-pale: #e8f0fe;
    --purple: #7c3aed;
    --purple-pale: #f3e8ff;
    --orange: #d97706;
    --orange-pale: #fef3c7;
    --shadow: 0 4px 24px rgba(26, 26, 46, 0.08);
    --shadow-lg: 0 12px 48px rgba(26, 26, 46, 0.14);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--ink);
}

/* Hide all screen panels by default — Stimulus shows the active one */
[data-app-target="screenPanel"] { display: none; }

/* Role-based visibility */
.role-chef [data-role="educ"] { display: none !important; }
.role-educ [data-role="chef"] { display: none !important; }
.role-sec  [data-role="educ"] { display: none !important; }
.role-sec  [data-role="chef"] { display: none !important; }
.role-dir  [data-role="educ"] { display: none !important; }
.role-dir  [data-role="chef"] { display: none !important; }

/* APP SHELL */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* NAV */
.nav {
    background: var(--sage);
    color: white;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    font-weight: 700;
    color: white;
}
.nav-logo span { color: var(--sage); }

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

.nav-user-info { font-size: 12px; color: white; text-align: right; line-height: 1.4; }
.nav-user-info strong { display: block; font-size: 13px; color: white; }

.nav-role { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.role-educ-badge { background: var(--sage-pale); color: var(--sage); }
.role-chef-badge { background: var(--gold-light); color: var(--gold); }

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}
.avatar-sec { background: var(--sage); }
.avatar-dir { background: var(--sage); }
.avatar-educ { background: var(--sage); }
.avatar-chef { background: var(--gold); }

/* LAYOUT */
.main { display: flex; flex: 1; min-height: calc(100vh - 60px); }

.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-section {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 14px 12px 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--ink);
    transition: all 0.15s;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}
.sidebar-item:hover { background: var(--warm-gray); }
.sidebar-item.active { background: var(--sage-pale); color: var(--sage); font-weight: 600; }
.sidebar-item.alert-item { color: var(--red); }
.sidebar-item.alert-item:hover { background: var(--red-pale); }
.sidebar-item.alert-item.active { background: var(--red-pale); color: var(--red); }
.sidebar-item.lock-item { color: var(--purple); }
.sidebar-item.lock-item:hover { background: var(--purple-pale); }
.sidebar-item.lock-item.active { background: var(--purple-pale); color: var(--purple); }

.sidebar-icon { font-size: 15px; width: 18px; text-align: center; }

.sidebar-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 20px; }
.nav-badge { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.badge-sage { background: var(--sage-pale); color: var(--sage); }
.badge-red { background: var(--red-pale); color: var(--red); }
.badge-gold { background: var(--gold-light); color: var(--gold); }
.badge-purple { background: var(--purple-pale); color: var(--purple); }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-green { background: #dcfce7; color: #15803d; }

.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ROLE SWITCHER */
.role-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--warm-gray);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.role-btn {
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.role-btn.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* CONTENT */
.content { flex: 1; padding: 28px 32px; overflow-y: auto; }

.page-header { margin-bottom: 24px; }
.page-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); }

/* CARDS & COMMON */
.card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; }
.card + .card { margin-top: 16px; }

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--ink);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* STAT CARDS */
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--sage); margin-top: 3px; }

/* DASHBOARD */
.welcome-banner {
    background: linear-gradient(135deg, var(--sage), #2d6058);
    border-radius: 14px;
    padding: 24px 28px;
    color: white;
    margin-bottom: 22px;
}
.welcome-banner h2 { font-family: 'Playfair Display', serif; font-size: 20px; margin-bottom: 4px; }
.welcome-banner p { opacity: 0.85; font-size: 13px; }

/* BUTTONS */
.btn {
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: var(--sage); color: white; }
.btn-primary:hover { background: #3d6b5f; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #c43e3e; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--sage); color: var(--sage); }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: #b8933c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* TAGS */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.tag-green { background: #e6f4ea; color: #2d7a3a; }
.tag-orange { background: #fef3e2; color: #c47a1a; }
.tag-blue { background: var(--blue-pale); color: var(--blue); }
.tag-red { background: var(--red-pale); color: var(--red); }
.tag-gray { background: var(--warm-gray); color: var(--text-muted); }
.tag-gold { background: var(--gold-light); color: var(--gold); }
.tag-purple { background: var(--purple-pale); color: var(--purple); }

/* FORM */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.form-input, .form-select, .form-textarea {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 13px;
    font-size: 13.5px;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
    background: var(--cream);
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--sage); background: white; }
.form-textarea { resize: none; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* DOC ROWS */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.doc-row:hover { border-color: var(--sage-light); box-shadow: var(--shadow); }
.doc-icon-box { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.doc-icon-green { background: #e6f4ea; }
.doc-icon-sage { background: var(--sage-pale); }
.doc-icon-blue { background: var(--blue-pale); }
.doc-icon-gold { background: var(--gold-light); }
.doc-icon-red { background: var(--red-pale); }
.doc-icon-purple { background: var(--purple-pale); }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11.5px; color: var(--text-muted); }
.doc-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* FOLDER CARDS */
.folder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.folder-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.folder-card:hover { border-color: var(--sage-light); box-shadow: var(--shadow); transform: translateY(-1px); }
.folder-card.active { border-color: var(--sage); background: var(--sage-pale); }
.folder-icon { font-size: 26px; margin-bottom: 8px; }
.folder-name { font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.folder-count { font-size: 11px; color: var(--text-muted); }

/* WORKFLOW */
.workflow-step { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.workflow-step:last-child { border-bottom: none; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.step-done { background: #e6f4ea; color: #2d7a3a; }
.step-current { background: var(--sage); color: white; }
.step-pending { background: var(--warm-gray); color: var(--text-muted); }
.step-info { flex: 1; }
.step-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.step-desc { font-size: 12px; color: var(--text-muted); }
.step-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* REVIEW PANEL */
.review-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.doc-preview {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--ink);
}
.doc-preview h3 { font-family: 'Playfair Display', serif; font-size: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.review-sidebar-panel { display: flex; flex-direction: column; gap: 14px; }
.comment-box { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-item { background: var(--warm-gray); border-radius: 9px; padding: 10px 13px; font-size: 12.5px; }
.comment-author { font-weight: 700; font-size: 11px; color: var(--sage); margin-bottom: 3px; }
.comment-input-row { display: flex; gap: 8px; }
.comment-input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; background: var(--cream); }
.comment-input:focus { border-color: var(--sage); }

/* FUGUE */
.fugue-alert-banner { background: linear-gradient(135deg, #c43e3e, #e05252); border-radius: 14px; padding: 20px 24px; color: white; margin-bottom: 20px; display: flex; align-items: center; gap: 16px; }
.fugue-alert-icon { font-size: 32px; }
.fugue-alert-text h3 { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.fugue-alert-text p { font-size: 13px; opacity: 0.9; }
.fugue-form { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 16px; }
.recipients-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.recipient-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--cream); border-radius: 9px; border: 1px solid var(--border); }
.recipient-check { width: 18px; height: 18px; accent-color: var(--sage); cursor: pointer; }
.recipient-info { flex: 1; }
.recipient-name { font-size: 13px; font-weight: 600; }
.recipient-email { font-size: 11px; color: var(--text-muted); }
.recipient-type { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.type-police { background: #e8f0fe; color: #1a6bc4; }
.type-justice { background: #f3e8ff; color: #7c3aed; }
.type-interne { background: var(--sage-pale); color: var(--sage); }
.send-confirm { background: var(--red-pale); border: 1px solid #f5c6c6; border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.send-confirm p { font-size: 13px; font-weight: 600; color: var(--red); }
.send-success { background: #e6f4ea; border: 1px solid #b7dfbf; border-radius: 12px; padding: 24px; text-align: center; }
.send-success .big-check { font-size: 36px; margin-bottom: 8px; }
.send-success h3 { font-size: 15px; font-weight: 700; color: #2d7a3a; margin-bottom: 4px; }
.send-success p { font-size: 12px; color: #4a8a55; }

/* LIBRARY */
.lib-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.lib-tab { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.lib-tab.active { background: var(--sage-pale); color: var(--sage); font-weight: 600; }

.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.template-card { background: var(--white); border: 1px solid var(--border); border-radius: 13px; padding: 18px; cursor: pointer; transition: all 0.2s; }
.template-card:hover { border-color: var(--sage-light); box-shadow: var(--shadow); }
.template-card .t-icon { font-size: 26px; margin-bottom: 10px; }
.template-card .t-name { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.template-card .t-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.template-card .t-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.template-card .t-tag { font-size: 10.5px; font-weight: 600; color: var(--sage); background: var(--sage-pale); padding: 2px 8px; border-radius: 6px; }
.admin-warning { background: var(--gold-light); border: 1px solid #f0d98a; border-radius: 10px; padding: 12px 16px; font-size: 12.5px; color: #8a6820; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }

/* INTER-ETABLISSEMENTS */
.inter-etab-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--cream); border-radius: 9px; margin-bottom: 8px; }
.etab-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* GENERATE */
.gen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gen-panel { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.gen-panel-title { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.output-area {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 14px;
    background: var(--cream);
    font-size: 13.5px;
    line-height: 1.75;
    overflow-y: auto;
    min-height: 300px;
    white-space: pre-wrap;
    font-family: 'DM Sans', sans-serif;
}
.output-placeholder { color: var(--text-muted); font-style: italic; }

.output-actions { display: none; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.typing-cursor {
    display: none;
    width: 2px;
    height: 14px;
    background: var(--sage);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.style-pill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.style-pill {
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--cream);
    color: var(--text-muted);
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.style-pill.active { background: var(--sage-pale); border-color: var(--sage-light); color: var(--sage); font-weight: 600; }

.style-indicator { display: flex; align-items: center; gap: 8px; padding: 8px 13px; background: var(--sage-pale); border-radius: 8px; font-size: 12px; color: var(--sage); font-weight: 500; }

.btn-generate {
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 11px;
    padding: 13px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
}
.btn-generate:hover { background: #3d6b5f; }
.btn-generate:disabled { background: var(--border); color: var(--text-muted); cursor: default; }

/* LOADING DOTS */
.loading-dots span { display: inline-block; animation: bounce 1.2s infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }

/* MEETINGS */
.mt-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.mt-card { background: var(--white); border: 2px solid var(--border); border-radius: 13px; padding: 18px; cursor: pointer; transition: all 0.2s; text-align: center; }
.mt-card:hover { border-color: var(--sage-light); box-shadow: var(--shadow); }
.mt-card.active { border-color: var(--sage); background: var(--sage-pale); }
.mt-icon { font-size: 28px; margin-bottom: 8px; }
.mt-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.mt-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

.decision-box .dec-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--gold); margin-bottom: 10px; }
.decision-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0d98a; }
.decision-item:last-child { border-bottom: none; }
.dec-num { width: 22px; height: 22px; background: var(--gold); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.dec-text { font-size: 13px; font-weight: 500; flex: 1; }
.dec-owner { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.cr-preview { background: var(--white); border: 1px solid var(--border); border-radius: 13px; padding: 22px; font-size: 13.5px; line-height: 1.75; }
.cr-preview h3 { font-family: 'Playfair Display', serif; font-size: 16px; margin-bottom: 4px; }
.cr-preview .cr-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.agenda-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.agenda-item:last-child { border-bottom: none; }
.ag-num { width: 24px; height: 24px; background: var(--sage-pale); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--sage); flex-shrink: 0; }
.ag-content { flex: 1; }
.ag-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.ag-note { font-size: 12px; color: var(--text-muted); }

.archive-month { margin-bottom: 18px; }
.am-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 10px; }

.locked-banner { background: var(--purple-pale); border: 1px solid #c4b5fd; border-radius: 10px; padding: 10px 16px; font-size: 12.5px; color: var(--purple); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 500; }

.validation-banner { background: #e6f4ea; border: 1px solid #b7dfbf; border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }

/* MODULE TABS (meetings, camp) */
.module-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.module-tab { padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.module-tab.active { background: var(--sage-pale); color: var(--sage); font-weight: 600; }

/* CAMP */
.camp-header { background: linear-gradient(135deg, #2d6058, var(--sage)); border-radius: 14px; padding: 22px 28px; color: #fff; margin-bottom: 20px; position: relative; overflow: hidden; }
.camp-header::after { content: '⛺'; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 60px; opacity: 0.15; }
.camp-header h2 { font-family: 'Playfair Display', serif; font-size: 20px; margin-bottom: 4px; }
.camp-header p { opacity: 0.85; font-size: 13px; }

.budget-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.budget-row:last-child { border-bottom: none; }
.budget-total { background: var(--sage-pale); border-radius: 10px; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--sage); margin-top: 12px; }

.day-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.day-header { background: var(--sage-pale); padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.day-title { font-weight: 700; font-size: 14px; color: var(--sage); }
.day-content { padding: 16px 18px; }

.jeune-cr-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.jeune-cr-row:last-child { border-bottom: none; }
.jeune-av { width: 32px; height: 32px; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.jeune-name-cr { font-size: 13px; font-weight: 600; }
.jeune-note-cr { font-size: 11.5px; color: var(--text-muted); }

/* ═══ ORANGE TAG + ICON ═══ */
.tag-orange-alt { background: var(--orange-pale); color: var(--orange); }
.doc-icon-orange { background: var(--orange-pale); }

/* ═══ CAHIER DE TRANSMISSION ═══ */
.cdt-layout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; min-height: 70vh; align-items: start; }
.cdt-left { display: flex; flex-direction: column; gap: 12px; }

/* ── Calendrier mois ─────────────────────────────────────── */
.cdt-calendar { }
.cal-widget { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cal-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 10px 8px; background: var(--cream, #faf8f4); border-bottom: 1px solid var(--border); }
.cal-month-label { font-size: 13px; font-weight: 700; color: var(--text-primary, #1c1a17); text-align: center; line-height: 1.3; }
.cal-year { font-size: 11px; font-weight: 400; color: var(--warm-gray, #9c9289); }
.cal-nav { background: none; border: none; cursor: pointer; font-size: 17px; color: var(--sage, #4a7c6f); width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background .12s; line-height: 1; }
.cal-nav:hover { background: var(--sage-pale, #e8f0ee); }
.cal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); padding: 6px 8px 3px; gap: 1px; }
.cal-dow { text-align: center; font-size: 9.5px; font-weight: 700; color: var(--warm-gray, #9c9289); text-transform: uppercase; letter-spacing: .3px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 2px 8px 10px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 11.5px; border-radius: 6px; cursor: pointer; color: var(--text-primary, #1c1a17); font-weight: 400; transition: background .12s, color .12s; }
.cal-day:not(.cal-empty):hover { background: var(--sage-pale, #e8f0ee); }
.cal-day.cal-empty { cursor: default; pointer-events: none; }
.cal-day.cal-today { background: var(--sage-pale, #e8f0ee); color: var(--sage, #4a7c6f); font-weight: 700; }
.cal-day.cal-selected { background: var(--sage, #4a7c6f) !important; color: #fff !important; font-weight: 700; }
.cal-day.cal-has-entry { position: relative; }
.cal-day.cal-has-entry::after { content: ''; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--sage, #4a7c6f); position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); }
.cal-day.cal-selected.cal-has-entry::after { background: rgba(255,255,255,.7); }

.shift-bar { display: flex; gap: 6px; margin-bottom: 4px; }
.shift-btn { flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; border: 2px solid var(--border); background: var(--white); color: var(--text-muted); transition: all .15s; text-align: center; }
.shift-btn.active { border-color: var(--sage); background: var(--sage-pale); color: var(--sage); }
.shift-btn.matin { border-color: #f59e0b; background: #fef3c7; color: #92400e; }
.shift-btn.apm { border-color: var(--blue); background: var(--blue-pale); color: var(--blue); }
.shift-btn.nuit { border-color: var(--purple); background: var(--purple-pale); color: var(--purple); }

.jeune-card { background: var(--white); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; cursor: pointer; transition: all .15s; position: relative; }
.jeune-card:hover { border-color: var(--sage-light); box-shadow: var(--shadow); }
.jeune-card.active { border-color: var(--sage); background: var(--sage-pale); }
.jeune-card.has-alert { border-left: 3px solid var(--red); }
.jeune-card.has-sanction { border-left: 3px solid var(--orange); }

.jc-header { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.jc-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.jc-name { font-size: 13px; font-weight: 700; }
.jc-age { font-size: 11px; color: var(--text-muted); }
.jc-indicators { display: flex; gap: 5px; flex-wrap: wrap; }
.jc-ind { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.ind-ok { background: #e6f4ea; color: #2d7a3a; }
.ind-warn { background: var(--orange-pale); color: var(--orange); }
.ind-alert { background: var(--red-pale); color: var(--red); }
.ind-sanction { background: var(--purple-pale); color: var(--purple); }
.ind-task { background: var(--blue-pale); color: var(--blue); }
.read-indicator { position: absolute; top: 10px; right: 10px; font-size: 10px; color: var(--sage); font-weight: 700; }
.unread-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; }

.cdt-right { display: flex; flex-direction: column; gap: 14px; }
.cdt-header { background: linear-gradient(135deg, var(--sage), #2d6058); border-radius: 12px; padding: 16px 20px; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.cdt-jeune-name { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; }
.cdt-meta { font-size: 12px; opacity: .85; margin-top: 3px; }
.cdt-shift-label { font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 20px; background: rgba(255,255,255,.2); }

.transmission-block { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tb-header { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.tb-shift { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.tb-author { font-size: 11.5px; color: var(--text-muted); }
.tb-content { padding: 16px 18px; }
.tb-section { margin-bottom: 14px; }
.tb-section:last-child { margin-bottom: 0; }
.tb-section-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.tb-text { font-size: 13.5px; line-height: 1.75; color: var(--ink); }

.sanction-box { background: var(--orange-pale); border: 1px solid rgba(217,119,6,.3); border-radius: 9px; padding: 10px 14px; }
.sanction-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(217,119,6,.2); }
.sanction-item:last-child { border-bottom: none; }
.sanction-icon { font-size: 15px; flex-shrink: 0; }
.sanction-text { font-size: 13px; flex: 1; }
.sanction-by { font-size: 11px; color: var(--orange); margin-top: 2px; font-weight: 600; }
.sanction-active { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: var(--orange); color: #fff; margin-left: 8px; }

.task-box { background: var(--blue-pale); border: 1px solid rgba(59,125,216,.2); border-radius: 9px; padding: 10px 14px; }
.task-item { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(59,125,216,.15); }
.task-item:last-child { border-bottom: none; }
.task-check { width: 16px; height: 16px; accent-color: var(--sage); cursor: pointer; margin-top: 2px; flex-shrink: 0; }
.task-text { font-size: 13px; flex: 1; }
.task-target { font-size: 11px; color: var(--blue); font-weight: 600; margin-top: 1px; }

.etat-pills { display: flex; gap: 7px; flex-wrap: wrap; }
.etat-pill { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--cream); color: var(--text-muted); transition: all .15s; }
.ep-calme { border-color: #2d7a3a; background: #e6f4ea; color: #2d7a3a; }
.ep-agite { border-color: var(--orange); background: var(--orange-pale); color: var(--orange); }
.ep-tendu { border-color: var(--red); background: var(--red-pale); color: var(--red); }
.ep-absent { border-color: var(--text-muted); background: var(--warm-gray); color: var(--text-muted); }
.ep-bien { border-color: var(--blue); background: var(--blue-pale); color: var(--blue); }

.new-entry-form { background: var(--white); border: 2px dashed var(--border); border-radius: 12px; padding: 18px 20px; }
.new-entry-form.active { border-style: solid; border-color: var(--sage); }
.read-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sage); font-weight: 600; padding: 8px 12px; background: var(--sage-pale); border-radius: 8px; }

.cdt-global { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.global-entry { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.global-entry:last-child { border-bottom: none; }
.ge-time { font-size: 11px; color: var(--text-muted); width: 45px; flex-shrink: 0; padding-top: 2px; }
.ge-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ge-content { flex: 1; }
.ge-jeune { font-size: 12px; font-weight: 700; margin-bottom: 1px; }
.ge-text { font-size: 12.5px; color: var(--ink); line-height: 1.5; }
.ge-author { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.tabs-bar { display: flex; gap: 4px; margin-bottom: 16px; background: var(--warm-gray); border-radius: 10px; padding: 3px; width: fit-content; }
.tab-b { padding: 6px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; }
.tab-b.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ═══ DEMANDES JEUNES ═══ */
.demandes-box { background: var(--blue-pale); border: 1px solid rgba(59,125,216,.25); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.demande-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(59,125,216,.15); }
.demande-item:last-child { border-bottom: none; }
.demande-av { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.demande-text { flex: 1; font-size: 13px; }
.demande-statut { display: flex; gap: 6px; align-items: center; }
.ds-btn { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; cursor: pointer; border: 1px solid; transition: all .15s; background: transparent; }
.ds-ok { border-color: #2d7a3a; color: #2d7a3a; background: #e6f4ea; }
.ds-ok.active { background: #2d7a3a; color: #fff; }
.ds-no { border-color: var(--red); color: var(--red); background: var(--red-pale); }
.ds-no.active { background: var(--red); color: #fff; }
.ds-wait { border-color: var(--text-muted); color: var(--text-muted); background: var(--warm-gray); font-size: 11px; padding: 4px 10px; border-radius: 20px; }

/* ═══════════════════════════════════════════════════
   PILOTAGE — Module directeur
   ═══════════════════════════════════════════════════ */

/* Page header */
.pil-header { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pil-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; margin-bottom: 3px; letter-spacing: -.3px; }
.pil-sub { font-size: 12px; color: var(--text-muted); }
.pil-header-r { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Sub-navigation (chart tabs style) */
.pil-nav { display: flex; gap: 4px; margin-bottom: 20px; background: var(--warm-gray); border-radius: 10px; padding: 3px; width: fit-content; }
.pil-nav-btn { padding: 6px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; font-family: 'DM Sans', sans-serif; }
.pil-nav-btn.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }

/* Alert banner (saisie incomplète) */
.pil-alert-banner { background: var(--gold-light); border: 1px solid rgba(201,168,76,.35); border-radius: 10px; padding: 11px 16px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; gap: 12px; }
.pil-alert-banner strong { color: var(--gold); }

/* Grid layouts */
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.grid-60-40 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin-bottom: 14px; }

/* KPI cards (pilotage) */
.kpi-p { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi-p::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--ac, var(--sage)); border-radius: 0 0 10px 10px; }
.kpi-p-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 5px; }
.kpi-p-value { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.kpi-p-sub { font-size: 10.5px; font-weight: 600; }
.kpi-p-src { font-size: 9.5px; color: var(--text-muted); margin-top: 3px; opacity: .7; }

/* Chart containers */
.chart-tabs-bar { display: flex; gap: 3px; margin-bottom: 12px; background: var(--warm-gray); border-radius: 8px; padding: 3px; width: fit-content; }
.chart-tab-btn { padding: 5px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; font-family: 'DM Sans', sans-serif; }
.chart-tab-btn.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.svg-chart-wrap { height: 190px; margin-top: 6px; position: relative; overflow: hidden; }
.svg-chart-wrap.tall { height: 230px; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-axis-label { font-size: 10px; fill: var(--text-muted); font-family: 'DM Sans', sans-serif; }
.chart-grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 4; }

/* Chart legend */
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.chart-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.chart-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Pie / donut chart (CSS) */
.pie-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.pie-donut { width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0; }
.pie-legend-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.pie-legend-row:last-child { border-bottom: none; }
.pie-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pie-label { flex: 1; }
.pie-val { font-weight: 700; font-size: 12.5px; }

/* Saisie mensuelle */
.saisie-header-box { background: linear-gradient(135deg, var(--sage-pale), var(--blue-pale)); border: 1px solid rgba(74,124,111,.2); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.saisie-progress-wrap { background: var(--warm-gray); border-radius: 4px; height: 6px; overflow: hidden; margin-top: 6px; width: 100%; }
.saisie-progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--sage), var(--blue)); transition: width .4s; }
.saisie-section-block { background: var(--white); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.ss-hd { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: background .15s; }
.ss-hd:hover { background: var(--warm-gray); }
.ss-hd-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ss-badge { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.ss-done { background: #e6f4ea; color: #2d7a3a; }
.ss-todo { background: var(--gold-light); color: var(--gold); }
.ss-body { padding: 0 16px 4px; }
.input-row-p { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.input-row-p:last-child { border-bottom: none; }
.input-lbl { font-size: 12.5px; flex: 1; }
.input-source { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.input-f { width: 130px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; font-family: 'DM Sans', sans-serif; color: var(--ink); background: var(--warm-gray); outline: none; text-align: right; transition: border-color .15s; }
.input-f:focus { border-color: var(--sage); background: var(--white); }
.input-f.auto-fill { background: #e6f4ea; border-color: rgba(45,122,58,.3); color: #2d7a3a; }
.auto-badge { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #e6f4ea; color: #2d7a3a; flex-shrink: 0; }

/* IA synthesis block */
.ia-analysis-block { background: linear-gradient(135deg, rgba(74,124,111,.06), rgba(59,125,216,.04)); border: 1px solid rgba(74,124,111,.2); border-radius: 12px; padding: 18px 22px; margin-bottom: 14px; }
.ia-analysis-text { font-size: 13px; line-height: 1.78; color: var(--ink); }
.ia-analysis-text p { margin-bottom: 9px; }
.ia-analysis-text p:last-child { margin-bottom: 0; }
.ia-point-ok { background: #e6f4ea; border: 1px solid rgba(45,122,58,.25); border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: #2d7a3a; display: flex; gap: 8px; margin-top: 10px; }
.ia-point-warn { background: var(--gold-light); border: 1px solid rgba(201,168,76,.3); border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: var(--gold); display: flex; gap: 8px; margin-top: 8px; }

/* Rapport preview */
.rapport-preview-box { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; font-size: 13.5px; line-height: 1.8; color: var(--ink); box-shadow: var(--shadow); }
.rp-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.rp-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.rp-section { margin-bottom: 18px; }
.rp-section-hd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--sage); margin-bottom: 8px; }
.rp-stat-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rp-stat-row:last-child { border-bottom: none; }
.rp-stat-label { font-size: 12.5px; flex: 1; color: var(--text-muted); }
.rp-stat-val { font-size: 13px; font-weight: 700; }
.decision-box { background: var(--gold-light); border: 1px solid rgba(201,168,76,.3); border-radius: 10px; padding: 14px 18px; margin-top: 14px; }
.dec-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--gold); margin-bottom: 10px; }
.dec-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(201,168,76,.2); }
.dec-item:last-child { border-bottom: none; }
.dec-n { width: 20px; height: 20px; background: var(--gold); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }

/* Benchmarks */
.bench-table { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.bench-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.bench-row:last-child { border-bottom: none; }
.bench-lbl { font-size: 12.5px; font-weight: 600; width: 180px; flex-shrink: 0; }
.bench-bar-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.bench-pbar { flex: 1; background: var(--warm-gray); border-radius: 3px; height: 6px; overflow: hidden; }
.bench-pbar-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.bench-val { font-size: 13px; font-weight: 700; width: 50px; text-align: right; flex-shrink: 0; }
.bench-avg { font-size: 11px; color: var(--text-muted); width: 90px; text-align: right; flex-shrink: 0; }
.bench-good { background: #2d7a3a; }
.bench-warn { background: var(--gold); }

/* Consent toggles */
.consent-card-box { background: var(--white); border: 1px solid rgba(59,125,216,.2); border-radius: 12px; padding: 20px 22px; }
.consent-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.consent-toggle-row:last-child { border-bottom: none; }
.ctr-info { flex: 1; }
.ctr-lbl { font-size: 13px; font-weight: 600; }
.ctr-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.p-toggle { width: 36px; height: 20px; background: var(--warm-gray); border-radius: 10px; border: 1px solid var(--border); cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.p-toggle.on { background: #2d7a3a; border-color: #2d7a3a; }
.p-knob { width: 14px; height: 14px; background: var(--white); border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.p-toggle.on .p-knob { left: 18px; }
.consent-status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 10px 12px; background: var(--sage-pale); border-radius: 8px; margin-top: 14px; }
.consent-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Alert rows (pilotage) */
.alert-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: 9px; margin-bottom: 8px; }
.alert-row:last-child { margin-bottom: 0; }
.alert-row.good { background: #e6f4ea; border: 1px solid rgba(45,122,58,.2); }
.alert-row.warn { background: var(--gold-light); border: 1px solid rgba(201,168,76,.25); }
.alert-row.bad { background: var(--red-pale); border: 1px solid rgba(224,82,82,.2); }
.ar-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.ar-hd { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.ar-hd.good { color: #2d7a3a; }
.ar-hd.warn { color: var(--gold); }
.ar-hd.bad { color: var(--red); }
.ar-bd { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* Profils — horizontal age bars */
.age-bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.age-bar-row:last-child { border-bottom: none; }
.age-bar-lbl { font-size: 12px; width: 40px; flex-shrink: 0; font-weight: 600; }
.age-bar-track { flex: 1; background: var(--warm-gray); border-radius: 3px; height: 8px; overflow: hidden; }
.age-bar-fill { height: 100%; border-radius: 3px; background: var(--blue); transition: width .4s; }
.age-bar-val { font-size: 11.5px; font-weight: 700; width: 30px; text-align: right; flex-shrink: 0; }

/* RH — turnover line chart container */
.rh-chart-wrap { height: 160px; margin-top: 8px; }

/* Rapport tabs */
.rapport-tabs { display: flex; gap: 5px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.rapport-tab-btn { padding: 6px 14px; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; font-family: 'DM Sans', sans-serif; }
.rapport-tab-btn.active { background: var(--warm-gray); color: var(--ink); font-weight: 600; }

/* Rapport structure list */
.rapport-structure { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rs-section { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.rs-section:last-child { border-bottom: none; }
.rs-num { width: 26px; height: 26px; background: var(--sage); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.rs-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.rs-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.rs-auto { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #e6f4ea; color: #2d7a3a; margin-left: 6px; vertical-align: middle; }

/* ═══════════════════════════════════════════════════
   TERRITOIRE — Module CD / ARS / PJJ
   ═══════════════════════════════════════════════════ */

/* Type filter bar */
.etab-type-bar { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.etb { padding: 6px 14px; border-radius: 20px; font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--text-muted); transition: all .15s; }
.etb:hover { border-color: var(--sage); color: var(--sage); }
.etb.active { color: var(--white); border-color: transparent; }

/* Authority badges */
.auth-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; letter-spacing: .3px; }
.auth-cd { background: var(--blue-pale); color: var(--blue); }
.auth-ars { background: var(--purple-pale); color: var(--purple); }
.auth-pjj { background: var(--red-pale); color: var(--red); }
.auth-both { background: var(--gold-light); color: var(--gold); }

/* Indicator mini-cards */
.ind-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.ind-card { background: var(--warm-gray); border-radius: 9px; padding: 12px 14px; border-left: 3px solid var(--ac, var(--blue)); }
.ind-label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.ind-val { font-size: 16px; font-weight: 700; }
.ind-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

/* Score rows (ranking table) */
.score-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.score-row:last-child { border-bottom: none; }
.sr-name { font-size: 12.5px; font-weight: 600; flex: 1; }
.sr-type { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.sr-score { font-size: 15px; font-weight: 700; width: 40px; text-align: right; flex-shrink: 0; }

/* Fiche établissement layout */
.fiche-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
.fiche-nav { display: flex; flex-direction: column; gap: 3px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.fn-item { padding: 8px 12px; border-radius: 7px; font-size: 12px; cursor: pointer; color: var(--text-muted); transition: all .15s; border: none; background: transparent; text-align: left; width: 100%; display: flex; align-items: center; gap: 8px; }
.fn-item:hover { background: var(--warm-gray); color: var(--ink); }
.fn-item.active { background: var(--sage-pale); color: var(--sage); font-weight: 600; }
.fn-badge { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 8px; background: #e6f4ea; color: #2d7a3a; margin-left: auto; }
.fn-badge.miss { background: var(--red-pale); color: var(--red); }

/* Référentiel accordion */
.ref-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.ref-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ref-header:hover { opacity: .85; }
.ref-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ref-source { font-size: 10px; color: var(--text-muted); background: var(--warm-gray); padding: 2px 7px; border-radius: 4px; }
.ref-body { margin-top: 12px; }
.data-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.data-item:last-child { border-bottom: none; }
.data-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.data-name { font-size: 12.5px; flex: 1; }
.data-type { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.data-req { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--red-pale); color: var(--red); margin-left: 6px; vertical-align: middle; }

/* Progress track (small) */
.progress-track { background: var(--warm-gray); border-radius: 4px; height: 5px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), #2d7a3a); transition: width .5s; }

/* ─── Suivi saisie (v3) ─── */
.deadline-banner { background: var(--red-pale); border: 1px solid rgba(224,82,82,.25); border-radius: 10px; padding: 12px 18px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; gap: 12px; }
.deadline-banner strong { color: var(--red); }

.saisie-global-bar { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sg-stat { text-align: center; flex-shrink: 0; }
.sg-val { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; line-height: 1; }
.sg-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin-top: 3px; }
.sg-divider { width: 1px; height: 48px; background: var(--border); flex-shrink: 0; }
.sg-progress-wrap { flex: 1; min-width: 200px; }
.sg-legend { display: flex; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.sgl-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.sgl-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.filter-tabs { display: flex; gap: 5px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab { padding: 5px 13px; border-radius: 20px; font-size: 11.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-muted); transition: all .15s; font-family: 'DM Sans', sans-serif; }
.filter-tab:hover { background: var(--warm-gray); color: var(--ink); }
.filter-tab.active { border-color: var(--sage); background: var(--sage-pale); color: var(--sage); font-weight: 600; }

.saisie-etab-row { background: var(--white); border: 1px solid var(--border); border-radius: 11px; padding: 14px 18px; margin-bottom: 8px; transition: border-color .15s; }
.saisie-etab-row:hover { border-color: var(--sage); }
.ser-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ser-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ser-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.ser-city { font-size: 11.5px; color: var(--text-muted); }
.ser-pct { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; flex-shrink: 0; width: 52px; text-align: right; }
.ser-update { font-size: 10.5px; color: var(--text-muted); flex-shrink: 0; }
.ser-sections { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 8px; }
.sec-pill { border-radius: 6px; padding: 5px 8px; font-size: 10.5px; font-weight: 600; text-align: center; border: 1px solid transparent; }
.sec-pill.done { background: #e6f4ea; color: #2d7a3a; border-color: rgba(45,122,58,.2); }
.sec-pill.partial { background: var(--gold-light); color: var(--gold); border-color: rgba(201,168,76,.25); }
.sec-pill.missing { background: var(--red-pale); color: var(--red); border-color: rgba(224,82,82,.2); }
.sec-pill.auto { background: var(--blue-pale); color: var(--blue); border-color: rgba(59,125,216,.2); }
.relance-btn { background: var(--blue-pale); border: 1px solid rgba(59,125,216,.3); color: var(--blue); border-radius: 7px; padding: 5px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s; white-space: nowrap; }
.relance-btn:hover { background: rgba(59,125,216,.15); }
.relance-sent { color: #2d7a3a; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* ─── Profils tabs ─── */
.profil-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--warm-gray); border-radius: 10px; padding: 3px; width: fit-content; flex-wrap: wrap; }
.profil-tab-btn { padding: 6px 14px; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; font-family: 'DM Sans', sans-serif; }
.profil-tab-btn.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }

/* Parcours individuel card */
.parcours-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; position: relative; overflow: hidden; transition: box-shadow .15s; }
.parcours-card:hover { box-shadow: var(--shadow); }
.parcours-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc-color, var(--sage)); }
.pc-initials { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.pc-name { font-size: 13px; font-weight: 600; }
.pc-age { font-size: 11px; color: var(--text-muted); }
.pc-etab { font-size: 11.5px; margin-top: 4px; color: var(--text-muted); }
.pc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pc-alert { background: var(--red-pale); border: 1px solid rgba(224,82,82,.2); border-radius: 6px; padding: 4px 8px; font-size: 11px; color: var(--red); margin-top: 6px; }

/* ─── Power BI Export ─── */
.pbi-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--warm-gray); border-radius: 10px; padding: 3px; width: fit-content; }
.pbi-tab-btn { padding: 6px 14px; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; font-family: 'DM Sans', sans-serif; }
.pbi-tab-btn.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }

.pbi-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.pbi-step:last-child { border-bottom: none; }
.pbi-step-num { width: 28px; height: 28px; background: var(--sage); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.pbi-step-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.pbi-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pbi-code-block { background: var(--ink); color: #e6edf3; border-radius: 8px; padding: 10px 14px; font-family: monospace; font-size: 12px; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pbi-copy-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: var(--white); border-radius: 5px; padding: 3px 8px; font-size: 10px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; white-space: nowrap; transition: all .15s; }
.pbi-copy-btn:hover { background: rgba(255,255,255,.2); }
.pbi-copy-btn.copied { background: rgba(45,122,58,.3); border-color: rgba(45,122,58,.5); color: #6fcf97; }

.pbi-status-bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--warm-gray); border-radius: 9px; margin-bottom: 16px; font-size: 11.5px; flex-wrap: wrap; }
.pbi-live-dot { width: 7px; height: 7px; background: #2d7a3a; border-radius: 50%; animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.pbi-stat { display: flex; flex-direction: column; gap: 1px; }
.pbi-stat-val { font-size: 13px; font-weight: 700; }
.pbi-stat-label { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

.pbi-endpoint { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.pbi-ep-header { display: flex; align-items: center; gap: 10px; }
.pbi-ep-check { width: 16px; height: 16px; accent-color: var(--sage); cursor: pointer; flex-shrink: 0; }
.pbi-ep-label { font-size: 13px; font-weight: 600; flex: 1; }
.pbi-ep-url { font-family: monospace; font-size: 11px; color: var(--blue); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbi-ep-meta { display: flex; gap: 12px; margin-top: 6px; padding-left: 26px; }
.pbi-ep-detail { font-size: 10.5px; color: var(--text-muted); }

.pbi-visual-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.pbi-vis-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.pbi-vis-type { font-size: 10.5px; color: var(--text-muted); margin-bottom: 5px; }
.pbi-vis-desc { font-size: 12px; color: var(--text-muted); }

.pbi-format-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.pbi-format-icon { font-size: 22px; flex-shrink: 0; }
.pbi-format-name { font-size: 13px; font-weight: 600; }
.pbi-format-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.pbi-format-size { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }

/* Sector view tag filters */
.sector-filters { display: flex; gap: 7px; margin-bottom: 16px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   SECRÉTARIAT MODULE
   ═══════════════════════════════════════════════════════════ */

/* ─── Stat grids ─── */
.stats4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }
.sec-stat { background: var(--white); border-radius: 12px; padding: 13px 16px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(26,26,46,.06); cursor: pointer; transition: all .15s; position: relative; overflow: hidden; }
.sec-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: currentColor; }
.sec-stat.red { color: var(--red); } .sec-stat.amb { color: var(--orange); } .sec-stat.blu { color: var(--blue); } .sec-stat.grn { color: var(--sage); }
.sec-stat:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.sec-stat-n { font-family: 'DM Serif Display', serif; font-size: 28px; line-height: 1; margin-bottom: 2px; }
.sec-stat-l { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.sec-stat-s { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

/* ─── Favori / avatar badges ─── */
.fav { width: 33px; height: 33px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.fav.enc { background: var(--red-pale); border: 1.5px solid #f0b0b0; color: var(--red); }
.fav.ret { background: var(--sage-pale); border: 1.5px solid #a8d5c9; color: var(--sage); }
.fav.arc { background: var(--warm-gray); border: 1.5px solid var(--border); color: var(--text-muted); }
.fav.cob { background: var(--blue-pale); border: 1.5px solid #a8c4ef; color: var(--blue); }

/* ─── Presence grid mini ─── */
.pg { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 12px 16px; }
.pc { background: var(--warm-gray); border-radius: 8px; padding: 9px 10px; text-align: center; cursor: pointer; border: 1px solid var(--border); transition: border-color .15s; }
.pc:hover { border-color: var(--sage); }
.pc-n { font-family: 'DM Serif Display', serif; font-size: 22px; line-height: 1; }
.pc-l { font-size: 9.5px; color: var(--text-muted); margin-top: 2px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }

/* ─── Courrier item ─── */
.ci { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.ci:last-child { border-bottom: none; }
.ci:hover { background: var(--warm-gray); }
.ci-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ci-dot.u { background: var(--red); } .ci-dot.i { background: var(--blue); } .ci-dot.d { background: var(--border); }
.ci-obj { font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* ─── Scan zone ─── */
.scan-zone { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.scan-btn { width: 100%; padding: 10px; border-radius: 8px; border: 2px dashed var(--border); background: var(--warm-gray); cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--sage); display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .15s; }
.scan-btn:hover { border-color: var(--sage); background: var(--sage-pale); }

/* ─── Courriers filters ─── */
.filters { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.fbtn { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--white); font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.fbtn:hover { border-color: var(--sage); color: var(--sage); }
.fbtn.on { background: var(--sage); color: white; border-color: var(--sage); }

/* ─── Tag color variants ─── */
.tag.red { background: var(--red-pale); color: var(--red); border: 1px solid #f0b0b0; }
.tag.blu { background: var(--blue-pale); color: var(--blue); border: 1px solid #a8c4ef; }
.tag.amb { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }
.tag.mut { background: var(--warm-gray); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── Urgence selector (scan modal) ─── */
.urg-row { display: flex; gap: 8px; }
.urg-opt { flex: 1; padding: 8px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--text-muted); transition: all .15s; user-select: none; }
.urg-opt:hover { border-color: var(--sage); color: var(--sage); }
.urg-opt.s-i { background: var(--blue-pale); border-color: #a8c4ef; color: var(--blue); }
.urg-opt.s-u { background: var(--orange-pale); border-color: #f0c080; color: var(--orange); }
.urg-opt.s-c { background: var(--red-pale); border-color: #f0b0b0; color: var(--red); }

/* ─── Seen badge ─── */
.seen { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 5px; }
.seen.ok { background: var(--sage-pale); color: var(--sage); border: 1px solid #a8d5c9; }
.seen.pend { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }

/* ─── Fugues table ─── */
.ft { background: var(--white); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.ft-h { display: grid; grid-template-columns: 1.8fr 1.1fr 1.1fr .7fr 1fr 130px; padding: 9px 18px; background: var(--warm-gray); border-bottom: 1px solid var(--border); }
.ft-hc { font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.ft-r { display: grid; grid-template-columns: 1.8fr 1.1fr 1.1fr .7fr 1fr 130px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: center; cursor: pointer; transition: background .12s; }
.ft-r:last-child { border-bottom: none; }
.ft-r:hover { background: var(--warm-gray); }
.ft-name { font-size: 12.5px; font-weight: 500; }
.ft-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.ft-c { font-size: 11.5px; color: var(--ink); opacity: .75; }

/* ─── Dossiers table ─── */
.dt { background: var(--white); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.dt-h { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr 100px; padding: 9px 18px; background: var(--warm-gray); border-bottom: 1px solid var(--border); }
.dt-hc { font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.dt-r { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr 100px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: center; cursor: pointer; transition: background .12s; }
.dt-r:last-child { border-bottom: none; }
.dt-r:hover { background: var(--warm-gray); }

/* ─── Présences stats (6-col) ─── */
.pres-stats { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 18px; }
.ps { background: var(--white); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); text-align: center; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.ps-n { font-family: 'DM Serif Display', serif; font-size: 30px; line-height: 1; }
.ps-l { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }

/* ─── Mouvement row ─── */
.mouv-row { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.mouv-row:last-child { border-bottom: none; }
.mouv-row:hover { background: var(--warm-gray); }
.mouv-ic { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }

/* ── Tableau présences semaine ───────────────────────────── */
.pres-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pres-table th { padding: 9px 10px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); background: var(--cream, #faf8f4); border-bottom: 2px solid var(--border); white-space: nowrap; }
.pres-table th:first-child { text-align: left; padding-left: 16px; min-width: 140px; }
.pres-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pres-table td:first-child { text-align: left; padding-left: 16px; font-weight: 600; font-size: 12.5px; color: var(--text-primary); }
.pres-table tbody tr:last-child td { border-bottom: none; }
.pres-table tbody tr:hover td { background: var(--cream, #faf8f4); }
.pb { display: inline-flex; align-items: center; justify-content: center; padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; border: 1px solid transparent; }
.pb-p   { background: rgba(74,124,111,.12); color: var(--sage, #4a7c6f); border-color: rgba(74,124,111,.25); }
.pb-we  { background: var(--cream, #faf8f4); color: var(--text-muted); border-color: var(--border); }
.pb-abs { background: #f5f3ee; color: var(--text-muted); border-color: var(--border); }
.pb-perm { background: rgba(201,168,76,.15); color: #7a6020; border-color: rgba(201,168,76,.3); }
.pb-fug  { background: rgba(192,57,43,.1); color: var(--red, #c0392b); border-color: rgba(192,57,43,.25); }
.pb-hosp { background: rgba(59,125,216,.1); color: var(--blue, #3b7dd8); border-color: rgba(59,125,216,.25); }

/* ─── Contacts grid ─── */
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(268px,1fr)); gap: 12px; }
.cc { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 15px; cursor: pointer; transition: all .15s; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.cc:hover { box-shadow: var(--shadow); border-color: #c8c0b5; }
.cc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cc-av { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0; }
.cc-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.cc-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cc-dets { border-top: 1px solid var(--border); padding-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.cc-det { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); opacity: .85; }
.cc-ico { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; }
.cc-jtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.cc-jtag { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: var(--sage-pale); color: var(--sage); font-weight: 500; }
.search-wrap input { width: 100%; padding: 9px 13px 9px 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--warm-gray); font-size: 13px; color: var(--ink); }
.search-wrap input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-pale); }

/* ─── Modèles layout ─── */
.mod-layout { display: grid; grid-template-columns: 228px 1fr; gap: 14px; align-items: start; }
.mod-cats { background: var(--white); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.mc-it { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; font-size: 12.5px; color: var(--text-muted); }
.mc-it:last-child { border-bottom: none; }
.mc-it:hover { background: var(--warm-gray); color: var(--ink); }
.mc-it.on { background: var(--sage-pale); color: var(--sage); font-weight: 500; }
.mc-cnt { margin-left: auto; font-size: 10px; background: var(--warm-gray); color: var(--text-muted); padding: 1px 6px; border-radius: 10px; border: 1px solid var(--border); }
.mc-it.on .mc-cnt { background: rgba(74,124,111,.1); color: var(--sage); }
.mk { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(26,26,46,.06); transition: box-shadow .15s; }
.mk:hover { box-shadow: var(--shadow); }

/* ─── Generic card row ─── */
.row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }

/* ─── Two-column layouts ─── */
.g2   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g2-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Avatar (custom color, used in RH) ─── */
.ava { width: 33px; height: 33px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; flex-shrink: 0; color: white; }

/* ─── Search wrap ─── */
.search-wrap { position: relative; }
.s-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-muted); pointer-events: none; }

/* ─── Archivage ─── */
.arch-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; }
.arch-card { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 16px; cursor: pointer; transition: all .15s; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.arch-card:hover { box-shadow: var(--shadow); }
.arch-icon { font-size: 28px; margin-bottom: 10px; }
.arch-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.arch-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.arch-ft { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

/* ─── RH ─── */
.rh-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }
.rh-s { background: var(--white); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.rh-s-n { font-family: 'DM Serif Display', serif; font-size: 28px; line-height: 1; }
.rh-s-l { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.sal-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.sal-row:last-child { border-bottom: none; }
.sal-row:hover { background: var(--warm-gray); }

/* ─── Agenda semaine ─── */
.week-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; margin-bottom: 16px; }
.wday { background: var(--white); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.wday.today { border-color: var(--sage); }
.wday-hd { padding: 8px 10px; background: var(--warm-gray); border-bottom: 1px solid var(--border); text-align: center; }
.wday-name { font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.wday-n { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--ink); line-height: 1; margin-top: 2px; }
.wday.today .wday-n { color: var(--sage); }
.wday-evts { padding: 6px; }
.wday-evt { padding: 5px 7px; border-radius: 5px; margin-bottom: 4px; cursor: pointer; transition: opacity .12s; }
.wday-evt:last-child { margin-bottom: 0; }
.wday-evt:hover { opacity: .8; }
.wday-evt.red { background: var(--red-pale); border-left: 2px solid var(--red); }
.wday-evt.blu { background: var(--blue-pale); border-left: 2px solid var(--blue); }
.wday-evt.grn { background: var(--sage-pale); border-left: 2px solid var(--sage); }
.wday-evt.amb { background: var(--orange-pale); border-left: 2px solid var(--orange); }
.wday-evt.perm { background: var(--warm-gray); border-left: 2px solid var(--border); }
.wday-evt.retour { background: var(--sage-pale); border-left: 2px solid var(--sage); }
.wday-evt.hosp { background: var(--blue-pale); border-left: 2px solid var(--blue); }
.wday-evt.fugue { background: var(--red-pale); border-left: 2px solid var(--red); }
.wday-evt.admission { background: var(--sage-pale); border-left: 2px solid var(--sage); }
.wday-evt.sortie { background: var(--purple-pale); border-left: 2px solid var(--purple); }
.wday-evt-ttl { font-size: 11px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.wday-evt-t { font-size: 10px; color: var(--text-muted); }
.wday-evt-s { font-size: 9.5px; color: var(--text-muted); }

/* ─── RDV item ─── */
.rdv { display: flex; gap: 9px; align-items: flex-start; padding: 5px 7px; border-radius: 6px; cursor: pointer; transition: background .12s; margin-bottom: 6px; }
.rdv:last-child { margin-bottom: 0; }
.rdv:hover { background: var(--warm-gray); }
.rdv-t { font-size: 10px; font-weight: 500; color: var(--text-muted); min-width: 34px; margin-top: 2px; }
.rdv-bar { width: 2.5px; border-radius: 2px; min-height: 32px; flex-shrink: 0; align-self: stretch; }
.rdv-bar.red { background: var(--red); } .rdv-bar.amb { background: var(--orange); } .rdv-bar.blu { background: var(--blue); } .rdv-bar.grn { background: var(--sage); }
.rdv-ttl { font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.rdv-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

/* ─── Notif panel ─── */
.np { background: var(--blue-pale); border: 1.5px solid #a8c4ef; border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.np-hd { padding: 10px 15px; background: var(--blue); display: flex; align-items: center; gap: 7px; }
.np-hd span { font-size: 12px; font-weight: 500; color: #fff; }
.nc { padding: 13px 15px; border-bottom: 1px solid #a8c4ef; display: flex; gap: 11px; }
.nc:last-child { border-bottom: none; }
.nc-ic { font-size: 20px; flex-shrink: 0; }
.nc-body { flex: 1; }
.nc-who { font-size: 10.5px; color: var(--blue); font-weight: 500; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.nc-who .tm { color: var(--text-muted); font-weight: 400; }
.nprev { background: var(--blue-pale); border: 1px solid #a8c4ef; border-radius: 8px; padding: 11px 13px; margin-top: 3px; }
.nprev-ttl { font-size: 11px; font-weight: 500; color: var(--blue); margin-bottom: 5px; }
.nprev-body { font-size: 12px; color: var(--ink); opacity: .75; line-height: 1.5; }

/* ═══ DOSSIERS D'ADMISSION ═══ */

/* KPI strip */
.kpi-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--white); border-radius: 12px; padding: 13px 16px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(26,26,46,.06); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--kc, var(--sage)); }
.kpi-n { font-family: 'DM Serif Display', serif; font-size: 26px; line-height: 1; margin-bottom: 3px; }
.kpi-l { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.kpi-s { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Dossier card */
.dossier-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; cursor: pointer; transition: all .18s; box-shadow: 0 1px 4px rgba(26,26,46,.06); position: relative; }
.dossier-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #c8c0b5; }
.dossier-card.urgent { border-left: 3px solid var(--red); }
.dossier-card.warn { border-left: 3px solid var(--orange); }
.dossier-card.ok { border-left: 3px solid var(--sage); }
.dossier-card.cloture { border-left: 3px solid var(--purple); opacity: .75; }
.dc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.dc-av { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.dc-info { flex: 1; min-width: 0; }
.dc-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.dc-meta { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.dc-right { text-align: right; flex-shrink: 0; }
.dc-pct { font-family: 'DM Serif Display', serif; font-size: 22px; line-height: 1; margin-bottom: 3px; }
.dc-bot { display: flex; align-items: center; gap: 10px; }
.prog-bar { flex: 1; height: 6px; background: var(--warm-gray); border-radius: 4px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 4px; }

/* Dossier detail layout */
.dossier-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }

/* Dossier section blocks */
.sec { background: var(--white); border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(26,26,46,.06); overflow: hidden; margin-bottom: 12px; }
.sec-hd { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sec-t { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.sec-ico { font-size: 15px; }
.sec-b { padding: 16px 18px; }
.sec-prog { height: 4px; background: var(--warm-gray); }
.sec-prog-f { height: 100%; transition: width .5s; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.ff { grid-column: 1 / -1; }
.sec .fl { font-size: 9.5px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.fv { font-size: 12.5px; color: var(--ink); }
.fv.empty { color: var(--text-muted); font-style: italic; font-size: 12px; }
.fv.alert { color: var(--red); font-weight: 500; }

/* Pièce checklist */
.piece-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(224,217,208,.5); }
.piece-row:last-child { border-bottom: none; }
.piece-status { width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.ps-ok { background: var(--sage-pale); color: var(--sage); border: 1px solid #a8d5c9; }
.ps-miss { background: var(--red-pale); color: var(--red); border: 1px solid #f0b0b0; }
.ps-wait { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }
.ps-na { background: var(--warm-gray); color: var(--text-muted); border: 1px solid var(--border); }
.piece-label { flex: 1; font-size: 12.5px; }
.piece-req { font-size: 9px; color: var(--red); font-weight: 600; margin-left: 3px; }
.piece-delay { font-size: 10.5px; color: var(--text-muted); }
.piece-action { flex-shrink: 0; }

/* Side card */
.side-card { background: var(--white); border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(26,26,46,.06); overflow: hidden; }
.sc-hd { padding: 11px 15px; border-bottom: 1px solid var(--border); }
.sc-t { font-size: 12.5px; font-weight: 500; }
.sc-b { padding: 12px 15px; }

/* Validation box */
.valid-box { border-radius: 12px; padding: 16px; border: 2px solid; }
.vb-ok { border-color: rgba(74,124,111,.3); background: var(--sage-pale); }
.vb-nok { border-color: #f0b0b0; background: var(--red-pale); }
.vb-partial { border-color: #f0c080; background: var(--orange-pale); }

/* Alerte inline */
.alerte { border-radius: 8px; padding: 10px 13px; display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; }
.al-r { background: var(--red-pale); border: 1px solid #f0b0b0; }
.al-a { background: var(--orange-pale); border: 1px solid #f0c080; }
.al-g { background: var(--sage-pale); border: 1px solid #a8d5c9; }
.al-b { background: var(--blue-pale); border: 1px solid #a8c4ef; }
.al-ico { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.al-txt { font-size: 12px; color: var(--ink); line-height: 1.5; }

/* Urgence banner */
.urgence-banner { background: linear-gradient(135deg,#fdf0ee,#fff5f3); border: 2px solid #f0b0b0; border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; }
.ub-ico { font-size: 28px; flex-shrink: 0; }
.ub-txt { flex: 1; }
.ub-timer { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--red); font-weight: 400; }

/* Step indicator */
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--warm-gray); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; transition: all .2s; }
.step-lbl { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.step.on .step-lbl { color: var(--sage); }
.step.done .step-lbl { color: var(--sage); }

/* Transfert box */
.transfert-box { background: var(--white); border-radius: 12px; border: 2px solid var(--blue); padding: 20px; box-shadow: var(--shadow); }
.tf-title { font-family: 'DM Serif Display', serif; font-size: 18px; letter-spacing: -.3px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.tf-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.tf-etab-selector { background: var(--blue-pale); border: 1px solid #a8c4ef; border-radius: 8px; padding: 13px 15px; margin-bottom: 14px; }
.ts-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--white); cursor: pointer; transition: all .12s; }
.ts-item:hover { background: var(--warm-gray); }
.ts-item.selected { border-color: var(--sage); background: var(--sage-pale); }
.ts-item.locked { opacity: .5; cursor: not-allowed; }

/* ═══ FICHE SIGNALÉTIQUE ═══ */

/* Complétude bar */
.completude-bar { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 16px 20px; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.cb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cb-pct { font-family: 'DM Serif Display', serif; font-size: 22px; font-weight: 400; }
.cb-track { background: var(--warm-gray); border-radius: 4px; height: 7px; overflow: hidden; margin-bottom: 10px; }
.cb-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--sage), var(--sage-light)); transition: width .5s; }
.cb-items { display: flex; gap: 6px; flex-wrap: wrap; }
.cb-item { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.cb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Fiche header */
.fiche-header { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 24px; box-shadow: 0 1px 4px rgba(26,26,46,.06); display: flex; gap: 24px; align-items: flex-start; }

/* Photo zone */
.photo-zone { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-frame { width: 110px; height: 130px; border-radius: 10px; background: var(--warm-gray); border: 2px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; transition: all .2s; }
.photo-frame:hover .photo-overlay { opacity: 1; }
.photo-frame.missing { border: 2px dashed #f0b0b0; background: var(--red-pale); }
.photo-frame.old { border: 2px dashed #f0c080; background: var(--orange-pale); }
.photo-canvas { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; }
.photo-overlay { position: absolute; inset: 0; background: rgba(74,124,111,.7); display: flex; align-items: center; justify-content: center; border-radius: 8px; opacity: 0; transition: opacity .2s; }
.photo-overlay span { color: #fff; font-size: 12px; font-weight: 500; }
.photo-badge { font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 10px; }
.pb-ok { background: var(--sage-pale); color: var(--sage); border: 1px solid #a8d5c9; }
.pb-miss { background: var(--red-pale); color: var(--red); border: 1px solid #f0b0b0; }
.pb-old { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }

/* Représentant card */
.rep-card { background: var(--warm-gray); border-radius: 8px; padding: 14px 16px; border: 1px solid var(--border); margin-bottom: 10px; }
.rep-card:last-child { margin-bottom: 0; }
.rep-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rep-av { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0; }
.rep-name { font-size: 13.5px; font-weight: 500; }
.rep-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.rep-details { display: flex; flex-direction: column; gap: 5px; }
.rep-det { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink); opacity: .8; }
.rep-det-ico { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
.rep-ap { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 4px; margin-top: 6px; }

/* Med block urgence */
.med-block { background: var(--red-pale); border: 1px solid #f0b0b0; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.med-block-ttl { font-size: 10.5px; font-weight: 600; color: var(--red); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.med-item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid rgba(224,82,82,.1); }
.med-item:last-child { border-bottom: none; }
.med-lbl { font-size: 11px; color: var(--red); font-weight: 500; width: 110px; flex-shrink: 0; }
.med-val { font-size: 12.5px; color: var(--ink); }

/* Usage item */
.usage-item { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.usage-item:last-child { border-bottom: none; }
.usage-item:hover { background: var(--warm-gray); }
.usage-ico-box { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.usage-lbl { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.usage-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.usage-date { font-size: 10.5px; color: var(--text-muted); flex-shrink: 0; }

/* Historique modifs */
.hist-item { display: flex; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.hist-item:last-child { border-bottom: none; }
.hist-dot { width: 7px; height: 7px; border-radius: 50%; background: #c8c0b5; flex-shrink: 0; margin-top: 4px; }
.hist-body { flex: 1; color: var(--text-muted); }
.hist-time { color: var(--text-muted); flex-shrink: 0; font-size: 10.5px; }

/* Avis box */
.avis-box { background: var(--red-pale); border: 1px solid #f0b0b0; border-radius: 8px; padding: 14px 16px; }
.avis-ttl { font-size: 12.5px; font-weight: 600; color: var(--red); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* Fugue preview */
.fugue-preview { background: var(--warm-gray); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fp-header { background: var(--red); padding: 10px 14px; display: flex; align-items: center; gap: 8px; }
.fp-header span { color: #fff; font-size: 12.5px; font-weight: 600; }
.fp-body { padding: 14px; }
.fp-row { display: flex; gap: 14px; margin-bottom: 12px; }
.fp-photo { width: 70px; height: 82px; border-radius: 6px; background: var(--cream); border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; }
.fp-info { flex: 1; }
.fp-field { margin-bottom: 6px; }
.fp-lbl { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 500; margin-bottom: 1px; }
.fp-val { font-size: 12px; color: var(--ink); }

/* Page layout fiche */
.page-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.col-main { display: flex; flex-direction: column; gap: 14px; }
.col-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }

/* Fiche header content */
.fi-name { font-family: 'DM Serif Display', serif; font-size: 26px; font-weight: 400; letter-spacing: -.4px; margin-bottom: 4px; }
.fi-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fi-id-tag { font-size: 11px; color: var(--text-muted); background: var(--warm-gray); padding: 2px 8px; border-radius: 4px; font-family: monospace; }
.fi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.fi-cell { background: var(--warm-gray); border-radius: 8px; padding: 10px 12px; }
.fi-cell-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.fi-cell-val { font-size: 13px; font-weight: 500; color: var(--ink); }
.fi-cell-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.fi-status-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Section (fiche — no margin-bottom, col-main gap handles spacing) */
.section { background: var(--white); border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(26,26,46,.06); overflow: hidden; }
.sec-ttl { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.sec-body { padding: 16px 18px; }

/* Field grids (fiche) */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field-label { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.field-val { font-size: 13px; color: var(--ink); }
.field-val.empty { color: var(--text-muted); font-style: italic; font-size: 12px; }
.field-val.alert { color: var(--red); font-weight: 500; }
.field-full { grid-column: 1 / -1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* Représentant AP/DV badges */
.rep-ap.ok { background: var(--sage-pale); color: var(--sage); border: 1px solid #a8d5c9; }
.rep-ap.partiel { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }
.rep-dv { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 4px; margin-top: 4px; }
.rep-dv.libre { background: var(--sage-pale); color: var(--sage); border: 1px solid #a8d5c9; }
.rep-dv.med { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }
.rep-dv.interdit { background: var(--red-pale); color: var(--red); border: 1px solid #f0b0b0; }

/* Fiche inline modals */
.fiche-modal-overlay { position: fixed; inset: 0; background: rgba(20,18,14,.45); z-index: 500; display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.fiche-modal-overlay.open { display: flex; }
.fiche-modal-box { background: var(--white); border-radius: 16px; width: 600px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.18); animation: popIn .2s ease; }
.fiche-modal-box.wide { width: 700px; }
.fiche-mo-hd { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--white); z-index: 2; }
.fiche-mo-ttl { font-family: 'DM Serif Display', serif; font-size: 18px; font-weight: 400; letter-spacing: -.3px; }
.fiche-mo-cl { width: 26px; height: 26px; border-radius: 6px; border: none; background: var(--warm-gray); cursor: pointer; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.fiche-mo-cl:hover { background: var(--border); }
.fiche-mo-bd { padding: 18px 22px; }
.fiche-mo-ft { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }

/* ═══ SÉGUR NUMÉRIQUE ═══ */

.sg-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }

/* Nav gauche */
.sg-nav { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 10px; position: sticky; top: 20px; }
.sg-nav-section { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 12px 8px; }
.sg-nav-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left; transition: all .15s; }
.sg-nav-item:hover { background: var(--sage-pale); color: var(--sage); }
.sg-nav-item.active { background: var(--sage-pale); color: var(--sage); font-weight: 700; }
.sg-nav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sg-nav-divider { height: 1px; background: var(--border); margin: 8px 10px; }
.sg-nav-calendar { padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.sg-cal-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-muted); }

/* Briques */
.sg-brique { background: var(--white); border-radius: 12px; border: 1px solid var(--border); padding: 20px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(26,26,46,.06); }
.sg-brique-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sg-brique-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

/* Badges statut */
.sg-status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sg-status-ok   { background: #dcfce7; color: #15803d; }
.sg-status-warn { background: #fef3c7; color: #92400e; }
.sg-status-todo { background: #fee2e2; color: #b91c1c; }
.sg-status-soon { background: #dbeafe; color: #1e40af; }

/* INS table */
.ins-qualifie  { color: #15803d; font-weight: 700; }
.ins-recupere  { color: #2563eb; font-weight: 700; }
.ins-verifier  { color: #d97706; font-weight: 700; }
.ins-manquant  { color: #dc2626; font-weight: 700; }

/* PSC cards */
.sg-psc-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; }
.sg-psc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sage); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* Roadmap */
.sg-roadmap-item { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sg-roadmap-item:last-child { border: none; }
.sg-roadmap-badge { width: 32px; text-align: center; font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 5px; flex-shrink: 0; }

/* Alertes inline */
.sg-alert { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; }
.sg-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.sg-alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.sg-alert-danger { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }

/* MSSanté inbox */
.mss-msg { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.mss-msg:hover { background: var(--warm-gray); }
.mss-msg.unread { font-weight: 600; background: #fafaf7; }
.mss-msg .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.mss-msg.read .dot { background: transparent; }

/* AHI places grid */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.place-cell { border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center; font-size: 11px; cursor: pointer; transition: all .15s; }
.place-cell:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.place-cell.occupe { background: #fef2f2; border-color: #fca5a5; }
.place-cell.disponible { background: #f0fdf4; border-color: #86efac; }
.place-cell.reserve { background: #eff6ff; border-color: #93c5fd; }
.place-cell.maintenance { background: #f3f4f6; border-color: #d1d5db; }

/* General progress bar (used in segur panels) */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }

/* Indicator cards sub-elements */
.ind-card .ind-val { font-family: 'DM Serif Display', serif; font-size: 32px; line-height: 1; margin: 8px 0 4px; }
.ind-card .ind-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.ind-card .ind-trend { font-size: 11px; font-weight: 600; margin-top: 4px; }

/* Tag amber */
.tag-amber { background: #fef3c7; color: #92400e; }

/* badge-blue sidebar */
.badge-blue { background: #dbeafe; color: #1d4ed8; }

/* ═══ PRÉSENCES ═══ */

/* View tabs */
.view-tabs { display: flex; gap: 4px; background: var(--warm-gray); border-radius: 8px; padding: 3px; width: fit-content; margin-bottom: 20px; border: 1px solid var(--border); }
.vt { padding: 6px 16px; border-radius: 6px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all .15s; font-family: inherit; }
.vt.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Jeune row */
.jeune-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; position: relative; }
.jeune-row:last-child { border-bottom: none; }
.jeune-row:hover { background: var(--warm-gray); }
.jeune-row.alerte { background: #FFFBF0; }
.jeune-row.alerte-red { background: #FFF8F8; }
.jalerte-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.jav { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.jav.present { background: var(--sage-pale); color: var(--sage); border: 1.5px solid #a8d5c9; }
.jav.permission { background: var(--warm-gray); color: var(--text-muted); border: 1.5px solid var(--border); }
.jav.hosp { background: var(--blue-pale); color: var(--blue); border: 1.5px solid #a8c4ef; }
.jav.fugue { background: var(--red-pale); color: var(--red); border: 1.5px solid #f0b0b0; }
.jav.retard { background: var(--orange-pale); color: var(--orange); border: 1.5px solid #f0c080; }
.jav.sortie { background: var(--purple-pale); color: var(--purple); border: 1.5px solid #c4a8ef; }
.jinfo { flex: 1; min-width: 0; }
.jnom { font-size: 13px; font-weight: 500; color: var(--ink); }
.jmeta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.jalerte-txt { font-size: 10.5px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.jalerte-txt.red { color: var(--red); }
.jalerte-txt.amb { color: var(--orange); }
.jalerte-txt.grn { color: var(--sage); }

/* Status pills */
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.sp-present { background: var(--sage-pale); color: var(--sage); border: 1px solid #a8d5c9; }
.sp-permission { background: var(--warm-gray); color: var(--text-muted); border: 1px solid var(--border); }
.sp-hosp { background: var(--blue-pale); color: var(--blue); border: 1px solid #a8c4ef; }
.sp-fugue { background: var(--red-pale); color: var(--red); border: 1px solid #f0b0b0; }
.sp-retard { background: var(--orange-pale); color: var(--orange); border: 1px solid #f0c080; }
.sp-sortie { background: var(--purple-pale); color: var(--purple); border: 1px solid #c4a8ef; }

/* Mouvement timeline */
.mv-item { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.mv-item:last-child { border-bottom: none; }
.mv-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.mv-line { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mv-connector { flex: 1; width: 1.5px; background: var(--border); min-height: 16px; }
.mv-content { flex: 1; }
.mv-label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.mv-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mv-time { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* Alerte banner */
.alerte-banner { border-radius: 12px; padding: 12px 16px; display: flex; align-items: flex-start; gap: 11px; margin-bottom: 14px; }
.ab-r { background: var(--red-pale); border: 1px solid rgba(224,82,82,.15); }
.ab-a { background: var(--orange-pale); border: 1px solid rgba(217,119,6,.15); }
.ab-g { background: var(--sage-pale); border: 1px solid rgba(74,124,111,.15); }
.ab-ico { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.ab-ttl { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.ab-txt { font-size: 11.5px; opacity: .85; line-height: 1.5; }
.ab-act { margin-top: 8px; }
@keyframes flash { 0%, 100% { background: var(--red-pale); } 50% { background: rgba(224,82,82,.04); } }
.flash { animation: flash 2s ease infinite; }

/* Facturation table */
.fact-table { width: 100%; border-collapse: collapse; }
.fact-table th { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--border); background: var(--warm-gray); }
.fact-table td { font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid rgba(224,217,208,.5); }
.fact-table tr:hover td { background: var(--warm-gray); }
.fact-table tr:last-child td { border-bottom: none; }
.fact-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.fact-fill { height: 100%; border-radius: 2px; background: var(--sage); }

/* ─── Modales ─── */
.mo { position: fixed; inset: 0; background: rgba(26,26,46,.45); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.mo.open { display: flex; }
.mo-box { background: var(--white); border-radius: 14px; width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(26,26,46,.22); }
.mo-hd { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--white); z-index: 1; }
.mo-ttl { font-family: 'DM Serif Display', serif; font-size: 18px; font-weight: 400; }
.mo-cl { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--warm-gray); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; line-height: 1; transition: background .12s; }
.mo-cl:hover { background: var(--border); }
.mo-bd { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.mo-ft { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fl { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.fi { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 13px; background: var(--white); color: var(--ink); outline: none; transition: border-color .15s; }
.fi:focus { border-color: var(--sage); }
.fg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-main { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
.g6 { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 16px; }
.g3-col { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }
.legende { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.leg-item { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.leg-swatch { width: 10px; height: 10px; }

/* Type grid (modal présences) */
.type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.type-opt { padding: 10px 8px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; text-align: center; transition: all .15s; }
.type-opt:hover { border-color: #c8c0b5; background: var(--warm-gray); }
.type-opt.on { font-weight: 600; }
.type-opt .to-ico { font-size: 20px; margin-bottom: 5px; }
.type-opt .to-lbl { font-size: 11px; font-weight: 500; }
.type-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; text-align: center; transition: all .15s; }
.type-card:hover { border-color: #c8c0b5; background: var(--warm-gray); }
.type-card input[type="radio"] { display: none; }
.type-card:has(input:checked) { border-color: var(--sage); background: var(--sage-pale); }
.type-icon { font-size: 20px; }
.type-lbl { font-size: 11px; font-weight: 500; color: var(--ink); }

/* Indicator row */
.ind-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ind-row:last-child { border-bottom: none; }
.ind-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ind-label { flex: 1; font-size: 12.5px; }
.ind-val { font-size: 13px; font-weight: 600; }

/* Countdown */
.countdown { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.cd-retard { background: var(--red-pale); color: var(--red); }
.cd-ok { background: var(--sage-pale); color: var(--sage); }
.cd-warn { background: var(--orange-pale); color: var(--orange); }

/* ═══ TRANSFERTS INTER-ÉTABLISSEMENTS ═══════════════════════════════════ */

/* Stats row */
.tr-stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.tr-stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.tr-stat-val { font-family: 'Playfair Display', serif; font-size: 26px; color: var(--ink); line-height: 1; }
.tr-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.tr-stat-delta { font-size: 11px; color: var(--sage); font-weight: 600; margin-top: 2px; }

/* Tabs */
.tr-tabs { display: flex; gap: 2px; background: var(--warm-gray); border-radius: 10px; padding: 3px; margin-bottom: 24px; width: fit-content; }
.tr-tab { padding: 7px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-muted); background: none; border: none; font-family: inherit; transition: all .15s; }
.tr-tab.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* List rows */
.transfert-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.transfert-row:last-child { border-bottom: none; }
.transfert-row:hover { background: var(--warm-gray); }
.tr-avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--sage-pale); color: var(--sage); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.tr-avatar-blue { background: var(--blue-pale); color: var(--blue); }
.tr-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.tr-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.tr-right { margin-left: auto; text-align: right; }
.tr-date { font-size: 11px; color: var(--text-muted); }

/* Status badges */
.tr-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 100px; }
.tr-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.s-attente { background: var(--orange-pale); color: var(--orange); }
.s-consulte { background: var(--blue-pale); color: var(--blue); }
.s-accepte { background: var(--sage-pale); color: var(--sage); }
.s-refuse { background: var(--red-pale); color: var(--red); }
.s-expire { background: var(--warm-gray); color: var(--text-muted); }
.s-annule { background: var(--warm-gray); color: var(--text-muted); }

/* Modal overlay (transfert-specific) */
.tr-modal-overlay { position: fixed; inset: 0; background: rgba(20,18,14,.45); z-index: 500; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.tr-modal-overlay.open { display: flex; }

/* Aperçu dossier */
.apercu-card { background: var(--sage-pale); border: 1px solid #b0d5cb; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.apercu-name { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--sage); margin-bottom: 4px; }
.apercu-meta { font-size: 12px; color: var(--sage-light); margin-bottom: 16px; }
.apercu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.apercu-field { background: rgba(255,255,255,.6); border-radius: 8px; padding: 10px 12px; }
.apercu-field-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--sage); margin-bottom: 2px; font-weight: 600; }
.apercu-field-val { font-size: 13px; color: var(--ink); font-weight: 500; }
.docs-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.doc-chip { font-size: 11px; padding: 4px 10px; background: rgba(255,255,255,.8); border: 1px solid #b0d5cb; border-radius: 100px; color: var(--sage); }

/* Timeline mini */
.timeline-mini { padding: 0; margin: 0; list-style: none; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--sage-pale); border: 2px solid #b0d5cb; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.tl-content { flex: 1; padding-top: 4px; }
.tl-text { font-size: 13px; color: var(--ink); }
.tl-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Code block */
.code-block { background: #1C3D35; border-radius: 16px; padding: 32px; text-align: center; }
.code-value { font-family: 'Playfair Display', serif; font-size: 48px; color: #fff; letter-spacing: .15em; margin-bottom: 8px; }
.code-expiry { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 20px; }
.code-copy { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.code-copy:hover { background: rgba(255,255,255,.25); }
.code-warning { background: rgba(255,255,255,.08); border-radius: 8px; padding: 10px 14px; font-size: 12px; color: rgba(255,255,255,.6); margin-top: 16px; }

/* Stepper */
.tr-steps { display: flex; margin-bottom: 28px; }
.tr-step { flex: 1; text-align: center; position: relative; }
.tr-step:not(:last-child)::after { content: ''; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.tr-step.tr-step-done::after { background: var(--sage-light); }
.tr-step-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); position: relative; z-index: 1; transition: all .3s; }
.tr-step.tr-step-active .tr-step-dot { border-color: var(--sage); background: var(--sage); color: #fff; }
.tr-step.tr-step-done .tr-step-dot { border-color: var(--sage-light); background: var(--sage-light); color: #fff; }
.tr-step-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.tr-step.tr-step-active .tr-step-label { color: var(--sage); font-weight: 600; }
.tr-step.tr-step-done .tr-step-label { color: var(--sage-light); }

/* Toast notification */
.tr-toast { position: fixed; bottom: 24px; right: 24px; background: #1C3D35; color: #fff; padding: 14px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 500; z-index: 9999; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: popIn .2s ease; max-width: 400px; }


/* ═══ NAV DROPDOWNS (avatar + role switcher DEV) ═══════════════════════════ */

.nav-dropdown {
    position: relative;
    cursor: pointer;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    min-width: 220px;
    z-index: 9000;
    overflow: hidden;
    border: 1px solid var(--border, #e8e4de);
}

.nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
}

/* ── DEV switch menu ─────────────────────────────────────── */

.dev-switch-header {
    padding: 9px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    background: var(--cream, #faf8f4);
    border-bottom: 1px solid var(--border, #e8e4de);
}

.dev-switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text-primary, #1c1a17);
    transition: background .12s;
    font-size: 13px;
}

.dev-switch-item:hover { background: var(--sage-pale, #e8f0ee); }
.dev-switch-item.dev-switch-current { background: var(--sage-pale, #e8f0ee); }

.dev-sw-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.dev-sw-info {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    flex: 1;
}
.dev-sw-info strong { font-size: 13px; font-weight: 600; }
.dev-sw-info em     { font-style: normal; font-size: 11px; color: var(--text-muted); }

.dev-sw-check {
    font-size: 13px;
    color: var(--sage, #4a7c6f);
    font-weight: 700;
}

/* ── Logout menu ─────────────────────────────────────────── */

.dev-logout-user {
    padding: 12px 16px;
    background: var(--cream, #faf8f4);
    border-bottom: 1px solid var(--border, #e8e4de);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dev-logout-user strong { font-size: 13px; font-weight: 600; color: var(--text-primary, #1c1a17); }
.dev-logout-user span   { font-size: 11px; color: var(--text-muted); }

.dev-logout-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: #c0392b;
    font-size: 13px;
    font-weight: 500;
    transition: background .12s;
}
.dev-logout-menu a:hover { background: #fff0f0; }
