/* ============================================================
   CAP2030-APP - Feuille de style principale
   Palette bleue - Design professionnel
   ============================================================ */

/* v25.08 : polices hébergées dans l'application (plus de fonts.googleapis.com) : voir assets/vendor/fonts/fonts.css */
@import url('../vendor/fonts/fonts.css');

/* ---------- Variables ---------- */
:root {
    --blue-950: #0a1628;
    --blue-900: #0d2149;
    --blue-800: #1a3a6b;
    --blue-700: #1e4d8c;
    --blue-600: #2563b8;
    --blue-500: #3b82d4;
    --blue-400: #60a5fa;
    --blue-300: #93c5fd;
    --blue-200: #bfdbfe;
    --blue-100: #dbeafe;
    --blue-50:  #eff6ff;

    --accent:   #f59e0b;
    --accent-l: #fde68a;
    --success:  #10b981;
    --danger:   #ef4444;
    --warning:  #f59e0b;
    --info:     #3b82f6;

    --bg:       #f0f6ff;
    --bg-card:  #ffffff;
    --text:     #0d2149;
    --text-muted: #576781;
    --border:   #c7dcf8;

    --radius:   12px;
    --radius-sm: 7px;
    --shadow:   0 4px 24px rgba(13,33,73,0.09);
    --shadow-lg:0 8px 40px rgba(13,33,73,0.14);

    --font-main: 'Outfit', sans-serif;
    --font-head: 'Fraunces', serif;

    --sidebar-w: 260px;
    --header-h:  64px;
    --modal-scale: 1; /* modifie par JS pour le slider de taille des modales */
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

/* v22.01 — Filet de sécurité anti-débordement horizontal : aucune règle de
   ce type n'existait avant. Avec ~159 largeurs fixes en dur disséminées
   dans les pages (voir docs/AUDIT-FIABILITE.md #16), le moindre élément
   trop large sur un écran étroit faisait défiler TOUTE la page sur le
   côté — sidebar et en-tête compris — plutôt que de rester contenu. Les
   tableaux gardent leur propre défilement horizontal interne
   (.table-responsive, overflow-x:auto), qui continue de fonctionner
   normalement : cette règle ne bloque que le débordement au niveau de la
   page elle-même. */
/* v22.10 — `overflow-x: hidden` sur html ET body faisait de body un
   conteneur de défilement (overflow-y passe à "auto" dès qu'un seul axe
   n'est plus "visible") : tout `position: sticky` (topbar, en-têtes
   collants) se calait alors sur un conteneur qui ne défile jamais et
   cessait de coller à l'écran. `clip` coupe de la même façon sans créer
   de conteneur de défilement. html garde un repli `hidden` pour les
   navigateurs sans `clip` : sur la racine il se propage au viewport,
   sans effet sur sticky. */
html { overflow-x: hidden; overflow-x: clip; }
body { overflow-x: clip; max-width: 100%; }

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;   /* v24.11 : sur iPhone, 100vh dépasse la zone visible (barre d'adresse) ; dvh = hauteur réellement visible */
    line-height: 1.6;
}

a { color: var(--blue-600); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blue-800); }

h1,h2,h3,h4 { font-family: var(--font-head); line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

/* ---------- Layout Login ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;   /* v24.11 : sur iPhone, 100vh dépasse la zone visible (barre d'adresse) ; dvh = hauteur réellement visible */
    background: linear-gradient(135deg, var(--blue-950) 0%, var(--blue-800) 50%, var(--blue-600) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,212,.18) 0%, transparent 70%);
    top: -200px; right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,.08) 0%, transparent 70%);
    bottom: -100px; left: -100px;
}

.login-card {
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    padding: 2.5rem 2.8rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,.35);
    position: relative;
    z-index: 1;
    animation: slideUp .5s cubic-bezier(.16,1,.3,1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 1.8rem;
}

.login-logo .app-name {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--blue-800);
    letter-spacing: -1px;
}

.login-logo .app-sub {
    font-size: .8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: .2rem;
}

.login-logo .badge-front {
    display: inline-block;
    background: var(--blue-100);
    color: var(--blue-700);
    border-radius: 20px;
    padding: .2rem .8rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: .5rem;
}

/* Logo image dans l'écran de connexion */
.login-logo-img {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: .6rem;
}

.login-logo-img img {
    max-width: 260px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ---------- App Layout ---------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;   /* v24.11 : sur iPhone, 100vh dépasse la zone visible (barre d'adresse) ; dvh = hauteur réellement visible */
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--blue-900);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform .3s;
}

.sidebar-header {
    padding: 1.5rem 1.4rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -.5px;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-badge {
    display: inline-block;
    background: var(--blue-700);
    color: var(--blue-200);
    border-radius: 6px;
    padding: .15rem .5rem;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: .3rem;
}

.sidebar-logo-img {
    padding: .2rem 0 .1rem;
}

.sidebar-logo-img img {
    max-width: 200px;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: left center;
    /* Légère correction de luminosité pour fond sombre de la sidebar */
    filter: brightness(1.08) drop-shadow(0 1px 3px rgba(0,0,0,.25));
}

.sidebar-logo-version {
    display: block;
    font-size: .62rem;
    color: var(--blue-300);
    font-family: var(--font-main);
    font-weight: 400;
    margin-top: .3rem;
    opacity: .75;
    letter-spacing: .3px;
}

.sidebar-user {
    padding: .8rem 1.4rem;
    background: rgba(255,255,255,.05);
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: .8rem;
    color: var(--blue-200);
}

.sidebar-user strong {
    display: block;
    color: #fff;
    font-size: .9rem;
}

.sidebar-nav {
    flex: 1;
    padding: .8rem 0;
}

.nav-section {
    padding: .6rem 1.4rem .2rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #8da0c4;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 1.4rem;
    color: rgba(255,255,255,.75);
    font-size: .88rem;
    border-radius: 0;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #fff;
    background: rgba(255,255,255,.08);
    border-left-color: var(--accent);
}

.sidebar-nav a .icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: rgba(255,255,255,.6);
    font-size: .85rem;
    padding: .4rem 0;
    transition: color .2s;
}

.sidebar-footer a:hover { color: #fff; }

/* Main content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;   /* v24.11 : sur iPhone, 100vh dépasse la zone visible (barre d'adresse) ; dvh = hauteur réellement visible */
    /* v22.02 — Confinement supplémentaire : html/body seuls (v22.01) ne
       suffisent pas si un descendant plus profond (ex. un tableau large)
       élargit ce conteneur intermédiaire sans jamais le faire défiler
       lui-même — le débordement remonte alors ici avant d'être coupé au
       bord de l'écran, décalant uniformément tout le contenu de la page
       (titre, boutons...), pas seulement l'élément réellement trop large.
       Voir docs/AUDIT-FIABILITE.md #16. */
    /* v22.10 : clip (et non hidden, qui neutralisait le sticky de la
       topbar) + min-width:0, indispensable pour qu'un item flex puisse
       rétrécir sous la largeur de son contenu — c'était précisément le rôle
       de overflow:hidden (min-width auto = 0 sur un conteneur de
       défilement), que clip n'assure pas. */
    overflow-x: hidden;   /* repli navigateurs sans "clip" (conserve le confinement v22.02) */
    overflow-x: clip;
    min-width: 0;
    max-width: 100%;
}

/* v22.10 — Annonces système persistantes (bandeau admin) : dans la colonne
   de contenu, collées sous la topbar au défilement jusqu'à ce que chaque
   administrateur clique sur OK. z-index sous la topbar (50). Hauteur
   plafonnée pour ne jamais monopoliser l'écran si plusieurs annonces. */
.app-announcements {
    position: sticky;
    top: var(--header-h);
    z-index: 49;
    max-height: 45vh;
    overflow-y: auto;
}
.app-announcements .app-announcement {
    margin: 0;
    border-radius: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .6rem;
}
.app-announcement-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.app-announcement-date { font-size: .78rem; color: var(--text-muted); margin-left: .4rem; }
.app-announcement-text { margin-top: .2rem; }
.app-announcement-ack { margin: 0; flex-shrink: 0; }

/* Top bar */
.topbar {
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 6px rgba(13,33,73,.05);
}

.topbar-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    color: var(--blue-800);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    overflow-x: hidden;   /* repli navigateurs sans "clip" */
    overflow-x: clip;     /* v22.10 : voir .main-content */
    min-width: 0;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(90deg, var(--blue-50), var(--bg-card));
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue-800);
}

.card-body {
    padding: 1.6rem;
}

/* ---------- Formulaires ---------- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--blue-800);
    margin-bottom: .4rem;
    letter-spacing: .3px;
}

.form-control {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: .9rem;
    color: var(--text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59,130,212,.15);
}

select.form-control { cursor: pointer; }

.form-control[readonly] {
    background: var(--blue-50);
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .3rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .88rem;
}

.form-check input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--blue-600);
    cursor: pointer;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: .85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue-600);
    color: #fff;
}
.btn-primary:hover { background: var(--blue-700); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,184,.3); }

.btn-secondary {
    background: var(--blue-100);
    color: var(--blue-700);
}
.btn-secondary:hover { background: var(--blue-200); color: var(--blue-800); }

.btn-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.btn-success:hover { background: #047857; color: #fff; }

.btn-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid var(--accent-l);
}
.btn-warning:hover { background: #b45309; color: #fff; }

.btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.btn-lg { padding: .75rem 1.6rem; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }

/* v22.07 — Bouton de menu contextuel (fiche mobile des OO) : masqué par
   défaut, révélé uniquement sous 768px (voir la règle correspondante dans
   la section responsive). */
.oo-menu-toggle { display: none; }

.btn-icon {
    padding: .4rem .5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
    font-size: .85rem;
    color: var(--text-muted);
}
.btn-icon:hover { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-300); }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

thead th {
    background: var(--blue-900);
    color: rgba(255,255,255,.9);
    padding: .8rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .5px;
    text-transform: uppercase;
}

tbody tr {
    border-bottom: 1px solid var(--blue-50);
    transition: background .15s;
}

tbody tr:hover { background: var(--blue-50); }

tbody td {
    padding: .8rem 1rem;
    vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.badge-active   { background: #ecfdf5; color: #065f46; }
.badge-inactive { background: #fef2f2; color: #991b1b; }
.badge-admin    { background: var(--blue-100); color: var(--blue-800); }
.badge-info     { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-200); }

/* v17.18b — Archivage : orange brique, distinct de tous les autres badges */
.badge-archived {
    display: inline-block;
    background: #fff7ed; color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 4px; padding: .05rem .35rem;
    font-size: .65rem; font-weight: 700;
    margin-right: .3rem; vertical-align: middle; white-space: nowrap;
}
/* Ligne / carte d'un objet archivé dans les listes */
.row-archived {
    background: #fff7ed !important;
    border-left: 3px solid #fed7aa !important;
    opacity: .85;
}

/* ---------- Alertes ---------- */
.alert {
    padding: .9rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    border-left: 4px solid;
    animation: alertIn .3s ease;
}

@keyframes alertIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.alert-success { background: #ecfdf5; color: #065f46; border-color: var(--success); }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
/* v24.07 — bouton ✕ des erreurs, qui ne s'effacent plus seules (voir footer.php) */
.alert-close { margin-left: auto; align-self: flex-start; flex: 0 0 auto; background: transparent; border: 0; color: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer; opacity: .7; padding: .15rem .45rem; border-radius: 6px; min-width: 32px; min-height: 32px; }
.alert-close:hover, .alert-close:focus-visible { opacity: 1; background: rgba(153, 27, 27, .12); }
.alert-warning { background: #fffbeb; color: #92400e; border-color: var(--warning); }
.alert-info    { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-400); }

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.4rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon-blue   { background: var(--blue-100); }
.stat-icon-green  { background: #ecfdf5; }
.stat-icon-amber  { background: #fffbeb; }
.stat-icon-violet { background: #f5f3ff; }

.stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 600; color: var(--blue-800); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ---------- Color picker ---------- */
.color-preview {
    width: 32px; height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: inline-block;
    vertical-align: middle;
    margin-left: .5rem;
}

/* ---------- Enjeu color dot ---------- */
.color-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid rgba(0,0,0,.1);
    flex-shrink: 0;
}

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,22,40,.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(3px);   /* v24.11 : préfixe requis par Safari jusqu'à iOS 17 */
    backdrop-filter: blur(3px);
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .3s cubic-bezier(.16,1,.3,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 1.2rem 1.6rem;
    background: linear-gradient(90deg, var(--blue-900), var(--blue-700));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color .2s;
    padding: .2rem;
    line-height: 1;
}

.modal-close:hover { color: #fff; }

.modal-body { padding: 1.6rem; }

.modal-footer {
    padding: 1rem 1.6rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    background: var(--blue-50);
}

/* Slider taille texte modales — toutes les font-size enfants scalent avec --modal-scale */
.modal .modal-body,
.modal .modal-footer { font-size: calc(1rem * var(--modal-scale, 1)); }

.modal .modal-body .form-group label,
.modal .modal-body .form-hint { font-size: calc(.82rem * var(--modal-scale, 1)); }

.modal .modal-body .form-control,
.modal .modal-body .form-select,
.modal .modal-body select { font-size: calc(.9rem * var(--modal-scale, 1)); }

.modal .modal-body .form-check { font-size: calc(.88rem * var(--modal-scale, 1)); }

.modal .modal-body .btn,
.modal .modal-footer .btn { font-size: calc(.85rem * var(--modal-scale, 1)); }

.modal .modal-body table { font-size: calc(.88rem * var(--modal-scale, 1)); }

.modal .modal-body thead th { font-size: calc(.78rem * var(--modal-scale, 1)); }

.modal .modal-body .badge { font-size: calc(.72rem * var(--modal-scale, 1)); }

.modal .modal-body .alert { font-size: calc(.88rem * var(--modal-scale, 1)); }

.modal .modal-body p,
.modal .modal-body span,
.modal .modal-body div,
.modal .modal-body li,
.modal .modal-body td,
.modal .modal-body th { font-size: inherit; }


/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: 1rem 0 0;
}

.pagination a, .pagination span {
    padding: .35rem .7rem;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--blue-700);
    transition: all .2s;
}

.pagination a:hover { background: var(--blue-100); border-color: var(--blue-300); }
.pagination .current { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: .7rem 1.4rem;
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
}

.tab-btn:hover { color: var(--blue-700); }
.tab-btn.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--blue-500); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--blue-800); font-weight: 600; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ---------- Search bar ---------- */
.search-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--blue-50);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .45rem .9rem;
    transition: border-color .2s;
}

.search-bar:focus-within { border-color: var(--blue-400); }
.search-bar input {
    border: none;
    background: none;
    outline: none;
    font-family: var(--font-main);
    font-size: .88rem;
    color: var(--text);
    min-width: 200px;
}

/* ---------- Progress / hierarchy ---------- */
.hierarchy-tree { padding: .5rem 0; }

.tree-item {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .6rem;
    border-radius: 8px;
    margin-bottom: .3rem;
    border: 1px solid transparent;
    transition: all .2s;
}

.tree-item:hover { background: var(--blue-50); border-color: var(--border); }

.tree-item-children {
    margin-left: 2rem;
    border-left: 2px solid var(--blue-200);
    padding-left: 1rem;
}

/* ---------- Log viewer ---------- */
.log-viewer {
    background: #0a1628;
    color: #7dd3fc;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    border-radius: var(--radius-sm);
    padding: 1rem;
    height: 400px;
    overflow-y: auto;
    line-height: 1.7;
}

.log-viewer .log-time { color: #94a3b8; }
.log-viewer .log-user { color: #34d399; }
.log-viewer .log-action { color: #fbbf24; font-weight: bold; }

/* ================================================================
   RESPONSIVE — Mobile / Tablette / Ordinateur
   Breakpoints : 480px (mobile) | 768px (tablette) | 1024px (large)
   ================================================================ */

/* ── Overlay sidebar (mobile/tablette) ──────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Bouton hamburger dans la topbar ────────────────────────── */
#menuBtn {
    display: none;
    padding: .45rem .6rem;
    font-size: 1.15rem;
    line-height: 1;
    background: var(--blue-50);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--blue-800);
    transition: all .2s;
    flex-shrink: 0;
}
#menuBtn:hover { background: var(--blue-100); }
#menuBtn:active { transform: scale(.95); }

/* ── Indicateur de type de terminal (login) ─────────────────── */
.device-indicator {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(59,130,212,.1);
    border: 1px solid rgba(59,130,212,.25);
    border-radius: 10px;
    padding: .6rem .9rem;
    margin-bottom: 1rem;
    font-size: .8rem;
    color: var(--blue-800);
}
.device-indicator .dev-icon { font-size: 1.1rem; flex-shrink: 0; }
.device-indicator strong { color: var(--blue-900); }
.device-force-link {
    display: block;
    text-align: center;
    font-size: .75rem;
    color: var(--blue-600);
    margin-top: .4rem;
    text-decoration: underline;
    cursor: pointer;
}
.device-force-link:hover { color: var(--blue-800); }

/* ── Tablette : 768px–1023px ────────────────────────────────── */

/* ── Sidebar rétractable ──────────────────────────────────────── */
:root { --sidebar-w-collapsed: 52px; }

.sidebar--collapsed {
    width: var(--sidebar-w-collapsed) !important;
    overflow: visible;
}
.sidebar--collapsed .sidebar-header,
.sidebar--collapsed .sidebar-user,
.sidebar--collapsed .view-as-banner,
.sidebar--collapsed .view-as-trigger,
.sidebar--collapsed .nav-section,
.sidebar--collapsed .sidebar-footer { display: none !important; }

.sidebar--collapsed .sidebar-nav { padding: .5rem 0; }

.sidebar--collapsed .sidebar-nav a {
    padding: .65rem 0;
    justify-content: center;
    gap: 0;
    border-left: none;
    position: relative;
}
.sidebar--collapsed .sidebar-nav a .icon { width: 100%; font-size: 1.15rem; }
.sidebar--collapsed .sidebar-nav a .nav-label { display: none; }

/* Tooltip CSS au survol en mode rétracté */
.sidebar--collapsed .sidebar-nav a::after {
    content: attr(data-label);
    position: fixed;
    left: calc(var(--sidebar-w-collapsed) + 6px);
    background: #1e293b;
    color: #f1f5f9;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    padding: .3rem .65rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 9999;
}
.sidebar--collapsed .sidebar-nav a:hover::after { opacity: 1; }

/* Bouton toggle */
.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    cursor: pointer;
    font-size: 1.15rem;
    padding: .5rem;
    border-radius: 6px;
    transition: background .2s, color .2s;
    line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Zone titre sidebar avec toggle */
.sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem .5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: 48px;
}
.sidebar--collapsed .sidebar-title-row {
    justify-content: center;
    padding: .75rem 0 .5rem;
}

/* Contenu principal : s'adapte à la largeur de la sidebar */
.main-content {
    transition: margin-left .2s ease;
}
.sidebar--collapsed ~ .main-content,
.sidebar--collapsed + * .main-content {
    margin-left: var(--sidebar-w-collapsed);
}

@media (max-width: 1023px) {
    /* Sidebar en overlay */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
    }
    .sidebar.open { transform: translateX(0); }

    .main-content { margin-left: 0; }

    /* Hamburger visible */
    #menuBtn { display: inline-flex; }

    /* Page content padding réduit */
    .page-content { padding: 1.4rem; }

    /* Grilles 2 colonnes */
    .form-row { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Tables : scroll horizontal */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 560px; }

    /* Cards grille */
    .card-grid-2 { grid-template-columns: 1fr; }

    /* Topbar */
    .topbar { padding: 0 1.2rem; gap: .6rem; }
    .topbar-title { font-size: .95rem; }

    /* Modales plein écran */
    .modal { max-width: calc(100vw - 2rem) !important; margin: 1rem; }
}

/* ── Mobile : < 768px ───────────────────────────────────────── */
@media (max-width: 767px) {
    html { font-size: 14px; }

    /* v22.04 — Transformation du tableau des OO (#oo-table, partagé par
       admin/obj_oper.php et front/obj_oper.php) en fiches empilées :
       chaque <tr> devient une carte autonome, chaque <td> un bloc pleine
       largeur au lieu d'une colonne étroite — l'intitulé et la
       description n'ont plus à se replier sur eux-mêmes dans 32% de
       largeur pendant que des colonnes presque vides (Contexte, Actions…)
       gaspillent le reste. Demande explicite : "une fiche OO doit être
       très facile à lire". Purement CSS, aucune modification du HTML des
       deux pages qui partagent ce tableau. */
    #oo-table, #oo-table thead, #oo-table tbody,
    #oo-table tr, #oo-table th, #oo-table td {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    #oo-table thead { display: none; }
    #oo-table tbody tr {
        margin-bottom: 1rem;
        border: 1.5px solid var(--border);
        border-radius: 10px;
        padding: .9rem;
        /* position:relative (v22.08) : ancre le menu contextuel "⋮" en
           haut à droite de la fiche entière (voir .oo-menu-wrap), pas
           seulement de la cellule Gestion où il vit dans le DOM. */
        position: relative;
        /* v22.06 — Fond légèrement distinct du panneau blanc environnant
           (relevé par capture d'écran réelle : "fond blanc derrière les
           fiches rend difficile la distinction entre deux fiches") + ombre
           légère, pour que chaque fiche se détache clairement au lieu de
           se fondre dans la carte "Objectifs opérationnels" qui la contient. */
        background: #fff;
        box-shadow: 0 1px 4px rgba(15,23,42,.08);
    }
    /* Fond gris clair du conteneur de la liste : renforce le contraste
       de chaque fiche blanche posée dessus. */
    #oo-table tbody { background: var(--bg, #f4f6fa); padding: .6rem; border-radius: 10px; }
    #oo-table tbody td {
        padding: .3rem 0 !important;
        border: none !important;
        text-align: left !important;
    }
    #oo-table tbody td:empty { display: none; }
    /* Widgets internes centrés en desktop (étoiles, SMART) : alignés à
       gauche ici, cohérent avec le reste de la fiche en lecture verticale */
    #oo-table .star-widget, #oo-table .smart-widget { align-items: flex-start !important; }
    #oo-table .stars-row { justify-content: flex-start !important; }

    /* v22.06 — Fiche mobile dédiée (demande explicite de Philippe, avec
       ordre précis des champs) : toutes les cellules du tableau desktop
       sont masquées, sauf la fiche reconstruite (.oo-mobile-card) et deux
       cellules réutilisées telles quelles pour éviter de dupliquer des
       formulaires/boutons interactifs (.oo-mobile-keep : date, gestion). */
    #oo-table td:not(.oo-mobile-card):not(.oo-mobile-keep) { display: none !important; }
    #oo-table .oo-mobile-card { display: block !important; }
    #oo-table .oo-mobile-keep { margin-top: .6rem; }

    /* v22.07 — Menu contextuel des actions (bouton "⋮") sur la fiche
       mobile, demandé pour éviter une rangée de boutons éparpillés en bas
       de fiche. Le bouton et le panneau existent aussi en desktop (mêmes
       balises, jamais dupliquées) mais y restent dans leur présentation
       habituelle — masqués/révélés uniquement sous 768px. */
    #oo-table .oo-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        line-height: 1;
        padding: .35rem .7rem;
    }
    /* v22.08 — Regroupe bouton + panneau dans un conteneur positionné en
       haut à droite de la fiche entière (et non plus de la cellule
       Gestion, généralement tout en bas) — demande explicite. */
    #oo-table .oo-menu-wrap {
        position: absolute;
        top: .7rem;
        right: .7rem;
        z-index: 41;
    }
    #oo-table .oo-menu-panel {
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .4rem !important;
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: .3rem;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(15,23,42,.18);
        padding: .6rem;
        z-index: 40;
        min-width: 190px;
    }
    #oo-table .oo-menu-panel.oo-menu-open { display: flex !important; }
    #oo-table .oo-menu-panel form { margin: 0; width: 100%; }
    #oo-table .oo-menu-panel .btn,
    #oo-table .oo-menu-panel form .btn { width: 100%; text-align: left; }

    /* v22.08 — Chaque paire "libellé : contenu" (Enjeux, OS, Popularité,
       SMART, Scénarios...) tient désormais sur une seule ligne : demande
       explicite, en remplacement de l'empilement libellé au-dessus /
       contenu en dessous. Défilement horizontal en secours si le contenu
       est trop long pour la largeur de l'écran, plutôt qu'un retour à la
       ligne qui romprait l'alignement avec le libellé. */
    #oo-table .oo-mc-row {
        display: flex;
        align-items: center;
        gap: .4rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-top: .55rem;
        padding-bottom: .1rem;
    }
    #oo-table .oo-mc-label {
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--text-muted);
        flex-shrink: 0;
        white-space: nowrap;
    }
    #oo-table .oo-mc-title {
        font-weight: 700;
        font-size: 1rem;
        color: var(--blue-800);
        margin-top: .6rem;
        line-height: 1.35;
    }
    #oo-table .oo-mc-desc {
        font-size: .82rem;
        color: var(--text-muted);
        margin-top: .3rem;
        line-height: 1.5;
    }
    #oo-table .oo-mc-author {
        display: flex;
        align-items: center;
        gap: .4rem;
        font-size: .78rem;
        color: var(--text-muted);
        margin-top: .6rem;
    }
    #oo-table .oo-mc-sep {
        border: none;
        border-top: 1px solid var(--border);
        margin: .8rem 0;
    }

    /* v22.05 — Deux défauts concrets remontés par capture d'écran réelle
       sur ce même tableau transformé en fiches (v22.04) :
       1) troncatures pensées pour une colonne étroite (160px / 14
          caractères) n'ont plus lieu d'être sur une fiche pleine largeur ;
       2) empilement vertical de plusieurs blocs conçus à l'origine pour
          être centrés/compacts dans une cellule, créant des espaces vides
          disproportionnés une fois étirés sur toute la largeur.
       Toujours utiles ici : ces mêmes classes sont réutilisées dans la
       fiche mobile dédiée v22.06 ci-dessus. */
    #oo-table .oo-context-tag {
        max-width: 100% !important;
    }
    #oo-table .oo-context-tag-text {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    #oo-table .oo-scenario-badge {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    /* Resserrement des espacements verticaux des widgets Popularité/SMART,
       conçus à l'origine pour une colonne étroite centrée */
    #oo-table .star-widget, #oo-table .smart-widget { gap: .2rem !important; }
    #oo-table .stars-summary > div { margin-top: 0 !important; }
    #oo-table td[style*="padding:.6rem .5rem"],
    #oo-table td[style*="padding:.5rem .4rem"] {
        padding: .2rem 0 !important;
    }

    /* Page content */
    .page-content { padding: .9rem; }

    /* Stats cards */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
    .stat-card { padding: .9rem; }
    .stat-value { font-size: 1.6rem; }

    /* Formulaires full-width */
    .form-row { grid-template-columns: 1fr; gap: .7rem; }

    /* Page header empilé */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .7rem;
        margin-bottom: 1rem;
    }
    .page-header-left h2 { font-size: 1.2rem; }

    /* Boutons plus grands (touch targets ≥ 44px) */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 36px; padding: .4rem .8rem; }
    .btn-lg { min-height: 48px; }

    /* Tables : scroll + cellules compactes */
    table { min-width: 480px; font-size: .82rem; }
    thead th { padding: .6rem .7rem; font-size: .7rem; }
    tbody td { padding: .6rem .7rem; }

    /* Cards */
    .card-header { padding: .9rem 1.1rem; }
    .card-body   { padding: 1rem; }

    /* Modales */
    .modal {
        max-width: 100vw !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
    }
    .modal-overlay {
        align-items: flex-end !important;
    }
    .modal-body { max-height: 60dvh; overflow-y: auto; }

    /* Grilles de permissions : 1 colonne */
    .perm-grid { grid-template-columns: 1fr; }

    /* Topbar */
    .topbar { padding: 0 .9rem; height: 56px; gap: .5rem; }
    .topbar-title { font-size: .88rem; }
    .topbar-actions .badge { display: none; }

    /* Sidebar */
    .sidebar { width: 88vw; max-width: 300px; }

    /* Forum */
    .forum-item-header { padding: .55rem .7rem; }
    .forum-item-name { font-size: .84rem; }

    /* Drag lists */
    .drag-item { padding: .45rem .7rem; }
}

/* ── Très petit mobile : < 480px ───────────────────────────── */
@media (max-width: 479px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 1.8rem 1.4rem; border-radius: 0; min-height: 100dvh;
                  display: flex; flex-direction: column; justify-content: center; }
    .page-content { padding: .7rem; }

    /* v22.01 — Neutralise les min-width: fixes en dur (99 occurrences
       relevées dans les pages, docs/AUDIT-FIABILITE.md #16) : sur un écran
       de 320 à 479px, aucun élément ne doit refuser de rétrécir sous une
       largeur minimale codée en dur — ça force un débordement plutôt que
       de laisser flexbox/grid le réduire normalement. Corriger les 99
       occurrences au cas par cas, fichier par fichier, exigerait de
       connaître le contexte exact de chacune (parent en display:flex avec
       ou sans flex-wrap) ; cette règle globale obtient le même résultat
       sans ce risque, en s'appuyant sur le repli naturel de
       flex-shrink/grid pour combler l'espace libéré. */
    [style*="min-width"] { min-width: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE COMPLÉMENTAIRE — v9.00
   ═══════════════════════════════════════════════════════════ */

/* Scroll horizontal garanti sur les tableaux */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive > table {
    min-width: 480px;
}

/* Modales plein écran sur petits smartphones
   v23.05 — « .modal > div » visait AUSSI les poignées de redimensionnement que modal-enhance.js injecte dans chaque
   fenêtre (DIV « .modal-resize-handle », prévues à 5 px de large) : elles passaient à 100 % de largeur sur toute la
   hauteur de la fenêtre, avec z-index:200 — une couche invisible qui interceptait TOUS les touchers (champs, listes,
   boutons Annuler / Enregistrer, croix de fermeture) de TOUTES les fenêtres sur téléphone. Elles sont exclues de la
   règle ci-dessous et masquées sur petit écran (voir plus bas). */
@media (max-width: 479px) {
    .modal-overlay > div,
    .modal > div:not(.modal-resize-handle),
    div[style*="max-width:700px"],
    div[style*="max-width: 700px"],
    div[style*="max-width:620px"],
    div[style*="max-width: 620px"] {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* Boutons plein largeur sur mobile */
    .page-header { flex-wrap: wrap; }
    .page-header .btn { width: 100%; text-align: center; }

    /* Filtres : empiler verticalement */
    .filters-row,
    div[style*="display:flex"][style*="flex-wrap:wrap"] {
        flex-direction: column !important;
    }
    .filters-row > * { width: 100% !important; max-width: 100% !important; }

    /* Stat-cards : 1 colonne déjà défini, assurer les valeurs lisibles */
    .stat-value { font-size: 1.4rem; }

    /* Popup fusion / bilan : plein écran */
    .merge-bilan-overlay > div {
        max-width: 100% !important;
        width: 100% !important;
        min-height: 100dvh;
        border-radius: 0 !important;
        padding: 1rem !important;
    }
}

/* Poignées de redimensionnement des fenêtres : inutiles (et dangereuses, voir plus haut) sur téléphone — elles ne
   réagissent qu'à la souris (mousedown) et leur z-index les place au-dessus du contenu. */
@media (max-width: 767px) {
    .modal-resize-handle { display: none !important; }
}

/* Taille tactile minimum pour les boutons (WCAG 2.5.5) */
@media (pointer: coarse) {
    .btn, button, select, input[type="checkbox"], input[type="radio"] {
        min-height: 44px;
    }
    .btn-sm { min-height: 38px; }
    /* Navigation latérale : liens plus hauts */
    .sidebar-nav a { min-height: 44px; }
    /* Kanban cards : plus hautes pour le touch */
    .kanban-card { min-height: 48px; }
}

/* v21.02 — 16px minimum sur les champs de saisie tactiles : sous ce seuil,
   Safari iOS zoome automatiquement toute la page à chaque prise de focus
   (le root passe à 14px en mobile ci-dessus, ramenant .form-control à
   12,6px réels — bien en dessous). Ciblé sur les seuls champs de saisie,
   sans toucher au reste de la hiérarchie de tailles mobile déjà en place. */
@media (pointer: coarse) {
    .form-control,
    input[type="text"], input[type="password"], input[type="email"],
    input[type="number"], input[type="date"], input[type="search"],
    input[type="tel"], input[type="url"], textarea, select {
        font-size: 16px !important;
    }
}


/* ── Mode "forcer ordinateur" : désactive le responsive ─────── */
body.force-desktop .sidebar { transform: none !important; width: var(--sidebar-w) !important; }
body.force-desktop .main-content { margin-left: var(--sidebar-w) !important; }
body.force-desktop #menuBtn { display: none !important; }
body.force-desktop .page-content { padding: 2rem !important; }
body.force-desktop .modal { max-width: unset !important; margin: unset !important;
                              border-radius: var(--radius) !important; }
body.force-desktop .modal-overlay { align-items: center !important; }
body.force-desktop .stats-grid { grid-template-columns: repeat(4,1fr) !important; }
body.force-desktop .form-row { grid-template-columns: 1fr 1fr !important; }
body.force-desktop table { min-width: unset !important; }
body.force-desktop html { font-size: 15px !important; }

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); font-size: .85rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.fw-600 { font-weight: 600; }
.w-100  { width: 100%; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.divider-text {
    text-align: center;
    position: relative;
    margin: 1rem 0;
    font-size: .8rem;
    color: var(--text-muted);
}

.divider-text::before, .divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* Permissions checkboxes grid */
.perm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    padding: .8rem;
    background: var(--blue-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Section page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-left h2 {
    color: var(--blue-900);
    margin-bottom: .2rem;
}

.page-header-left p {
    color: var(--text-muted);
    font-size: .85rem;
}

/* Infobox stratégique */
.obj-stra-badge {
    background: var(--blue-100);
    color: var(--blue-800);
    border: 1px solid var(--blue-200);
    border-radius: 6px;
    padding: .2rem .6rem;
    font-size: .75rem;
    font-weight: 600;
}

.enjeu-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .7rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
}

/* Select multiple */
select[multiple] {
    height: 120px;
}

.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}

.selected-item {
    background: var(--blue-100);
    color: var(--blue-800);
    border-radius: 20px;
    padding: .15rem .6rem;
    font-size: .75rem;
    font-weight: 600;
}

/* v24.12 — iPhone : un champ de texte de MOINS de 16 px fait zoomer la page à la prise de focus. Les règles ordinaires donnent déjà 16 px au toucher ;
   cette règle, réservée à iOS (seul moteur qui comprend -webkit-touch-callout), le GARANTIT quelle que soit la règle qui l'aurait réduit ailleurs. */
@supports (-webkit-touch-callout: none) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=button]):not([type=submit]):not([type=reset]):not([type=image]):not([type=hidden]),
    select, textarea { font-size: 16px !important; }
}

/* v24.14 — Pastilles « statut » et « porteur » d'un OO (listes, carte mobile, page de détail) */
.oo-sp-badges { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .3rem; }
.oo-st-badge, .oo-po-badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; border: 1px solid transparent; padding: .08rem .55rem; font-size: .7rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.oo-st-enregistre { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.oo-st-en_cours   { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.oo-st-termine    { background: #dcfce7; color: #166534; border-color: #86efac; }
.oo-st-abandonne  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.oo-st-en_attente { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.oo-po-badge   { background: #fff; color: #1e3a5f; border-color: #cbd5e1; font-weight: 600; max-width: 100%; white-space: normal; }
.oo-po-none    { background: #fff7ed; color: #c2410c; border-color: #fdba74; font-style: italic; font-weight: 700; }
.oo-po-unknown { background: #f8fafc; color: #64748b; border-color: #e2e8f0; font-style: italic; }

/* v24.14 — Filtre « statut » : cases en ligne sur ordinateur, sur DEUX colonnes sur téléphone (le style tactile général donnait une hauteur démesurée à chaque libellé) */
#flt-statut .flt-checks { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin-top: .45rem; }
@media (max-width: 768px) {
    #flt-statut .flt-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
    #flt-statut .flt-checks label { min-height: 40px; margin: 0; }
}

/* v24.15 — Annonces système : barre compacte sur téléphone quand il y en a deux ou plus (voir header.php). Ordinateur et annonce unique : inchangés.
   Corrigé : le menu ⋮ des listes (z-index 61 / 60) passait AU-DESSUS de la barre du haut (50) et des annonces (49) ; ramené à 41 / 40, au-dessus du contenu mais sous eux. */
.app-ann-bar, .app-ann-ackall { display: none; }
@media (max-width: 768px), (max-height: 520px) {
    .app-announcements.app-ann-multi { max-height: none; overflow: visible; }
    .app-ann-multi .app-ann-bar { display: flex; align-items: center; gap: .5rem; width: 100%; height: 44px; margin: 0; padding: 0 .8rem; border: 0; border-left: 4px solid #d97706; border-bottom: 1px solid #fcd34d;
        background: #fffbeb; color: #92400e; font: inherit; font-size: .84rem; font-weight: 700; text-align: left; cursor: pointer; }
    .app-ann-multi .app-ann-bar:focus-visible { outline: 3px solid #111827; outline-offset: -3px; }
    .app-ann-bar-count { flex: 0 0 auto; white-space: nowrap; }
    .app-ann-bar-first { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #78350f; }
    .app-ann-bar-caret { flex: 0 0 auto; transition: transform .15s; }
    .app-ann-multi.open .app-ann-bar-caret { transform: rotate(180deg); }
    .app-ann-multi .app-ann-list { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: min(60vh, calc(100dvh - var(--header-h, 64px) - 56px)); overflow-y: auto;
        background: #fffbeb; border-bottom: 2px solid #d97706; box-shadow: 0 12px 24px rgba(0, 0, 0, .28); }
    .app-ann-multi.open .app-ann-list { display: block; }
    .app-ann-multi .app-ann-ackall { display: block; position: sticky; bottom: 0; margin: 0; padding: .6rem .8rem; background: #fffbeb; border-top: 1px solid #fcd34d; }
    .app-ann-multi .app-ann-ackall .btn { width: 100%; min-height: 44px; }
}
/* v27.01 : entrée de menu dont la fonction repose sur l'IA, indisponible : grisée (le clic mène au réglage) */
nav a.nav-disabled{opacity:.45;font-style:italic}
nav a.nav-disabled:hover{opacity:.75}
