/* ==========================================================
   CARILLON BACK-OFFICE — la MÊME identité que l'app cliente
   (décision patron 18/07) : carillon-ui.css est chargé AVANT
   et fournit jetons + doctrine (nuit #071c3b, bleu France
   #1546a0, vermillon = alertes seules, warn = gris, titres
   Fraunces). Le vieux thème est RETIRÉ : tout le fichier
   consomme directement les jetons carillon-ui (repli littéral
   identique) — admin.css n'ajoute que la mise en page
   (sidebar nuit, tableaux, kanban, agents, configuration).
   ========================================================== */
:root {
  /* Seules VALEURS LOCALES sans jeton carillon-ui officiel — tout le reste
     du fichier consomme directement les jetons de carillon-ui.css. */
  --nuit-2: #051530;                                /* borne sombre du dégradé gate */
  --alerte-douce: #fdeeee;                          /* fond doux des alertes */
  --ombre-carte: 0 1px 2px rgba(7, 28, 59, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--blanc-chaud, #faf8f3);
  color: var(--ink, #071c3b);
  font-size: 15.5px;
  line-height: 1.5;
  font-family: var(--font-interface, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
h2, h3 { color: var(--carillon-nuit, #071c3b); font-family: var(--font-titres, Fraunces, Georgia, serif); }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-weight: 600; }
.wordmark { font-family: var(--font-titres, Georgia, serif); font-weight: 500; color: var(--carillon-nuit, #071c3b); }
.dot { color: var(--carillon-bleu, #1546a0); }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

/* ---------- champs et boutons : mêmes formes que l'app ---------- */
.field { display: grid; gap: 5px; min-width: 0; }
.field span { font-size: 0.78rem; font-weight: 700; color: var(--muted, #596579); }
.field input, .field select, .search, .filters select {
  border: 1px solid var(--line, #d9e2ee);
  border-radius: 9px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink, #071c3b);
  min-height: 42px;
}
.field input:focus, .search:focus { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line, #d9e2ee); border-radius: 10px;
  background: #fff; color: var(--carillon-nuit, #071c3b);
  padding: 9px 16px; font-weight: 700; min-height: 42px;
}
.btn:hover { border-color: var(--carillon-bleu, #1546a0); background: var(--gris-bleute, #e8eef7); }
.btn.primary { background: var(--carillon-bleu, #1546a0); border-color: var(--carillon-bleu, #1546a0); color: #fff; }
.btn.primary:hover { background: var(--carillon-bleu-fonce, #0f3578); border-color: var(--carillon-bleu-fonce, #0f3578); }
.btn.danger { background: var(--carillon-rouge, #e63946); border-color: var(--carillon-rouge, #e63946); color: #fff; }
.btn.danger:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; font-size: 1.4rem; color: var(--muted, #596579); width: 42px; height: 42px; }

.badge {
  display: inline-block; border-radius: 999px; padding: 2px 10px;
  font-size: 0.74rem; font-weight: 700; white-space: nowrap;
}
.badge.ok { background: var(--surface-green, #e9f5ef); color: var(--carillon-vert, #168a4b); }
/* Doctrine app : « warn » = brouillon GRIS (jamais orange), vermillon = alertes seules. */
.badge.warn { background: var(--gris-bleute, #e8eef7); color: var(--muted, #596579); }
.badge.danger { background: var(--alerte-douce); color: var(--carillon-rouge, #e63946); }
.badge.info { background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578); }

/* ---------- écran d'entrée : même famille que le login de l'app ---------- */
/* ---------- Bannière d'environnement (Gate 0 / ADM-IND-003) ---------- */
.env-banner {
  position: fixed; top: 0; left: 0; right: 0; height: 30px; z-index: 1000;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; box-shadow: 0 1px 4px rgba(7, 28, 59, 0.35);
}
.env-banner .env-host { font-weight: 600; letter-spacing: 0.04em; opacity: 0.85; text-transform: none; }
.env-prod    { background: var(--carillon-rouge, #e63946); }         /* PRODUCTION = alerte */
.env-qual    { background: #a15c00; }                                /* bande d'AVERTISSEMENT test dédiée (pas l'identité app) */
.env-local   { background: var(--carillon-nuit, #071c3b); color: #c6d2e6; }
.env-unknown { background: repeating-linear-gradient(45deg, var(--carillon-rouge, #e63946) 0 12px, #b12b37 12px 24px); }
/* Décale les racines sous la bande fixe, sans débordement. */
body.env-on .gate,
body.env-on .console { margin-top: 30px; min-height: calc(100vh - 30px); }
/* Offset de la sidebar STICKY : desktop uniquement (en mobile ≤860px elle est
   `position:static; height:auto` — ne pas clobber cette mise en page horizontale). */
@media (min-width: 861px) {
  body.env-on .side { top: 30px; height: calc(100vh - 30px); }
}

/* ---------- P0-002 : purge sûre ---------- */
.purge-panel .purge-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.purge-panel .field { margin: 0; }
.purge-panel .field > span { display: block; font-size: 0.8rem; color: var(--muted, #596579); margin-bottom: 4px; }
.purge-panel input, .purge-panel select { padding: 8px 10px; border: 1px solid var(--line, #d9e2ee); border-radius: 10px; background: #fff; font: inherit; }
.purge-panel input:focus, .purge-panel select:focus { outline: 2px solid var(--carillon-bleu, #1546a0); outline-offset: 1px; }
.purge-preview { margin-top: 12px; }
.purge-confirm { margin-top: 12px; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line, #d9e2ee); border-radius: 12px; background: var(--gris-bleute, #e8eef7); }
.purge-appro { display: flex; gap: 12px; flex-wrap: wrap; }
.purge-appro .field { flex: 1; min-width: 160px; }

.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--nuit-2) 0%, var(--carillon-nuit, #071c3b) 55%, #0d2b57 100%);
  padding: 20px;
}
.gate-card {
  background: var(--surface, #ffffff); border-radius: 18px; padding: 36px 34px;
  width: 100%; max-width: 400px; display: grid; gap: 14px; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.gate-logo { width: 92px; margin: 0 auto; }
.gate-card h1 { font-family: var(--font-titres, Georgia, serif); font-weight: 500; font-size: 1.7rem; color: var(--carillon-nuit, #071c3b); }
.gate-sub { color: var(--muted, #596579); font-size: 0.92rem; }
.gate-card .field { text-align: left; }
.gate-status { min-height: 1.2em; font-size: 0.85rem; color: var(--carillon-rouge, #e63946); font-weight: 600; }

/* ---------- console : sidebar BLEU NUIT comme l'app (carillon-ui §3) ---------- */
.console { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--carillon-nuit, #071c3b);
  border-right: none;
  color: #e7edf7;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.side-brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); background: #fff; }
.side-brand strong {
  font-family: var(--font-titres, Georgia, serif); font-weight: 500;
  color: #ffffff; font-size: 1.25rem; display: block; line-height: 1.1;
}
.side-brand span { font-size: 0.72rem; color: #c6d2e6; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.side-nav { display: grid; gap: 4px; }
.side-nav button {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid transparent; color: #c6d2e6;
  padding: 10px 12px; border-radius: 10px; font-weight: 700; text-align: left; min-height: 44px;
}
.side-nav button .nav-ico {
  width: 18px; height: 18px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.side-nav button:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.side-nav button.active { background: var(--carillon-bleu, #1546a0); border-color: var(--carillon-bleu, #1546a0); color: #fff; box-shadow: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-foot .btn { background: transparent; border-color: rgba(255, 255, 255, 0.25); color: #ffffff; }
.side-foot .btn:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.1); }

main { padding: 26px 30px 60px; min-width: 0; }
.section { display: none; }
.section.active { display: block; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.stamp { font-size: 0.8rem; color: var(--muted, #596579); }
.search { min-width: 260px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface, #ffffff); border: 1px solid var(--line, #d9e2ee);
  border-radius: 14px; padding: 18px;
  box-shadow: var(--ombre-carte);
}
.card h3 { font-size: 1.02rem; margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }

/* KPI : mêmes chiffres géants colorés que l'app */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface, #ffffff); border: 1px solid var(--line, #d9e2ee); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--ombre-carte);
  display: grid; gap: 2px;
}
.kpi strong { font-size: 1.6rem; font-weight: 800; color: var(--kpi-accent, var(--carillon-bleu, #1546a0)); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted, #596579); }

.alert-list { display: grid; gap: 8px; }
.alert-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line, #d9e2ee); border-radius: 10px; background: #fff; cursor: pointer;
}
.alert-row:hover { border-color: var(--carillon-bleu, #1546a0); background: #f3f6fa; }
.alert-row .metier-badge { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.alert-row strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty {
  color: var(--muted, #596579); font-size: 0.9rem; padding: 14px; text-align: center;
  border: 1.5px dashed var(--line, #d9e2ee); border-radius: 10px; background: #f3f6fa;
}

/* capacité + jauges */
.capacity-box, .gauge-grid { display: grid; gap: 12px; }
.gauge label { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; font-weight: 650; margin-bottom: 4px; }
.gauge .track { height: 10px; border-radius: 999px; background: var(--gris-bleute, #e8eef7); overflow: hidden; }
.gauge .fill { height: 100%; border-radius: 999px; background: var(--carillon-vert, #168a4b); }
.gauge.warn .fill { background: var(--warn, #596579); }
.gauge.danger .fill { background: var(--carillon-rouge, #e63946); }
.capacity-banner {
  border-radius: 10px; padding: 12px 14px; font-weight: 700;
  background: var(--surface-green, #e9f5ef); color: var(--carillon-vert, #168a4b);
}
.capacity-banner.warn { background: var(--gris-bleute, #e8eef7); color: var(--muted, #596579); }

/* table clients */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted, #596579); padding: 12px 14px; border-bottom: 1px solid var(--line, #d9e2ee);
  white-space: nowrap; font-weight: 800;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--gris-bleute, #e8eef7); vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #f3f6fa; }
.table-actions { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.table-actions .btn { min-height: 34px; }

#operatorFeedback { min-height: 20px; }
.operator-sessions .mini-kpi { margin: 0 0 10px; background: var(--admin-surface); border-left: 4px solid var(--admin-primary); }
#operatorSessionsRows { min-height: 110px; }
.operator-status { display: inline-flex; align-items: center; gap: 6px; }
.operator-status .badge { margin-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .btn { min-height: 34px; }

.table tbody tr:last-child td { border-bottom: 0; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-name .metier-badge { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.cell-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; display: block; }
.cell-price { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--carillon-nuit, #071c3b); white-space: nowrap; }

.create-card { margin-top: 16px; }
.create-card summary { font-weight: 750; color: var(--carillon-nuit, #071c3b); cursor: pointer; min-height: 24px; }
.create-card .form-grid { margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.hint { font-size: 0.8rem; color: var(--muted, #596579); line-height: 1.45; }

/* abonnements */
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.sub-card {
  background: var(--surface, #ffffff); border: 1px solid var(--line, #d9e2ee); border-radius: 14px;
  padding: 16px; box-shadow: var(--ombre-carte); cursor: pointer;
}
.sub-card:hover { border-color: var(--carillon-bleu, #1546a0); }
.sub-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-width: 0; }
.sub-card .head .metier-badge { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.sub-card .head > div { flex: 1; min-width: 0; }
.sub-card .head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-card .head small { color: var(--muted, #596579); font-size: 0.78rem; }
.sub-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 0.88rem; border-bottom: 1px dashed var(--gris-bleute, #e8eef7); }
.sub-line span:first-child { min-width: 0; overflow-wrap: anywhere; }
.sub-line .p { font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.sub-line.total { border-bottom: 0; font-weight: 800; color: var(--carillon-nuit, #071c3b); font-size: 1rem; padding-top: 9px; }
.sub-line.muted { color: var(--muted, #596579); }

/* journal */
.journal-list { display: grid; gap: 2px; max-height: 66vh; overflow-y: auto; }
.log-row { display: grid; grid-template-columns: 148px 160px minmax(0, 1fr); gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--gris-bleute, #e8eef7); font-size: 0.86rem; }
.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--muted, #596579); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-row .actor { font-weight: 700; color: var(--carillon-nuit, #071c3b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .what { min-width: 0; overflow-wrap: anywhere; }
.log-row .what b { color: var(--carillon-bleu-fonce, #0f3578); font-weight: 700; }

/* fiche client : modale centrée (verdict patron V2) */
.bo-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.bo-modal-backdrop { position: absolute; inset: 0; background: rgba(30, 42, 63, 0.5); backdrop-filter: blur(2px); }
.bo-modal-card {
  position: relative; width: min(640px, 96vw); max-height: 88vh;
  background: var(--blanc-chaud, #faf8f3); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(30, 42, 63, 0.35);
  display: flex; flex-direction: column;
}
.bo-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line, #d9e2ee); background: #fff; flex: none;
}
.bo-modal-head .metier-badge { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.bo-modal-head > div { flex: 1; min-width: 0; }
.bo-modal-head strong { display: block; font-size: 1.05rem; color: var(--carillon-nuit, #071c3b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-modal-head span { font-size: 0.82rem; color: var(--muted, #596579); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-modal-body { overflow-y: auto; padding: 16px 18px 28px; display: grid; gap: 14px; }
.d-block { background: #fff; border: 1px solid var(--line, #d9e2ee); border-radius: 12px; padding: 14px; box-shadow: var(--ombre-carte); }
.d-block h4, .d-summary { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted, #596579); margin-bottom: 10px; font-weight: 800; }
.d-summary { cursor: pointer; margin-bottom: 0; }
details[open] > .d-summary { margin-bottom: 10px; }
.d-identity .sub-line, .d-usage .sub-line, .d-accounts .sub-line { font-size: 0.88rem; }
.btn .btn-ico { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.server-actions { margin-top: 14px; }
.d-option { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--gris-bleute, #e8eef7); font-size: 0.88rem; cursor: pointer; }
.d-option:last-of-type { border-bottom: 0; }
.d-option input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--carillon-bleu, #1546a0); flex: none; }
.d-option > span:not(.p) { min-width: 0; }
.d-option small { color: var(--muted, #596579); }
.d-option .p { margin-left: auto; white-space: nowrap; color: var(--muted, #596579); font-variant-numeric: tabular-nums; flex: none; font-size: 0.8rem; }
.d-option.included .p { color: var(--carillon-vert, #168a4b); }
.d-extra { margin: 12px 0 4px; font-size: 0.88rem; }
.d-extra label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; color: var(--ink, #071c3b); }
.d-extra input { width: 84px; border: 1px solid var(--line, #d9e2ee); border-radius: 8px; padding: 7px 9px; min-height: 38px; }
.danger-zone { border-color: #f7ccd1; }
.danger-zone h4, .danger-zone .d-summary { color: var(--carillon-rouge, #e63946); }
.bo-modal .toolbar { margin-top: 10px; }
.bo-modal .btn { min-height: 44px; }

/* divers */
.metier-badge { object-fit: cover; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--carillon-nuit, #071c3b); color: #fff; border-radius: 12px;
  padding: 12px 20px; font-weight: 650; max-width: min(560px, 92vw);
  box-shadow: 0 14px 40px rgba(30, 42, 63, 0.35); z-index: 90;
}
.waiting {
  border: 1.5px dashed var(--line, #d9e2ee); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted, #596579);
  background: #f3f6fa;
}
.waiting b { color: var(--carillon-nuit, #071c3b); display: block; margin-bottom: 6px; }

@media (max-width: 860px) {
  .console { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-nav { display: flex; flex-wrap: wrap; }
  .side-foot { margin: 0; display: flex; }
  main { padding: 18px 14px 50px; }
  .two-col { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
}


/* ---------- maintenance : kanban des tickets ---------- */
.ticket-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.ticket-col {
  background: var(--surface-douce, #f3f6fa);
  border: 1px solid var(--line, #d9e2ee);
  border-radius: 14px;
  padding: 10px;
  min-height: 180px;
}
.ticket-col > header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; color: var(--carillon-nuit, #071c3b); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 6px 10px;
}
.ticket-col > header i {
  font-style: normal; background: #fff; border: 1px solid var(--line, #d9e2ee);
  border-radius: 999px; min-width: 26px; text-align: center; padding: 1px 8px;
}
.ticket-col-body { display: grid; gap: 8px; }
.ticket-kcard {
  background: var(--surface, #ffffff); border: 1px solid var(--line, #d9e2ee); border-radius: 11px;
  padding: 11px 12px; box-shadow: var(--ombre-carte); cursor: grab;
}
.ticket-kcard:active { cursor: grabbing; }
.ticket-kcard .k-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ticket-kcard .k-head strong { font-size: 0.9rem; min-width: 0; overflow-wrap: anywhere; }
.ticket-kcard .k-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; font-size: 0.76rem; color: var(--muted, #596579); }
.ticket-kcard .k-desc { font-size: 0.82rem; color: var(--muted, #596579); overflow-wrap: anywhere; }
.ticket-kcard .k-actions { display: flex; gap: 8px; margin-top: 9px; align-items: center; }
.ticket-kcard .k-actions select {
  flex: 1; min-width: 0; border: 1px solid var(--line, #d9e2ee); border-radius: 8px; padding: 6px 8px; min-height: 36px;
}
.ticket-kcard .k-actions .btn { min-height: 36px; padding: 6px 12px; }
@media (max-width: 1100px) { .ticket-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ticket-board { grid-template-columns: 1fr; } }


/* ---------- correctifs mobile (findings 390px) ---------- */
.console > * { min-width: 0; }
.two-col > * { min-width: 0; }
.alert-row { flex-wrap: wrap; }
#gateToken { font-size: 16px; } /* anti-zoom iOS */
@media (max-width: 860px) {
  /* C-390-01 (revue S5) : marque + nav + pied ne tiennent pas dans 390px —
     la RANGÉE sidebar défile en interne, le body ne déborde jamais. */
  .side { flex-wrap: nowrap; gap: 10px; align-items: center; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .side-foot .btn { white-space: nowrap; }
  .side-nav {
    display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex: 1; min-width: 0; padding-bottom: 4px;
  }
  .side-nav button { white-space: nowrap; flex: none; }
  .side-brand span { display: none; }
  .side-foot { flex: none; }
  .side-foot .btn { padding: 8px 10px; }
  .bo-modal { padding: 10px; }
  .bo-modal-card { max-height: 94vh; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* KPI compacts (journal) + badge purge cliquable */
.kpi-grid-mini { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.kpi.kpi-mini { padding: 10px 14px; }
.kpi.kpi-mini strong { font-size: 1.25rem; }

/* ===== Cockpit Agents IA (Lot 1 P0) : file de validation + sous-titres. Adopte
   l'echelle du design-system partage (--space-*/--text-*, carillon-ui.css Lot F). ===== */
.agent-kpis { margin: var(--space-3, 12px) 0; }
.agents-sub { font-size: var(--text-base, 16px); font-weight: 700; margin: var(--space-4, 16px) 0 var(--space-2, 8px); }
.agents-validation { display: grid; gap: var(--space-2, 8px); }
.agent-validation-row {
  display: flex; align-items: center; gap: var(--space-3, 12px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  border: 1px solid var(--line, #d9e2ee); border-left: 3px solid var(--carillon-orange, #d98324);
  border-radius: var(--radius-sm, 10px); background: var(--surface, #fff);
}
.agent-validation-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agent-validation-main strong { font-size: var(--text-sm, 14px); }
.agent-validation-meta { font-size: var(--text-xs, 12px); color: var(--muted, #596579); }

/* ===== Journal (Lot 2 P0) : niveau DEDUIT — couleur + LIBELLE, jamais la couleur
   seule (accessibilite) ; detail depliable ; fin de la troncature silencieuse. ===== */
.jlevel { font-size: var(--text-xs, 12px); font-weight: 800; padding: 2px var(--space-2, 8px); border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.jlevel-error { background: #fdecec; color: #a01722; border-color: #f3c2c6; }
.jlevel-warn { background: #fdf3e3; color: #8a5200; border-color: #f0d9ae; }
.jlevel-success { background: #e8f6ee; color: #126b3c; border-color: #b9e2cb; }
.jlevel-info { background: #eef2f9; color: #3b4a63; border-color: #d3dcea; }
.log-row { cursor: pointer; }
.log-detail { display: grid; gap: var(--space-1, 4px); padding: var(--space-3, 12px) var(--space-4, 16px); background: #f7f9fc; border-left: 3px solid var(--carillon-bleu, #1546a0); border-radius: var(--radius-sm, 10px); margin: 0 0 var(--space-2, 8px); font-size: var(--text-xs, 12px); }
.log-detail b { display: inline-block; min-width: 150px; color: var(--muted, #596579); font-weight: 700; }
.log-detail .jnote { margin-top: var(--space-1, 4px); color: var(--muted, #596579); font-style: italic; }
.journal-more { display: flex; align-items: center; gap: var(--space-3, 12px); margin-top: var(--space-3, 12px); flex-wrap: wrap; }
.jcount { font-size: var(--text-xs, 12px); color: var(--muted, #596579); font-weight: 700; }

/* ===== Reprise (seam Helper C, lecture seule) : verdict de restauration + registre. ===== */
.restore-grid {
  display: flex; flex-wrap: wrap; gap: var(--space-3, 12px) var(--space-5, 24px);
  margin-bottom: var(--space-2, 8px);
}
.restore-grid span { font-size: var(--text-sm, 14px); display: inline-flex; align-items: center; gap: var(--space-2, 8px); }
.restore-grid b { color: var(--muted, #596579); font-weight: 700; }
.restore-grid small { color: var(--muted, #596579); }
.purge-badge { border: 0; cursor: pointer; margin-left: 6px; }
.purge-badge:hover { filter: brightness(0.92); }


/* comptes de l'établissement */
.add-account-form { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line, #d9e2ee); }
.user-remove { width: 30px; height: 30px; font-size: 1.1rem; color: var(--carillon-rouge, #e63946); }
.user-remove:hover { background: var(--alerte-douce); border-radius: 8px; }
.user-act { width: 30px; height: 30px; color: var(--muted, #596579); }
.user-act .btn-ico { width: 14px; height: 14px; }
.user-act:hover { background: var(--gris-bleute, #e8eef7); border-radius: 8px; color: var(--carillon-bleu-fonce, #0f3578); }
.hint-warn { color: var(--muted, #596579); font-weight: 700; }


/* détail ticket */
.td-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.td-description { font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.td-shot {
  max-width: 100%; max-height: 320px; object-fit: contain;
  border: 1px solid var(--line, #d9e2ee); border-radius: 10px; margin-top: 12px;
  background: #fff; cursor: zoom-in;
}
.td-comments { display: grid; gap: 6px; }
.td-comment { background: var(--surface-douce, #f3f6fa); border-radius: 10px; padding: 8px 12px; font-size: 0.88rem; overflow-wrap: anywhere; }
.td-comment.from-support { background: #eef2ff; }
.td-comment b { color: var(--carillon-nuit, #071c3b); margin-right: 6px; }
.td-reply { display: flex; gap: 8px; }
.td-reply input { flex: 1; min-width: 0; border: 1px solid var(--line, #d9e2ee); border-radius: 9px; padding: 9px 12px; min-height: 44px; }
#tdStatus { border: 1px solid var(--line, #d9e2ee); border-radius: 9px; padding: 9px 12px; min-height: 44px; width: 100%; }

/* ---------- constructeur d'agents ---------- */
.agents-intro { color: var(--muted, #596579); font-size: 0.9rem; margin: 4px 0 14px; max-width: 760px; }
.agents-list { display: grid; gap: 8px; }
.agents-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface, #ffffff); border: 1px solid var(--line, #d9e2ee); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--ombre-carte);
}
.agents-row-main { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.agents-row-main strong { color: var(--carillon-nuit, #071c3b); font-size: 0.95rem; }
.agents-row-sum { color: var(--muted, #596579); font-size: 0.82rem; }
.ab-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ab-dot.on { background: var(--carillon-vert, #168a4b); }
.ab-dot.off { background: #c8c2b6; }

.agents-editor {
  margin-top: 16px; background: var(--surface-douce, #f3f6fa); border: 1px solid var(--line, #d9e2ee);
  border-radius: 14px; padding: 16px 18px;
}
.ab-editor-head { margin-bottom: 14px; }
.ab-name {
  width: 100%; max-width: 420px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px;
  padding: 10px 12px; min-height: 44px; font-weight: 600; color: var(--carillon-nuit, #071c3b); background: #fff;
}
.ab-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.ab-node {
  flex: 1; min-width: 190px; background: #fff; border: 1px solid var(--line, #d9e2ee);
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.ab-node-h { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--carillon-nuit, #071c3b); font-size: 0.86rem; }
.ab-node-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--carillon-nuit, #071c3b); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; flex-shrink: 0;
}
.ab-node-b { display: flex; flex-direction: column; gap: 8px; }
.ab-arrow { align-self: center; color: var(--muted, #596579); font-size: 1.2rem; }
.ab-ctl, .ab-ctl-sm, .ab-sample {
  border: 1px solid var(--line, #d9e2ee); border-radius: 9px; padding: 8px 10px; background: #fff; color: var(--ink, #071c3b);
}
.ab-ctl { width: 100%; min-height: 40px; }
.ab-ctl-sm { min-height: 36px; }
.ab-cond { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.ab-cond .ab-cond-value { flex: 1; min-width: 90px; }
.ab-cond-logic { font-size: 0.82rem; color: var(--muted, #596579); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ab-risk { font-size: 0.78rem; color: var(--muted, #596579); }
.ab-note { font-size: 0.76rem; color: var(--muted, #596579); }
.ab-note.warn { color: var(--carillon-bleu-fonce, #0f3578); }
.ab-test { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ab-sample { flex: 1; min-width: 200px; min-height: 40px; }
.ab-test-result { font-size: 0.84rem; }
.ab-test-result.ok { color: var(--carillon-vert, #168a4b); }
.ab-test-result.no { color: var(--carillon-bleu-fonce, #0f3578); }
.ab-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* journal d'exécutions */
.agents-runs-title { margin: 22px 0 10px; font-size: 1rem; }
.agents-runs { display: grid; gap: 8px; }
.agents-run {
  background: var(--surface, #ffffff); border: 1px solid var(--line, #d9e2ee); border-radius: 12px;
  padding: 11px 14px; box-shadow: var(--ombre-carte);
}
.agents-run-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.agents-run-head strong { color: var(--carillon-nuit, #071c3b); font-size: 0.92rem; }
.agents-run-when { color: var(--muted, #596579); font-size: 0.78rem; white-space: nowrap; }
.agents-run-meta { display: flex; align-items: center; gap: 8px; color: var(--muted, #596579); font-size: 0.8rem; margin-top: 3px; }
.ab-report { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ab-report-kpi {
  display: grid; gap: 1px; background: var(--surface-douce, #f3f6fa); border-radius: 9px;
  padding: 7px 11px; font-size: 0.72rem; color: var(--muted, #596579); min-width: 84px;
}
.ab-report-kpi strong { font-size: 1rem; color: var(--carillon-nuit, #071c3b); }

/* ---------- icône métier DANS le champ (motif S5, un <option> ne rend pas de SVG) ---------- */
.field-select-iconed { position: relative; display: flex; align-items: center; min-width: 0; }
.field-select-iconed .metier-badge {
  position: absolute; left: 9px; width: 26px; height: 26px; border-radius: 7px;
  pointer-events: none; z-index: 1;
}
.field-select-iconed select { width: 100%; padding-left: 44px; min-height: 44px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px; background: #fff; color: var(--ink, #071c3b); }

/* ---------- icônes dans bannières/toasts (remplace les anciens glyphes coche/alerte/trombone) ---------- */
.banner-ico, .k-clip {
  width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.k-clip { margin-right: 0; }

/* ---------- section Configuration de l'app (contrat app-config v1.1) ---------- */
.cfg-intro { max-width: 68ch; margin-bottom: 16px; }
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cfg-col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1050px) { .cfg-grid { grid-template-columns: 1fr; } }

.cfg-card h3 { display: flex; align-items: center; gap: 8px; }
.cfg-card h3 .cfg-ico { width: 16px; height: 16px; flex: none; stroke: var(--carillon-bleu, #1546a0); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cfg-lead { color: var(--muted, #596579); font-size: 0.82rem; margin: -6px 0 12px; }

.cfg-profil {
  display: flex; align-items: center; gap: 12px; padding: 12px; flex-wrap: wrap;
  border: 1px solid var(--line, #d9e2ee); border-radius: 12px; background: var(--gris-bleute, #e8eef7);
}
.cfg-profil .metier-badge { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.cfg-profil .pt { flex: 1; min-width: 150px; }
.cfg-profil .pt strong { display: block; color: var(--carillon-nuit, #071c3b); }
.cfg-profil .pt small { color: var(--muted, #596579); font-size: 0.78rem; }
.cfg-profil select { min-height: 44px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px; padding: 8px 10px; background: #fff; font-weight: 600; }

.cfg-switch { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line, #d9e2ee); }
.cfg-switch:first-of-type { border-top: 0; }
.cfg-switch .sl { flex: 1; min-width: 0; }
.cfg-switch .sl strong { display: block; font-weight: 700; color: var(--carillon-nuit, #071c3b); font-size: 0.88rem; }
.cfg-switch .sl small { color: var(--muted, #596579); font-size: 0.77rem; }
.cfg-tgl {
  width: 44px; height: 24px; border-radius: 999px; border: 0; background: #c3cede;
  position: relative; flex: none; cursor: pointer; transition: background 0.15s;
}
/* Cible tactile >= 44px (retouche S5) : zone cliquable étendue, visuel inchangé. */
.cfg-tgl::before { content: ""; position: absolute; inset: -10px 0; }
.cfg-tgl::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(7, 28, 59, 0.35); transition: left 0.15s;
}
.cfg-tgl[aria-checked="true"] { background: var(--carillon-bleu, #1546a0); }
.cfg-tgl[aria-checked="true"]::after { left: 22px; }
/* Règle verrouillée : affichée cadenassée, jamais cachée (gate S5). */
.cfg-locked { display: inline-flex; align-items: center; gap: 5px; }
.cfg-locked .banner-ico { margin-right: 0; }

.cfg-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
/* Bordure PLEINE à l'état inactif : le pointillé est la signature réservée du badge SIMULÉ (gate S5). */
.cfg-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px;
  border: 1px solid var(--line, #d9e2ee); border-radius: 999px; padding: 5px 12px;
  font-size: 0.78rem; font-weight: 600; color: var(--muted, #596579); background: var(--surface, #ffffff); cursor: pointer;
}
.cfg-chip.on { border: 1px solid var(--carillon-bleu, #1546a0); color: var(--carillon-bleu-fonce, #0f3578); background: var(--gris-bleute, #e8eef7); }
.cfg-chip .banner-ico { width: 12px; height: 12px; margin-right: 0; }
.cfg-chip:disabled { cursor: not-allowed; opacity: 0.7; }

.cfg-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.cfg-state.published { background: var(--surface-green, #e9f5ef); color: var(--carillon-vert, #168a4b); }
.cfg-state.draft { background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578); }
.cfg-state .banner-ico { width: 12px; height: 12px; margin-right: 0; }

.cfg-diff-line { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line, #d9e2ee); font-size: 0.86rem; }
.cfg-diff-line:first-of-type { border-top: 0; }
.cfg-diff-mark { width: 20px; height: 20px; border-radius: 6px; flex: none; display: grid; place-items: center; }
.cfg-diff-mark .banner-ico { width: 12px; height: 12px; margin-right: 0; }
.cfg-diff-line.add .cfg-diff-mark { background: var(--surface-green, #e9f5ef); color: var(--carillon-vert, #168a4b); }
.cfg-diff-line.rem .cfg-diff-mark { background: var(--alerte-douce); color: var(--carillon-rouge, #e63946); }
.cfg-diff-line.chg .cfg-diff-mark { background: var(--gris-bleute, #e8eef7); color: var(--carillon-bleu-fonce, #0f3578); }
.cfg-diff-line .dt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cfg-diff-line .dp { font-variant-numeric: tabular-nums; color: var(--muted, #596579); font-weight: 700; white-space: nowrap; }

.cfg-hist-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line, #d9e2ee); }
.cfg-hist-row:first-of-type { border-top: 0; }
.cfg-hist-rev {
  width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--surface-douce, #f3f6fa); border: 1px solid var(--line, #d9e2ee);
  font-weight: 800; font-size: 0.8rem; color: var(--carillon-nuit, #071c3b); font-variant-numeric: tabular-nums;
}
.cfg-hist-row.current .cfg-hist-rev { background: var(--carillon-nuit, #071c3b); color: #fff; border-color: var(--carillon-nuit, #071c3b); }
.cfg-hist-row .hl { flex: 1; min-width: 0; }
.cfg-hist-row .hl strong { display: block; font-weight: 700; color: var(--carillon-nuit, #071c3b); font-size: 0.86rem; }
.cfg-hist-row .hl small { color: var(--muted, #596579); font-size: 0.76rem; overflow-wrap: anywhere; }
.cfg-hist-row .btn { min-height: 36px; padding: 6px 12px; }

.cfg-provenance { font-size: 0.78rem; color: var(--muted, #596579); margin-top: 8px; }

/* ---------- connexions des canaux (installation) ---------- */
.connex-box { margin-top: 16px; }
.connex-bind { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; color: var(--carillon-nuit, #071c3b); margin-bottom: 12px; }
.connex-bind select { min-height: 44px; border: 1px solid var(--line, #d9e2ee); border-radius: 9px; padding: 8px 10px; background: #fff; font-weight: 600; }
.connex-card { border: 1px solid var(--line, #d9e2ee); border-radius: 12px; background: var(--surface, #ffffff); padding: 0 14px; margin-top: 10px; }
.connex-card > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; min-height: 48px; padding: 10px 0; font-size: 0.92rem; color: var(--carillon-nuit, #071c3b); }
.connex-card[open] > summary { border-bottom: 1px dashed var(--gris-bleute, #e8eef7); }
.connex-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; padding: 12px 0 2px; }
.connex-field input { border: 1px solid var(--line, #d9e2ee); border-radius: 9px; padding: 9px 12px; min-height: 42px; background: #fff; color: var(--ink, #071c3b); }
.connex-card .toolbar { padding-bottom: 14px; }
.connex-test-result { font-size: 0.8rem; color: var(--muted, #596579); }

/* ==========================================================
   AUDIT UX/UI BACKOFFICE - cockpit d'exploitation 2026-07-23
   ========================================================== */
:root { --bo-success:#168a4b; --bo-danger:#e63946; --bo-soft:#f4f7fb; }
.side { overflow-y:auto; }
.side-group-label { margin:12px 12px 3px; color:#91a3bd; font-size:.66rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.side-health { display:flex; align-items:center; gap:8px; padding:8px 10px; color:#c6d2e6; font-size:.72rem; }
.side-health i,.live-status i { width:8px; height:8px; border-radius:50%; background:var(--bo-success); box-shadow:0 0 0 4px rgba(22,138,75,.14); }
main { padding-top:0; }
.admin-topbar { position:sticky; top:0; z-index:20; min-height:76px; margin:0 -30px 24px; padding:12px 30px; display:flex; align-items:center; justify-content:space-between; gap:18px; background:rgba(250,248,243,.96); border-bottom:1px solid var(--line,#d9e2ee); backdrop-filter:blur(12px); }
body.env-on .admin-topbar { top:30px; }
.admin-topbar>div:first-child { display:grid; }
.admin-topbar-kicker { color:var(--carillon-bleu,#1546a0); font-size:.67rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.admin-topbar strong { color:var(--carillon-nuit,#071c3b); font-family:var(--font-titres,Georgia,serif); font-size:1.15rem; }
.admin-topbar small,.section-subtitle { color:var(--muted,#596579); }
.admin-topbar-actions,.live-status { display:flex; align-items:center; gap:10px; }
.live-status { font-size:.77rem; font-weight:700; color:var(--muted,#596579); }
.topbar-icon-btn { position:relative; white-space:nowrap; }
.topbar-icon-btn .btn-ico { margin-right:2px; }
.topbar-alert-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--carillon-rouge,#e63946);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.64rem;
  line-height: 0.98rem;
  font-weight: 750;
  text-align: center;
}
.section-subtitle { margin-top:3px; font-size:.86rem; }
.section-kpis { margin-bottom:14px; }
.kpi { min-height:108px; align-content:center; text-align:left; }
button.kpi { width:100%; cursor:pointer; font:inherit; }
button.kpi:hover { border-color:var(--carillon-bleu,#1546a0); transform:translateY(-1px); box-shadow:0 8px 24px rgba(7,28,59,.09); }
button:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid rgba(21,70,160,.32)!important; outline-offset:2px; }
.kpi small { color:var(--muted,#596579); font-size:.72rem; }
.priority-strip { display:flex; gap:8px; flex-wrap:wrap; margin:14px 0 0; }
.priority-action { border:1px solid var(--line,#d9e2ee); background:#fff; color:var(--carillon-nuit,#071c3b); border-radius:999px; padding:8px 12px; min-height:40px; font-weight:700; }
.priority-action.danger { border-color:rgba(230,57,70,.35); color:var(--bo-danger); background:#fff5f5; }
.filter-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px; padding:10px; border:1px solid var(--line,#d9e2ee); border-radius:14px; background:#fff; }
.filter-bar .search { flex:1 1 260px; }
.filter-bar select { min-height:42px; padding:8px 32px 8px 10px; border:1px solid var(--line,#d9e2ee); border-radius:9px; background:#fff; color:var(--ink,#071c3b); }
.table-card { overflow:hidden; padding:0; }
.table-card .table { margin:0; }
.table tbody tr:hover { background:var(--bo-soft); }
.table td:last-child { white-space:nowrap; }
.row-actions { display:flex; gap:6px; }
.row-actions .btn { min-height:36px; padding:6px 10px; }
.pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:54px; padding:10px 14px; border-top:1px solid var(--line,#d9e2ee); color:var(--muted,#596579); font-size:.8rem; }
.pagination .pager-actions { display:flex; align-items:center; gap:6px; }
.sub-card .sub-actions { display:flex; gap:8px; margin-top:12px; }
.sub-card .next-payment { margin-top:8px; color:var(--muted,#596579); font-size:.78rem; }
.ticket-board { grid-template-columns:repeat(5,minmax(220px,1fr)); overflow-x:auto; padding-bottom:8px; }
.ticket-col { min-width:220px; }
.ticket-sla { white-space:nowrap; }
.ticket-meta-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:14px 0; }
.bo-modal-card { width:min(1440px,82vw); max-width:none; max-height:92vh; display:flex; flex-direction:column; }
.bo-modal-body { flex:1; overflow:auto; }
.client-tabs { position:sticky; top:0; z-index:2; display:flex; gap:4px; overflow-x:auto; margin:-2px 0 16px; padding:4px; background:var(--blanc-chaud,#faf8f3); border:1px solid var(--line,#d9e2ee); border-radius:12px; }
.client-tabs button { min-height:40px; flex:0 0 auto; padding:8px 13px; border:0; border-radius:9px; background:transparent; color:var(--muted,#596579); font-weight:800; }
.client-tabs button.active { background:var(--carillon-nuit,#071c3b); color:#fff; }
.client-tab-panel { display:none; }
.client-tab-panel.active { display:block; }
.bo-modal-actions { position:sticky; bottom:0; display:flex; justify-content:flex-end; gap:8px; padding:12px 18px; background:#fff; border-top:1px solid var(--line,#d9e2ee); }
.cfg-card:has(.cfg-switch) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:18px; }
.cfg-card:has(.cfg-switch)>h3,.cfg-card:has(.cfg-switch)>.cfg-lead { grid-column:1/-1; }
@media(max-width:1200px){.console{grid-template-columns:210px minmax(0,1fr)}main{padding-left:20px;padding-right:20px}.admin-topbar{margin-left:-20px;margin-right:-20px;padding-left:20px;padding-right:20px}.two-col,.cfg-grid{grid-template-columns:1fr}.table-card{overflow-x:auto}.table{min-width:1080px}.bo-modal-card{width:92vw}}
@media(max-width:860px){.console{display:block}.side{position:static;width:100%;height:auto;padding:10px}.side-brand,.side-foot{display:none}.side-nav{display:flex;overflow-x:auto;padding-bottom:4px}.side-nav button{flex:0 0 auto}.side-group-label{display:none}main{padding:0 14px 40px}.admin-topbar{top:0;margin:0 -14px 18px;padding:10px 14px}body.env-on .admin-topbar{top:30px}.admin-topbar small,.live-status{display:none}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-bar>*{flex:1 1 100%;width:100%}.bo-modal-card{width:100vw;height:calc(100vh - 30px);max-height:none;border-radius:0}.ticket-meta-form,.cfg-card:has(.cfg-switch){grid-template-columns:1fr}.cfg-card:has(.cfg-switch)>h3,.cfg-card:has(.cfg-switch)>.cfg-lead{grid-column:auto}}
@media(max-width:520px){.kpi-grid{grid-template-columns:1fr}.admin-topbar-actions .btn span{display:none}.bo-modal-actions{display:grid;grid-template-columns:1fr}}
/* ==========================================================================
   AUDIT GRAPHIQUE V2 - cockpit dense, technique et responsive
   ========================================================================== */
:root {
  --admin-font: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  --admin-bg: #f4f7fb;
  --admin-surface: #ffffff;
  --admin-border: #d8e1ee;
  --admin-text: #102746;
  --admin-muted: #63738c;
  --admin-primary: #1546a0;
  --admin-navy: #071c3b;
  --admin-danger: #d83b45;
  --admin-success: #14875c;
  --admin-radius: 10px;
  --admin-shadow: 0 1px 3px rgb(7 28 59 / 8%);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; min-width: 0; margin: 0; }
body, button, input, select, textarea { font-family: var(--admin-font); }
body { color: var(--admin-text); background: var(--admin-bg); }
h1, h2, h3, h4, .admin-topbar strong, .side-brand strong { font-family: var(--admin-font); letter-spacing: -.02em; }
.env-banner { height: 24px; min-height: 24px; font-size: .62rem; letter-spacing: .1em; box-shadow: none; }
.env-qual { background: var(--admin-primary); }
body.env-on .gate, body.env-on .console { margin-top: 24px; min-height: calc(100vh - 24px); }
.gate { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 560px) minmax(340px, 420px); align-items: center; justify-content: center; gap: clamp(40px, 7vw, 88px); padding: 48px 32px; overflow: hidden; background: radial-gradient(circle at 15% 18%, rgb(21 70 160 / 32%), transparent 32%), linear-gradient(145deg, #071c3b 0%, #0a2a55 100%); }
.gate-intro { max-width: 560px; color: #fff; }
.gate-eyebrow { display: block; margin-bottom: 18px; color: #9db7e8; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gate-intro h2 { max-width: 540px; margin: 0; color: #fff; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.02; letter-spacing: -.045em; }
.gate-intro p { max-width: 520px; margin: 24px 0; color: #c8d5e9; font-size: 1rem; line-height: 1.65; }
.gate-proof { display: flex; flex-wrap: wrap; gap: 8px; }
.gate-proof span { padding: 7px 10px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 7px; color: #dce6f5; font-size: .72rem; font-weight: 700; }
.gate-card { width: min(100%, 420px); min-width: 0; gap: 13px; padding: 30px; text-align: left; border: 1px solid rgb(255 255 255 / 25%); border-radius: 12px; box-shadow: 0 24px 64px rgb(0 0 0 / 25%); }
.gate-logo { width: 132px; margin: 0 0 10px; }
.gate-card h1 { margin: 0; font-family: var(--admin-font); font-size: 1.65rem; font-weight: 750; }
.gate-sub { margin: -4px 0 8px; font-size: .86rem; line-height: 1.45; }
.gate-card .field, .gate-card .field input, .gate-card .btn { width: 100%; min-width: 0; }
.gate-card .field > span { display: block; margin-bottom: 6px; color: var(--admin-text); font-size: .78rem; font-weight: 750; }
.gate-card input { min-height: 46px; border-radius: 8px; }
.gate-card .btn { min-height: 46px; border-radius: 8px; }
.gate-trust { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--admin-muted); font-size: .68rem; }
.gate-trust .btn-ico { color: var(--admin-primary); }
.console { grid-template-columns: 208px minmax(0, 1fr); background: var(--admin-bg); }
.side { width: 208px; gap: 12px; padding: 16px 10px; background: var(--admin-navy); }
.side-brand { padding: 0 8px 8px; }
.side-brand img { width: 36px; height: 36px; border-radius: 8px; }
.side-brand strong { font-size: 1.05rem; font-weight: 750; }
.side-group-label { margin: 12px 10px 4px; font-size: .58rem; }
.side-nav { gap: 2px; }
.side-nav button { min-height: 40px; padding: 8px 10px; border-radius: 7px; font-size: .78rem; font-weight: 650; }
.side-nav button.active { background: #1546a0; box-shadow: inset 3px 0 0 #fff; }
.side-health { font-size: .65rem; }
main { width: 100%; max-width: 100%; min-width: 0; padding: 0 24px 36px; background: var(--admin-bg); }
.admin-topbar { min-height: 68px; margin: 0 -24px 14px; padding: 10px 24px; background: rgb(255 255 255 / 97%); border-bottom: 1px solid var(--admin-border); backdrop-filter: none; }
body.env-on .admin-topbar { top: 24px; }
.admin-topbar-copy { display: grid; min-width: 0; }
.admin-topbar strong { color: var(--admin-text); font-size: 1.08rem; font-weight: 760; }
.admin-topbar-kicker { font-size: .58rem; }
.admin-topbar small { font-size: .72rem; }
.overview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; margin-bottom: 8px; }
.overview-toolbar-label { color: var(--admin-muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0; color: var(--admin-text); font-size: 1.12rem; font-weight: 760; }
.section-subtitle { font-size: .78rem; }
#kpiGrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kpi { min-width: 0; min-height: 86px; padding: 11px 13px; align-content: start; gap: 3px; border-color: var(--admin-border); border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); }
.kpi strong { color: var(--admin-text); font-size: 1.45rem; line-height: 1.1; }
.kpi > span { color: var(--admin-muted); font-size: .62rem; letter-spacing: .05em; }
.kpi .kpi-context { display: block; margin-top: auto; color: #718096; font-size: .61rem; font-weight: 500; line-height: 1.25; text-transform: none; letter-spacing: 0; }
.kpi.kpi-alert { border-color: rgb(216 59 69 / 45%); box-shadow: inset 3px 0 0 var(--admin-danger); }
button.kpi:hover { transform: none; border-color: var(--admin-primary); box-shadow: 0 3px 10px rgb(7 28 59 / 10%); }
.priority-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 0; }
.priority-action { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 10px; min-width: 0; min-height: 64px; padding: 10px 12px; text-align: left; border: 1px solid var(--admin-border); border-radius: var(--admin-radius); background: #fff; color: var(--admin-text); font-weight: 650; }
.priority-action .priority-badge { grid-row: 1 / 3; align-self: center; padding: 4px 6px; border-radius: 5px; color: #1546a0; background: #e8f0ff; font-size: .62rem; font-weight: 850; }
.priority-action strong { display: block; min-width: 0; font-size: .78rem; }
.priority-action > span:last-child { display: block; min-width: 0; overflow: hidden; color: var(--admin-muted); font-size: .66rem; font-weight: 500; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.priority-action:first-child .priority-badge { color: #b4232d; background: #fdebed; }
.two-col { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 12px; margin-top: 12px; }
.card { padding: 15px; border-color: var(--admin-border); border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); }
.card h3 { margin: 0 0 10px; color: var(--admin-text); font-size: .88rem; font-weight: 760; }
.alert-list { gap: 5px; }
.alert-row { min-height: 46px; padding: 7px 9px; border-radius: 7px; }
.capacity-banner { font-size: .75rem; }
.filter-bar { padding: 8px; border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); }
.table-card { border-radius: var(--admin-radius); }
.table th { color: #526278; background: #f7f9fc; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; }
.table td { color: var(--admin-text); font-size: .76rem; }
.btn, .table-action { border-radius: 7px; }
.mobile-nav-toggle, .mobile-nav-close, .nav-backdrop { display: none; }
@media (min-width: 768px) and (max-width: 1199px) {
  .console { grid-template-columns: 72px minmax(0, 1fr); }
  .side { width: 72px; padding: 14px 8px; }
  .side-brand { justify-content: center; padding: 0 0 8px; }
  .side-brand > div, .side-group-label, .side-foot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .side-nav button { justify-content: center; gap: 0; padding: 9px; font-size: 0; }
  .side-nav .nav-ico { width: 20px; height: 20px; }
  main { padding: 0 20px 32px; }
  .admin-topbar { margin-inline: -20px; padding-inline: 20px; }
  #kpiGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .priority-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1.35fr) minmax(250px, .8fr); }
}
@media (max-width: 767px) {
  body.mobile-nav-open { overflow: hidden; }
  .env-banner { min-height: 24px; height: auto; padding: 5px 10px; font-size: .55rem; white-space: normal; }
  .gate { min-height: calc(100dvh - 24px); grid-template-columns: minmax(0, 1fr); align-content: center; gap: 22px; padding: 30px 16px 24px; }
  .gate-intro { width: min(100%, 420px); margin-inline: auto; }
  .gate-eyebrow { margin-bottom: 8px; font-size: .58rem; }
  .gate-intro h2 { max-width: 330px; font-size: clamp(1.65rem, 8vw, 2.25rem); line-height: 1.05; }
  .gate-intro p, .gate-proof { display: none; }
  .gate-card { width: min(100%, 420px); margin-inline: auto; padding: 22px 20px; border-radius: 10px; }
  .gate-logo { width: 112px; }
  .console { display: block; width: 100%; max-width: 100%; min-width: 0; }
  .side { position: fixed; inset: 24px auto 0 0; z-index: 60; width: min(86vw, 320px); height: calc(100dvh - 24px); padding: 16px 12px; align-items: stretch; overflow-y: auto; transform: translateX(-102%); transition: transform 180ms ease; }
  .side.is-open { transform: translateX(0); }
  .side-brand, .side-foot { display: flex; }
  .side-brand > div { display: block; }
  .side-group-label { display: block; position: static; width: auto; height: auto; overflow: visible; }
  .side-nav { display: grid; overflow: visible; }
  .side-nav button { justify-content: flex-start; width: 100%; font-size: .82rem; }
  .mobile-nav-close { display: grid; position: absolute; top: 10px; right: 10px; place-items: center; width: 36px; height: 36px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 7px; background: transparent; color: #fff; font-size: 1.35rem; }
  .nav-backdrop { display: block; position: fixed; inset: 24px 0 0; z-index: 50; border: 0; background: rgb(7 28 59 / 55%); }
  .nav-backdrop.hidden { display: none; }
  main { width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 0 14px 30px; overflow: visible; }
  .admin-topbar { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; min-height: 64px; margin: 0 -14px 12px; padding: 9px 14px; }
  .mobile-nav-toggle { display: grid; align-content: center; gap: 4px; width: 38px; height: 38px; padding: 8px; border: 1px solid var(--admin-border); border-radius: 7px; background: #fff; }
  .mobile-nav-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--admin-navy); }
  .admin-topbar-copy { min-width: 0; }
  .admin-topbar strong { overflow: hidden; font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
  .admin-topbar small, .live-status { display: none; }
  .admin-topbar-actions .btn { width: 38px; height: 38px; min-height: 38px; padding: 8px; }
  .admin-topbar-actions .btn span { display: none; }
  .overview-toolbar { margin-bottom: 7px; }
  .overview-toolbar-label { font-size: .58rem; }
  .stamp { font-size: .64rem; }
  .section, #kpiGrid, #overviewActionStrip, .two-col, .card { width: 100%; max-width: 100%; min-width: 0; }
  #kpiGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { width: auto; min-height: 94px; margin: 0; padding: 12px; }
  .kpi strong { font-size: 1.35rem; }
  .kpi > span { font-size: .57rem; }
  .kpi .kpi-context { font-size: .56rem; }
  .priority-strip { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .priority-action { width: 100%; min-height: 58px; }
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .section-head { align-items: flex-start; }
  .section-head > * { min-width: 0; max-width: 100%; }
  .filter-bar > * { flex: 1 1 100%; width: 100%; }
  .table-card { max-width: 100%; overflow-x: auto; }
  .table { min-width: 760px; }
  .bo-modal-card { width: 100vw; height: calc(100dvh - 24px); }
}
@media (max-width: 340px) { #kpiGrid { grid-template-columns: minmax(0, 1fr); } }\r\n/* ========================================================================== 
   AUDIT GRAPHIQUE V2.1 - cockpit premium cohérent
   ========================================================================== */
:root {
  --admin-font: "Aptos", "Trebuchet MS", Georgia, serif, sans-serif;
  --admin-bg: #fdfbfc;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f7f6f2;
  --admin-border: #d8e2ef;
  --admin-text: #071c3b;
  --admin-muted: #5d6a7a;
  --admin-primary: #1546a0;
  --admin-primary-soft: #edf3ff;
  --admin-navy: #071c3b;
  --admin-red: #e63946;
  --admin-success: #1d6f4f;
  --admin-danger-soft: #fdeeee;
  --admin-radius: 13px;
  --admin-shadow: 0 12px 24px rgb(7 28 59 / 7%);
}

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

body,
button,
input,
select,
textarea { font-family: var(--admin-font); }

body {
  color: var(--admin-text);
  background:
    radial-gradient(circle at 100% 0, #f3f7ff 0%, transparent 33%),
    radial-gradient(circle at 0 28%, #f8f8f2 0%, transparent 24%),
    var(--admin-bg);
}

h1,
h2,
h3,
h4,
.admin-topbar strong,
.side-brand strong,
.agent-validation-main strong { font-family: var(--admin-font); font-weight: 700; }

.env-banner { 
  height: 24px;
  min-height: 24px;
  font-size: 0.65rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.env-banner .env-host { opacity: 0.95; }

body.env-on .gate,
body.env-on .console { margin-top: 24px; min-height: calc(100vh - 24px); }

.console {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 80%), rgb(255 255 255 / 60%)),
    var(--admin-bg);
}

.side {
  width: 230px;
  background: linear-gradient(180deg, var(--admin-navy) 0%, #0a2550 100%);
  border-right: 1px solid rgb(255 255 255 / 6%);
  box-shadow: inset -1px 0 0 rgb(255 255 255 / 12%);
}

.side-brand { align-items: flex-start; }
.side-brand strong { color: #ffffff; }
.side-brand span { color: #c8d6ea; }
.side-group-label {
  margin: 10px 12px 4px;
  color: #aec1db;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-nav button {
  color: #e5ebf3;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 12px;
  position: relative;
  border-color: transparent;
}

.side-nav button:hover {
  background: rgb(255 255 255 / 8%);
  border-color: rgb(255 255 255 / 18%);
}

.side-nav button.active {
  background: var(--admin-primary);
  border-color: #d9e7ff;
  color: #fff;
  box-shadow: inset 3px 0 0 #fff;
}

.side-nav button.active::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  width: 2px;
  height: 16px;
  border-radius: 999px;
  background: #fdfcf9;
}

.side-health { color: #d0def0; }
.side-health i { background: var(--admin-success); }

.side-foot {
  margin-top: auto;
  gap: 8px;
}

.side-foot .btn {
  border-color: rgb(255 255 255 / 22%);
  color: #fff;
  background: rgb(255 255 255 / 6%);
}

main { 
  width: min(100%, 100%);
  max-width: 100%;
  padding: 0 30px 56px;
  background: transparent;
}

.section { animation: adminSectionReveal 0.12s ease; }
@keyframes adminSectionReveal {
  from { opacity: 0.9; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  margin: 0 -30px 16px;
  padding: 11px 30px;
  align-items: center;
  gap: 16px;
  background: rgb(255 255 255 / 92%);
  border-bottom: 1px solid var(--admin-border);
  box-shadow: 0 12px 28px rgb(14 27 45 / 8%);
  backdrop-filter: blur(10px);
}

body.env-on .admin-topbar { top: 24px; }

.admin-topbar-copy { display: grid; gap: 2px; min-width: 0; }
.admin-topbar-kicker { color: var(--admin-primary); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-topbar strong { font-size: 1.08rem; font-weight: 760; color: var(--admin-text); }
.admin-topbar small { font-size: 0.8rem; color: var(--admin-muted); }
.admin-topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.live-status { font-size: 0.78rem; color: var(--admin-muted); display: inline-flex; align-items: center; gap: 8px; }
.live-status i { margin: 0; }

.mobile-nav-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #fff;
}

.mobile-nav-toggle span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--admin-navy);
}

.mobile-nav-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgb(255 255 255 / 26%);
  color: #fff;
}

.overview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  min-height: 22px;
}

.overview-toolbar-label {
  color: #6f7e90;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.65rem;
  font-weight: 800;
}

.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0; color: var(--admin-text); }
.section-subtitle { font-size: 0.82rem; color: var(--admin-muted); }

#kpiGrid,
.kpi-grid,
.kpi-grid-mini { gap: 12px; }

#kpiGrid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.kpi {
  min-height: 94px;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--kpi-accent, var(--admin-primary));
  border-radius: var(--admin-radius);
  padding: 13px 14px;
  box-shadow: var(--admin-shadow);
  align-content: start;
  gap: 3px;
}

button.kpi { width: 100%; min-height: 92px; }
button.kpi:hover,
button.kpi:focus-visible {
  border-color: var(--admin-primary);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgb(20 70 160 / 18%);
}

.kpi strong {
  color: var(--admin-text);
  font-size: 1.4rem;
  line-height: 1.2;
}

.kpi span,
.kpi small {
  color: var(--admin-muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi .kpi-context {
  margin-top: auto;
  color: #8290a2;
  text-transform: none;
  font-size: 0.62rem;
  letter-spacing: normal;
}

.mini-kpi {
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-primary);
  border-radius: 11px;
  min-height: 72px;
  padding: 10px 12px;
  background: #fff;
  color: var(--admin-text);
  font-family: var(--admin-font);
  text-align: left;
}

.mini-kpi strong { font-size: 1.4rem; }
.mini-kpi span { font-size: 0.64rem; color: #738194; letter-spacing: 0.04em; text-transform: uppercase; }

.priority-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 8px 0 0;
}

.priority-action {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 11px;
  border-left: 4px solid var(--admin-primary);
  min-height: 60px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  text-align: left;
  gap: 2px;
  color: var(--admin-text);
  font-weight: 700;
}

.priority-action strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.priority-action > span:last-child { color: var(--admin-muted); font-size: 0.66rem; text-transform: none; letter-spacing: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.priority-action .priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  width: 20px;
  border-radius: 6px;
  border: 1px solid #d7e2f6;
  font-size: 0.62rem;
  color: var(--admin-primary);
  background: #eff4ff;
}
.priority-action.danger { border-left-color: var(--admin-red); }
.priority-action.danger .priority-badge {
  border-color: #f2bfc4;
  color: var(--admin-red);
  background: var(--admin-danger-soft);
}

.two-col { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 14px; }
.card {
  border-color: var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  padding: 16px;
  background: #fff;
}
.card h3 { margin: 0 0 10px; font-size: 0.92rem; color: var(--admin-text); }

.filter-bar {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 11px;
  border-color: var(--admin-border);
  background: #fff;
  box-shadow: var(--admin-shadow);
}

.table-card { border-radius: var(--admin-radius); overflow: hidden; }
.table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; }
.table thead th {
  background: var(--admin-surface-soft);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
  padding: 11px 12px;
}
.table tbody td { padding: 12px; font-size: 0.82rem; border-bottom: 1px solid #edf1f8; }
.table tbody tr:hover { background: #f9fbff; }

.row-actions { display: flex; gap: 8px; }
.pagination { color: #6f7e90; }

.sub-card {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px rgb(9 20 37 / 6%);
}

.sub-line span:last-child,
.sub-line .p { font-weight: 700; color: var(--admin-text); }

.ticket-board {
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 11px;
}
.ticket-col {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 10px;
}
.ticket-col > header {
  color: var(--admin-text);
  font-size: 0.76rem;
  padding: 4px 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--admin-border);
}
.ticket-col > header i {
  width: 24px;
  height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-primary);
  background: var(--admin-surface-soft);
}

.ticket-col-body { display: grid; gap: 9px; }
.ticket-kcard {
  border-radius: 11px;
  border: 1px solid var(--admin-border);
  background: #fff;
  box-shadow: 0 4px 16px rgb(7 28 59 / 6%);
}
.ticket-kcard:hover { border-color: #b1c4e8; }

.ticket-kcard .k-actions .btn { min-height: 34px; }

.bo-modal { padding: 16px; }
.bo-modal-backdrop { background: rgb(7 28 59 / 48%); backdrop-filter: blur(2px); }
.bo-modal-card {
  width: min(1360px, 84vw);
  max-width: none;
  max-height: 92vh;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 22px 40px rgb(8 23 45 / 22%);
}
.bo-modal-head {
  border-bottom: 1px solid var(--admin-border);
  padding: 14px 18px;
}
.bo-modal-body {
  padding: 14px 18px 18px;
  display: grid;
  gap: 12px;
}
.bo-modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--admin-border);
  padding: 12px 18px 16px;
  justify-content: flex-end;
  gap: 8px;
}

.client-tabs {
  margin: -2px 0 14px;
  padding: 3px;
  border-radius: 12px;
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  position: static;
}

.client-tabs button {
  border-radius: 9px;
  font-weight: 700;
  color: #4d5f77;
  min-height: 38px;
}

.client-tabs button.active {
  background: var(--admin-navy);
  color: #fff;
}

.client-tab-panel { display: none; }
.client-tab-panel.active { display: block; }

.agent-kpis {
  margin: 8px 0 16px;
  padding: 0 0 0 2px;
  display: grid;
  gap: 10px;
}

.cfg-card:has(.cfg-switch) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}
.cfg-card:has(.cfg-switch)>h3,
.cfg-card:has(.cfg-switch)>.cfg-lead { grid-column: 1 / -1; }

.btn {
  min-height: 40px;
  border-radius: 9px;
  padding-inline: 13px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 3px solid rgb(21 70 160 / 28%) !important; outline-offset: 2px; }

.notice,
.toast { border-radius: 12px; }

@media (max-width: 1400px) {
  .console { grid-template-columns: 206px minmax(0, 1fr); }
  .side { width: 206px; }
  main { padding-left: 20px; padding-right: 20px; }
  #kpiGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .two-col { grid-template-columns: minmax(0, 1.25fr) minmax(250px, .8fr); gap: 12px; }
  .priority-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-topbar,
  .admin-topbar + * { margin-inline: 0; }
}

@media (max-width: 860px) {
  .console { display: block; }
  .side {
    position: fixed;
    inset: 24px auto 0 0;
    width: min(84vw, 320px);
    z-index: 60;
    transform: translateX(-104%);
    transition: transform 170ms ease;
  }
  .side.is-open { transform: translateX(0); }
  .side-brand,
  .side-foot { display: flex; }
  .side-brand > div { display: block; }
  .side-group-label {
    display: block;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
  }
  .side-nav { display: grid; overflow: visible; }
  .side-nav button { justify-content: flex-start; width: 100%; }
  .mobile-nav-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 24px 0 0;
    z-index: 50;
    border: 0;
    background: rgb(7 28 59 / 55%);
  }
  .nav-backdrop.hidden { display: none; }
  .admin-topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0 -14px 12px;
    padding: 10px 14px;
    min-height: 64px;
  }
  .admin-topbar small,
  .live-status { display: none; }
  .admin-topbar-actions .btn { width: 38px; height: 38px; min-height: 38px; padding: 8px; }
  .admin-topbar-actions .btn span { display: none; }
  .side-foot .btn { padding: 8px 10px; }
  .side-foot span#envMode,
  .admin-topbar-kicker + span { display: none; }
  main { padding: 0 14px 30px; }
  .section,
  #kpiGrid,
  #overviewActionStrip,
  .two-col,
  .card { width: 100%; max-width: 100%; min-width: 0; }
  .priority-strip,
  #kpiGrid { grid-template-columns: minmax(0, 1fr); }
  .ticket-board { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .admin-topbar strong { font-size: 0.96rem; }
  .overview-toolbar-label,
  .admin-topbar small,
  .section-subtitle { max-width: 96%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kpi strong { font-size: 1.3rem; }
  .filter-bar .search,
  .filter-bar select { width: 100%; min-width: 0; }
}





/* Zone 3 (390-420px) : anti-collage topbar/filtres/tableau/modales */
@media (min-width: 360px) and (max-width: 420px) {
  .admin-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
    margin: 0 -12px 14px;
    padding: 10px 12px;
  }

  .admin-topbar > div {
    min-width: 0;
  }

  .admin-topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-topbar-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-topbar small,
  .admin-topbar-kicker {
    white-space: normal;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .filters > .field {
    width: 100%;
    min-width: 0;
  }

  .filters select,
  .filters input,
  .filters button {
    width: 100%;
    min-width: 0;
  }

  .table-card {
    margin-top: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 860px;
    width: 100%;
  }

  .table-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
  }

  .table-actions .btn {
    width: 100%;
  }

  .bo-modal {
    padding: 0;
    align-items: stretch;
  }

  .bo-modal-card {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .bo-modal-head {
    gap: 9px;
    flex-wrap: wrap;
  }

  .bo-modal-head strong,
  .bo-modal-head span {
    overflow-wrap: anywhere;
    white-space: normal;
    max-width: 100%;
  }

  .bo-modal-body {
    padding: 12px 10px 16px;
  }

  .bo-modal-actions {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 8px;
    padding: 12px 10px;
  }

  .bo-modal-actions .btn {
    width: 100%;
  }
}
