/* ============================================================================
   Pilotage KPI - Formation, Planification & Évaluation - OFPPT
   Feuille de style unique - variables CSS, thème clair, responsive mobile-first
   ============================================================================ */

:root {
    /* Palette alignée sur le sceau OFPPT (assets/img/logo.png : losanges vert/bleu/gris sur
       fond navy) — le bleu et le vert sont calés sur les teintes échantillonnées du logo
       (#0050a0 / #008040) plutôt que sur un bleu/vert générique, pour une identité mémorable
       et cohérente avec la marque. */
    --navy-900: #0f2440;
    --navy-800: #16305a;
    --navy-700: #1e3a6e;
    --blue-600: #0d63b8;
    --blue-500: #2f7fd1;
    --blue-100: #dce8f7;
    --gold-500: #b08d3e;
    --gold-400: #c7a350;
    --gold-100: #f5ecd8;
    --green-600: #0a8a4b;
    --green-100: #d8f3e3;
    --amber-600: #d97706;
    --amber-100: #fef3c7;
    --red-600: #dc2626;
    --red-100: #fee2e2;
    --grey-50: #f7f8fa;
    --grey-100: #eef1f5;
    --grey-200: #e2e6ec;
    --grey-300: #cbd2dc;
    --grey-500: #6b7280;
    --grey-700: #374151;
    --grey-900: #111827;
    --white: #ffffff;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
    --shadow-brand: 0 10px 24px rgba(13, 99, 184, .18);
    --brand-gradient: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--blue-600) 130%);
    --accent-gradient: linear-gradient(90deg, var(--green-600), var(--blue-600) 50%, var(--gold-500));
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-fast: 160ms ease;
    --transition-lift: 220ms cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: var(--font-main);
    background: var(--grey-50);
    color: var(--grey-900);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0 0 8px; font-weight: 700; color: var(--navy-900); }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0; padding-left: 20px; }
table { border-collapse: collapse; width: 100%; }
img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--grey-200); margin: 16px 0; }

/* ---------------------------------------------------------------------- */
/* LAYOUT GENERAL                                                          */
/* ---------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--brand-gradient);
    color: var(--white);
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast);
    box-shadow: 2px 0 0 0 rgba(255,255,255,.04) inset;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    position: relative;
}
.sidebar-brand::after {
    content: ""; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 2px;
    background: var(--accent-gradient); opacity: .8;
}
.sidebar-logo {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--white); padding: 2px; box-shadow: 0 0 0 2px rgba(255,255,255,.15), var(--shadow-sm);
}
.sidebar-brand .logo-badge {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--gold-500);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: var(--navy-900); font-size: 15px;
}
.sidebar-brand-text { font-size: 14px; font-weight: 700; line-height: 1.25; }
.sidebar-brand-text small { display: block; font-weight: 400; opacity: .7; font-size: 11px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.sidebar-section-label {
    text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em;
    color: rgba(255,255,255,.45); padding: 14px 12px 6px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.82); font-size: 14px; font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), padding-left var(--transition-fast);
}
.sidebar-link:hover { background: rgba(255,255,255,.08); text-decoration: none; color: var(--white); padding-left: 16px; }
.sidebar-link.active {
    background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
    color: var(--navy-900); font-weight: 700;
    box-shadow: var(--shadow-md);
}
.sidebar-link .icon { width: 18px; text-align: center; font-size: 15px; }

.sidebar-footer {
    padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1);
    font-size: 12.5px; color: rgba(255,255,255,.55);
}

.main-content { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--grey-200);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 30;
}
.topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--accent-gradient); opacity: .55;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--navy-900); }
.topbar-title .subtitle { display: block; font-size: 12px; font-weight: 400; color: var(--grey-500); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.topbar-user .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--blue-100); color: var(--blue-600);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.menu-toggle {
    display: inline-flex; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--navy-900);
    transition: transform var(--transition-fast);
}
.menu-toggle:hover { transform: scale(1.1); }

/* Sidebar repliable (desktop) : bascule via #menuToggle, état mémorisé côté client. */
.app-shell.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.app-shell.sidebar-collapsed .main-content { margin-left: 0; }

.page-body { padding: 24px; flex: 1; width: 100%; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-header-text .eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: .07em; color: var(--gold-500); font-weight: 700; margin-bottom: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.overlay-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,36,64,.5); z-index: 35;
}

/* ---------------------------------------------------------------------- */
/* GRID / LAYOUT HELPERS                                                   */
/* ---------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--grey-500); }
.text-danger { color: var(--red-600); }
.text-success { color: var(--green-600); }
.text-warning { color: var(--amber-600); }
.text-sm { font-size: 12.5px; }
.text-lg { font-size: 18px; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------------- */
/* MOTION - entrées douces + survols, désactivés sous prefers-reduced-motion */
/* ---------------------------------------------------------------------- */
@keyframes cardRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------------- */
/* CARDS                                                                   */
/* ---------------------------------------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: box-shadow var(--transition-lift), transform var(--transition-lift), border-color var(--transition-lift);
    animation: fadeIn .35s ease both;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--grey-300); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-header h3 { margin: 0; }
.card-header .card-subtitle { color: var(--grey-500); font-size: 12.5px; margin-top: 2px; }
.card-flat { box-shadow: none; }
.card-compact { padding: 14px 16px; }

/* KPI tiles */
.kpi-tile {
    background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg);
    padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
    transition: box-shadow var(--transition-lift), transform var(--transition-lift);
    animation: cardRise .4s var(--transition-lift) both;
}
.kpi-tile:hover { box-shadow: var(--shadow-brand); transform: translateY(-3px); }
.kpi-tile::before {
    content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--blue-500);
}
.kpi-tile.accent-green::before { background: var(--green-600); }
.kpi-tile.accent-amber::before { background: var(--amber-600); }
.kpi-tile.accent-red::before { background: var(--red-600); }
.kpi-tile.accent-gold::before { background: var(--gold-500); }
.kpi-tile-label { font-size: 12.5px; color: var(--grey-500); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.kpi-tile-value { font-size: 30px; font-weight: 800; color: var(--navy-900); line-height: 1; }
.kpi-tile-value small { font-size: 15px; font-weight: 600; color: var(--grey-500); }
.kpi-tile-footer { margin-top: 10px; font-size: 12.5px; color: var(--grey-500); display: flex; align-items: center; gap: 6px; }
.kpi-trend-up { color: var(--green-600); font-weight: 700; }
.kpi-trend-down { color: var(--red-600); font-weight: 700; }

.chart-box { position: relative; width: 100%; }
.chart-box.h-220 { height: 220px; } .chart-box.h-260 { height: 260px; } .chart-box.h-320 { height: 320px; }

.chart-legend-manual { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grey-200); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--grey-700); }
.chart-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* BADGES / ALERTS                                                        */
/* ---------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .02em;
}
.badge-success { background: var(--green-100); color: var(--green-600); }
.badge-warning { background: var(--amber-100); color: var(--amber-600); }
.badge-danger  { background: var(--red-100); color: var(--red-600); }
.badge-info    { background: var(--blue-100); color: var(--blue-600); }
.badge-neutral { background: var(--grey-100); color: var(--grey-700); }

.alert-box { border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 10px; border-left: 4px solid; font-size: 13.5px; }
.alert-box.critique { background: var(--red-100); border-color: var(--red-600); color: #7f1d1d; }
.alert-box.moyen { background: var(--amber-100); border-color: var(--amber-600); color: #78350f; }
.alert-box.faible { background: var(--blue-100); border-color: var(--blue-600); color: #1e3a8a; }
.alert-box .alert-title { font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }

.flash-message { border-radius: var(--radius-md); padding: 12px 18px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--green-100); color: #065f46; border: 1px solid #6ee7b7; }
.flash-error { background: var(--red-100); color: #991b1b; border: 1px solid #fca5a5; }
.flash-info { background: var(--blue-100); color: #1e40af; border: 1px solid #93c5fd; }
.flash-warning { background: var(--amber-100); color: #92400e; border: 1px solid #fcd34d; }

/* ---------------------------------------------------------------------- */
/* TABLES                                                                  */
/* ---------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--grey-200); border-radius: var(--radius-md); }
table.data-table { width: 100%; font-size: 13.5px; }
table.data-table th {
    background: var(--grey-50); text-align: left; padding: 10px 14px;
    font-weight: 700; color: var(--grey-700); font-size: 12px; text-transform: uppercase; letter-spacing: .02em;
    border-bottom: 1px solid var(--grey-200); white-space: nowrap;
}
table.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--grey-100); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--grey-50); }
table.data-table .cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 30px; text-align: center; color: var(--grey-500); font-size: 13.5px; }

/* Tri et filtres génériques des tableaux (.data-table) */
th.sortable-th { cursor: pointer; user-select: none; position: relative; padding-right: 20px; }
th.sortable-th:hover { background: var(--grey-100); }
th.sortable-th .sort-indicator { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 9px; opacity: .35; }
th.sortable-th .sort-indicator::after { content: '\25B2\25BC'; letter-spacing: -2px; }
th.sortable-th.sort-asc .sort-indicator::after { content: '\25B2'; opacity: 1; color: var(--blue-600); }
th.sortable-th.sort-desc .sort-indicator::after { content: '\25BC'; opacity: 1; color: var(--blue-600); }
th.sortable-th.sort-asc .sort-indicator, th.sortable-th.sort-desc .sort-indicator { opacity: 1; }
tr.filter-row th { background: var(--white); padding: 6px 8px; border-top: 1px solid var(--grey-200); }
tr.filter-row .column-filter-input {
    width: 100%; padding: 5px 8px; font-size: 12px; border: 1px solid var(--grey-300); border-radius: 4px;
    font-weight: 400; text-transform: none;
}
table.data-table tbody tr.hidden { display: none; }

.progress-bar { background: var(--grey-200); border-radius: 999px; height: 8px; overflow: hidden; width: 100%; min-width: 80px; }
.progress-bar-fill { height: 100%; border-radius: 999px; background: var(--blue-500); transition: width .4s ease; }
.progress-bar-fill.ok { background: var(--green-600); }
.progress-bar-fill.moyen { background: var(--amber-600); }
.progress-bar-fill.critique { background: var(--red-600); }
/* Classes utilitaires de largeur (pas de style inline) - paliers de 5% */
.w-p0{width:0%}.w-p5{width:5%}.w-p10{width:10%}.w-p15{width:15%}.w-p20{width:20%}.w-p25{width:25%}
.w-p30{width:30%}.w-p35{width:35%}.w-p40{width:40%}.w-p45{width:45%}.w-p50{width:50%}.w-p55{width:55%}
.w-p60{width:60%}.w-p65{width:65%}.w-p70{width:70%}.w-p75{width:75%}.w-p80{width:80%}.w-p85{width:85%}
.w-p90{width:90%}.w-p95{width:95%}.w-p100{width:100%}

/* ---------------------------------------------------------------------- */
/* FORMS                                                                   */
/* ---------------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }
label.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--grey-700); margin-bottom: 6px; }
.form-hint { font-size: 12px; color: var(--grey-500); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=search], input[type=file],
select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--grey-300); border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font-main); background: var(--white); color: var(--grey-900);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100);
}
textarea { resize: vertical; min-height: 80px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checkbox-line input { width: auto; }

.input-group { display: flex; }
.input-group input, .input-group select { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------------------------------------------------------------------- */
/* BUTTONS                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 700;
    border: 1px solid transparent; cursor: pointer; transition: all var(--transition-fast), transform var(--transition-lift), box-shadow var(--transition-lift);
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--navy-700); box-shadow: var(--shadow-brand); }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-500); box-shadow: 0 10px 24px rgba(176, 141, 62, .3); }
.btn-success { background: var(--green-600); color: var(--white); }
.btn-danger { background: var(--red-600); color: var(--white); }
.btn-outline { background: var(--white); color: var(--grey-700); border-color: var(--grey-300); }
.btn-outline:hover { background: var(--grey-50); border-color: var(--grey-500); }
.btn-ghost { background: transparent; color: var(--blue-600); }
.btn-ghost:hover { background: var(--blue-100); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------------------------------------------------------------------- */
/* TABS                                                                    */
/* ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--grey-200); margin-bottom: 20px; flex-wrap: wrap; }
.tab-link {
    padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--grey-500);
    border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tab-link:hover { color: var(--navy-900); text-decoration: none; }
.tab-link.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 160px; }

/* ---------------------------------------------------------------------- */
/* LOGIN PAGE                                                              */
/* ---------------------------------------------------------------------- */
.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--brand-gradient);
    background-size: 180% 180%;
    animation: brandDrift 14s ease-in-out infinite alternate;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-shell::before, .login-shell::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; pointer-events: none;
}
.login-shell::before { width: 420px; height: 420px; background: var(--green-600); top: -140px; left: -120px; }
.login-shell::after { width: 380px; height: 380px; background: var(--gold-500); bottom: -140px; right: -100px; }
@keyframes brandDrift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.login-card {
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 400px; padding: 36px 32px;
    position: relative; z-index: 1;
    animation: cardRise .5s var(--transition-lift) both;
}
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; text-align: center; }
.login-logo-img {
    width: 68px; height: 68px; border-radius: 50%; margin-bottom: 12px;
    box-shadow: 0 0 0 4px var(--grey-100), var(--shadow-md);
}
.login-logo .logo-badge {
    width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--gold-500);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: var(--navy-900);
    margin-bottom: 12px;
}
.login-logo h1 { font-size: 18px; margin-bottom: 2px; }
.login-logo p { color: var(--grey-500); font-size: 12.5px; margin: 0; }
.login-demo-accounts { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--grey-200); font-size: 12px; color: var(--grey-500); }
.login-demo-accounts code { background: var(--grey-100); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------------- */
/* EDT GRID (Emploi du temps)                                              */
/* ---------------------------------------------------------------------- */
.edt-grid-wrap { overflow-x: auto; border: 1px solid var(--grey-200); border-radius: var(--radius-md); }
table.edt-grid { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12.5px; }
table.edt-grid th, table.edt-grid td { border: 1px solid var(--grey-200); padding: 6px; vertical-align: top; }
table.edt-grid th { background: var(--navy-900); color: var(--white); font-size: 11.5px; text-transform: uppercase; padding: 8px 6px; }
table.edt-grid td.creneau-label { background: var(--grey-50); font-weight: 700; color: var(--grey-700); white-space: nowrap; font-size: 11.5px; }
.edt-cell { min-height: 64px; border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12px; min-width: 130px; }
.edt-cell.filled { background: var(--blue-100); border: 1px solid var(--blue-500); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.edt-cell.empty { background: var(--grey-50); border: 1px dashed var(--grey-300); display: flex; align-items: center; justify-content: center; color: var(--grey-300); min-height: 64px; }
.edt-cell .edt-module { font-weight: 700; color: var(--navy-900); display: block; margin-bottom: 2px; }
.edt-cell .edt-formateur { color: var(--grey-700); display: block; }
.edt-cell .edt-salle { color: var(--grey-500); font-size: 11px; display: block; margin-top: 2px; }
.edt-cell .edt-actions { margin-top: 6px; display: flex; gap: 4px; }
.edt-cell .edt-actions a, .edt-cell .edt-actions button { font-size: 11px; }

.legend-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0; font-size: 12.5px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-swatch.proposed { background: var(--white); border: 1px dashed var(--grey-700); }
.legend-swatch.valide { background: var(--white); border: 1px solid var(--grey-700); }
.legend-swatch.modifie { background: var(--white); border: 1px solid var(--grey-700); box-shadow: inset 4px 0 0 var(--gold-500); }
.legend-swatch.seance-presentiel { background: var(--blue-100); border: 1px solid var(--blue-500); }
.legend-swatch.seance-synchrone { background: var(--green-100); border: 1px solid var(--green-600); }
.legend-swatch.seance-efm { background: var(--red-100); border: 1px solid var(--red-600); }
.legend-swatch.type-presentiel { background: var(--white); border-top: 3px solid var(--blue-500); border-left: 1px solid var(--grey-300); border-right: 1px solid var(--grey-300); border-bottom: 1px solid var(--grey-300); }
.legend-swatch.type-synchrone { background: var(--white); border-top: 3px solid var(--green-600); border-left: 1px solid var(--grey-300); border-right: 1px solid var(--grey-300); border-bottom: 1px solid var(--grey-300); }

/* ---------------------------------------------------------------------- */
/* MISC COMPONENTS                                                         */
/* ---------------------------------------------------------------------- */
.stepper-upload {
    border: 2px dashed var(--grey-300); border-radius: var(--radius-lg); padding: 40px 20px;
    text-align: center; background: var(--grey-50); transition: border-color var(--transition-fast);
}
.stepper-upload:hover { border-color: var(--blue-500); }
.stepper-upload .upload-icon { font-size: 34px; margin-bottom: 10px; color: var(--blue-500); }

.import-progress-box { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--grey-200); border-radius: var(--radius-md); background: var(--grey-50); }
.import-progress-box.hidden { display: none; }
.import-progress-box.progress-error { border-color: var(--red-600); background: var(--red-100); }
.import-progress-box.progress-error .progress-bar-fill { background: var(--red-600); }

.avatar-lg {
    width: 56px; height: 56px; border-radius: 50%; background: var(--navy-800); color: var(--white);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
}

.timeline { border-left: 2px solid var(--grey-200); margin-left: 8px; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
    content: ""; position: absolute; left: -25px; top: 3px; width: 10px; height: 10px;
    border-radius: 50%; background: var(--blue-500); border: 2px solid var(--white);
}
.timeline-item .timeline-date { font-size: 11.5px; color: var(--grey-500); font-weight: 700; text-transform: uppercase; }

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(15,36,64,.55); z-index: 100;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--grey-200); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--grey-200); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--grey-500); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--grey-500); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }

.role-pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--navy-800); color: var(--white); }

/* ---------------------------------------------------------------------- */
/* DRAG & DROP - chips et zones de depot                                   */
/* ---------------------------------------------------------------------- */
.dnd-palette { display: flex; flex-wrap: wrap; gap: 8px; max-height: 480px; overflow-y: auto; padding: 4px; }
.dnd-chip {
    background: var(--white); border: 1px solid var(--grey-300); border-radius: var(--radius-sm);
    padding: 8px 10px; font-size: 12px; cursor: grab; box-shadow: var(--shadow-sm);
    width: 100%; transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.dnd-chip:active { cursor: grabbing; }
.dnd-chip:hover { box-shadow: var(--shadow-md); border-color: var(--blue-500); }
.dnd-chip .dnd-chip-title { font-weight: 700; color: var(--navy-900); display: block; }
.dnd-chip .dnd-chip-sub { color: var(--grey-500); display: block; font-size: 11px; margin-top: 2px; }
.dnd-chip.dnd-dragging { opacity: .4; }
.dnd-chip.urgent { border-left: 3px solid var(--red-600); }
.dnd-chip.en-cours { background: var(--gold-100); }
.dnd-chip .dnd-chip-encours { color: var(--amber-600); font-weight: 600; }
.dnd-chip.type-presentiel { border-top: 3px solid var(--blue-500); }
.dnd-chip.type-synchrone { border-top: 3px solid var(--green-600); }
.dnd-chip.filtered-out { display: none; }

.dnd-drop-zone { transition: background var(--transition-fast), border-color var(--transition-fast); }
.dnd-drop-zone.dnd-over { background: var(--blue-100) !important; border-color: var(--blue-500) !important; }

.matrix-grid-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--grey-200); border-radius: var(--radius-md); }
table.matrix-grid { border-collapse: collapse; font-size: 11.5px; width: max-content; min-width: 100%; }
table.matrix-grid th, table.matrix-grid td { border: 1px solid var(--grey-200); padding: 4px; }
table.matrix-grid th { background: var(--navy-900); color: var(--white); position: sticky; top: 0; z-index: 5; font-size: 10.5px; padding: 8px 6px; white-space: nowrap; }
table.matrix-grid td.row-label {
    background: var(--grey-50); font-weight: 700; color: var(--grey-700); white-space: nowrap;
    position: sticky; left: 0; z-index: 4; min-width: 150px; max-width: 190px; font-size: 11.5px;
}
table.matrix-grid th.corner { position: sticky; left: 0; top: 0; z-index: 6; }
.matrix-cell { min-width: 108px; min-height: 50px; border-radius: 4px; padding: 4px 6px; font-size: 10.5px; }
.matrix-cell.filled { background: var(--blue-100); border: 1px solid var(--blue-500); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Couleur d'une séance programmée selon son type : bleu Présentiel, vert Synchrone, rouge EFM (prioritaire) */
.edt-cell.filled.seance-synchrone, .matrix-cell.filled.seance-synchrone { background: var(--green-100); border-color: var(--green-600); }
.edt-cell.filled.seance-efm, .matrix-cell.filled.seance-efm { background: var(--red-100); border-color: var(--red-600); }
/* Statut d'une séance : Proposé = bordure pointillée, Validé = bordure pleine, Modifié = liseré doré à gauche */
.edt-cell.filled.status-propose, .matrix-cell.filled.status-propose { border-style: dashed; }
.edt-cell.filled.status-modifie, .matrix-cell.filled.status-modifie { box-shadow: inset 4px 0 0 var(--gold-500); }
.matrix-cell.empty { background: var(--grey-50); border: 1px dashed var(--grey-300); min-height: 50px; }
.matrix-cell .mc-title { font-weight: 700; color: var(--navy-900); display: block; }
.matrix-cell .mc-sub { color: var(--grey-500); display: block; font-size: 10px; }
.matrix-cell .mc-remove { float: right; background: none; border: none; color: var(--red-600); cursor: pointer; font-size: 11px; line-height: 1; }
.efm-label { display: inline-block; font-size: 10px; font-weight: 800; color: var(--red-600); text-transform: uppercase; letter-spacing: .03em; margin-left: 4px; }

/* ---------------------------------------------------------------------- */
/* PALETTE FLOTTANTE (vue EDT par formateur)                               */
/* ---------------------------------------------------------------------- */
.floating-palette {
    position: fixed; top: 90px; right: 20px; width: 300px; max-height: calc(100vh - 120px);
    background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); z-index: 50; display: flex; flex-direction: column;
    transition: transform var(--transition-fast);
}
.floating-palette.collapsed { transform: translateX(340px); }
.floating-palette-header {
    padding: 12px 16px; border-bottom: 1px solid var(--grey-200); display: flex; align-items: center; justify-content: space-between;
    cursor: grab; background: var(--navy-900); color: var(--white); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.floating-palette-header h4 { color: var(--white); margin: 0; font-size: 13.5px; }
.floating-palette-toggle {
    position: fixed; top: 90px; right: 20px; z-index: 49; background: var(--gold-500); color: var(--navy-900);
    border: none; border-radius: var(--radius-md) 0 0 var(--radius-md); padding: 10px 8px; cursor: pointer;
    font-weight: 700; font-size: 12px; box-shadow: var(--shadow-md); display: none;
}
.floating-palette.collapsed ~ .floating-palette-toggle { display: block; }
.floating-palette-body { padding: 12px; overflow-y: auto; flex: 1; }
.floating-palette-group { margin-bottom: 14px; }
.floating-palette-group h5 { font-size: 12px; color: var(--grey-700); margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.floating-palette-search { padding: 10px 16px; border-bottom: 1px solid var(--grey-200); }
.floating-palette-search input { font-size: 12.5px; padding: 7px 10px; }
.floating-palette-header .btn-ghost { color: var(--white); }
.floating-palette-group.filtered-out { display: none; }

.floating-palette.compact { width: 220px; }
.floating-palette.compact .dnd-chip { padding: 5px 7px; }
.floating-palette.compact .dnd-chip .dnd-chip-title { font-size: 11px; }
.floating-palette.compact .dnd-chip .dnd-chip-sub { font-size: 9.5px; }
.floating-palette.compact .floating-palette-body { padding: 8px; }
.floating-palette.compact .floating-palette-group { margin-bottom: 8px; }
.floating-palette-compact-toggle { color: var(--white); }

@media (max-width: 860px) {
    .floating-palette { width: calc(100vw - 32px); right: 16px; left: 16px; top: auto; bottom: 16px; max-height: 50vh; }
    .floating-palette.collapsed { transform: translateY(calc(100% + 20px)); }
    .floating-palette-toggle { top: auto; bottom: 16px; right: 16px; border-radius: var(--radius-md); }
}

.info-list dt { font-size: 12px; color: var(--grey-500); text-transform: uppercase; letter-spacing: .02em; margin-top: 10px; }
.info-list dd { margin: 2px 0 0; font-size: 14.5px; font-weight: 600; color: var(--navy-900); }

/* ---------------------------------------------------------------------- */
/* RESPONSIVE                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .overlay-backdrop.open { display: block; }
    .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 { grid-template-columns: 1fr; }
    .col-span-2, .col-span-3 { grid-column: span 1; }
    .page-body { padding: 16px; }
    .topbar { padding: 0 16px; }
    .topbar-user span.user-name-text { display: none; }
}

@media (max-width: 560px) {
    .kpi-tile-value { font-size: 24px; }
    .card { padding: 16px; }
    .login-card { padding: 26px 20px; }
    .filter-bar select, .filter-bar input { width: 100%; min-width: 0; }
    .filter-bar { flex-direction: column; align-items: stretch; }
}

/* Print (EDT export) */
@media print {
    .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
    .main-content { margin-left: 0; }
    body { background: var(--white); }
    .card, .kpi-tile { animation: none !important; box-shadow: none !important; }
    .hidden-screen { display: block !important; }
    .page-body { padding: 0; }
    .print-title { margin-bottom: 14px; border-bottom: 2px solid var(--navy-900); padding-bottom: 10px; }
    .print-title h2 { margin-bottom: 2px; }
    .print-title p { color: var(--grey-500); margin: 0; font-size: 12px; }
    .print-footer { margin-top: 20px; font-size: 10px; color: var(--grey-500); text-align: right; }
    .print-section { page-break-inside: avoid; margin-bottom: 24px; }
    table.edt-grid, table.data-table { font-size: 10.5px; }
    .edt-cell { min-height: 44px; padding: 4px 6px; }
}
/* Masqué à l'écran, visible seulement à l'impression (ex: titre dédié au PDF) */
.hidden-screen { display: none; }

/* Liste déroulante de choix de semaine (pages EDT) */
.select-semaine { min-width: 210px; }

/* Graphique à nombreuses lignes (tous les groupes / formateurs) : défilement vertical dans la carte */
.chart-scroll { max-height: 520px; overflow-y: auto; padding-right: 4px; }
