/*
 * COMPOS UI — la charte commune des pages web de la plateforme (www.delivro-dz.com) :
 * le site, l'administration Delivro, le suivi de commande, les pages légales et l'administration Activation.
 * Une seule mise en page : la barre du haut (logo COMPOS en blanc + nom du module + menu + compte),
 * le contenu, le pied de page (logo, www.compos-dz.com, 0550 20 02 72).
 *
 * Look « Salle des opérations » (2026-10-15, choisi par COMPOS) : bleu canard profond + ambre, fond sable,
 * barre du haut sombre avec les rubriques dedans, bandeau de tête, une couleur par statut de course.
 *
 * Source : delivro-backend/app/static/ui/compos-ui.css (servie à /admin/ui/compos-ui.css).
 * Copies identiques : activation-server/public/compos-ui.css (servie à /activation/admin/static/compos-ui.css)
 * et, sur le serveur VENTO, le portail Resto : resto/static/compos/compos-ui.css (servie à /static/compos/).
 * Modifier la source, recopier les deux autres.
 *
 * Tout est préfixé « cx- » pour ne jamais heurter les classes des pages qui l'utilisent.
 */
:root {
    color-scheme: light;
    /* surfaces */
    --cx-bg: #f5f3ee;             /* sable chaud */
    --cx-card: #ffffff;
    --cx-card-2: #faf8f4;
    --cx-line: #e6e1d7;
    --cx-line-strong: #d3ccbd;
    --cx-track: #eeeae2;
    /* texte */
    --cx-ink: #0f2629;            /* titres */
    --cx-text: #22363a;
    --cx-muted: #55686b;
    /* nuit : barre du haut et bandeau de tête */
    --cx-night: #0b3036;
    --cx-night-2: #0f3d44;
    --cx-on-night: #ffffff;
    --cx-on-night-2: #bdd5d3;
    /* une seule couleur d'action pour toute la plateforme (bleu canard), l'ambre pour signaler « ici » */
    --cx-primary: #0f766e;
    --cx-primary-strong: #115e59;
    --cx-primary-soft: #e2f1ee;
    --cx-accent: #f59e0b;
    --cx-accent-bright: #fbbf24;
    /* états */
    --cx-ok: #15803d;   --cx-ok-soft: #e3f4e8;
    --cx-warn: #b45309; --cx-warn-soft: #fff3da;
    --cx-bad: #b42318;  --cx-bad-soft: #fdeceb;
    --cx-info: #0369a1; --cx-info-soft: #e4f3fc;
    /* statuts d'une course — la même couleur partout (pastille, barre, frise, badge) */
    --cx-s-wait: #d97706;   --cx-s-wait-text: #8a3c0b;   --cx-s-wait-soft: #fff3da;
    --cx-s-assign: #9333ea; --cx-s-assign-text: #6b21a8; --cx-s-assign-soft: #f4ecff;
    --cx-s-route: #0284c7;  --cx-s-route-text: #075985;  --cx-s-route-soft: #e4f3fc;
    --cx-s-done: #15803d;   --cx-s-done-text: #14532d;   --cx-s-done-soft: #e3f4e8;
    --cx-s-cancel: #dc2626; --cx-s-cancel-text: #991b1b; --cx-s-cancel-soft: #fdeceb;
    --cx-radius: 16px;
    --cx-radius-sm: 10px;
    --cx-shadow: 0 1px 2px rgba(15, 38, 41, .05), 0 12px 32px -14px rgba(15, 38, 41, .22);
    --cx-font: "Segoe UI", Roboto, system-ui, -apple-system, "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

html { height: 100%; -webkit-text-size-adjust: 100%; }
body.cx {
    margin: 0; min-height: 100%;
    display: flex; flex-direction: column;
    font-family: var(--cx-font); color: var(--cx-text); background: var(--cx-bg);
    -webkit-font-smoothing: antialiased;
}
/* Liens simples dans la couleur d'action, SANS priorite (:where) : un bouton-lien (.btn, .cx-btn…) garde sa propre
   couleur. Avec « body.cx a », un bouton ecrit dans sa propre couleur devenait illisible (2026-10-12). */
:where(body.cx a) { color: var(--cx-primary); }
body.cx :focus-visible { outline: 2px solid var(--cx-primary); outline-offset: 2px; }
.cx-top :focus-visible, .cx-band :focus-visible { outline-color: var(--cx-accent-bright); }
/* icones SVG au trait (jamais d'emoji) */
.cx-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- barre du haut ---------- */
.cx-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
    padding: 10px 22px;
    background: linear-gradient(180deg, var(--cx-night) 0%, var(--cx-night-2) 100%); color: var(--cx-on-night);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 8px 22px -12px rgba(11, 48, 54, .55);
}
.cx-brand { display: flex; align-items: center; gap: 14px; color: #fff !important; text-decoration: none; flex: none; }
.cx-brand img { height: 30px; width: auto; display: block; }
.cx-module {
    padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .22);
    font-size: 16px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; white-space: nowrap;
}
.cx-module small { display: block; font-size: 10.5px; font-weight: 650; color: var(--cx-on-night-2); letter-spacing: .1em; text-transform: uppercase; }
.cx-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 0; }
.cx-nav a {
    position: relative; padding: 7px 10px; border-radius: 9px;
    color: var(--cx-on-night-2) !important; text-decoration: none; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.cx-nav a:hover { color: #fff !important; background: rgba(255, 255, 255, .08); }
.cx-nav a.on { color: #fff !important; background: rgba(255, 255, 255, .10); box-shadow: inset 0 -2px 0 var(--cx-accent-bright); }
.cx-user { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; color: var(--cx-on-night-2); font-size: 12.5px; }
.cx-user form { display: inline; margin: 0; }
.cx-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--cx-on-night-2); white-space: nowrap; }
.cx-live b { color: #fff; font-variant-numeric: tabular-nums; }
.cx-live::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399;
    animation: cx-pulse 2s infinite;
}
@keyframes cx-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); }
    70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
@media (prefers-reduced-motion: reduce) { .cx-live::before { animation: none; } }

/* Rubriques d'un module, sur leur propre ligne DANS la barre du haut (soulignées d'ambre quand actives).
   <nav class="cx-tabs"><button class="cx-tab" aria-current="page">…</button>…</nav> */
.cx-tabs {
    flex: 0 0 100%; order: 10; display: flex; align-items: stretch; gap: 2px;
    margin: 2px -10px -10px; padding: 0 2px; overflow-x: auto; scrollbar-width: none;
}
.cx-tabs::-webkit-scrollbar { display: none; }
.cx-tab {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 10px 13px; border: 0; border-radius: 0; background: none;
    color: var(--cx-on-night-2); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap;
    text-decoration: none; cursor: pointer;
}
.cx-tab .cx-i { width: 16px; height: 16px; }
.cx-tab:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.cx-tab[aria-current="page"], .cx-tab.on { color: #fff; }
.cx-tab[aria-current="page"] .cx-i, .cx-tab.on .cx-i { color: var(--cx-accent-bright); }
.cx-tab[aria-current="page"]::after, .cx-tab.on::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
    border-radius: 3px 3px 0 0; background: var(--cx-accent-bright);
}
.cx-tab .cx-count {
    min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--cx-accent); color: #1f1300;
    font-size: 11px; font-weight: 800; line-height: 16px; text-align: center;
}
.cx-tab.cx-danger { margin-left: auto; color: #fca5a5; }
.cx-tab.cx-danger:hover { color: #fee2e2; background: rgba(239, 68, 68, .16); }

/* ---------- bandeau de tête (continue la barre du haut) ---------- */
.cx-band {
    flex: none; color: var(--cx-on-night);
    background:
        radial-gradient(1200px 260px at 85% -40%, rgba(245, 158, 11, .16), transparent 60%),
        linear-gradient(180deg, var(--cx-night-2) 0%, #124850 100%);
    padding: 26px 22px 64px;
}
.cx-band__in { max-width: 1180px; margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between;
               gap: 16px 24px; flex-wrap: wrap; }
.cx-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--cx-accent-bright);
              font-size: 12.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.cx-eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.cx-band h1 { margin: 6px 0 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.cx-band p { margin: 6px 0 0; font-size: 14.5px; color: var(--cx-on-night-2); }
/* le contenu qui suit remonte sur le bandeau */
.cx-band + .cx-main, .cx-band + .cx-lift { margin-top: -44px; }

/* ---------- contenu ---------- */
.cx-main { flex: 1 0 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 22px 40px; box-sizing: border-box; }
.cx-main.cx-narrow { max-width: 820px; }
.cx-head { margin: 2px 0 18px; }
.cx-head h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; color: var(--cx-ink); }
.cx-head p { margin: 0; color: var(--cx-muted); }
.cx-card {
    background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow); padding: 20px 22px; margin-bottom: 16px;
}

/* ---------- boutons ---------- */
.cx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: var(--cx-radius-sm); border: 1px solid var(--cx-primary);
    background: var(--cx-primary); color: #fff !important; font: inherit; font-size: 14px; font-weight: 700;
    text-decoration: none; cursor: pointer; line-height: 1.2; box-sizing: border-box;
}
.cx-btn:hover { background: var(--cx-primary-strong); border-color: var(--cx-primary-strong); }
.cx-btn.cx-ghost { background: #fff; color: var(--cx-primary) !important; border-color: var(--cx-line-strong); }
.cx-btn.cx-ghost:hover { background: var(--cx-primary-soft); border-color: var(--cx-primary); }
.cx-btn.cx-dark { background: rgba(255, 255, 255, .07); color: #fff !important; border-color: rgba(255, 255, 255, .2); }
.cx-btn.cx-dark:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .34); }
.cx-btn.cx-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.cx-btn.cx-block { display: flex; width: 100%; }
.cx-btn .cx-i { width: 16px; height: 16px; }

/* ---------- connexion ---------- */
.cx-login { width: 100%; max-width: 400px; margin: 8% auto 32px; padding: 30px 28px; text-align: center; box-sizing: border-box; }
.cx-login .cx-logo { display: block; height: 44px; width: auto; margin: 2px auto 16px; }
.cx-login h1 { margin: 0 0 4px; font-size: 21px; color: var(--cx-ink); }
.cx-login p { margin: 0 0 18px; color: var(--cx-muted); font-size: 14px; }
.cx-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--cx-muted); font-size: 12px; }
.cx-or::before, .cx-or::after { content: ""; flex: 1; height: 1px; background: var(--cx-line); }

/* ---------- pied de page ---------- */
.cx-foot {
    flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
    padding: 18px 22px; border-top: 1px solid var(--cx-line); background: #fff;
    color: var(--cx-muted); font-size: 12.5px; text-align: center;
}
.cx-foot img { height: 22px; width: auto; display: block; }
.cx-foot a { color: var(--cx-ink) !important; font-weight: 700; text-decoration: none; }
.cx-foot a:hover { color: var(--cx-primary) !important; }

/* ---------- téléphone : logo et compte sur la 1re ligne, le menu sur sa propre ligne, qui défile ---------- */
@media (max-width: 760px) {
    /* Sur trois lignes, une barre collée en haut mangerait un tiers de l'écran : elle défile avec la page. */
    .cx-top { position: static; padding: 8px 12px; gap: 8px 10px; }
    .cx-brand { gap: 9px; }
    .cx-brand img { height: 24px; }
    .cx-module { padding-left: 9px; font-size: 14.5px; }
    .cx-nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .cx-nav::-webkit-scrollbar { display: none; }
    .cx-nav a { padding: 6px 9px; font-size: 13.5px; }
    .cx-user { font-size: 12px; gap: 6px; }
    .cx-tabs { margin: 0 -12px -8px; padding: 0 4px; }
    .cx-tab { padding: 10px 9px 12px; }
    .cx-band { padding: 18px 14px 56px; }
    .cx-band h1 { font-size: 24px; }
    .cx-main { padding: 14px 12px 32px; }
    .cx-head h1 { font-size: 20px; }
    .cx-login { margin-top: 28px; padding: 24px 18px; }
}

@media print {
    .cx-top, .cx-foot, .cx-band { display: none !important; }
    body.cx { background: #fff; display: block; }
    .cx-main { max-width: none; padding: 0; margin-top: 0 !important; }
}
