/* AMOPY Dashboard — custom.css v10 (sidebar 6 items + homepage opiniâtré) */

:root {
    --pri: #1a4f7a;
    --pri-light: #2874a6;
    --acc: #0f766e;
    --green: #16a34a;
    --orange: #d97706;
    --red: #dc2626;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --sidebar: #1e293b;
    --sidebar-text: #cbd5e1;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    height: 100%;
}

main { padding: 0; }
section { padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; color: var(--text); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; margin-bottom: 16px; }
h4 { font-size: 14px; margin-bottom: 10px; }
p { margin: 0; }
a { color: var(--pri); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
small { font-size: 12px; color: var(--text-muted); }
ul { margin: 0; padding-left: 20px; }
details { padding: 4px 0; }
summary { cursor: pointer; padding: 8px 0; font-weight: 500; }
summary:hover { color: var(--pri); }
details[open] summary { color: var(--pri); }

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

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    padding: 0 20px 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}
.logo-circle {
    width: 38px; height: 38px;
    background: var(--pri-light);
    color: white;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 17px;
}
.brand-name { color: white; font-weight: 600; font-size: 15px; }
.brand-sub { color: var(--sidebar-text); font-size: 11px; opacity: 0.7; }

.sidebar-nav { flex: 1; padding: 0 12px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: white; }
.sidebar-nav a.active { background: var(--pri); color: white; }
.sidebar-nav a svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.badge-new {
    position: absolute;
    right: 12px;
    background: var(--orange);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}
.sync-info { display: flex; align-items: center; gap: 6px; }
.sync-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.sync-dot.sync-green { background: var(--green); animation: pulse 2s infinite; }
.sync-dot.sync-orange { background: var(--orange); }
.sync-dot.sync-red { background: var(--red); }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Main content ───────────────────────────────────────────────────────── */
.main-content { padding: 32px 40px; max-width: 1400px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { margin-bottom: 4px; }
.page-header p { font-size: 13px; }

/* ─── ACCUEIL : Bannière situation ───────────────────────────────────────── */
.situation-banner {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.situation-banner h1 {
    font-size: 22px;
    text-transform: capitalize;
    color: var(--text);
    margin-bottom: 6px;
}
.situation-summary {
    font-size: 14px;
    color: var(--text-muted);
}

/* ─── ACCUEIL : Alertes ──────────────────────────────────────────────────── */
.alerts-zone {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.alert-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 8px;
    background: white;
    border-left: 4px solid var(--orange);
    box-shadow: var(--shadow-sm);
}
.alert-card.alert-red { border-left-color: var(--red); background: #fef2f2; }
.alert-card.alert-orange { border-left-color: var(--orange); background: #fffbeb; }
.alert-card.alert-success { border-left-color: var(--green); background: #f0fdf4; }
.alert-icon { font-size: 22px; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; font-size: 14px; }
.alert-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.alert-action {
    background: var(--pri);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}
.alert-action:hover { background: var(--pri-light); }

/* ─── ACCUEIL : Cards sessions ───────────────────────────────────────────── */
.section-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.session-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.session-card {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
}
.session-card:hover { border-color: var(--pri-light); box-shadow: var(--shadow); }
.session-card-date {
    text-align: center;
    background: var(--bg);
    border-radius: 6px;
    padding: 10px 6px;
    line-height: 1;
}
.date-day-big { font-size: 24px; font-weight: 700; color: var(--text); }
.date-month-big { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }
.session-card-title {
    font-weight: 500;
    font-size: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.session-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}
.session-card-meta .paiement-warn { color: var(--orange); font-weight: 500; }
.session-card-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}
.session-card-progress .progress-bar { flex: 1; max-width: 200px; }
.progress-label { font-size: 11px; color: var(--text-muted); font-weight: 500; min-width: 90px; }
.session-card-status { text-align: right; }

/* ─── ACCUEIL : CTA Formateur ─────────────────────────────────────────────── */
.formateur-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    background: #eff6ff;
    border-left: 4px solid var(--pri);
    border-radius: 8px;
    margin-bottom: 20px;
}
.formateur-cta-title { font-weight: 600; font-size: 14px; }
.formateur-cta-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── ACCUEIL : 3 chiffres mensuels ──────────────────────────────────────── */
.monthly-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.monthly-stat {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: left;
    box-shadow: var(--shadow-sm);
}
.monthly-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.monthly-value { font-size: 22px; font-weight: 700; color: var(--text); }
.monthly-unit { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

/* ─── Status badges ──────────────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-planifiee { background: #dbeafe; color: #1e40af; }
.status-en_cours { background: #fef3c7; color: #92400e; }
.status-terminee { background: #f1f5f9; color: var(--text-muted); }
.status-annulee { background: #fee2e2; color: #991b1b; }

/* ─── Formation tag ──────────────────────────────────────────────────────── */
.formation-tag {
    display: inline-block;
    background: var(--pri);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ─── Filters chips ──────────────────────────────────────────────────────── */
.filters-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--pri); color: white; border-color: var(--pri); }
.chip-count {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}
.chip:not(.active) .chip-count { background: var(--border); color: var(--text-muted); }
.chip-formation.active { background: var(--acc); border-color: var(--acc); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    background: var(--bg);
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.row-clickable { cursor: pointer; transition: background 0.15s; }
.data-table tbody tr.row-clickable:hover { background: var(--bg); }
.data-table.compact td { padding: 6px 8px; font-size: 12px; }
.cell-mono { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 12px; color: var(--text-muted); }
.cell-sub { font-size: 11px; }
.row-statut-absent { opacity: 0.5; }
.row-statut-annule { opacity: 0.4; text-decoration: line-through; }

/* ─── Metric pills ───────────────────────────────────────────────────────── */
.metric-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    min-width: 42px;
    text-align: center;
}
.metric-pill.metric-good { background: #dcfce7; color: var(--green); }
.metric-pill.metric-warn { background: #fef3c7; color: var(--orange); }
.metric-pill.metric-bad { background: #fee2e2; color: var(--red); }
.metric-pill.metric-empty { background: var(--bg); color: var(--text-muted); }

/* ─── Conformité badge ───────────────────────────────────────────────────── */
.conformite-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    min-width: 50px;
    text-align: center;
}
.conformite-badge.conf-good { background: #dcfce7; color: var(--green); }
.conformite-badge.conf-warn { background: #fef3c7; color: var(--orange); }
.conformite-badge.conf-bad { background: #fee2e2; color: var(--red); }

/* ─── PAIEMENTS : Finance grid ───────────────────────────────────────────── */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.finance-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.finance-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: 8px;
}
.finance-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.finance-sub { font-size: 12px; }
.finance-card.fin-direct { border-top: 3px solid var(--pri); }
.finance-card.fin-dpc { border-top: 3px solid var(--green); }
.finance-card.fin-faf_pm { border-top: 3px solid var(--orange); }

/* ─── ESPACE FORMATEUR ───────────────────────────────────────────────────── */
.formateur-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.formateur-selector label { font-weight: 500; font-size: 14px; }
.formateur-selector select {
    flex: 1;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}
.badge-auto {
    background: var(--green);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.formateur-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.formateur-after { background: #f0fdf4; border-color: var(--green); }

/* ─── CONFORMITÉ : qualiopi grid ─────────────────────────────────────────── */
.qualiopi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (min-width: 1100px) {
    .qualiopi-grid { grid-template-columns: repeat(4, 1fr); }
}
.qualiopi-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.qualiopi-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.qualiopi-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.qualiopi-num {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    cursor: help;
}
.progress-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar.conf-bg { background: var(--border); }
.progress-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 5px;
}
.progress-bar-fill.conf-good { background: var(--green); }
.progress-bar-fill.conf-warn { background: var(--orange); }
.progress-bar-fill.conf-bad { background: var(--red); }
.progress-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}
.progress-value small { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.qualiopi-desc { font-size: 12px; line-height: 1.4; }

.weakness-tag {
    display: inline-block;
    background: #fee2e2;
    color: var(--red);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 2px;
}

.empty-state, .empty-state-cell {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Financement tag ────────────────────────────────────────────────────── */
.financ-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}
.financ-tag.financ-direct { background: #dbeafe; color: #1e40af; }
.financ-tag.financ-faf_pm { background: #fef3c7; color: #92400e; }
.financ-tag.financ-dpc { background: #dcfce7; color: var(--green); }
.financ-tag.financ-opco { background: #fce7f3; color: #9d174d; }
.financ-tag.financ-autre { background: var(--bg); color: var(--text-muted); }

/* ─── Pastilles status ───────────────────────────────────────────────────── */
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-green { background: var(--green); }
.dot-grey { background: var(--border-strong); }
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }

/* ─── TABS ───────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--pri); border-bottom-color: var(--pri); }

/* ─── DOSSIER CHECKLIST ──────────────────────────────────────────────────── */
.dossier-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dossier-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.dossier-checklist li:last-child { border-bottom: none; }

.export-list {
    list-style: none;
    padding: 16px 20px;
    margin: 16px 0;
    background: var(--bg);
    border-radius: 8px;
}
.export-list li {
    padding: 6px 0;
    font-size: 13px;
}

/* ─── DRAWER ─────────────────────────────────────────────────────────────── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 99;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed;
    top: 0;
    right: -700px;
    width: 700px;
    max-width: 95vw;
    height: 100vh;
    background: white;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.1);
    transition: right 0.25s ease;
    z-index: 100;
    overflow-y: auto;
}
.drawer.open { right: 0; }
.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1;
}
.drawer-header h2 { flex: 1; font-size: 16px; }
.btn-icon-close {
    background: white;
    border: 1px solid var(--border-strong);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}
.btn-icon-close:hover { background: var(--bg); }

.drawer-content { padding: 20px; }
.drawer-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.drawer-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.drawer-kpis > div {
    text-align: center;
    padding: 14px;
    background: var(--bg);
    border-radius: 6px;
}
.drawer-kpis strong { font-size: 22px; color: var(--text); display: block; }
.drawer-kpis .muted { font-size: 12px; }
.drawer-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-small {
    font-family: inherit;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-primary {
    background: var(--pri);
    color: white;
    border: 1px solid var(--pri);
    padding: 10px 18px;
    font-size: 14px;
}
.btn-primary:hover { background: var(--pri-light); border-color: var(--pri-light); }
.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 10px 18px;
    font-size: 14px;
}
.btn-secondary:hover { background: var(--bg); }
.btn-small {
    background: white;
    color: var(--pri);
    border: 1px solid var(--border-strong);
    padding: 4px 10px;
    font-size: 12px;
}
.btn-small:hover { background: var(--pri); color: white; border-color: var(--pri); }

/* ─── AIDE ───────────────────────────────────────────────────────────────── */
.aide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.aide-grid .section-block { margin-bottom: 0; }
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
}
.faq-item:last-of-type { border-bottom: none; }
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 0;
    font-weight: 500;
    color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
    content: '+';
    margin-right: 10px;
    font-weight: 300;
    font-size: 18px;
    color: var(--pri);
    display: inline-block;
    transition: transform 0.2s;
}
.faq-item[open] summary::before { content: '−'; }
.faq-item p {
    padding: 4px 0 12px 24px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}
.auto-status {
    list-style: none;
    padding: 0;
    font-size: 13px;
}
.auto-status li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.aide-contact { background: #eff6ff; border-color: var(--pri); }

/* ─── TOAST ──────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--sidebar);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    font-size: 14px;
    font-weight: 500;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ─── Loading ────────────────────────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: white;
    z-index: 1000;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   HUB FORMATEUR — recréation du hub-amopy-processus.netlify.app
   ═══════════════════════════════════════════════════════════════════════════ */

/* Timeline 8 étapes parcours stagiaire */
.hub-timeline {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    position: relative;
    margin: 16px 0 8px;
}
.hub-timeline::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: var(--pri-light);
    z-index: 0;
}
.hub-tl-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 6px;
    position: relative;
    z-index: 1;
}
.hub-tl-dot {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    color: white;
}
.hub-tl-dot.blue   { background: #2563eb; }
.hub-tl-dot.green  { background: #16a34a; }
.hub-tl-dot.orange { background: #d97706; }
.hub-tl-dot.purple { background: #7c3aed; }
.hub-tl-dot.teal   { background: #0891b2; }
.hub-tl-dot.indigo { background: #4f46e5; border-style: dashed; opacity: 0.85; }
.hub-tl-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.hub-tl-sub { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.hub-tl-optional {
    font-size: 10px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 4px;
    padding: 1px 6px;
    margin-top: 4px;
    display: inline-block;
    font-weight: 600;
}

/* Alert info */
.hub-alert {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    align-items: flex-start;
}
.hub-alert-green { background: #f0fdf4; border-left: 3px solid var(--green); }
.hub-alert span { font-size: 18px; }

/* Workflow cards grid */
.hub-wf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 1100px) { .hub-wf-grid { grid-template-columns: repeat(3, 1fr); } }
.hub-wf-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.hub-wf-card:hover { box-shadow: var(--shadow); }
.hub-wf-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hub-wf-num {
    background: var(--pri);
    color: white;
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.hub-wf-title { font-size: 14px; font-weight: 700; color: var(--text); }
.hub-wf-trigger { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.hub-wf-body { font-size: 12px; color: #475569; margin-bottom: 10px; line-height: 1.5; }
.hub-wf-status { font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.hub-wf-status.on { color: var(--green); }
.hub-wf-copy {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11px;
    color: #1e40af;
    line-height: 1.5;
}
.hub-wf-copy strong {
    display: block; margin-bottom: 2px;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Subsection labels */
.hub-subsection-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--text);
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hub-subsection-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-style: italic;
}

/* Links grid */
.hub-links-grid    { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hub-links-grid-3  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) {
    .hub-links-grid   { grid-template-columns: repeat(4, 1fr); }
    .hub-links-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.hub-link {
    background: white;
    border-radius: 10px;
    padding: 14px 12px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: all 0.2s;
}
.hub-link:hover {
    background: #f0f9ff;
    border-color: var(--pri-light);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.hub-link.admin { background: #f8fafc; opacity: 0.85; }
.hub-link.admin:hover { opacity: 1; }
.hub-link-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.hub-link-label { font-size: 13px; font-weight: 700; }
.hub-link-sub { font-size: 11px; color: var(--text-muted); }

.bg-blue   { background: #eff6ff; }
.bg-green  { background: #f0fdf4; }
.bg-purple { background: #faf5ff; }
.bg-teal   { background: #f0fdfa; }
.bg-orange { background: #fff7ed; }
.bg-yellow { background: #fefce8; }
.bg-gray   { background: #f8fafc; }

/* QR Codes grid */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 900px) { .qr-grid { grid-template-columns: repeat(4, 1fr); } }
.qr-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.qr-card img {
    width: 130px;
    height: 130px;
    border-radius: 6px;
}
.qr-label { font-size: 13px; font-weight: 700; }
.qr-sub { font-size: 11px; color: var(--text-muted); }
.qr-dl-btn {
    margin-top: 6px;
    background: var(--pri);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.qr-dl-btn:hover { background: var(--pri-light); }

/* Checklist 2 colonnes */
.hub-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 800px) { .hub-two-col { grid-template-columns: 1fr; } }
.hub-cl-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.hub-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hub-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.hub-checklist li:last-child { border-bottom: none; }
.hub-checklist li.auto { color: var(--green); font-weight: 500; }
.hub-checklist input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Contacts grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 800px) { .contacts-grid { grid-template-columns: 1fr; } }
.contact-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.contact-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.contact-name { font-weight: 700; font-size: 14px; }
.contact-role { font-size: 12px; margin-top: 1px; }
.contact-email { font-size: 12px; color: var(--pri); text-decoration: none; display: inline-block; margin-top: 2px; }
.contact-email:hover { text-decoration: underline; }

/* Finance card variations */
.finance-card.fin-total { border-top: 3px solid var(--text); }

/* ═══ DRAWER : Onglets enrichis (Profils / QCM / Évaluations) ═══════════════ */

/* Profils & attentes */
.profil-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.profil-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.profil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}
.profil-grid > div { font-size: 13px; }
.profil-grid > div strong { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
.profil-grid > div p { margin-top: 2px; }
.profil-wide { grid-column: span 2; }

/* QCM */
.qcm-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg);
    padding: 18px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--pri);
    margin-bottom: 8px;
}
.qcm-stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.qcm-stat-value { font-size: 24px; font-weight: 700; color: var(--text); }
.qcm-stat-value.prog-positive { color: var(--green); }
.qcm-arrow { font-size: 28px; color: var(--text-muted); align-self: center; }
.qcm-prog { margin-left: auto; }
.prog-positive { color: var(--green); font-weight: 600; }

/* Évaluations détaillées */
.eval-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: var(--bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-align: center;
}
.eval-summary strong { font-size: 22px; color: var(--text); display: block; margin-top: 4px; }
.eval-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.eval-card-froid { border-left: 3px solid var(--acc); }
.eval-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.eval-note-big {
    font-size: 20px;
    font-weight: 700;
    color: var(--pri);
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 6px;
}
.eval-criteres {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}
.critere-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.critere-label { color: var(--text-muted); flex: 1; }
.critere-value { font-weight: 600; color: var(--text); }
.eval-commentaire {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fef3c7;
    border-left: 3px solid var(--orange);
    border-radius: 6px;
    font-size: 13px;
}
.eval-commentaire p { margin-top: 4px; font-style: italic; color: #475569; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .layout { grid-template-columns: 70px 1fr; }
    .sidebar-brand > div:last-child, .sidebar-nav a span, .sidebar-footer, .brand-sub { display: none; }
    .sidebar-brand { justify-content: center; padding: 0 10px 24px; }
    .sidebar-nav a { justify-content: center; padding: 12px; }
    .main-content { padding: 20px; }
    .qualiopi-grid, .finance-grid, .monthly-numbers { grid-template-columns: 1fr 1fr; }
    .aide-grid { grid-template-columns: 1fr; }
    .drawer { width: 100vw; }
    .session-card { grid-template-columns: 50px 1fr; }
    .session-card-status { display: none; }
}
