/* =========================================================
   17 Global Business — Design system
   Thème sombre « ciel nocturne », surfaces vitrées,
   compatible LTR (français) et RTL (arabe) via propriétés logiques.
   ========================================================= */

:root {
    /* Fond & surfaces */
    --bg:            #05070f;
    --bg-2:          #080c18;
    --surface:       rgba(255, 255, 255, 0.028);
    --surface-2:     rgba(255, 255, 255, 0.05);
    --surface-solid: #0d1220;
    --line:          rgba(255, 255, 255, 0.08);
    --line-strong:   rgba(255, 255, 255, 0.16);

    /* Texte */
    --ink:           #eef2ff;
    --ink-2:         #aab4d0;
    --ink-3:         #6f7a99;

    /* Accents */
    --accent:        #4d7cff;
    --accent-2:      #17d4ff;
    --accent-ink:    #ffffff;
    --accent-soft:   rgba(77, 124, 255, 0.14);
    --accent-glow:   rgba(77, 124, 255, 0.45);

    --success:       #1fd47f;
    --success-soft:  rgba(31, 212, 127, 0.13);
    --warning:       #ffb020;
    --warning-soft:  rgba(255, 176, 32, 0.13);
    --danger:        #ff5470;
    --danger-soft:   rgba(255, 84, 112, 0.13);
    --info:          #17d4ff;
    --info-soft:     rgba(23, 212, 255, 0.13);

    /* Formes */
    --r-sm: 10px;
    --r:    16px;
    --r-lg: 22px;
    --r-xl: 23px;
    --r-pill: 999px;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow:    0 18px 40px -18px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.95);

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --sidebar-w: 248px;
    --header-h: 58px;

    --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-ar: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
}

html[dir="rtl"] {
    --font: var(--font-ar);
}

/* ---------------- Base ---------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14.6px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html[dir="rtl"] body { line-height: 1.85; }

img { max-width: 100%; display: block; }

/* Les icônes sont rendues sans attribut width/height. Sans taille par défaut,
   un SVG placé dans un conteneur flex s'étire à toute la hauteur disponible
   (une ligne de tableau passait ainsi à 124px). Chaque composant qui a besoin
   d'une autre taille la redéfinit : sa règle est plus spécifique que celle-ci. */
svg { display: block; width: 1.05em; height: 1.05em; flex: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.18;
    letter-spacing: -0.02em;
    font-weight: 800;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 { letter-spacing: 0; line-height: 1.4; }

p { margin: 0; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Barre de défilement */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: content-box; }

/* ---------------- Utilitaires ---------------- */

.container { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.container-narrow { width: min(820px, calc(100% - 40px)); margin-inline: auto; }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap    { flex-wrap: wrap; }
.gap-1 { gap: 8px; }  .gap-2 { gap: 14px; }
.gap-3 { gap: 22px; } .gap-4 { gap: 34px; }
.grow { flex: 1; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 26px; } .mt-4 { margin-top: 40px; }

.muted   { color: var(--ink-2); }
.muted-2 { color: var(--ink-3); }
.small   { font-size: 13.5px; }
.tiny    { font-size: 12px; }
.strong  { font-weight: 700; }
.mono    { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.nowrap  { white-space: nowrap; }
.hide    { display: none !important; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-2);
}
html[dir="rtl"] .kicker { letter-spacing: 0; }

.gradient-text {
    background: linear-gradient(100deg, #ffffff 10%, var(--accent-2) 55%, var(--accent) 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------------- Décor de fond ---------------- */

.aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(1100px 620px at 78% -12%, rgba(77, 124, 255, 0.20), transparent 62%),
        radial-gradient(900px 520px at 8% 4%,   rgba(23, 212, 255, 0.13), transparent 60%),
        radial-gradient(800px 800px at 50% 108%, rgba(120, 80, 255, 0.14), transparent 65%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.aurora::after {
    content: '';
    position: absolute;
    inset: -40%;
    background-image:
        radial-gradient(1.4px 1.4px at 20% 30%, rgba(255,255,255,.55), transparent),
        radial-gradient(1.2px 1.2px at 70% 18%, rgba(255,255,255,.42), transparent),
        radial-gradient(1.6px 1.6px at 42% 72%, rgba(255,255,255,.38), transparent),
        radial-gradient(1.1px 1.1px at 88% 62%, rgba(255,255,255,.45), transparent),
        radial-gradient(1.3px 1.3px at 12% 84%, rgba(255,255,255,.35), transparent),
        radial-gradient(1px 1px   at 58% 44%, rgba(255,255,255,.30), transparent);
    background-size: 620px 620px, 420px 420px, 760px 760px, 520px 520px, 680px 680px, 380px 380px;
    animation: drift 140s linear infinite;
    opacity: .75;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-320px, -220px, 0); }
}

/* ---------------- Cartes & surfaces ---------------- */

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 19px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.card-tight { padding: 14px; }
.card-flush { padding: 0; overflow: hidden; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.card-head h2, .card-head h3 { font-size: 14.8px; }
.card-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

.hairline { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

/* ---------------- Boutons ---------------- */

.btn {
    --btn-bg: var(--surface-2);
    --btn-ink: var(--ink);
    --btn-bd: var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 17px;
    border-radius: var(--r-pill);
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-weight: 700;
    font-size: 13.6px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .18s var(--ease), box-shadow .22s var(--ease),
                background .22s var(--ease), border-color .22s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.3); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
    --btn-bg: linear-gradient(120deg, var(--accent) 0%, #6d5cff 55%, var(--accent-2) 130%);
    --btn-ink: var(--accent-ink);
    --btn-bd: transparent;
    box-shadow: 0 10px 30px -12px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 18px 40px -14px var(--accent-glow); }

.btn-success { --btn-bg: var(--success-soft); --btn-ink: var(--success); --btn-bd: rgba(31,212,127,.35); }
.btn-success:hover { --btn-bg: rgba(31,212,127,.2); }
.btn-danger  { --btn-bg: var(--danger-soft);  --btn-ink: var(--danger);  --btn-bd: rgba(255,84,112,.35); }
.btn-danger:hover { --btn-bg: rgba(255,84,112,.2); }
.btn-ghost   { --btn-bg: transparent; --btn-bd: var(--line); }
.btn-quiet   { --btn-bg: transparent; --btn-bd: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }

.btn-sm  { padding: 6px 13px; font-size: 12.5px; }
.btn-lg  { padding: 12px 24px; font-size: 14.6px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* Icône seule */
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    color: var(--ink-2);
    transition: all .2s var(--ease);
    position: relative;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- Badges & puces ---------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: var(--r-pill);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

.badge-pending     { background: var(--warning-soft); color: var(--warning); border-color: rgba(255,176,32,.28); }
.badge-approved    { background: var(--success-soft); color: var(--success); border-color: rgba(31,212,127,.32); }
.badge-in_progress { background: var(--info-soft);    color: var(--info);    border-color: rgba(23,212,255,.28); }
.badge-resolved    { background: var(--success-soft); color: var(--success); border-color: rgba(31,212,127,.32); }
.badge-cancelled   { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(255,84,112,.28); }
.badge-neutral     { background: var(--surface-2);    color: var(--ink-2);   border-color: var(--line); }
.badge-accent      { background: var(--accent-soft);  color: var(--accent-2);border-color: rgba(77,124,255,.3); }

.badge-approved .dot,
.badge-resolved .dot { box-shadow: 0 0 0 4px rgba(31, 212, 127, .18); }
.badge-pending .dot  { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .5); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 176, 32, 0); }
}

.prio-low    { color: var(--ink-3); }
.prio-normal { color: var(--ink-2); }
.prio-high   { color: var(--warning); }
.prio-urgent { color: var(--danger); font-weight: 800; }

/* ---------------- Formulaires ---------------- */

.field { margin-bottom: 16px; }

.field > label,
.label {
    display: block;
    font-size: 12.8px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--ink);
}
.label .req { color: var(--accent-2); margin-inline-start: 3px; }
.label .opt { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-inline-start: 6px; }

.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    transition: border-color .2s, background .2s, box-shadow .2s;
    appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(77, 124, 255, 0.07);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.textarea { min-height: 118px; resize: vertical; line-height: 1.65; }

.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7a99' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 17px;
    padding-inline-end: 42px;
}
html[dir="rtl"] .select { background-position: left 14px center; padding-inline-end: 42px; }
.select option { background: var(--surface-solid); color: var(--ink); }

/* Champ verrouillé : valeur issue du compte, lisible et copiable mais non modifiable. */
.input[readonly] {
    background: rgba(255, 255, 255, 0.015);
    color: var(--ink-2);
    cursor: default;
    border-style: dashed;
}
.input[readonly]:hover { border-color: var(--line); }
.input[readonly]:focus { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.02); box-shadow: none; }

.lock-badge {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 6px;
    color: var(--ink-3);
    vertical-align: -2px;
}
.lock-badge svg { width: 12px; height: 12px; }

.has-error .input,
.has-error .select,
.has-error .textarea { border-color: var(--danger); background: rgba(255, 84, 112, 0.06); }

.field-error {
    margin-top: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 6px;
}
.field-error::before { content: '!'; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; font-weight: 900; flex: none; }

/* Champ téléphone avec préfixe pays */
.phone-field { display: flex; align-items: stretch; }
.phone-prefix {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-inline: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-inline-end: 0;
    border-start-start-radius: 10px;
    border-end-start-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-2);
    white-space: nowrap;
}
.phone-prefix .flag { font-size: 17px; line-height: 1; }
.phone-field .input {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    letter-spacing: 0.06em;
}
html[dir="rtl"] .phone-field .input { direction: ltr; text-align: right; }

/* Champ mot de passe */
.pass-field { position: relative; }
.pass-field .input { padding-inline-end: 48px; }
.pass-toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 6px;
    width: 38px;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    color: var(--ink-3);
    cursor: pointer;
    border-radius: 9px;
}
.pass-toggle:hover { color: var(--ink); }
.pass-toggle svg { width: 19px; height: 19px; }

/* Jauge de robustesse */
.pass-meter { display: flex; gap: 5px; margin-top: 9px; }
.pass-meter i {
    height: 4px; flex: 1; border-radius: 99px;
    background: rgba(255,255,255,.09);
    transition: background .3s;
}
.pass-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.pass-meter[data-score="2"] i:nth-child(-n+2) { background: var(--warning); }
.pass-meter[data-score="3"] i:nth-child(-n+3) { background: #7fd41f; }
.pass-meter[data-score="4"] i { background: var(--success); }

/* Case à cocher */
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.check input { appearance: none; width: 20px; height: 20px; flex: none; margin-top: 2px;
    border: 1.6px solid var(--line-strong); border-radius: 6px; background: var(--surface-2);
    cursor: pointer; transition: all .18s; position: relative; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
    content: ''; position: absolute; inset-inline-start: 6px; top: 2px;
    width: 5px; height: 10px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg);
}
.check span { font-size: 14px; color: var(--ink-2); }

/* Grille de formulaire : une colonne, puis deux au-delà d'une largeur confortable.
   On évite `auto-fit` ici : sur un très grand écran il produirait 3 ou 4 colonnes
   et séparerait des champs qui se lisent par paire (les deux numéros). */
.field-pair { display: grid; grid-template-columns: 1fr; column-gap: 20px; }
.field-pair .full { grid-column: 1 / -1; }

@media (min-width: 1400px) {
    .field-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sélecteur de catégorie en cartes radio */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 11px; }
.choice {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
    transition: all .18s var(--ease);
}
.choice:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--surface-2); color: var(--ink-2); flex: none; transition: all .18s; }
.choice .ic svg { width: 18px; height: 18px; }
.choice .tx { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(77, 124, 255, .12);
}
.choice:has(input:checked) .ic { background: var(--accent); color: #fff; }

/* Champ qui n'apparaît que pour certains domaines : rattaché visuellement
   au choix qui vient d'être fait juste au-dessus. */
.conditional-field {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(77, 124, 255, .28);
    background: var(--accent-soft);
    animation: fadeUp .25s var(--ease) both;
}
.conditional-field[hidden] { display: none; }
.conditional-field .hint { color: var(--ink-2); }

/* Dépôt de fichier */
.dropzone {
    display: flex; align-items: center; gap: 14px;
    padding: 18px;
    border: 1.6px dashed var(--line-strong);
    border-radius: 16px;
    background: var(--surface);
    cursor: pointer;
    transition: all .2s var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.dropzone .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
    background: var(--surface-2); color: var(--accent-2); flex: none; }
.dropzone .ic svg { width: 21px; height: 21px; }

/* ---------------- Alertes ---------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 18px;
    border-radius: 15px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 14.5px;
    line-height: 1.6;
}
.alert .ic { flex: none; width: 21px; height: 21px; margin-top: 1px; }
.alert-success { background: var(--success-soft); border-color: rgba(31,212,127,.3);  color: #9df3c9; }
.alert-error,
.alert-danger  { background: var(--danger-soft);  border-color: rgba(255,84,112,.3);  color: #ffc0cb; }
.alert-warning { background: var(--warning-soft); border-color: rgba(255,176,32,.3);  color: #ffdca3; }
.alert-info    { background: var(--info-soft);    border-color: rgba(23,212,255,.3);  color: #b3edff; }

.flash-stack {
    position: fixed;
    top: 84px;
    inset-inline-end: 22px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 11px;
    width: min(400px, calc(100vw - 44px));
}
.flash-stack .alert {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    background-color: rgba(13, 18, 32, .94);
    animation: flashIn .45s var(--ease) both;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.flash-stack .alert.out { animation: flashOut .35s var(--ease) forwards; }
@keyframes flashOut { to { opacity: 0; transform: translateY(-10px); } }

/* ---------------- En-tête public ---------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(5, 7, 15, 0.62);
    border-bottom: 1px solid transparent;
    transition: background .3s, border-color .3s;
}
.site-header.scrolled {
    background: rgba(5, 7, 15, 0.9);
    border-bottom-color: var(--line);
}
.site-header .inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; }
.brand .logo {
    display: grid; place-items: center;
    width: 33px; height: 33px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 22px -8px var(--accent-glow);
    flex: none;
}
.brand .logo svg { width: 18px; height: 18px; color: #fff; }
.brand .logo .mark {
    font-size: 13.8px;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: #fff;
    line-height: 1;
    font-family: 'Manrope', system-ui, sans-serif;
}
.brand .name { font-size: 14.8px; line-height: 1.15; }
.brand .name small { display: block; font-size: 10px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.03em; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    padding: 7px 13px;
    border-radius: var(--r-pill);
    font-size: 13.6px;
    font-weight: 600;
    color: var(--ink-2);
    transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-2);
    transition: all .2s;
}
.lang-switch:hover { color: var(--ink); border-color: var(--line-strong); }
.lang-switch svg { width: 14px; height: 14px; }

.burger { display: none; }

/* ---------------- Héros ---------------- */

.hero { position: relative; padding: 60px 0 52px; overflow: hidden; }
.hero-grid {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 44px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px 7px 9px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    font-size: 12.4px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 19px;
}
html[dir="rtl"] .hero-badge { padding: 7px 9px 7px 16px; }
.hero-badge .live {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(31, 212, 127, .18);
    animation: pulse-green 2.2s ease-in-out infinite;
    flex: none;
    margin-inline-start: 6px;
}
@keyframes pulse-green {
    0%,100% { box-shadow: 0 0 0 0 rgba(31,212,127,.5); }
    50%     { box-shadow: 0 0 0 7px rgba(31,212,127,0); }
}

.hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    font-weight: 800;
    margin-bottom: 17px;
}
.hero h1 span { display: block; }
.hero .lede { font-size: 15.8px; color: var(--ink-2); max-width: 58ch; margin-bottom: 25px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.hero-note { font-size: 12.4px; color: var(--ink-3); margin-top: 13px; display: flex; align-items: center; gap: 7px; }
.hero-note svg { width: 15px; height: 15px; color: var(--success); flex: none; }

/* Visuel : carte de suivi flottante */
.hero-visual { position: relative; }
.hero-visual .glow {
    position: absolute;
    inset: -12% -6%;
    background: radial-gradient(circle at 50% 45%, var(--accent-glow), transparent 66%);
    filter: blur(56px);
    opacity: .58;
    z-index: -1;
}

.mock {
    background: linear-gradient(165deg, rgba(255,255,255,.085), rgba(255,255,255,.022));
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    padding: 17px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-11px); }
}
.mock-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mock-ref { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; color: var(--ink-3); }
.mock-title { font-size: 14.6px; font-weight: 800; margin-bottom: 5px; }
.mock-sub { font-size: 12.3px; color: var(--ink-3); margin-bottom: 15px; }

.mock-steps { display: flex; flex-direction: column; gap: 0; }
.mock-step { display: flex; gap: 13px; align-items: flex-start; }
.mock-step .rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.mock-step .bullet {
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1.6px solid var(--line-strong);
    color: var(--ink-3);
}
.mock-step .bullet svg { width: 12px; height: 12px; }
.mock-step .line { width: 2px; flex: 1; min-height: 20px; background: var(--line); }
.mock-step.done .bullet { background: var(--success); border-color: var(--success); color: #04160d; }
.mock-step.done .line   { background: linear-gradient(var(--success), var(--line)); }
.mock-step.active .bullet { background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 0 0 5px rgba(77,124,255,.18); }
.mock-step .body { padding-bottom: 14px; }
.mock-step .body b { display: block; font-size: 12.8px; }
.mock-step .body small { color: var(--ink-3); font-size: 12px; }
.mock-step:last-child .body { padding-bottom: 0; }

/* Bandeau de chiffres clés */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-top: 46px;
}
.kpi-strip .kpi { background: rgba(8, 12, 24, .8); padding: 17px 18px; }
.kpi-strip .kpi .v { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.kpi-strip .kpi .k { font-size: 11.8px; color: var(--ink-3); margin-top: 2px; }

/* ---------------- Sections publiques ---------------- */

.section { padding: 58px 0; }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 11px 0 9px; }
.section-head p { color: var(--ink-2); font-size: 14.5px; }
.section-head.center { margin-inline: auto; text-align: center; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); gap: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 17px; }

.feature {
    padding: 18px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.feature:hover { transform: translateY(-5px); border-color: var(--line-strong); background: var(--surface-2); }
.feature .ic {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(23,212,255,.1));
    border: 1px solid rgba(77,124,255,.24);
    color: var(--accent-2);
    margin-bottom: 17px;
}
.feature .ic svg { width: 18px; height: 18px; }
.feature h3 { font-size: 14.8px; margin-bottom: 7px; }
.feature p { font-size: 13.5px; color: var(--ink-2); }

/* ---------------- Catalogue de formations ---------------- */

/* Entrée mise en avant dans la navigation publique */
.site-nav .nav-highlight {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(77, 124, 255, .3);
}
.site-nav .nav-highlight svg { color: var(--accent-2); }
.site-nav .nav-highlight:hover { background: rgba(77, 124, 255, .22); }
.site-nav .nav-highlight.is-active { background: var(--accent); color: #fff; box-shadow: none; }
.site-nav .nav-highlight.is-active svg { color: #fff; }

.level-head {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}
.level-head h2 { font-size: 19px; }
.level-head p { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
.level-num {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    flex: none;
    border-radius: 13px;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 9px 22px -12px var(--accent-glow);
}

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 14px; }

.course {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: transform .25s var(--ease), border-color .25s, background .25s;
}
.course:hover { transform: translateY(-3px); border-color: rgba(77,124,255,.4); background: var(--surface-2); }
.course-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.course-top .ic {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(23,212,255,.1));
    border: 1px solid rgba(77,124,255,.24);
    color: var(--accent-2);
}
.course-top .ic svg { width: 18px; height: 18px; }
.course h3 { font-size: 15px; margin-bottom: 7px; line-height: 1.35; }
.course p { font-size: 13.2px; color: var(--ink-2); flex: 1; }
.course-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}
.course-foot .price small { display: block; font-size: 10.5px; color: var(--ink-3); }
.course-foot .price b { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.course-foot .price b + small { margin-top: 1px; }

/* ---------------- Choix de la modalité ---------------- */

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }

.mode-card {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line-strong);
    background:
        radial-gradient(560px 240px at 50% -40%, var(--mode-glow, rgba(77,124,255,.24)), transparent 68%),
        linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
    transition: transform .28s var(--ease), border-color .28s, box-shadow .28s;
}
.mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--mode-line, rgba(77,124,255,.55));
    box-shadow: 0 28px 60px -32px rgba(0, 0, 0, .95);
}
.mode-card.mode-a-distance { --mode-glow: rgba(23,212,255,.26); --mode-line: rgba(23,212,255,.55); }
.mode-card.mode-presentiel { --mode-glow: rgba(160,120,255,.26); --mode-line: rgba(160,120,255,.55); }

.mode-ic {
    display: grid; place-items: center;
    width: 54px; height: 54px;
    border-radius: 16px;
    margin-bottom: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--accent-2);
}
.mode-card.mode-presentiel .mode-ic { color: #b79bff; }
.mode-ic svg { width: 25px; height: 25px; }

.mode-card h3 { font-size: 19px; margin-bottom: 8px; }
.mode-desc { font-size: 14px; color: var(--ink-2); margin-bottom: 17px; }
.mode-features { margin-bottom: 20px; }
.mode-features li { font-size: 13.4px; }

.mode-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid var(--line);
}
.mode-foot .price small { display: block; font-size: 10.5px; color: var(--ink-3); }
.mode-foot .price b { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }

@media (max-width: 620px) {
    .mode-card { padding: 19px; }
    .mode-foot .btn { width: 100%; justify-content: center; }
}

/* ---------------- Fiche d'une formation ---------------- */

.course-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; }
.course-title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 12px; max-width: 22ch; }
.course-hero-ic {
    display: grid; place-items: center;
    width: 78px; height: 78px;
    flex: none;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(23,212,255,.1));
    border: 1px solid rgba(77,124,255,.26);
    color: var(--accent-2);
}
.course-hero-ic svg { width: 34px; height: 34px; }

.level-dot {
    display: inline-grid; place-items: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
}

/* Objectifs */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); }
.check-list .tick {
    display: grid; place-items: center;
    width: 20px; height: 20px;
    flex: none;
    margin-top: 1px;
    border-radius: 6px;
    background: var(--success-soft);
    color: var(--success);
}
.check-list .tick svg { width: 12px; height: 12px; }

/* Programme */
.module-list { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.module-list li {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.module-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.module-list li:first-child { padding-top: 0; }
.module-list .num {
    display: grid; place-items: center;
    width: 26px; height: 26px;
    flex: none;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-2);
}
.module-list small { display: block; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
html[dir="rtl"] .module-list small { letter-spacing: 0; }
.module-list b { font-size: 14px; font-weight: 600; }

/* Encart tarif */
.price-card { position: sticky; top: calc(var(--header-h) + 16px); }
.price-main { text-align: center; padding: 4px 0 2px; }
.price-main small { display: block; font-size: 11.5px; color: var(--ink-3); }
.price-main b {
    display: block;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    background: linear-gradient(100deg, #fff, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.price-main span { font-size: 12px; color: var(--ink-2); }

@media (max-width: 1150px) {
    .price-card { position: static; }
}
@media (max-width: 620px) {
    .course-hero { flex-direction: column-reverse; align-items: flex-start; gap: 16px; }
    .course-hero-ic { width: 58px; height: 58px; border-radius: 17px; }
    .course-hero-ic svg { width: 26px; height: 26px; }
}

/* Étapes numérotées */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 16px; counter-reset: s; }
.step {
    position: relative;
    padding: 22px 19px 19px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
}
.step::before {
    counter-increment: s;
    content: counter(s, decimal-leading-zero);
    position: absolute;
    top: 12px;
    inset-inline-end: 18px;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    color: rgba(255, 255, 255, .045);
    letter-spacing: -0.05em;
}
.step .ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; margin-bottom: 18px;
    box-shadow: 0 10px 26px -12px var(--accent-glow); }
.step .ic svg { width: 18px; height: 18px; }
.step h3 { font-size: 14.8px; margin-bottom: 7px; }
.step p { font-size: 13.5px; color: var(--ink-2); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 9px; }
.faq details {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .25s, background .25s;
}
.faq details[open] { border-color: rgba(77,124,255,.32); background: var(--surface-2); }
.faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14.4px;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '';
    width: 11px; height: 11px; flex: none;
    border-right: 2.2px solid var(--ink-3);
    border-bottom: 2.2px solid var(--ink-3);
    transform: rotate(45deg);
    transition: transform .28s var(--ease), border-color .25s;
    margin-top: -4px;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 3px; border-color: var(--accent-2); }
.faq .answer { padding: 0 18px 16px; color: var(--ink-2); font-size: 13.8px; }

/* Bandeau d'appel à l'action */
.cta-band {
    position: relative;
    border-radius: var(--r-xl);
    padding: 38px 30px;
    text-align: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background:
        radial-gradient(700px 340px at 50% -30%, rgba(77,124,255,.34), transparent 66%),
        linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
}
.cta-band h2 { font-size: clamp(1.35rem, 2.5vw, 1.8rem); margin-bottom: 10px; }
.cta-band p { color: var(--ink-2); max-width: 54ch; margin: 0 auto 21px; }

/* Contact */
.contact-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); transition: all .2s; }
.contact-item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.contact-item .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent-2); flex: none; }
.contact-item .ic svg { width: 17px; height: 17px; }
.contact-item .k { font-size: 12px; color: var(--ink-3); }
.contact-item .v { font-weight: 700; font-size: 13.8px; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 24px; margin-top: 28px; }
.site-footer .inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.site-footer .legal { font-size: 12.5px; color: var(--ink-3); max-width: 58ch; }

/* ---------------- Pages d'authentification ---------------- */

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

.auth-aside {
    position: relative;
    padding: 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border-inline-end: 1px solid var(--line);
    background:
        radial-gradient(760px 520px at 24% 16%, rgba(77,124,255,.28), transparent 62%),
        radial-gradient(620px 520px at 84% 88%, rgba(23,212,255,.18), transparent 62%),
        linear-gradient(165deg, #070b16, #05070f);
}
.auth-aside .pitch h2 { font-size: 1.7rem; margin-bottom: 12px; max-width: 16ch; }
.auth-aside .pitch p { color: var(--ink-2); max-width: 42ch; }
.auth-aside .points { display: flex; flex-direction: column; gap: 11px; margin-top: 24px; }
.auth-aside .point { display: flex; align-items: center; gap: 10px; font-size: 13.6px; color: var(--ink-2); }
.auth-aside .point .ic { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px;
    background: var(--success-soft); color: var(--success); flex: none; }
.auth-aside .point .ic svg { width: 14px; height: 14px; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 34px 22px; }
.auth-card { width: min(430px, 100%); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 7px; }
.auth-card .sub { color: var(--ink-2); margin-bottom: 24px; font-size: 14px; }
.auth-alt { margin-top: 20px; text-align: center; font-size: 13.6px; color: var(--ink-2); }
.auth-alt a { color: var(--accent-2); font-weight: 700; }
.auth-alt a:hover { text-decoration: underline; }
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }

/* ---------------- Coquille tableau de bord ---------------- */

.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 15px 11px;
    border-inline-end: 1px solid var(--line);
    background: rgba(7, 10, 20, .74);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
    z-index: 80;
}
.sidebar .brand { padding: 3px 8px 17px; }

.side-group { margin-bottom: 15px; }
.side-group .title {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0 12px 10px;
}
html[dir="rtl"] .side-group .title { letter-spacing: 0; }

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 13.4px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 3px;
    position: relative;
    transition: color .18s, background .18s;
}
.side-link svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side-link:hover { color: var(--ink); background: var(--surface-2); }
.side-link.is-active {
    color: var(--ink);
    background: linear-gradient(100deg, var(--accent-soft), rgba(23,212,255,.05));
    box-shadow: inset 0 0 0 1px rgba(77,124,255,.24);
}
.side-link.is-active svg { color: var(--accent-2); opacity: 1; }
.side-link.is-active::before {
    content: '';
    position: absolute;
    inset-inline-start: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 22px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(var(--accent), var(--accent-2));
}
html[dir="rtl"] .side-link.is-active::before { border-radius: 4px 0 0 4px; }
.side-link .count {
    margin-inline-start: auto;
    min-width: 22px; height: 20px;
    padding: 0 7px;
    border-radius: 99px;
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 800;
    background: var(--surface-2);
    color: var(--ink-2);
}
.side-link .count.hot { background: var(--warning); color: #201400; }
.side-link .count.alert { background: var(--danger); color: #fff; }

.side-cta { margin: 2px 0 15px; }

.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; }
.side-user:hover { background: var(--surface-2); }
.side-user .meta { min-width: 0; }
.side-user .meta b { display: block; font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .meta small { color: var(--ink-3); font-size: 11.5px; }

.avatar {
    display: grid; place-items: center;
    width: 33px; height: 33px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #7c5cff);
    color: #fff;
    font-weight: 800;
    font-size: 12.4px;
    flex: none;
    letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11.5px; }
.avatar-lg { width: 62px; height: 62px; border-radius: 18px; font-size: 21px; }
.avatar-staff { background: linear-gradient(135deg, #17d4ff, #1fd47f); color: #04222b; }

/* Zone principale */
.app-main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: var(--header-h);
    padding-inline: 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 7, 15, .78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.topbar .page-title { font-size: 14.4px; font-weight: 800; }
.topbar .crumb { font-size: 12px; color: var(--ink-3); }

.app-body { padding: 21px; flex: 1; }
.page-head { margin-bottom: 19px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* Le groupe de boutons d'en-tête doit pouvoir passer à la ligne : sinon deux
   libellés longs débordent de l'écran sur mobile (les boutons sont en nowrap). */
.page-head .row { flex-wrap: wrap; }
.page-head h1 { font-size: 1.28rem; margin-bottom: 4px; }

/* Colonne principale + colonne latérale. Définie ici plutôt qu'en style inline
   dans les vues, sinon la règle responsive ne pourrait pas s'appliquer. */
.split-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 17px; }
@media (max-width: 1000px) { .split-main { grid-template-columns: 1fr; } }
.page-head p { color: var(--ink-2); font-size: 13.3px; }

/* Cloche de notifications */
.notif-wrap { position: relative; }
.notif-dot {
    position: absolute;
    top: 6px; inset-inline-end: 6px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: grid; place-items: center;
    border: 2px solid var(--bg);
}
.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    width: min(370px, calc(100vw - 40px));
    background: rgba(12, 17, 30, .97);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    overflow: hidden;
    z-index: 120;
    display: none;
}
.notif-panel.open { display: block; animation: flashIn .22s var(--ease) both; }
.notif-panel .head { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.notif-panel .head b { font-size: 14px; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 13px 17px; border-bottom: 1px solid var(--line); transition: background .18s; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: rgba(77,124,255,.06); }
.notif-item .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.notif-item .ic svg { width: 15px; height: 15px; }
.notif-item .ic.new     { background: var(--accent-soft); color: var(--accent-2); }
.notif-item .ic.success { background: var(--success-soft); color: var(--success); }
.notif-item .ic.danger  { background: var(--danger-soft); color: var(--danger); }
.notif-item .ic.info,
.notif-item .ic.message { background: var(--info-soft); color: var(--info); }
.notif-item .tx { font-size: 13.4px; line-height: 1.5; }
.notif-item .tx time { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.notif-empty { padding: 34px 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

/* ---------------- Cartes statistiques ---------------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 11px; }

.stat {
    position: relative;
    padding: 14px 16px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
    transition: transform .28s var(--ease), border-color .28s;
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.stat::after {
    content: '';
    position: absolute;
    inset-inline-end: -30px; top: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: var(--stat-glow, var(--accent-soft));
    filter: blur(28px);
    opacity: .8;
    pointer-events: none;
}
.stat .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.stat .ic { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px;
    background: var(--stat-soft, var(--accent-soft)); color: var(--stat-ink, var(--accent-2)); }
.stat .ic svg { width: 16px; height: 16px; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat .k { font-size: 12.2px; color: var(--ink-2); margin-top: 6px; font-weight: 600; }
.stat .sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.stat-day   { --stat-soft: var(--accent-soft);  --stat-ink: var(--accent-2); --stat-glow: rgba(77,124,255,.16); }
.stat-week  { --stat-soft: var(--info-soft);    --stat-ink: var(--info);     --stat-glow: rgba(23,212,255,.14); }
.stat-month { --stat-soft: rgba(160,120,255,.14); --stat-ink: #b79bff;       --stat-glow: rgba(160,120,255,.16); }
.stat-year  { --stat-soft: var(--success-soft); --stat-ink: var(--success);  --stat-glow: rgba(31,212,127,.14); }
.stat-warn  { --stat-soft: var(--warning-soft); --stat-ink: var(--warning);  --stat-glow: rgba(255,176,32,.14); }
.stat-danger{ --stat-soft: var(--danger-soft);  --stat-ink: var(--danger);   --stat-glow: rgba(255,84,112,.14); }

/* ---------------- Graphique ---------------- */

.chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 12px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.chart .bar {
    width: 100%;
    max-width: 34px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    min-height: 4px;
    position: relative;
    transition: filter .2s, transform .2s;
    animation: grow .7s var(--ease) both;
    transform-origin: bottom;
}
.chart .bar-wrap:hover .bar { filter: brightness(1.25); transform: scaleY(1.03); }
.chart .bar[data-zero="1"] { background: rgba(255,255,255,.08); }
.chart .bar .tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-solid);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
    box-shadow: var(--shadow-sm);
}
.chart .bar-wrap:hover .tip { opacity: 1; }
.chart .lbl { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Barres de répartition */
.split-list { display: flex; flex-direction: column; gap: 14px; }
.split-row .top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.split-row .top b { font-weight: 700; }
.split-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.split-bar i { display: block; height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: widen .8s var(--ease) both; }
html[dir="rtl"] .split-bar i { background: linear-gradient(270deg, var(--accent), var(--accent-2)); }
@keyframes widen { from { width: 0 !important; } }

/* ---------------- Tableaux ---------------- */

.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data thead th {
    text-align: start;
    padding: 9px 15px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: rgba(255, 255, 255, .022);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
html[dir="rtl"] table.data thead th { letter-spacing: 0; }
table.data tbody td { padding: 10px 15px; border-bottom: 1px solid var(--line); font-size: 13.2px; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .16s; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .028); }
table.data tbody tr.clickable { cursor: pointer; }
table.data .ref { font-weight: 800; font-size: 13px; letter-spacing: .03em; }
table.data .cell-actions { text-align: end; white-space: nowrap; }

.empty-state { padding: 36px 22px; text-align: center; }
.empty-state .ic { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 13px;
    border-radius: 13px; background: var(--surface-2); color: var(--ink-3); }
.empty-state .ic svg { width: 21px; height: 21px; }
.empty-state h3 { font-size: 14.5px; margin-bottom: 6px; }
.empty-state p { color: var(--ink-3); font-size: 13.2px; max-width: 46ch; margin: 0 auto 17px; }

/* Cartes de demandes (mobile / liste client) */
.ticket-card {
    display: block;
    padding: 14px 16px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: transform .22s var(--ease), border-color .22s, background .22s;
}
.ticket-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-2); }
.ticket-card .top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 11px; flex-wrap: wrap; }
.ticket-card .desc {
    color: var(--ink-2); font-size: 14.2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ticket-card .foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 13px;
    font-size: 12.5px; color: var(--ink-3); }
.ticket-card .foot span { display: inline-flex; align-items: center; gap: 6px; }
.ticket-card .foot svg { width: 14px; height: 14px; }

/* Filtres */
.filters { display: flex; gap: 11px; flex-wrap: wrap; align-items: flex-end; }
.filters .f { min-width: 150px; }
.filters .f.grow { flex: 1; min-width: 220px; }
.filters .f label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.filters .input, .filters .select { padding: 10px 14px; border-radius: 11px; font-size: 14px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    padding: 7px 15px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    transition: all .18s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--accent-soft); border-color: rgba(77,124,255,.4); color: var(--accent-2); font-weight: 700; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.pager .links { display: flex; gap: 6px; }
.pager a, .pager span {
    min-width: 38px; height: 38px;
    display: grid; place-items: center;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid var(--line);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-2);
    transition: all .18s;
}
.pager a:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-2); }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .disabled { opacity: .35; pointer-events: none; }

/* ---------------- Détail d'une demande ---------------- */

.detail-grid { display: grid; grid-template-columns: 1fr 322px; gap: 18px; align-items: start; }

.detail-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.detail-head .ref-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-head h1 { font-size: 1.5rem; }

.kv { display: grid; grid-template-columns: 132px 1fr; gap: 11px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.desc-block {
    padding: 18px 20px;
    border-radius: var(--r);
    background: rgba(255, 255, 255, .028);
    border: 1px solid var(--line);
    white-space: pre-wrap;
    line-height: 1.75;
    font-size: 14.8px;
}

/* Chronologie verticale */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; }
.tl-item .rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.tl-item .dot {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2);
    border: 1.6px solid var(--line-strong);
    color: var(--ink-3);
}
.tl-item .dot svg { width: 13px; height: 13px; }
.tl-item .line { width: 2px; flex: 1; min-height: 22px; background: var(--line); }
.tl-item.done .dot { background: var(--success); border-color: var(--success); color: #04160d; }
.tl-item.done .line { background: rgba(31, 212, 127, .4); }
.tl-item.current .dot { background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 0 0 5px rgba(77,124,255,.16); }
.tl-item.cancelled .dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tl-item .body { padding-bottom: 20px; min-width: 0; }
.tl-item .body b { display: block; font-size: 14px; }
.tl-item .body small { color: var(--ink-3); font-size: 12px; }
.tl-item:last-child .body { padding-bottom: 0; }

/* Conversation */
.thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.msg { display: flex; gap: 12px; max-width: 82%; }
.msg .bubble {
    padding: 13px 17px;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 14.5px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}
.msg .who { font-size: 11.5px; color: var(--ink-3); margin-bottom: 5px; display: flex; gap: 8px; align-items: center; }
.msg.mine { margin-inline-start: auto; flex-direction: row-reverse; }
.msg.mine .bubble {
    background: linear-gradient(135deg, rgba(77,124,255,.24), rgba(23,212,255,.12));
    border-color: rgba(77,124,255,.32);
    border-start-end-radius: 5px;
}
.msg.mine .who { justify-content: flex-end; }
.msg.theirs .bubble { border-start-start-radius: 5px; }
.msg.internal .bubble { background: var(--warning-soft); border-color: rgba(255,176,32,.3); }
.msg.internal .who { color: var(--warning); font-weight: 700; }

/* Pièces jointes — vignettes cliquables */
.attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 9px;
}
.attach-thumb {
    position: relative;
    display: block;
    padding: 0;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    overflow: hidden;
    cursor: zoom-in;
    transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.attach-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-thumb .tag {
    position: absolute;
    inset-block-start: 6px;
    inset-inline-start: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: rgba(5, 7, 15, .78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink);
    opacity: 0;
    transition: opacity .18s;
}
.attach-thumb:hover .tag, .attach-thumb:focus-visible .tag { opacity: 1; }
.attach-thumb .cap {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    padding: 14px 8px 5px;
    font-size: 10.5px;
    text-align: start;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(transparent, rgba(5, 7, 15, .9));
}

/* Visionneuse plein écran */
.viewer {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    background: rgba(3, 5, 11, .93);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: flashIn .22s var(--ease) both;
}
.viewer[hidden] { display: none; }
.viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 14, 26, .85);
}
.viewer-name {
    font-size: 12.5px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-body {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 18px;
    min-height: 0;
}
.viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}
.viewer-body iframe {
    width: min(1000px, 100%);
    height: 100%;
    border: 0;
    border-radius: 10px;
    background: #fff;
}

/* Pièces jointes — fichiers non images */
.attach-list { display: flex; flex-direction: column; gap: 9px; }
.attach {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: all .18s;
}
.attach:hover { border-color: var(--accent); background: var(--accent-soft); }
.attach .ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--surface-2); color: var(--accent-2); flex: none; }
.attach .ic svg { width: 17px; height: 17px; }
.attach .meta { min-width: 0; }
.attach .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach .meta small { color: var(--ink-3); font-size: 11.5px; }

/* Panneau de décision admin */
/* `1fr` vaut `minmax(auto, 1fr)` : une piste ne descend jamais sous la largeur
   min-content de son contenu. Comme les boutons sont en `nowrap`, un libellé long
   (« Annuler la demande ») débordait de la colonne. On force donc `minmax(0, 1fr)`
   et on autorise le retour à la ligne dans ces boutons-là. */
.decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.decision-grid .btn-block { width: 100%; }
.decision-grid .btn { white-space: normal; text-align: center; line-height: 1.3; padding-inline: 11px; }

/* Bandeau d'état pour le client */
.status-banner {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 18px 20px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface-2);
    margin-bottom: 22px;
}
.status-banner .ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; flex: none; }
.status-banner .ic svg { width: 20px; height: 20px; }
.status-banner b { display: block; font-size: 15px; margin-bottom: 3px; }
.status-banner p { font-size: 14px; color: var(--ink-2); }
.status-banner.ok { background: var(--success-soft); border-color: rgba(31,212,127,.3); }
.status-banner.ok .ic { background: var(--success); color: #04160d; }
.status-banner.wait { background: var(--warning-soft); border-color: rgba(255,176,32,.28); }
.status-banner.wait .ic { background: var(--warning); color: #201400; }
.status-banner.bad { background: var(--danger-soft); border-color: rgba(255,84,112,.28); }
.status-banner.bad .ic { background: var(--danger); color: #fff; }
.status-banner.info { background: var(--info-soft); border-color: rgba(23,212,255,.28); }
.status-banner.info .ic { background: var(--info); color: #04222b; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
    padding: 12px 18px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--ink-3);
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    transition: color .18s, border-color .18s;
    margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .3s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
    width: 46px; height: 26px; border-radius: 99px;
    background: rgba(255,255,255,.11);
    border: 1px solid var(--line-strong);
    position: relative;
    transition: background .22s;
    flex: none;
}
.switch .track::after {
    content: '';
    position: absolute;
    top: 2px; inset-inline-start: 2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--ink-2);
    transition: transform .22s var(--ease), background .22s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { background: #fff; transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-20px); }

/* Page d'erreur */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; text-align: center; }
.error-page .code { font-size: clamp(5rem, 18vw, 9rem); font-weight: 900; line-height: .9; letter-spacing: -0.06em; }
.error-page h1 { font-size: 1.6rem; margin: 18px 0 12px; }
.error-page p { color: var(--ink-2); max-width: 44ch; margin: 0 auto 30px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1150px) {
    .detail-grid { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: 1fr; gap: 46px; }
    .hero-visual { max-width: 460px; }
}

@media (max-width: 980px) {
    :root { --sidebar-w: 0px; }

    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: 280px;
        transform: translateX(-105%);
        transition: transform .3s var(--ease);
        box-shadow: var(--shadow-lg);
        background: rgba(7, 10, 20, .98);
    }
    html[dir="rtl"] .sidebar { transform: translateX(105%); }
    .sidebar.open { transform: none; }
    .scrim {
        position: fixed; inset: 0; z-index: 79;
        background: rgba(0, 0, 0, .6);
        backdrop-filter: blur(3px);
        opacity: 0; pointer-events: none;
        transition: opacity .3s;
    }
    .scrim.show { opacity: 1; pointer-events: auto; }
    .burger { display: inline-grid; }

    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }

    .site-nav { display: none; }
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .topbar { padding-inline: 15px; }
    .app-body { padding: 16px 13px; }
}

@media (max-width: 620px) {
    body { font-size: 14.2px; }
    .container, .container-narrow { width: calc(100% - 32px); }
    .section { padding: 58px 0; }
    .hero { padding: 52px 0 44px; }
    .card { padding: 15px; border-radius: var(--r); }
    .kv { grid-template-columns: 1fr; gap: 4px 0; }
    .kv dd { margin-bottom: 10px; }
    .decision-grid { grid-template-columns: 1fr; }
    .msg { max-width: 94%; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat .v { font-size: 21px; }
    .stat { padding: 12px 13px; }
    .cta-band { padding: 38px 22px; }
    .flash-stack { top: 76px; inset-inline: 16px; width: auto; }
    .header-actions .btn span.label { display: none; }
    /* Place gagnée dans l'en-tête mobile sans retirer aucun bouton :
       la baseline de la marque et le libellé de langue passent à la trappe,
       le globe et le nom du site suffisent. */
    .brand .name small { display: none; }
    .lang-switch span { display: none; }
    .lang-switch { padding: 6px 9px; }
    .chart { height: 150px; }
    .chart .lbl { display: none; }
    .chart .lbl.show-sm { display: block; }
}

@media print {
    .sidebar, .topbar, .flash-stack, .btn, .site-header, .site-footer { display: none !important; }
    body { background: #fff; color: #000; }
    .card { border-color: #ccc; box-shadow: none; background: #fff; }
}

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

/* ---------------- Inscription ---------------- */

.enroll-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.enroll-summary .ic {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex: none;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(23,212,255,.1));
    border: 1px solid rgba(77,124,255,.24);
    color: var(--accent-2);
}
.enroll-summary .ic svg { width: 20px; height: 20px; }
.enroll-summary .price { text-align: end; }
.enroll-summary .price small { display: block; font-size: 10.5px; color: var(--ink-3); }
.enroll-summary .price b { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }

/* Carte de modalite selectionnee dans l'administration */
.mode-card.is-active {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent), 0 20px 44px -30px rgba(0,0,0,.9);
}

.ic-mini {
    display: grid; place-items: center;
    width: 26px; height: 26px; flex: none;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--accent-2);
}
.ic-mini svg { width: 14px; height: 14px; }

/* ============================================================
   Vidéos de formation — vignettes, grille et lecteur
   ============================================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 14px;
}
.video-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.video-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.video-card.is-locked { opacity: .82; }
.video-card.is-locked:hover { transform: none; box-shadow: none; }

/* Vignette : dégradé sombre + gros bouton lecture au centre */
.video-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0;
    cursor: pointer;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(77, 124, 255, .22), transparent 62%),
        linear-gradient(155deg, #101827, #070a13);
    transition: background .2s var(--ease);
}
.video-thumb[aria-disabled="true"] { cursor: not-allowed; }
.video-card:hover .video-thumb:not([aria-disabled="true"]) {
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(77, 124, 255, .34), transparent 62%),
        linear-gradient(155deg, #142033, #070a13);
}
/* Trame technique discrète en fond de vignette */
.video-thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: .5;
    pointer-events: none;
}
.video-thumb .play {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 30px -8px var(--accent-glow);
    transition: transform .2s var(--ease), background .2s var(--ease);
}
/* En RTL, translate(-50%) part du mauvais côté : on repasse par une valeur logique */
[dir="rtl"] .video-thumb .play { transform: translate(50%, -50%); }
.video-card:hover .video-thumb:not([aria-disabled="true"]) .play { transform: translate(-50%, -50%) scale(1.08); }
[dir="rtl"] .video-card:hover .video-thumb:not([aria-disabled="true"]) .play { transform: translate(50%, -50%) scale(1.08); }
.video-thumb .play svg { width: 20px; height: 20px; }
.video-thumb .play.locked { background: var(--surface-2); color: var(--ink-3); box-shadow: none; border: 1px solid var(--line-strong); }
.video-thumb .video-time {
    position: absolute;
    inset-block-end: 9px;
    inset-inline-end: 9px;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    background: rgba(3, 5, 11, .78);
    color: var(--ink);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.video-kind {
    position: absolute;
    inset-block-start: 9px;
    inset-inline-start: 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    background: rgba(3, 5, 11, .78);
    color: var(--ink-2);
    font-size: 11px;
}
.video-kind svg { width: 12px; height: 12px; }

.video-body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 5px; }
/* Deux lignes au plus : un titre long ne doit pas déformer la grille. */
.video-body > b {
    font-size: 13.5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-body .row { margin-top: 2px; }

/* Bloc d'édition repliable, dans le corps de la carte (admin) */
.video-edit { border-top: 1px solid var(--line); margin-inline: -13px; }
.video-edit > summary {
    list-style: none;
    cursor: pointer;
    padding: 9px 13px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 7px;
}
.video-edit > summary::-webkit-details-marker { display: none; }
.video-edit > summary::marker { content: ''; }
.video-edit > summary:hover { color: var(--ink); background: var(--surface-2); }
.video-edit > summary svg { width: 14px; height: 14px; }
.video-edit[open] > summary { color: var(--ink); border-bottom: 1px solid var(--line); }
.video-edit > form { padding: 12px 13px 4px; }
.video-edit .field { margin-bottom: 9px; }
.video-edit .input, .video-edit .select { font-size: 12.5px; }

/* ---------------- Panneau « Ajouter une vidéo » ---------------- */

/*
 * Replié, le panneau ne montre qu'un bouton : la page s'ouvre donc sur la
 * liste des vidéos déjà publiées, qui est ce que l'on vient consulter le
 * plus souvent. Le formulaire complet se déplie à la demande.
 */
.add-panel { padding: 0; }
.add-panel > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 19px;
    border-radius: var(--r);
}
.add-panel > summary::-webkit-details-marker { display: none; }
.add-panel > summary::marker { content: ''; }
.add-panel > summary:hover .btn-primary { filter: brightness(1.07); }
.add-panel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Le bouton n'est qu'un habillage : c'est le summary qui reçoit le clic. */
.add-panel > summary .btn { pointer-events: none; }
.add-panel > summary .chev {
    display: inline-flex;
    color: var(--ink-3);
    transition: transform .2s var(--ease);
}
.add-panel > summary .chev svg { width: 16px; height: 16px; }
.add-panel[open] > summary {
    border-bottom: 1px solid var(--line);
    border-end-start-radius: 0;
    border-end-end-radius: 0;
}
.add-panel[open] > summary .chev { transform: rotate(180deg); }
.add-body { padding: 16px 19px 19px; }
.add-body > .sub { font-size: 13px; color: var(--ink-3); margin: 0 0 15px; }

/* Rang d'affichage : rend l'ordre de la liste lisible d'un coup d'œil. */
.video-card { position: relative; }
.video-rank {
    position: absolute;
    inset-block-start: 9px;
    inset-inline-start: 9px;
    z-index: 2;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(6, 10, 20, .74);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Vidéo qui vient d'être publiée : repérable sans avoir à la chercher. */
.video-card.is-new {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    animation: video-new-in .5s var(--ease) both;
}
.video-card.is-new .video-rank {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
@keyframes video-new-in {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .video-card.is-new { animation: none; }
}
/* ================= Espace de cours : lecteur + liste des séances =================
   Disposition classique des sites de vidéo : une scène large à gauche, la
   suite des séances à droite, et tout passe l'un sous l'autre sur mobile. */

.tube {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 372px;
    gap: 24px;
    align-items: start;
}
.tube-main { min-width: 0; }

/* Scène : fond noir, comme un lecteur. Le ratio est fixé pour éviter que la
   page ne saute au chargement de la vidéo. */
.tube-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.tube-stage video,
.tube-stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.tube-title {
    font-size: 20px;
    line-height: 1.35;
    margin: 15px 0 0;
    font-weight: 700;
}

.tube-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.tube-chan { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tube-ava {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .3px;
}
.tube-chan-txt { display: flex; flex-direction: column; min-width: 0; }
.tube-chan-txt b { font-size: 14.5px; }
.tube-chan-txt small { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.tube-pos {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
}
.tube-pos svg { width: 14px; height: 14px; }

/* Description repliée, dépliable d'un clic */
.tube-desc {
    margin-top: 15px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.tube-desc > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    font-size: 13.5px;
}
.tube-desc > summary::-webkit-details-marker { display: none; }
.tube-desc > summary::marker { content: ''; }
.tube-desc > summary .chev { display: inline-flex; color: var(--ink-3); transition: transform .2s var(--ease); }
.tube-desc > summary .chev svg { width: 16px; height: 16px; }
.tube-desc[open] > summary .chev { transform: rotate(180deg); }
.tube-desc p { margin: 0; padding: 0 16px 15px; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }

/* ---- Liste latérale des séances ---- */
.tube-rail { min-width: 0; }
.tube-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
    font-size: 14.5px;
}
.tube-list { display: flex; flex-direction: column; gap: 8px; }

.tube-item {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    text-align: start;
    transition: background .16s var(--ease), border-color .16s var(--ease);
}
.tube-item:hover { background: var(--surface-2); }
.tube-item.is-active { background: var(--surface-2); border-color: var(--line-strong); }

.tube-thumb {
    position: relative;
    flex: none;
    width: 158px;
    aspect-ratio: 16 / 9;
    border-radius: 9px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(77, 124, 255, .22), transparent 62%),
        linear-gradient(155deg, #101827, #070a13);
}
.tube-thumb .ic {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .13);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.tube-thumb .ic svg { width: 16px; height: 16px; }
/* Durée en surimpression, coin bas de la vignette */
.tube-time {
    position: absolute;
    inset-block-end: 5px;
    inset-inline-end: 5px;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
/* « En lecture » ne s'affiche que sur la séance en cours */
.tube-now {
    position: absolute;
    inset-block-start: 5px;
    inset-inline-start: 5px;
    display: none;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 10.5px;
    font-weight: 700;
}
.tube-item.is-active .tube-now { display: block; }
.tube-item.is-active .tube-thumb .ic { background: var(--accent); }

.tube-item-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-block-start: 2px; }
.tube-item-txt b {
    font-size: 13.5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tube-item-txt small { font-size: 12px; color: var(--ink-3); }

@media (max-width: 1100px) {
    .tube { grid-template-columns: minmax(0, 1fr); }
    .tube-rail { margin-top: 22px; }
    .tube-thumb { width: 168px; }
}
@media (max-width: 560px) {
    .tube-stage { border-radius: 0; margin-inline: -14px; border-inline: 0; }
    .tube-title { font-size: 17px; }
    .tube-thumb { width: 132px; }
}
/* Inscription réglée : la carte du plan ouvre l'espace de cours */
.ticket-card.is-openable:hover { border-color: var(--accent); }
.ticket-card .open-hint { color: var(--accent); font-weight: 600; }
/* Progression d'un envoi de vidéo */
.upload-progress { margin-bottom: 14px; }
.upload-progress .bar {
    height: 7px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}
.upload-progress .bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s var(--ease);
}
.upload-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--ink-2);
}
.upload-meta .pct { font-variant-numeric: tabular-nums; color: var(--ink); }
.upload-progress .hint { margin-top: 4px; }

/* Pendant l'envoi : plus rien n'est modifiable, et le panneau ne peut pas
   être replié par mégarde sur une barre en cours. */
.is-uploading .field,
.is-uploading .dropzone { opacity: .55; pointer-events: none; }
.is-uploading button[type="submit"] { opacity: .55; pointer-events: none; }
/* Lecture plein écran */
.viewer-body video {
    width: min(1100px, 100%);
    max-height: 100%;
    border-radius: 10px;
    background: #000;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 560px) {
    .video-grid { grid-template-columns: 1fr; }
    .video-thumb .play { width: 46px; height: 46px; }
}

/* ============================================================
   Compléments — barre de téléversement, listes et blocs verrouillés
   ============================================================ */

/* ---------- Progression du téléversement d'une vidéo ---------- */
.upload-bar {
    margin: 14px 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}
.upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 12.5px;
    color: var(--ink-2);
}
.upload-track {
    height: 8px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    overflow: hidden;
}
.upload-fill {
    height: 100%;
    width: 0;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s var(--ease);
}
/* Pendant le traitement serveur, la barre respire : l'utilisateur voit que
   quelque chose se passe encore alors que le pourcentage ne bouge plus. */
.upload-bar[data-state="processing"] .upload-fill { animation: pulseFill 1.1s ease-in-out infinite; }
.upload-bar[data-state="done"] .upload-fill { background: var(--success); animation: none; }
@keyframes pulseFill { 50% { opacity: .55; } }

.upload-bar #upload-cancel { margin-top: 9px; }
.upload-note { margin-top: 9px; font-size: 12.5px; }
.upload-note-success { color: var(--success); }
.upload-note-error   { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
    .upload-fill { transition: none; animation: none; }
}

/* ---------- Coordonnées verrouillées ---------- */
.locked-fields, .locked-block {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}
.locked-block { border: 0; padding: 0; margin-bottom: 14px; }
.locked-fields dt {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
}
.locked-fields dd { margin: 0 0 11px; font-size: 14px; font-weight: 600; }
.locked-fields dd:last-child { margin-bottom: 0; }

/* ---------- Lignes cliquables ---------- */
.ticket-row, .user-row, .cat-row, .plan-card {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    margin-bottom: 8px;
    transition: border-color .18s var(--ease);
}
.ticket-row:hover, .cat-row:hover, .plan-card:hover { border-color: var(--line-strong); }
.ticket-row b, .plan-card b { font-size: 13.5px; }
.user-row form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.user-row input, .user-row select { max-width: 190px; }

/* ---------- Répartition par statut ---------- */
.status-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.status-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
}

/* ---------- Histogramme des 14 derniers jours ---------- */
.spark {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 92px;
    padding-top: 6px;
}
.spark-bar {
    flex: 1;
    min-width: 6px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-soft));
}

/* ---------- Séparateur et libellé de section dans la barre latérale ---------- */
.nav-sep {
    display: block;
    margin: 15px 0 7px;
    padding-inline-start: 12px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-3);
}
.nav-badge-admin {
    display: block;
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

/* ---------- Récapitulatif d'inscription ---------- */
.recap {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    margin-bottom: 16px;
}
.recap b { font-size: 15px; }

/* La visionneuse bloque le défilement du fond pendant la lecture. */
body.viewer-open-lock { overflow: hidden; }
/* ==========================================================================
   Le plan et la salle de cours
   --------------------------------------------------------------------------
   Tout est écrit en propriétés logiques — inset-inline-start plutôt que left,
   margin-inline plutôt que margin-left. La même feuille sert donc en français
   et en arabe, sans miroir écrit à la main.
   ========================================================================== */

/* --------------------------------------------------------------- le plan */

.grille-plan {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 12px;
}

/* La fiche entière est le lien : on n'a pas à viser un bouton pour entrer. */
.fiche-plan {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    text-decoration: none;
    color: inherit;
    transition: transform 0.14s var(--ease), border-color 0.14s var(--ease),
                background 0.14s var(--ease);
}

.fiche-plan:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.fiche-plan.est-ouverte { border-inline-start: 3px solid var(--success); }

.fiche-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.fiche-titre {
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fiche-faits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--ink-3);
    font-size: 12px;
}

.fiche-faits > span { display: inline-flex; align-items: center; gap: 4px; }
.fiche-faits svg { width: 13px; height: 13px; }

.fiche-pied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.fiche-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent-2);
}

.fiche-action svg { width: 14px; height: 14px; }
html[dir="rtl"] .fiche-action svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------- la scène */

.salle-scene { max-inline-size: 1180px; margin-inline: auto; }

.scene {
    position: relative;
    background: #000;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.scene video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
    cursor: pointer;
}

.scene.plein { border-radius: 0; border: 0; aspect-ratio: auto; height: 100vh; }

/* Le curseur disparaît avec les commandes : rien ne flotte sur l'image. */
.scene.sans-controles { cursor: none; }
.scene.sans-controles .controles { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* ------------------------------------------------------- attente et départ */

.attente { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

.rouet {
    width: 46px;
    height: 46px;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: rouet 0.8s linear infinite;
}

@keyframes rouet { to { transform: rotate(360deg); } }

.grande-icone {
    position: absolute;
    inset-inline-start: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    inline-size: 78px;
    block-size: 78px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 14, 26, 0.62);
    backdrop-filter: blur(6px);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.16s var(--ease), background 0.16s var(--ease);
}

html[dir="rtl"] .grande-icone { transform: translate(50%, -50%); }
.grande-icone:hover { background: var(--accent); transform: translate(-50%, -50%) scale(1.07); }
html[dir="rtl"] .grande-icone:hover { transform: translate(50%, -50%) scale(1.07); }
.grande-icone svg { width: 34px; height: 34px; margin-inline-start: 3px; }
html[dir="rtl"] .grande-icone svg { transform: scaleX(-1); }

/* -------------------------------------------------------------- commandes */

.controles {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 26px 12px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.45) 55%, transparent);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.rangee-controles { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.pousse { flex: 1; }

.cmd {
    inline-size: 38px;
    block-size: 38px;
    border: 0;
    background: transparent;
    color: #fff;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.14s var(--ease), opacity 0.14s var(--ease);
}

.cmd:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.cmd:disabled { opacity: 0.32; cursor: default; }
.cmd svg { width: 20px; height: 20px; }

.cmd-texte {
    inline-size: auto;
    padding-inline: 11px;
    font-weight: 800;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* Les icônes directionnelles suivent le sens de lecture. */
html[dir="rtl"] #btn-precedent svg,
html[dir="rtl"] #btn-suivant svg,
html[dir="rtl"] .si-lecture svg { transform: scaleX(-1); }

/* Une seule icône visible à la fois, selon l'état. */
.si-pause, #btn-lecture[data-etat="pause"] .si-lecture { display: none; }
#btn-lecture[data-etat="pause"] .si-pause { display: grid; }

.si-bas, .si-muet { display: none; }
#btn-muet[data-niveau="bas"]  .si-haut { display: none; }
#btn-muet[data-niveau="bas"]  .si-bas  { display: grid; }
#btn-muet[data-niveau="muet"] .si-haut { display: none; }
#btn-muet[data-niveau="muet"] .si-muet { display: grid; }

/* --------------------------------------------------------- barre de temps */

.piste-temps {
    position: relative;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.piste-temps::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.26);
    border-radius: var(--r-pill);
    transition: height 0.12s var(--ease);
}

.piste-temps:hover::before, .piste-temps:focus-visible::before { height: 6px; }

.tampon, .remplissage {
    position: absolute;
    inset-inline-start: 0;
    height: 4px;
    border-radius: var(--r-pill);
    transition: height 0.12s var(--ease);
}

.tampon { background: rgba(255, 255, 255, 0.34); width: 0; }
.remplissage { background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; }
.piste-temps:hover .tampon, .piste-temps:hover .remplissage { height: 6px; }

.poignee {
    position: absolute;
    inline-size: 13px;
    block-size: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.12s var(--ease);
    pointer-events: none;
}

html[dir="rtl"] .poignee { transform: translateX(50%); }
.piste-temps:hover .poignee, .piste-temps:focus-visible .poignee { opacity: 1; }

.bulle {
    position: absolute;
    bottom: 22px;
    transform: translateX(-50%);
    background: rgba(8, 12, 24, 0.94);
    border: 1px solid var(--line-strong);
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    pointer-events: none;
    white-space: nowrap;
}

html[dir="rtl"] .bulle { transform: translateX(50%); }

.horloge {
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    padding-inline: 8px;
    white-space: nowrap;
}

.horloge .separe { opacity: 0.5; margin-inline: 3px; }

/* -------------------------------------------------------------- le volume */

.bloc-volume { display: flex; align-items: center; }

.volume {
    inline-size: 0;
    opacity: 0;
    accent-color: var(--accent-2);
    transition: inline-size 0.18s var(--ease), opacity 0.18s var(--ease);
    cursor: pointer;
}

.bloc-volume:hover .volume, .volume:focus-visible {
    inline-size: 84px;
    opacity: 1;
    margin-inline-end: 6px;
}

/* ------------------------------------------------------------- la vitesse */

.bloc-vitesse { position: relative; }

.menu-vitesse {
    position: absolute;
    bottom: 46px;
    inset-inline-end: 0;
    background: rgba(8, 12, 24, 0.97);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 5px;
    display: grid;
    gap: 1px;
    min-inline-size: 92px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
    z-index: 5;
}

.menu-vitesse button {
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: start;
}

.menu-vitesse button:hover { background: rgba(255, 255, 255, 0.1); }
.menu-vitesse button.is-active { background: var(--accent); color: var(--accent-ink); }

/* ----------------------------------------------------------- sous la scène */

.sous-scene { padding: 14px 2px 4px; }
.sous-scene h2 { font-size: 19px; margin: 0 0 4px; }

/* ------------------------------------------------------------- les leçons */

.lecons {
    max-inline-size: 1180px;
    margin-inline: auto;
    margin-block-start: 18px;
}

.lecons-tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.lecons-tete .sub { color: var(--ink-3); font-size: 12px; margin-inline-start: 8px; }

.jauge {
    height: 4px;
    background: var(--surface-2);
    border-radius: var(--r-pill);
    overflow: hidden;
    margin-bottom: 14px;
}

.jauge span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--success));
    transition: width 0.4s var(--ease);
}

/* Cinq par rangée sur grand écran, puis la grille se replie d'elle-même. */
.grille-lecons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1400px) { .grille-lecons { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .grille-lecons { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .grille-lecons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .grille-lecons { grid-template-columns: 1fr; } }

.piste { cursor: pointer; display: grid; gap: 7px; }

.piste-vignette {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0b1020, #141c33);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    overflow: hidden;
    transition: border-color 0.14s var(--ease), transform 0.14s var(--ease);
}

.piste:hover .piste-vignette { border-color: var(--line-strong); transform: translateY(-2px); }

.piste.is-active .piste-vignette {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.piste-jouer {
    display: grid;
    place-items: center;
    inline-size: 42px;
    block-size: 42px;
    border-radius: 50%;
    background: rgba(10, 14, 26, 0.6);
    color: #fff;
    transition: background 0.14s var(--ease), transform 0.14s var(--ease);
}

.piste-jouer svg { width: 18px; height: 18px; margin-inline-start: 2px; }
html[dir="rtl"] .piste-jouer svg { transform: scaleX(-1); }
.piste:hover .piste-jouer { background: var(--accent); transform: scale(1.08); }
.piste.is-active .piste-jouer { background: var(--accent); }

.piste-num {
    position: absolute;
    inset-block-start: 6px;
    inset-inline-start: 6px;
    min-inline-size: 20px;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    background: rgba(0, 0, 0, 0.66);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.piste-duree {
    position: absolute;
    inset-block-end: 6px;
    inset-inline-end: 6px;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.piste-vue {
    position: absolute;
    inset-block-start: 6px;
    inset-inline-end: 6px;
    inline-size: 19px;
    block-size: 19px;
    border-radius: 50%;
    background: var(--success);
    color: #04250f;
    display: none;
    place-items: center;
}

.piste-vue svg { width: 12px; height: 12px; stroke-width: 3.4; }
.piste.is-vue .piste-vue { display: grid; }
.piste.is-vue .piste-vignette { opacity: 0.72; }

.reprise-cadre {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.22);
}

.reprise { display: block; height: 100%; width: 0; background: var(--accent-2); }

.piste-texte { min-width: 0; }

.piste-texte b {
    display: -webkit-box;
    font-size: 13.5px;
    line-height: 1.34;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.piste.is-active .piste-texte b { color: var(--accent-2); }

.piste-meta {
    display: block;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}
