/* QuickOps — surcouche Bootstrap 5.3 à la marque du client.
   Les variables --qo-* sont injectées par base.html depuis l'apparence
   configurée (app/services/apparence_service.py) : aucune couleur de
   marque n'est écrite en dur ici. Propriétés logiques (inline-start/end)
   partout : la mise en page se retourne d'elle-même en arabe. */

:root {
    --qo-sidebar-largeur: 256px;
    --qo-ombre: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
    --qo-fond: #f4f6fb;
    --qo-surface: #ffffff;
    --qo-bordure: #e2e8f0;
    /* 4,5:1 minimum sur --qo-fond comme sur --qo-surface. */
    --qo-texte-doux: #526077;

    --bs-primary: var(--qo-primaire);
    --bs-primary-rgb: var(--qo-primaire-rgb);
    --bs-link-color: var(--qo-primaire);
    --bs-link-color-rgb: var(--qo-primaire-rgb);
    --bs-link-hover-color: var(--qo-primaire-survol);
    --bs-border-radius: var(--qo-rayon);
    --bs-border-radius-lg: calc(var(--qo-rayon) * 1.4);
    --bs-body-font-family: var(--qo-police), system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-bg: var(--qo-fond);
    --bs-focus-ring-color: rgba(var(--qo-primaire-rgb), .35);
}
/* Arabe : la police de marque garde le texte latin, les glyphes arabes
   viennent d'une police dessinée pour l'écran (chargée dans cette langue). */
html[lang="ar"] { --bs-body-font-family: var(--qo-police), "IBM Plex Sans Arabic", system-ui, sans-serif; }

[data-bs-theme="dark"] {
    --qo-fond: #0b1120;
    --qo-surface: #111a2e;
    --qo-bordure: #1f2a44;
    --qo-texte-doux: #a3adc2;
    --qo-ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --bs-body-bg: var(--qo-fond);
    --bs-link-color: var(--qo-primaire-sombre);
    --bs-link-hover-color: #ffffff;
}

body { background: var(--qo-fond); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }
.text-doux { color: var(--qo-texte-doux) !important; }

/* Focus clavier toujours visible (WCAG 2.4.7). */
:focus-visible { outline: 3px solid rgba(var(--qo-primaire-rgb), .6); outline-offset: 2px; }
.qo-lien-evitement {
    position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 2000;
    background: var(--qo-primaire); color: var(--qo-primaire-texte); padding: .5rem 1rem; border-radius: var(--qo-rayon);
}
.qo-lien-evitement:focus { inset-inline-start: 8px; }

/* ---------- Boutons ---------- */
.btn-primary {
    --bs-btn-bg: var(--qo-primaire); --bs-btn-border-color: var(--qo-primaire); --bs-btn-color: var(--qo-primaire-texte);
    --bs-btn-hover-bg: var(--qo-primaire-survol); --bs-btn-hover-border-color: var(--qo-primaire-survol); --bs-btn-hover-color: var(--qo-primaire-texte);
    --bs-btn-active-bg: var(--qo-primaire-survol); --bs-btn-active-border-color: var(--qo-primaire-survol);
    --bs-btn-disabled-bg: var(--qo-primaire); --bs-btn-disabled-border-color: var(--qo-primaire);
    font-weight: 600;
}
.btn-outline-primary {
    --bs-btn-color: var(--qo-primaire); --bs-btn-border-color: var(--qo-primaire);
    --bs-btn-hover-bg: var(--qo-primaire); --bs-btn-hover-border-color: var(--qo-primaire); --bs-btn-hover-color: var(--qo-primaire-texte);
    font-weight: 600;
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--qo-primaire-sombre); --bs-btn-border-color: var(--qo-primaire-sombre); }
/* Le gris Bootstrap des boutons secondaires n'atteint pas 4,5:1 sur le fond de page. */
.btn-outline-secondary { --bs-btn-color: var(--qo-texte-doux); --bs-btn-border-color: var(--qo-bordure); }

/* ---------- Structure ---------- */
.qo-shell { display: flex; min-height: 100vh; }
.qo-sidebar { width: var(--qo-sidebar-largeur); background: var(--qo-navigation) !important; color: #fff; flex-shrink: 0; }
@media (min-width: 992px) { .qo-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.qo-sidebar.offcanvas-lg { --bs-offcanvas-width: var(--qo-sidebar-largeur); --bs-offcanvas-bg: var(--qo-navigation); --bs-offcanvas-color: #fff; }
.qo-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; height: 100%; }
.qo-marque { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.qo-marque:hover { color: #fff; }
.qo-marque img { max-height: 40px; max-width: 160px; object-fit: contain; }
.qo-monogramme {
    width: 40px; height: 40px; border-radius: calc(var(--qo-rayon) * 1.2); display: grid; place-items: center;
    font-weight: 800; background: var(--qo-accent); color: var(--qo-accent-texte);
}
.qo-marque-nom { font-weight: 800; font-size: 1.1rem; }
.qo-filet-accent { height: 3px; margin: 0 1.25rem 1rem; border-radius: 3px; background: linear-gradient(90deg, var(--qo-accent), transparent); }
[dir="rtl"] .qo-filet-accent { background: linear-gradient(-90deg, var(--qo-accent), transparent); }
.qo-nav-section { padding: .9rem 1.25rem .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .72); font-weight: 700; }
.qo-nav { list-style: none; margin: 0; padding: 0 .75rem; }
.qo-nav a {
    display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; margin-bottom: 2px;
    color: rgba(255, 255, 255, .88); text-decoration: none; border-radius: var(--qo-rayon); font-weight: 500;
}
.qo-nav a:hover { background: var(--qo-navigation-survol); color: #fff; }
.qo-nav a.active { background: var(--qo-navigation-actif); color: #fff; box-shadow: inset 3px 0 0 var(--qo-accent); }
[dir="rtl"] .qo-nav a.active { box-shadow: inset -3px 0 0 var(--qo-accent); }
.qo-sidebar-pied { margin-top: auto; padding: 1rem 1.25rem; font-size: .8rem; color: rgba(255, 255, 255, .75); }

.qo-principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qo-barre-haute {
    position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .6rem; padding: .7rem 1.25rem;
    background: color-mix(in srgb, var(--qo-fond) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--qo-bordure);
}
.qo-horloge { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .85rem; color: var(--qo-texte-doux); }
.qo-contenu { padding: 1.5rem 1.25rem 3rem; flex: 1; }
@media (min-width: 1200px) { .qo-contenu { padding-inline: 2.25rem; } }
.qo-pied { padding: 1rem 1.25rem; font-size: .8rem; color: var(--qo-texte-doux); border-top: 1px solid var(--qo-bordure); }

.qo-entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.qo-entete-page h1 { font-size: 1.6rem; margin: 0; }
.qo-fil { font-size: .85rem; color: var(--qo-texte-doux); margin-bottom: .25rem; }
.qo-fil a { color: inherit; }
[dir="rtl"] .qo-fil .bi-chevron-right { display: inline-block; transform: scaleX(-1); }

/* ---------- Surfaces ---------- */
.qo-carte { background: var(--qo-surface); border: 1px solid var(--qo-bordure); border-radius: var(--bs-border-radius-lg); box-shadow: var(--qo-ombre); }
.qo-carte-corps { padding: 1.25rem; }
.qo-carte-titre { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.qo-tuile { text-decoration: none; color: inherit; position: relative; }
.qo-tuile:hover { box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
.qo-tuile-icone {
    position: absolute; inset-inline-end: 1rem; top: 1rem; width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; background: var(--qo-primaire-doux); color: var(--qo-primaire);
}
[data-bs-theme="dark"] .qo-tuile-icone { background: rgba(var(--qo-primaire-rgb), .25); color: var(--qo-primaire-sombre); }
.qo-tuile-valeur { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; padding-inline-end: 3rem; }
.qo-tuile-libelle { color: var(--qo-texte-doux); font-size: .88rem; margin-top: .35rem; }
.qo-graphique { position: relative; height: 260px; }

.qo-table { margin: 0; --bs-table-bg: transparent; }
.qo-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--qo-texte-doux); font-weight: 700; white-space: nowrap; }
.qo-table td { border-color: var(--qo-bordure); }

/* États : fond doux + texte foncé, ≥ 4,5:1 dans les deux thèmes, toujours avec une icône. */
.qo-pastille { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.qo-pastille-succes { background: #dcfce7; color: #14532d; }
.qo-pastille-attention { background: #fef3c7; color: #713f12; }
.qo-pastille-danger { background: #fee2e2; color: #7f1d1d; }
.qo-pastille-neutre { background: #e5e7eb; color: #1f2937; }

.qo-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--qo-primaire-doux); color: var(--qo-primaire); }
[data-bs-theme="dark"] .qo-avatar { background: rgba(var(--qo-primaire-rgb), .3); color: #fff; }

.form-label { font-weight: 600; font-size: .9rem; }
.form-control, .form-select { border-color: var(--qo-bordure); background-color: var(--qo-surface); }
.form-control:focus, .form-select:focus { border-color: var(--qo-primaire); box-shadow: 0 0 0 .2rem rgba(var(--qo-primaire-rgb), .2); }
.form-text { color: var(--qo-texte-doux); }
.form-check-input:checked { background-color: var(--qo-primaire); border-color: var(--qo-primaire); }
.qo-apercu-couleur { width: 46px; flex-shrink: 0; padding: 3px; }
.qo-apercu-image { max-height: 80px; max-width: 100%; background: repeating-conic-gradient(#e5e7eb 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 8px; }
.qo-ligne-appareil { border-bottom: 1px solid var(--qo-bordure); padding-bottom: .75rem; }
.qo-ligne-appareil:last-child { border-bottom: 0; padding-bottom: 0; }

.qo-onglets { flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--qo-bordure); }
.qo-onglets .nav-link { white-space: nowrap; color: var(--qo-texte-doux); font-weight: 600; border-bottom: 2px solid transparent; }
.qo-onglets .nav-link.active, .qo-onglets .nav-link:hover { color: var(--bs-body-color); border-bottom-color: var(--qo-primaire); }
.qo-onglets .badge { background: rgba(127, 127, 127, .18); color: inherit; }

/* ---------- Écrans publics ---------- */
.qo-public { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .qo-public { grid-template-columns: 1.1fr 1fr; } }
.qo-public-visuel {
    position: relative; display: none; color: #fff; overflow: hidden;
    background: radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--qo-primaire) 55%, transparent), transparent 60%), var(--qo-navigation);
}
@media (min-width: 992px) { .qo-public-visuel { display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; } }
.qo-public-visuel.avec-image { background-size: cover; background-position: center; }
.qo-public-visuel.avec-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 10, 25, .45), rgba(5, 10, 25, .85)); }
.qo-public-visuel > * { position: relative; }
.qo-public-slogan { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; line-height: 1.15; max-width: 18ch; }
.qo-logo-public { max-height: 48px; max-width: 200px; }
.qo-public-forme { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--qo-surface); }
.qo-public-forme > div { width: 100%; max-width: 420px; }

/* ---------- Sélecteur de contexte ---------- */
.qo-contexte .form-select { max-width: 22rem; min-width: 9rem; }
/* Téléphone : la barre passe sur deux lignes, le sélecteur occupe seul la
   seconde (sinon la barre déborde horizontalement dès 360 px). */
@media (max-width: 767.98px) {
    .qo-barre-haute { flex-wrap: wrap; row-gap: .5rem; }
    .qo-contexte { order: 10; flex: 1 0 100%; min-width: 0; }
    .qo-contexte .form-select { max-width: none; min-width: 0; flex: 1 1 auto; }
}

/* ---------- Arborescence de l'organisation ---------- */
.qo-arbre { list-style: none; margin: 0; padding-inline-start: 1.25rem; border-inline-start: 2px solid var(--qo-bordure); }
.qo-arbre > li { margin: .2rem 0; }
.qo-arbre-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding: .25rem .4rem; border-radius: var(--qo-rayon); }
.qo-arbre-ligne:hover { background: rgba(var(--qo-primaire-rgb), .05); }
.qo-arbre-nom { margin-inline-end: auto; min-width: 0; overflow-wrap: anywhere; }
.qo-actions { display: inline-flex; align-items: center; }
.qo-actions .btn-link { color: var(--qo-texte-doux); padding: .15rem .35rem; }
.qo-actions .btn-link:hover { color: var(--bs-link-color); }
.qo-actions .btn-link.text-danger { color: #b42318 !important; }
[data-bs-theme="dark"] .qo-actions .btn-link.text-danger { color: #fda29b !important; }
.qo-liste-postes { max-height: 26rem; overflow-y: auto; }

.qo-vide { text-align: center; padding: 2.5rem 1rem; color: var(--qo-texte-doux); }
.qo-vide .bi { font-size: 2.4rem; display: block; margin-bottom: .75rem; color: var(--qo-primaire); }
[data-bs-theme="dark"] .qo-vide .bi { color: var(--qo-primaire-sombre); }
.toast-container { z-index: 1090; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .qo-sidebar, .qo-barre-haute, .qo-pied, form { display: none !important; } }

/* Photo d'identite (fiche utilisateur) */
.qo-photo { width: 5rem; height: 5rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.qo-photo-vide { display: inline-flex; align-items: center; justify-content: center; background: var(--qo-bordure); color: var(--bs-body-color); font-weight: 600; font-size: 1.5rem; }
.qo-secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.25rem; letter-spacing: .05em; user-select: all; overflow-wrap: anywhere; }
.qo-liste-droits > li + li { border-top: 1px solid var(--qo-bordure); }
.qo-qr svg { width: 12rem; height: auto; background: #fff; padding: .25rem; border-radius: .5rem; }
/* Un element en position absolue (libelle .visually-hidden) dans un tableau
   defilant doit rester dans son cadre : sinon il elargit toute la page. */
.table-responsive { position: relative; }

/* Priorite d'une activite (journal) : barres pleines selon le niveau,
   toujours doublees d'un texte (jamais la couleur seule). */
.qo-priorite { display: inline-flex; gap: 2px; align-items: flex-end; }
.qo-priorite span { width: 4px; height: 12px; border-radius: 1px; background: var(--qo-bordure); }
.qo-priorite-1 span:nth-child(-n+1) { background: #15803d; }
.qo-priorite-2 span:nth-child(-n+2) { background: #b45309; }
.qo-priorite-3 span { background: #b91c1c; }
.qo-activite-attention { color: #92400e; }
.qo-activite-danger { color: #b91c1c; }
[data-bs-theme="dark"] .qo-activite-attention { color: #fbbf24; }
[data-bs-theme="dark"] .qo-activite-danger { color: #fca5a5; }

/* Createur de formulaire */
.qo-groupe-createur { border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); padding: .5rem; background: var(--qo-surface); }
.qo-groupe-selectionne { border-color: var(--qo-primaire); box-shadow: 0 0 0 2px rgba(var(--qo-primaire-rgb), .2); }
.qo-groupe-reserve { opacity: .65; }
.qo-groupe-entete { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .25rem .25rem .5rem; }
.qo-zone-depot { min-height: 3rem; border: 2px dashed transparent; border-radius: var(--qo-rayon); padding: .25rem; }
.qo-zone-active { border-color: var(--qo-primaire); background: rgba(var(--qo-primaire-rgb), .06); }
.qo-zone-vide { padding: 1rem; text-align: center; color: var(--qo-texte-doux); border: 2px dashed var(--qo-bordure); border-radius: var(--qo-rayon); }
.qo-carte-champ { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .4rem .5rem; margin-bottom: .25rem; border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); background: var(--bs-body-bg); cursor: grab; }
.qo-palette-element { cursor: grab; }
.qo-pastille-obligation { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; vertical-align: middle; }
.qo-pastille-obligation.qo-ouvert { background: #c2410c; }
.qo-pastille-obligation.qo-cloture { background: #b91c1c; }
.qo-dialogue { border: 0; border-radius: var(--qo-rayon); padding: 1.25rem; width: min(40rem, 94vw); background: var(--qo-surface); color: inherit; box-shadow: var(--qo-ombre); }
.qo-dialogue::backdrop { background: rgba(15, 23, 42, .45); }
.qo-apercu-mobile { max-width: 20rem; margin: 0 auto; border: 8px solid #1f2937; border-radius: 1.5rem; padding: .75rem; background: var(--bs-body-bg); max-height: 32rem; overflow-y: auto; }
.qo-apercu-titre-groupe { font-weight: 700; background: var(--qo-bordure); padding: .25rem .5rem; border-radius: .25rem; margin: .5rem 0 .25rem; }
.qo-apercu-champ { padding: .3rem 0; border-bottom: 1px solid var(--qo-bordure); }
.qo-apercu-conditionnel { border-left: 3px dotted var(--qo-texte-doux); padding-left: .4rem; }
.qo-apercu-saisie { height: 1.6rem; border: 1px solid var(--qo-bordure); border-radius: .25rem; margin-top: .2rem; font-size: .75rem; text-align: right; padding-right: .3rem; }
.qo-apercu-zone { height: 3rem; border: 1px dashed var(--qo-bordure); border-radius: .25rem; display: flex; align-items: center; justify-content: center; margin-top: .2rem; }
.qo-apercu-bouton { display: inline-block; padding: .1rem .5rem; border: 1px solid var(--qo-bordure); border-radius: .25rem; margin-top: .2rem; }
.qo-apercu-interrupteur { display: inline-block; width: 2rem; height: 1rem; border-radius: 1rem; background: var(--qo-bordure); margin-top: .2rem; }

/* Rendu d'un formulaire du moteur */
.qo-groupe-formulaire { border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); padding: .75rem 1rem; }
.qo-groupe-formulaire-titre { float: none; width: auto; padding: 0 .4rem; font-size: 1rem; font-weight: 700; }
.qo-obligation { font-size: .78rem; font-weight: 600; margin-inline-start: .35rem; }
.qo-obligation-ouvert { color: #9a3412; }
.qo-obligation-cloture { color: #b91c1c; }
[data-bs-theme="dark"] .qo-obligation-ouvert { color: #fdba74; }
[data-bs-theme="dark"] .qo-obligation-cloture { color: #fca5a5; }
.qo-dessin-canvas { width: 100%; max-width: 600px; border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); background: #fff; touch-action: none; }
.qo-zone-riche { min-height: 6rem; }

/* Rapports (M01) : en-tete bleu pour un evenement, rouge pour un incident ;
   la nature est aussi ecrite en toutes lettres (jamais la couleur seule). */
.qo-entete-rapport { border-inline-start: 6px solid; border-radius: var(--qo-rayon); padding: .9rem 1.1rem; }
.qo-entete-evenement { border-color: #1d4ed8; background: #eff6ff; color: #1e3a8a; }
.qo-entete-incident { border-color: #b91c1c; background: #fef2f2; color: #7f1d1d; }
[data-bs-theme="dark"] .qo-entete-evenement { background: rgba(29, 78, 216, .2); color: #bfdbfe; }
[data-bs-theme="dark"] .qo-entete-incident { background: rgba(185, 28, 28, .2); color: #fecaca; }
.qo-ligne-retard > td { background: #fef2f2 !important; }
.qo-ligne-retard > td:first-child { box-shadow: inset 4px 0 0 #b91c1c; }
[data-bs-theme="dark"] .qo-ligne-retard > td { background: rgba(185, 28, 28, .18) !important; }
.qo-pastille-auteur { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; padding: 0 .3rem;
    border-radius: 999px; color: #fff; font-size: .75rem; font-weight: 700; vertical-align: middle; }
.qo-reponse-figee { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .4rem .6rem; border: 1px dashed var(--qo-bordure); border-radius: var(--qo-rayon); }

/* Galerie photo (M01 §12) : vignettes par jour, et choix d'une photo pendant la rédaction. */
.qo-vignette { width: 11rem; }
.qo-vignette img, .qo-vignette-choix img { width: 100%; height: 8rem; object-fit: cover; border-radius: var(--qo-rayon); border: 1px solid var(--qo-bordure); }
.qo-vignette-choix { display: flex; flex-direction: column; gap: .25rem; width: 8rem; cursor: pointer; }
.qo-vignette-choix img { height: 5.5rem; }

/* Planning du site (M05 §3) : une colonne par jour, vacants en rouge en tête
   (texte « Vacant » écrit, pas seulement la couleur). */
.qo-planning th, .qo-planning td { border: 1px solid var(--qo-bordure); padding: .25rem; font-size: .78rem; text-align: center; vertical-align: top; min-width: 3.2rem; }
.qo-planning thead th { position: sticky; top: 0; background: var(--bs-body-bg); z-index: 1; }
.qo-planning tbody th { text-align: start; white-space: nowrap; min-width: 9rem; }
.qo-planning-weekend { background: rgba(var(--qo-primaire-rgb), .06); }
.qo-planning-aujourdhui { box-shadow: inset 0 -3px 0 var(--qo-primaire); }
.qo-vacant { color: #b91c1c; }
[data-bs-theme="dark"] .qo-vacant { color: #fca5a5; }
.qo-vacation { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--qo-rayon); padding: .1rem; margin-bottom: .2rem; }
.qo-vacation:hover, .qo-vacation:focus-visible { background: rgba(var(--qo-primaire-rgb), .12); }
.qo-vacation-vacante { color: #b91c1c; border: 1px dashed #b91c1c; }
[data-bs-theme="dark"] .qo-vacation-vacante { color: #fca5a5; border-color: #fca5a5; }
.qo-duree-rouge { color: #b91c1c; font-weight: 600; }
[data-bs-theme="dark"] .qo-duree-rouge { color: #fca5a5; }

/* Cartes Leaflet (D3) : hauteur fixe, sous la barre haute et les menus Bootstrap. */
/* Géofencing (M03 §9) : carte de dessin plus haute, curseur de précision ; type de zone aussi écrit en toutes lettres. */
.qo-carte-leaflet.qo-carte-zone { height: 28rem; }
/* Analyses (M03 §11) : hauteur fixe, Chart.js remplit le conteneur. */
.qo-graphique { position: relative; height: 18rem; }
.qo-liste-postes { max-height: 14rem; overflow-y: auto; }
/* Centre de commandement (M13) : bandeau d'alerte PTI persistant (RG-M13-1), filtres globaux en encart sombre. */
.qo-centre-alerte { position: sticky; top: 0; z-index: 1020; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
    background: #b91c1c; color: #fff; font-weight: 600; padding: .6rem 1rem; border-radius: var(--qo-rayon); margin-bottom: 1rem; }
.qo-centre-alerte[hidden] { display: none; }
.qo-centre-filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; background: var(--qo-navigation); color: #fff;
    padding: .75rem 1rem; border-radius: var(--qo-rayon); }
.qo-centre-filtres .form-label { color: #e2e8f0; }
.qo-ligne-alerte > td, .qo-ligne-alerte > th { background: rgba(185, 28, 28, .08) !important; }
/* Carte du centre (M13 §2) : ancienneté de la position (couleur doublée de la légende et de l'infobulle). */
.qo-carte-leaflet.qo-carte-centre { height: 36rem; }
.qo-marqueur { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0f172a;
    color: #fff; font: 700 11px/1 sans-serif; position: relative; }
.qo-marqueur b { position: absolute; top: -10px; right: -10px; background: #b91c1c; color: #fff; border-radius: 50%; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center; font-size: 12px; box-shadow: 0 0 0 2px #fff; }
.qo-marqueur-choisi { box-shadow: 0 0 0 3px #1d4ed8; }
.qo-age-recente { background: #15803d; } .qo-age-ancienne { background: #c2410c; } .qo-age-perimee { background: #64748b; } .qo-age-alerte { background: #b91c1c; }
.qo-marqueur-site { display: flex; align-items: center; justify-content: center; background: #fff; color: #0f172a; border: 2px solid #0f172a; border-radius: 6px; }
.qo-site-critique { border-color: #b91c1c; color: #b91c1c; box-shadow: 0 0 0 2px #fecaca; }
.qo-marqueur-evenement { display: flex; align-items: center; justify-content: center; color: #b91c1c; font-size: 18px; text-shadow: 0 0 2px #fff; }
.qo-marqueur-evenement.qo-priorite-moyenne { color: #c2410c; }
.qo-selection { max-height: 16rem; overflow-y: auto; }
/* Tableau de bord personnalisé (M12) : thème du conteneur en filet supérieur ; seuil atteint en
   contour épais, couleur doublée d'un texte (jamais la couleur seule). Contrastes AA vérifiés. */
.qo-conteneur-primaire { border-top: 4px solid var(--qo-primaire); }
.qo-conteneur-accent { border-top: 4px solid var(--qo-accent); }
.qo-conteneur-neutre { border-top: 4px solid var(--qo-bordure); }
.qo-widget { border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); padding: .75rem; }
.qo-widget-agrandi .qo-graphique { height: 30rem; }
.qo-seuil-vert { outline: 3px solid #15803d; outline-offset: -1px; }
.qo-seuil-orange { outline: 3px solid #c2410c; outline-offset: -1px; }
.qo-seuil-rouge { outline: 3px solid #b91c1c; outline-offset: -1px; }
.qo-texte-seuil-vert { color: #15803d; } .qo-texte-seuil-orange { color: #c2410c; } .qo-texte-seuil-rouge { color: #b91c1c; }
[data-bs-theme="dark"] .qo-seuil-vert { outline-color: #4ade80; } [data-bs-theme="dark"] .qo-texte-seuil-vert { color: #4ade80; }
[data-bs-theme="dark"] .qo-seuil-orange { outline-color: #fb923c; } [data-bs-theme="dark"] .qo-texte-seuil-orange { color: #fb923c; }
[data-bs-theme="dark"] .qo-seuil-rouge { outline-color: #f87171; } [data-bs-theme="dark"] .qo-texte-seuil-rouge { color: #f87171; }
.qo-menu-conteneur { position: relative; }
.qo-menu-conteneur > summary { list-style: none; }
.qo-menu-conteneur > summary::-webkit-details-marker { display: none; }
.qo-menu-conteneur-corps { position: absolute; inset-inline-end: 0; z-index: 5; min-width: 13rem; background: var(--qo-surface); border: 1px solid var(--qo-bordure);
    border-radius: var(--qo-rayon); box-shadow: var(--qo-ombre); padding: .25rem 0; }
.qo-carte-en-dessin { cursor: crosshair; }
.qo-pastille-couleur { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: -.05rem; }
.qo-carte-leaflet { height: 22rem; width: 100%; border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); z-index: 0; }
/* Plans de ronde (M03 §8) : points ronds, état aussi dit dans l'infobulle. */
.qo-plan { height: 36rem; background: #f1f5f9; }
.qo-plan-point span { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0f172a;
    color: #fff; font-weight: 800; font-size: 14px; line-height: 18px; text-align: center; }
.qo-plan-agent span { font-size: 22px; line-height: 24px; }
/* Plans de zone des inspections d'équipement (M18) : même visionneuse, icône du type comme repère. */
.qo-plan-inspection { height: 28rem; background: #f1f5f9; border: 1px solid var(--qo-bordure); border-radius: var(--qo-rayon); z-index: 0; }
.qo-plan-icone img, .qo-plan-icone span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0f172a; background: #b91c1c; }
.qo-plan-legende { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
@keyframes qo-clignote { 50% { opacity: .55; } }
.qo-clignote { animation: qo-clignote 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .qo-clignote { animation: none; } }

/* Talkie-walkie du centre (M14 §3) : bouton rond à maintenir, assombri pendant l'émission ;
   problème de connexion = cercle grisé à contour orange, et le texte le dit. */
.qo-ptt-bouton { width: 4.5rem; height: 4.5rem; border-radius: 50%; border: 0; background: var(--qo-primaire); color: #fff; font-size: 1.75rem; touch-action: none; user-select: none; }
.qo-ptt-bouton:disabled { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.qo-ptt-bouton.qo-ptt-emission { filter: brightness(0.6); box-shadow: 0 0 0 0.35rem rgba(var(--qo-primaire-rgb), 0.3); }
.qo-ptt-bouton:focus-visible { outline: 3px solid var(--qo-primaire); outline-offset: 3px; }
.qo-ptt-etat::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-inline-end: 0.35rem; background: #16a34a; vertical-align: -0.05rem; }
.qo-ptt-etat.qo-ptt-hors-ligne::before { background: #9ca3af; border: 2px solid #f97316; }

/* Fenêtre du flux vidéo d'alerte (M13 §6) : vidéo pivotable dans un cadre carré. */
.qo-fenetre-video { width: min(36rem, calc(100vw - 2rem)); border: 0; border-radius: var(--qo-arrondi, 0.5rem); padding: 1rem; background: var(--bs-body-bg); color: var(--bs-body-color); }
.qo-fenetre-video::backdrop { background: rgba(0, 0, 0, 0.6); }
.qo-video-cadre { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
.qo-video-cadre video { max-width: 100%; max-height: 100%; transition: transform 0.2s; }

/* Véhicule sur la carte du centre (M15 §3) : pastille à la couleur du statut, vitesse en cas d'excès. */
.qo-vehicule span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; color: #fff; }
.qo-vehicule em { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-weight: 700;
    font-size: 11px; color: #fff; background: #b91c1c; border-radius: 4px; padding: 0 4px; }
.qo-minuteur-depasse { color: #b91c1c; font-weight: 700; }
