/*
 * console.css — shared design tokens + components for the Operations console
 * SPAs (OPS-CONSOLE-702). Used by /admin/ (home) and /admin/support/; the
 * older pages (metrics/login/staff/providers) keep their inline styles with
 * the SAME variable names, so both generations render consistently.
 * Dark by default, light via prefers-color-scheme.
 */

:root {
  color-scheme: dark light;
  --bg: #0d1117; --panel: #161b22; --panel-2: #1c2129; --border: #2d333b;
  --text: #e6edf3; --muted: #8b949e; --accent: #58a0f9; --accent-2: #3fb950;
  --danger: #f85149; --warn: #d29922;
  /* Aplats sous texte BLANC (boutons, onglets, pastilles pleines) : distincts des couleurs
     de texte, car #4493f8 / #f85149 sous du blanc tombent à 3,1 / 3,35:1. Visés ≥ 4,5:1 mesuré
     (QA2 Régie AGENT-PC-0511-22, OPS-REGIE-SOMBRE-TABLEAU-0511-001). */
  --accent-fill: #1a64d6; --danger-fill: #d1242f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
html[data-theme="light"] { --bg: #f4f7fb; --panel: #fff; --panel-2: #edf2f7; --border: #d7e0eb; --text: #142033; --muted: #5e6d80;
  /* Couleurs sémantiques ASSOMBRIES pour le fond clair. Celles de `:root` sont
     calibrées pour du sombre : sur blanc elles tombent à 2,5-3,3 de contraste,
     sous le seuil AA de 4,5 — c'est ce qui rendait les pastilles d'alerte
     illisibles (OPS-CONSOLE-LIGHT-CONTRAST-001). */
  /* OPS-CDP-PAQUET-PROVIDERS-ETAT-1211-001 — accent clair #1160c4 → #0f5bbb : onglet actif sur son
     propre fond teinté (13 % d'accent sur --panel-2) à 4,43:1 → 4,75:1. Même teinte. */
  --accent: #0f5bbb; --accent-2: #1c7a37; --warn: #8a6410; --danger: #c0322b;
  --accent-fill: #1160c4; --danger-fill: #c0322b; }
html[data-theme="dark"] { --bg: #0a101a; --panel: #101925; --panel-2: #182333; --border: #273649; --text: #eaf0f7; --muted: #9aabbd;
  /* Couleurs sémantiques du SOMBRE reposées ici — OPS-WEB-KO-CAMPAGNE-1211-001.
     Sans elles, un poste réglé en CLAIR qui force la console en sombre héritait des valeurs
     claires du bloc `@media (prefers-color-scheme: light)` ci-dessous (#1160c4, #1c7a37…) :
     onglets actifs, surtitres, liens et puces tombaient à 2,0–3,3:1 sur #101925 / #0a101a
     (tour web QA du 12/11). Mêmes teintes que `:root`, mesurées ≥ 4,5:1 sur --panel et --bg. */
  /* OPS-CDP-PAQUET-PROVIDERS-ETAT-1211-001 — accent #4493f8 → #58a0f9 (même teinte, plus clair) :
     menu mobile actif (#1c2c4d) 4,47 → 5,15:1, entrée active Hôpital/Console IA 4,19 → 4,76:1. */
  --accent: #58a0f9; --accent-2: #3fb950; --warn: #d29922; --danger: #f85149;
  --accent-fill: #1a64d6; --danger-fill: #d1242f; }
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f8fa; --panel: #ffffff; --panel-2: #eef1f4; --border: #d0d7de;
          --text: #1f2328; --muted: #656d76;
          --accent: #0f5bbb; --accent-2: #1c7a37; --warn: #8a6410; --danger: #c0322b;
          --accent-fill: #1160c4; --danger-fill: #c0322b; }
}

/* Lissage en niveaux de gris : seulement sur fond SOMBRE.
 *
 * La version précédente (2026-08-06) posait la règle sans condition, sur la
 * foi que « la console est sombre par défaut ». C'est faux : elle a deux
 * thèmes, `html[data-theme="light"]` et la palette claire ci-dessus, et un
 * poste réglé en clair les voit. Or sur fond clair, `antialiased` SUPPRIME le
 * rendu sous-pixels, amincit les glyphes et délave le texte — soit exactement
 * le flou que la règle prétendait corriger, dans l'autre sens.
 *
 * (Propriété appliquée par Chrome/Safari sous macOS seulement ; sous Windows
 * elle est analysée puis ignorée, le lissage y vient de DirectWrite.) */
html[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header.console {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .9rem 1.4rem; background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.console-brand { display:flex; align-items:center; gap:.55rem; color:var(--text); text-decoration:none; min-width:max-content; }
.console-brand img { width:34px; height:34px; object-fit:contain; }
/* ⚠️ LA CLASSE QUI NOMME LE LOGO LE DIMENSIONNE — 2026-09-04.
   Elle ne portait que `object-fit` et `flex`. La TAILLE vivait dans la règle du PARENT
   (`.console-brand img`), donc toute console qui bâtit son en-tête avec un autre parent
   héritait d'un `<img>` SANS dimension — et `myth-mark.png` fait 1280 × 1280 px.
   Constaté par le fondateur sur « Carte & Navigation » : le logo occupait toute la page.
   `flex: 0 0 auto` interdisait en plus au conteneur de le réduire.
   La console `support` avait déjà résolu ça chez elle (`.brand-link img{height:34px;width:34px}`) ;
   `routing`, née après, ne l'a pas repris — « le correctif livré sur une seule des deux ».
   Poser la taille ICI ferme le motif pour toutes, actuelles et futures.
   ⚠️ Aucune régression possible : toutes les règles existantes qui dimensionnent un logo
   (`.console-brand img`, `.brand-link img`, `.brand img`) sont en `.classe + type`, soit une
   spécificité (0,1,1) qui l'emporte sur `.myth-logo` (0,1,0). Elles gardent donc la main. */
.myth-logo { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
html[data-theme="dark"] .myth-logo { filter: brightness(0) invert(1); opacity: .92; }
html[data-theme="light"] .myth-logo { filter: none; opacity: 1; }
.console-brand span { display:grid; line-height:1.05; }
.console-brand strong { font-size:.92rem; letter-spacing:.08em; }
.console-brand small, .console-title small { color:var(--muted); font-size:.69rem; letter-spacing:.04em; }
.console-divider { width:1px; height:28px; background:var(--border); }
.console-title { display:grid; gap:.08rem; }
.console-title strong { font-size:.94rem; }
.spacer { flex: 1; }
#who { font-size: .85rem; color: var(--muted); }
.profile-summary { display:flex; align-items:center; gap:.45rem; background:transparent; border:1px solid transparent; padding:.4rem .55rem; color:var(--text); }
.profile-summary-label { font-weight:650; font-size:.82rem; }
.theme-toggle { width:34px; height:34px; padding:0; display:grid; place-items:center; font-size:1rem; }

/* ── Controls ───────────────────────────────────────────────────────────── */
button, select, input, textarea {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: .42rem .7rem;
}
button, select { cursor: pointer; }
button:hover, select:hover { border-color: var(--accent); }
button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .55; cursor: not-allowed; }
.ghost { background: transparent; color: var(--muted); border-color: transparent; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

/* Listes déroulantes lisibles dans les deux thèmes — OPS-CONSOLE-LISTES-LISIBLES-3010-001.
   La liste OUVERTE d'un <select> est dessinée par le navigateur selon `color-scheme`, pas selon
   `data-theme` : un poste réglé en clair qui force la console en sombre ouvrait des options
   blanches sur fond blanc (constaté par le fondateur sur Messagerie, 30/10). Le thème forcé fixe
   donc aussi `color-scheme` (ici et dans operations-ui.js), et chaque option reprend les jetons
   du panneau, même quand le <select> fermé est transparent. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
select option, select optgroup { background-color: var(--panel); color: var(--text); }
select option:disabled { color: var(--muted); }

/* Liens nus : couleur du thème au lieu du bleu du navigateur (#0000ee = ~2:1 sur fond sombre,
   « Ouvrir l'exemple en grand » sur /admin/workspace/, tour web du 12/11). `:where` = spécificité
   nulle : toute règle de page garde la main — OPS-WEB-KO-CAMPAGNE-1211-001. */
:where(a:not([class])), :where(a:not([class])):visited { color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
code.evt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; }

/* ── Sections & cards ───────────────────────────────────────────────────── */
h2.section {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 650; margin: 1.4rem 0 .7rem;
}
h2.section:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
        padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.card .top { display: flex; align-items: center; gap: .6rem; }
.card h3 { font-size: 1rem; margin: 0; font-weight: 650; flex: 1; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--muted); }
.domains { font-size: .84rem; color: var(--muted); }

/* Admin section cards double as one big link. */
a.card { text-decoration: none; color: var(--text); }
a.card:hover { border-color: var(--accent); }
a.card .ico { font-size: 1.35rem; }
.admin-card { min-height:148px; justify-content:center; }
.admin-icon, .chip .ico { display:inline-flex; align-items:center; justify-content:center; min-width:2.3rem; min-height:1.55rem; padding:.16rem .38rem; border:1px solid var(--border); border-radius:6px; font-size:.67rem; color:var(--accent); background:color-mix(in srgb, var(--accent) 10%, var(--panel-2)); }

/* ── Status badges ──────────────────────────────────────────────────────── */
.badge { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
         border-radius: 999px; padding: .16rem .55rem; border: 1px solid var(--border); color: var(--muted); }
.badge.active { color: var(--accent-2); border-color: var(--accent-2);
                background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
.badge.beta { color: var(--warn); border-color: var(--warn);
              background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge.planned { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
                 background: color-mix(in srgb, var(--warn) 6%, transparent); opacity: .9; }

/* ── Link chips (visible buttons, icon + label) ─────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips.push { margin-top: auto; padding-top: .35rem; }
a.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: .3rem .6rem;
  background: var(--panel-2); line-height: 1.2;
}
a.chip:hover { border-color: var(--accent); color: var(--accent); }
a.chip .ico { font-size: .95em; }
a.nav {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .84rem; text-decoration: none; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: .34rem .65rem; background: var(--panel-2);
}
a.nav:hover { border-color: var(--accent); color: var(--accent); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tabs button { border: 0; border-radius: 0; background: transparent; padding: .42rem .9rem; }
.tabs button.on { background: var(--accent-fill); color: #fff; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
tr.row { cursor: pointer; }
tr.row:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }

.empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.5; }
footer { margin-top: 1.2rem; }

/* OPS-CONSOLE-703 — self-declared product surfaces (collapsible groups). */
.surf-group { margin-top: .5rem; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .7rem; }
.surf-group summary { cursor: pointer; font-size: .86rem; color: var(--muted); user-select: none; }
.surf-group summary:hover { color: var(--text); }
.surf-group[open] summary { color: var(--text); }

/* ── OPS-PROFILE-001 — Profile drawer (shared/profile.js) ────────────────────── */
.pf-trigger { cursor: pointer; border-radius: 8px; padding: .1rem .35rem; }
.pf-trigger:hover { color: var(--text); background: var(--panel-2); }
.pf-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

body.pf-noscroll { overflow: hidden; }
.pf-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in srgb, #000 45%, transparent);
  display: flex; justify-content: flex-end;
}
.pf-overlay[hidden] { display: none !important; }
.pf-drawer {
  width: min(440px, 100%); height: 100%; background: var(--panel);
  border-left: 1px solid var(--border); box-shadow: -8px 0 32px rgba(0, 0, 0, .28);
  display: flex; flex-direction: column; outline: none;
}
.pf-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel);
}
.pf-drawer-head strong { font-size: 1rem; }
.pf-close { font-size: .95rem; padding: .25rem .55rem; }
.pf-drawer-body { padding: 1.1rem 1.2rem; overflow-y: auto; }
.pf-loading { padding: 1.4rem 0; }

.pf-section { padding: .2rem 0 1.1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; }
.pf-section:last-child { border-bottom: 0; margin-bottom: 0; }
.pf-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em;
        color: var(--muted); font-weight: 650; margin: 0 0 .7rem; }
.pf-subh { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
           color: var(--muted); font-weight: 600; margin: 1rem 0 .5rem; }

.pf-identity { display: flex; align-items: center; gap: .8rem; }
.pf-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-2));
  color: var(--accent); font-weight: 700; font-size: 1.15rem;
}
.pf-idmeta { min-width: 0; }
.pf-name { font-weight: 600; font-size: .98rem; }
.pf-email { font-size: .84rem; word-break: break-all; }
.pf-status { margin-top: .3rem; }
.pf-roles { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }

.pf-badge { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
            border-radius: 999px; padding: .12rem .5rem; border: 1px solid var(--border); }
.pf-badge.ok { color: var(--accent-2); border-color: var(--accent-2);
               background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
.pf-badge.warn { color: var(--warn); border-color: var(--warn);
                 background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pf-chip { font-size: .76rem; border: 1px solid var(--border); border-radius: 8px;
           padding: .18rem .5rem; background: var(--panel-2); color: var(--text);
           font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.pf-permgroup { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .7rem; margin-top: .5rem; }
.pf-permgroup summary { cursor: pointer; font-size: .86rem; color: var(--text); user-select: none; }
.pf-perms { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.pf-perm { font-size: .74rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
           border: 1px solid var(--border); border-radius: 6px; padding: .12rem .45rem;
           background: var(--panel-2); color: var(--muted); }

.pf-field { margin-bottom: .8rem; }
.pf-field > label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.pf-inputwrap { display: flex; gap: .4rem; }
.pf-inputwrap input { flex: 1; }
.pf-reveal { padding: .42rem .55rem; }
.pf-reveal.on { border-color: var(--accent); }

.pf-strength { display: flex; gap: .3rem; margin-top: .45rem; }
.pf-strength-bar { height: 4px; flex: 1; border-radius: 999px; background: var(--border); transition: background .15s; }
.pf-strength-bar.s1 { background: var(--danger); }
.pf-strength-bar.s2 { background: var(--warn); }
.pf-strength-bar.s3 { background: var(--accent); }
.pf-strength-bar.s4 { background: var(--accent-2); }

.pf-actions { margin-top: .9rem; display: flex; justify-content: flex-end; }
.pf-error { display: none; color: var(--danger); font-size: .84rem; margin-top: .6rem; line-height: 1.4; }
.pf-error[hidden] { display: none; }
.pf-error:not([hidden]) { display: block; }
.pf-success { color: var(--accent-2); font-size: .9rem; }

@media (max-width: 520px) { .pf-drawer { width: 100%; border-left: 0; } }
@media (max-width: 720px) { .console-title, .console-divider, .profile-summary-label { display:none; } header.console { padding:.75rem 1rem; } .console-brand img { width:30px; height:30px; } }

/* ── Operations home ───────────────────────────────────────────────────── */
.ops-home { background: var(--bg); }
.ops-home header.console { min-height: 78px; padding: .75rem clamp(1rem, 3vw, 2rem); }
.ops-home .console-brand img { width: 40.8px; height: 40.8px; }
.ops-home .console-brand strong { font-size: 1.104rem; }
.ops-home .console-brand small, .ops-home .console-title small { font-size: .828rem; }
.ops-home .console-title strong { font-size: 1.128rem; }
.ops-home header.console #who { font-size: 1.02rem; }
.ops-home header.console .profile-summary-label { font-size: .984rem; }
.ops-home header.console .profile-role { font-size: .84rem; }
.ops-home header.console .ghost { font-size: 1.2rem; }
.ops-home header.console .theme-toggle { font-size: 1.2rem; }
.ops-main { max-width: 1360px; padding: 0 clamp(1rem, 3vw, 2rem) 3rem; }
.ops-intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); gap: 3rem;
  align-items: end; padding: clamp(1.5rem, 2.4vw, 2.4rem) 0 2rem; border-bottom: 1px solid var(--border);
}
.ops-brand-intro { display: grid; justify-items: start; gap: .65rem; margin-bottom: .7rem; }
.ops-brand-intro .eyebrow { margin: 0; }
.eyebrow { margin: 0 0 .45rem; color: var(--accent); font-size: .72rem; line-height: 1.2; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ops-intro h1 { max-width: 720px; margin: 0; font-size: clamp(1.62rem, 2.7vw, 2.52rem); line-height: 1.12; font-weight: 700; letter-spacing: 0; }
.intro-copy { max-width: 650px; margin: 1rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.ops-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; border: 1px solid var(--border); background: var(--border); }
.ops-summary div { min-height: 112px; padding: 1rem; background: var(--panel); }
.ops-summary dt { color: var(--text); font-size: 2rem; line-height: 1; font-weight: 700; }
.ops-summary dd { margin: .5rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.ops-section { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
.section-heading { display: flex; gap: 2rem; justify-content: space-between; align-items: end; margin-bottom: 1.2rem; }
.section-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: 0; }
.section-heading > p { max-width: 410px; margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; text-align: right; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.admin-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; min-height: 150px; padding: 1.25rem; color: var(--text); text-decoration: none; background: var(--panel); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background .16s, color .16s; }
.ops-home .admin-tile[hidden] { display: none; }
.admin-tile:hover { background: var(--panel-2); color: var(--accent); }
.admin-tile strong, .admin-tile small { display: block; }
.admin-tile strong { font-size: .98rem; font-weight: 700; }
.admin-tile small { margin-top: .38rem; color: var(--muted); font-size: .81rem; line-height: 1.45; }
.tile-icon, .product-mark { display: grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--panel-2)); }
.tile-icon.data { color: #0b7361; background: color-mix(in srgb, #0b7361 9%, var(--panel-2)); }
.tile-icon.qa { color: #94590f; background: color-mix(in srgb, #94590f 9%, var(--panel-2)); }
.tile-icon svg, .tile-arrow svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-arrow { color: var(--muted); }
.admin-tile:hover .tile-arrow { color: var(--accent); transform: translateX(2px); }
.product-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.status-filter { display: inline-flex; align-items: stretch; border: 1px solid var(--border); background: var(--panel); }
.filter-button { display: inline-flex; gap: .5rem; align-items: center; min-height: 36px; padding: 0 .8rem; color: var(--muted); border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; font-size: .8rem; white-space: nowrap; }
.filter-button:last-child { border-right: 0; }
.filter-button span { color: inherit; font-size: .72rem; }
.filter-button:hover { color: var(--text); }
.filter-button.is-active { color: #fff; background: var(--accent-fill); }
.product-search { display: flex; align-items: center; gap: .5rem; width: min(100%, 300px); height: 36px; padding: 0 .7rem; color: var(--muted); border: 1px solid var(--border); background: var(--panel); }
.product-search:focus-within { border-color: var(--accent); }
.product-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.product-search input { width: 100%; min-width: 0; height: 100%; padding: 0; color: var(--text); border: 0; border-radius: 0; outline: 0; background: transparent; font-size: .83rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.product-card { display: flex; flex-direction: column; min-height: 250px; padding: 1.15rem; border: 1px solid var(--border); background: var(--panel); }
.product-card:hover { border-color: color-mix(in srgb, var(--accent) 72%, var(--border)); }
.product-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
.product-mark { width: 42px; height: 42px; }
.product-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-mark.blue { color: #2470cb; background: color-mix(in srgb, #2470cb 10%, var(--panel-2)); }
.product-mark.teal { color: #087e73; background: color-mix(in srgb, #087e73 10%, var(--panel-2)); }
.product-mark.amber { color: #8c5b13; background: color-mix(in srgb, #8c5b13 10%, var(--panel-2)); }
.product-mark.pink { color: #b83280; background: color-mix(in srgb, #b83280 10%, var(--panel-2)); }
.product-mark.violet { color: #7251b5; background: color-mix(in srgb, #7251b5 10%, var(--panel-2)); }
.product-mark.cyan { color: #087a9c; background: color-mix(in srgb, #087a9c 10%, var(--panel-2)); }
.product-card h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; font-weight: 700; }
.product-card-head p { margin: .18rem 0 0; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { padding: .18rem .45rem; border: 1px solid var(--border); font-size: .67rem; font-weight: 700; white-space: nowrap; }
/* Couleurs du THÈME, jamais en dur : #13795b et #a75f00, calibrés pour le clair, tombaient à
   3,08:1 en sombre (accueil /admin/, OPS-ACCUEIL-BADGE-CONTRASTE-0611-001). --accent-2 et --warn
   ont une valeur par thème, visée ≥ 4,5:1. */
.status-badge.active { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border)); background: color-mix(in srgb, var(--accent-2) 8%, var(--panel)); }
.status-badge.beta { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 8%, var(--panel)); }
.status-badge.planned { color: var(--muted); }
.product-domain { min-height: 2.6em; margin: 1rem 0; color: var(--muted); font-size: .79rem; line-height: 1.45; }
.product-apps { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .45rem; min-height: 38px; }
.app-link, .product-action { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; color: var(--text); text-decoration: none; }
.app-link { padding: .28rem .48rem; border: 1px solid var(--border); background: var(--panel-2); font-size: .75rem; }
.app-link:hover { border-color: var(--accent); color: var(--accent); }
.app-link.is-static { color: var(--muted); }
.app-icon, .product-action svg { display: inline-flex; flex: 0 0 auto; width: 15px; height: 15px; }
.app-icon svg, .product-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.product-action { color: var(--muted); font-size: .76rem; }
.product-action:hover { color: var(--accent); }
.profile-role { max-width: 170px; overflow: hidden; color: var(--accent); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .ops-intro { grid-template-columns: 1fr; gap: 1.5rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; gap: .6rem; }
  .section-heading > p { max-width: 650px; text-align: left; }
}
@media (max-width: 620px) {
  .ops-main { padding-bottom: 2rem; }
  .ops-intro { padding-top: 1.5rem; }
  .ops-summary { grid-template-columns: repeat(3, 1fr); }
  .ops-summary div { min-height: 92px; padding: .75rem; }
  .ops-summary dt { font-size: 1.55rem; }
  .product-toolbar { align-items: stretch; flex-direction: column; }
  .status-filter { width: 100%; }
  .filter-button { flex: 1; justify-content: center; padding: 0 .45rem; }
  .product-search { width: 100%; }
  .product-grid { grid-template-columns: 1fr; }
  .profile-role { display: none; }
}

/* ── Tiroir de détail partagé (Hôpital, console IA) ────────────────────────────────
   OPS-MYTHAI-LECTURE-PERIMEE-0511-001 : déplacé de hospital/app.css pour que la console IA ouvre ses
   cas dans le MÊME tiroir (un seul exemplaire). `--overlay` a un repli : seule l'Hôpital le définit. */
.drawer-overlay { position:fixed; inset:0; z-index:30; display:flex; justify-content:flex-end; background:var(--overlay, color-mix(in srgb, #000 48%, transparent)); }
.record-drawer { width:min(480px,100%); height:100%; overflow-y:auto; border-left:1px solid var(--border); background:var(--panel); box-shadow:-10px 0 38px rgba(0,0,0,.25); }
.record-drawer > header { display:flex; justify-content:space-between; gap:10px; padding:18px; border-bottom:1px solid var(--border); }
.record-drawer h2 { margin:0; font-size:1.1rem; }
.record-drawer header > div > span { display:block; margin-top:4px; color:var(--muted); font-family:ui-monospace,monospace; font-size:.73rem; }
@media (max-width:720px) { .drawer-overlay { align-items:stretch; } .record-drawer { width:100%; } }
