/* AxioPanel — feuille de style unique, sans dépendance. Thème clair / sombre automatique. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #16181d;
  --text-2: #475467;
  --muted: #667085;
  --primary: #3451d1;
  --primary-hover: #2a43b3;
  --primary-soft: #eef1fd;
  --ok: #12805c;      --ok-soft: #e7f6ef;
  --warn: #b25e09;    --warn-soft: #fdf3e5;
  --danger: #c4320a;  --danger-soft: #fdecea;
  --sidebar: #111318;
  --sidebar-text: #c3c7d0;
  --sidebar-muted: #7c8392;
  --sidebar-hover: #1c1f27;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13; --surface: #15181e; --surface-2: #1a1e25; --border: #262b34; --border-strong: #333a45;
    --text: #eceef2; --text-2: #b6bcc8; --muted: #8b93a3;
    --primary: #6b83f2; --primary-hover: #8196f5; --primary-soft: #1d2340;
    --ok: #3ccf91; --ok-soft: #10281f; --warn: #f0a44b; --warn-soft: #2d2213; --danger: #f97361; --danger-soft: #2f1714;
    --sidebar: #0a0b0e; --sidebar-hover: #16181e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
pre code { border: 0; padding: 0; background: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; }
.text-warn { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.i { width: 17px; height: 17px; flex: none; }
.i-xl { width: 36px; height: 36px; color: var(--muted); }
.i-ok { color: var(--ok); }

/* ---------- Structure ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 32px 48px; max-width: 1400px; width: 100%; }

.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; color: #fff; text-decoration: none !important; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4d68ea, #2d45bd); color: #fff; font-weight: 700; font-size: 16px;
}
.brand-text { font-weight: 700; letter-spacing: .08em; font-size: 14px; display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-weight: 500; letter-spacing: .02em; font-size: 11.5px; color: var(--sidebar-muted); }

.nav { padding: 4px 10px 16px; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); padding: 16px 10px 6px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500; text-decoration: none !important;
}
.nav-link .i { color: var(--sidebar-muted); }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: #232734; color: #fff; }
.nav-link.active .i { color: #8fa2ff; }

.sidebar-foot { border-top: 1px solid #1f232c; padding: 12px 14px; display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { color: #fff; font-size: 13px; font-weight: 600; }
.me-text small { color: var(--sidebar-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2b3142; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.sidebar .icon-btn { color: var(--sidebar-muted); }
.sidebar .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }

.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; color: var(--muted); }
.search input { border: 0; background: none; padding: 8px 0; width: 100%; box-shadow: none !important; }
.topbar .btn-primary { margin-left: auto; }
.menu-btn { display: none; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.crumb a::after { content: " /"; }

/* ---------- Cartes & grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card.highlight { border-color: var(--warn); background: var(--warn-soft); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-side > .stack > .card:last-child { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.narrow { max-width: 760px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none !important; transition: border-color .15s; }
.kpi:hover { border-color: var(--border-strong); }
.kpi-danger { border-color: var(--danger); background: var(--danger-soft); }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-label .i { width: 15px; height: 15px; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sm { font-size: 17px; display: flex; align-items: center; gap: 6px; }
.kpi-foot { font-size: 12.5px; color: var(--muted); }
.stat { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  box-shadow: var(--shadow); transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { font-size: 13px; font-weight: 500; }

/* ---------- Formulaires ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 11px; min-height: 36px; box-shadow: var(--shadow);
}
textarea { resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.stack > .field, .row-2 > .field { margin-bottom: 0; }
.field > span, .field > legend { font-weight: 500; font-size: 13px; color: var(--text-2); padding: 0; }
.hint { color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio input { margin-top: 3px; }
.radio span, .switch > span:last-child { display: flex; flex-direction: column; }
.radio small, .switch small { color: var(--muted); font-size: 12.5px; }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--border); }
.switch:last-of-type { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 36px; height: 20px; border-radius: 20px; background: var(--border-strong); position: relative; flex: none; margin-top: 1px; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch.is-disabled { opacity: .55; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 820px; }
.form-grid > .card { margin: 0; }
.field + .row-2, .row-2 + .field, .row-2 + fieldset { margin-top: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.inline-form { display: flex; gap: 10px; }
.inline-form select { max-width: 200px; }
.input-prefix { display: flex; }
.input-prefix span { display: grid; place-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.toolbar { margin-bottom: 16px; }
.toolbar-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-form input[type=search] { max-width: 320px; }
.toolbar-form select { width: auto; }

/* ---------- Tableaux ---------- */
.table-wrap { padding: 0; overflow-x: auto; position: relative; }
.table-wrap > .card-head { padding: 16px 20px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table a.strong { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact td { padding: 8px 16px; }
.actions-col { width: 1%; text-align: right; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-error td { background: var(--danger-soft); }

/* ---------- Badges, points, jauges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 1px 7px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; flex: none; vertical-align: middle; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-muted { background: var(--border-strong); }
.meter { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--border); border-radius: 6px; }
.meter::-webkit-progress-value { border-radius: 6px; background: var(--ok); }
.meter::-moz-progress-bar { border-radius: 6px; background: var(--ok); }
.meter-warn::-webkit-progress-value { background: var(--warn); } .meter-warn::-moz-progress-bar { background: var(--warn); }
.meter-danger::-webkit-progress-value { background: var(--danger); } .meter-danger::-moz-progress-bar { background: var(--danger); }
.res { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.res-row { display: grid; grid-template-columns: 80px 1fr 150px; gap: 12px; align-items: center; font-size: 13px; }
.res-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.services, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.svc, .chip { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--border); border-radius: 20px; font-size: 12.5px; background: var(--surface-2); }
.chip-danger { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); gap: 6px; }
.summary { margin-bottom: 16px; }
.stat-5xx .kpi-value { color: var(--danger); } .stat-4xx .kpi-value { color: var(--warn); }

.bars { display: flex; gap: 2px; height: 28px; align-items: stretch; margin-top: 6px; }
.bars-sm { height: 18px; min-width: 200px; }
.bar { flex: 1; border-radius: 2px; min-width: 2px; }
.bar-ok { background: var(--ok); } .bar-warn { background: var(--warn); } .bar-danger { background: var(--danger); } .bar-none { background: var(--border); }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li .muted { margin-left: auto; font-size: 12.5px; }
.list-compact li { padding: 6px 0; }
.empty-inline { display: flex; align-items: center; gap: 8px; color: var(--text-2); padding: 8px 0; }

/* ---------- Identifiants ---------- */
.creds { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0; align-items: center; }
.creds dt { color: var(--muted); font-size: 13px; }
.creds dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.creds-inline { grid-template-columns: 110px 1fr; }
.secret { background: var(--warn-soft); border-color: var(--warn); color: var(--text); }
.copy-btn { font: inherit; font-size: 11.5px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 5px; padding: 1px 7px; cursor: pointer; }
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
pre.code { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin: 14px 0 0; white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: 12px; }
pre.code + .copy-btn { margin-top: 6px; }

/* ---------- Alertes ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: 13.5px; }
.alert .i { margin-top: 1px; }
.alert-success { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.alert-success span, .alert-warning span, .alert-error span, .alert-info span { color: var(--text); }
.alert-warning { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.alert-error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert-info { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ---------- Onglets & segments ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg-btn { padding: 7px 12px; color: var(--text-2); font-weight: 500; border-right: 1px solid var(--border); text-decoration: none !important; }
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: var(--primary-soft); color: var(--primary); }

/* ---------- Journaux ---------- */
.log-card { padding: 0; overflow: hidden; }
.log-card > p { padding: 20px; margin: 0; }
pre.log { margin: 0; padding: 16px; max-height: 65vh; overflow: auto; background: #0f1115; color: #d4d8e0; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
pre.log { white-space: pre-wrap; word-break: break-all; }
pre.log .l-danger { color: #ff8a7a; }
pre.log .l-warn { color: #f5c26b; }

/* ---------- Divers ---------- */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
.danger-zone .stack { max-width: 480px; }
.success-hero { display: flex; align-items: center; gap: 16px; }
.success-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none; }
.success-icon .i { width: 26px; height: 26px; }
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { margin: 0; justify-content: center; }
.notes { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 14px 0; font-size: 13px; }
.pager { display: flex; gap: 8px; justify-content: center; }

details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 36px; z-index: 20; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; text-align: left; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); font: inherit; color: var(--text); cursor: pointer; }
.menu-item:hover:not(:disabled) { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Connexion ---------- */
body.bare { background: var(--bg); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card h1 { margin: 22px 0 4px; }
.auth-card .brand { padding: 0; color: var(--text); }
.auth-card .brand-text small { color: var(--muted); }
.auth-card .stack { margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  .menu-btn { display: inline-grid; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; }
  .grid-2, .grid-side, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpis, .grid-4, .grid-3, .row-2, .action-grid { grid-template-columns: 1fr; }
  .topbar .btn-primary span { display: none; }
  .res-row { grid-template-columns: 70px 1fr; }
  .res-row .num { grid-column: 2; text-align: left; }
  .creds { grid-template-columns: 1fr; gap: 2px 0; }
  .creds dd { margin-bottom: 8px; }
  .search { display: none; }
}

/* =====================================================================
   Monitoring (façon Uptime Kuma)
   ===================================================================== */
.i-sm { width: 14px; height: 14px; }
.text-danger { color: var(--danger); }
.pad { padding: 0 20px 16px; }
.spacer { flex: 1; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.row-3 .radio { margin: 0; }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpis-mon .kpi { cursor: default; }

.mon-layout { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mon-list { padding: 8px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; margin: 0; }
.mon-search { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; color: var(--muted); }
.mon-search input { min-height: 32px; padding: 6px 10px; }
.mon-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 10px 6px; display: flex; gap: 6px; }
.mon-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; border: 1px solid transparent; }
.mon-item:hover { background: var(--surface-2); }
.mon-item.active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.mon-item-name { display: flex; flex-direction: column; min-width: 0; }
.mon-item-name strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-item-name small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-item.is-hidden { display: none; }

.pct { display: inline-flex; justify-content: center; align-items: center; min-width: 58px; height: 24px; padding: 0 8px; border-radius: 20px;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }
.pct-ok { background: var(--ok); } .pct-warn { background: var(--warn); } .pct-danger { background: var(--danger); }
.pct-none { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.beats { display: flex; align-items: center; gap: 3px; }
.beat { display: block; width: 6px; height: 22px; border-radius: 6px; background: var(--border); flex: none; transition: transform .1s; }
.beat-up { background: var(--ok); }
.beat-down { background: var(--danger); }
.beat-empty { background: var(--border); opacity: .6; }
.beat[data-tip]:hover, .beat[data-tip]:focus-visible { transform: scaleY(1.2); outline: none; }
.beats-sm { gap: 2px; } .beats-sm .beat { width: 4px; height: 18px; border-radius: 4px; }
.beats-md { gap: 2px; margin-top: 8px; } .beats-md .beat { flex: 1 1 0; width: auto; max-width: 8px; height: 26px; }
.beats-lg { flex: 1; min-width: 0; gap: 3px; } .beats-lg .beat { flex: 1 1 0; width: auto; max-width: 10px; height: 32px; border-radius: 10px; }

.mon-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.mon-title { font-size: 22px; margin: 0 0 6px; }
.mon-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.mon-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mon-status { display: flex; align-items: center; gap: 16px; }
.mon-sub { margin: 10px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; border-radius: 36px; font-weight: 600; white-space: nowrap; flex: none; }
.pill-ok { background: var(--ok); color: #fff; }
.pill-danger { background: var(--danger); color: #fff; }
.pill-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Infobulle commune (pulsations, graphique) */
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12px;
  padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow-lg); max-width: 320px; white-space: nowrap; }
.tip strong { font-weight: 600; }

/* Graphique */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-axis { stroke: var(--border-strong); stroke-width: 1; }
.ch-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ch-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--primary); opacity: .08; }
.ch-dot { fill: var(--primary); }
.ch-down { fill: var(--danger); opacity: .14; }
.ch-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-cross-dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-empty { padding: 36px 0; text-align: center; color: var(--muted); }
.data-table { margin-top: 12px; }
.data-table summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.data-table .table-wrap { max-height: 280px; overflow: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

@media (max-width: 1100px) {
  .mon-layout { grid-template-columns: minmax(0, 1fr); }
  .mon-list { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .grid-5, .row-3 { grid-template-columns: 1fr 1fr; }
  .mon-head .mon-actions { width: 100%; }
  .mon-item { grid-template-columns: 58px minmax(0, 1fr); }
  .mon-item .beats { grid-column: 1 / -1; }
  .mon-status { flex-direction: column; align-items: stretch; }
}

/* Sauvegardes */
.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.menu-wide { min-width: 300px; }
.wrap-form { flex-wrap: wrap; }
.wrap-form select { max-width: 280px; }
input[type=number] { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 11px; min-height: 36px; }
@media (max-width: 1500px) { .grid-side-xl { grid-template-columns: minmax(0, 1fr); } }
.stack input[type=number] { max-width: 160px; }

/* Paramètres / intégrations */
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.form-actions-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.check-sm { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

/* v1.2 — tâches de fond, mise en ligne */
.badge-info { background: var(--primary-soft); color: var(--primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--danger); background: var(--danger-soft); }
.publish-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; margin-bottom: 12px; }
@media (max-width: 860px) { .publish-grid { grid-template-columns: minmax(0, 1fr); } }
.job { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.job-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.job-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.job-step { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; overflow-wrap: anywhere; }
.job-ico { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; }
.job-ico .i { width: 13px; height: 13px; }
.job-step.is-ok .job-ico { background: var(--ok-soft); color: var(--ok); }
.job-step.is-skip .job-ico { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.job-step.is-error .job-ico { background: var(--danger-soft); color: var(--danger); }
.spinner { border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.right { text-align: right; } td.right .inline-actions { justify-content: flex-end; }
td .inline-actions { margin: 0; padding: 0; border: 0; flex-wrap: nowrap; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.zone-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.zone-tile:hover { border-color: var(--primary); background: var(--primary-soft); }
.record-form { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 2fr) 110px 110px; gap: 10px 12px; align-items: end; }
.record-form .check, .record-form .form-actions-inline { grid-column: 1 / -1; }
@media (max-width: 860px) { .record-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .record-form .field-wide { grid-column: 1 / -1; } }
.wrap-any { overflow-wrap: anywhere; max-width: 420px; }
tr.is-selected td { background: var(--primary-soft); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
/* AxioWeb — graphique en barres */
.bar-chart { margin: 8px 0 4px; }
.bar-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .ch-base { stroke: var(--border-strong); stroke-width: 1; }
.bar-chart .bar { fill: var(--primary); }
.bar-chart .bar-hit { fill: transparent; }
.bar-chart .bar-g:hover .bar-hit { fill: var(--primary-soft); }
.bar-chart .bar-val { font-size: 11px; font-weight: 600; fill: var(--text-2, var(--muted)); }
.bar-chart .bar-lbl { font-size: 11px; fill: var(--muted); }
a.stat-link { color: inherit; text-decoration: none; }
a.stat-link:hover { border-color: var(--primary); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.seg { max-width: 100%; overflow-x: auto; }
.qr-box { display: inline-block; padding: 8px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 8px 0; }
.qr-box svg { display: block; max-width: 100%; height: auto; }
.otp-input { font-family: var(--mono); font-size: 20px; letter-spacing: 4px; text-align: center; }
.recovery-codes { column-count: 2; font-size: 15px; line-height: 1.9; }
.steps-list { padding-left: 18px; margin: 0; }
details.danger-zone { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
details.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 500; }
.grid > *, .form-grid > *, .publish-grid > * { min-width: 0; }
[hidden] { display: none !important; }
input[type=date], input[type=time], input[type=number], input[type=datetime-local] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px; box-shadow: var(--shadow); max-width: 100%;
}
input[type=file] { font: inherit; max-width: 100%; }
/* Tâches planifiées */
.freq-list { display: grid; gap: 6px; }
.freq-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px 30px; color: var(--text-2, var(--muted)); }
.freq-opts select, .freq-opts input[type=time] { width: auto; }
.freq-opts .num-sm { width: 80px; }
.freq-opts .hint { flex-basis: 100%; }
.check-inline { display: inline-flex; gap: 4px; align-items: center; margin-right: 6px; }
.cron-out { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
details.run { border-bottom: 1px solid var(--border); padding: 8px 0; }
details.run summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.run pre { margin-top: 8px; }
.section-gap { margin-top: 18px; }
/* Statistiques */
.stats-chart { width: 100%; height: auto; display: block; margin: 6px 0; overflow: visible; }
.stats-chart .grid { stroke: var(--border); stroke-width: 1; }
.stats-chart .axis { font-size: 10.5px; fill: var(--muted); }
.stats-chart .bar { fill: var(--primary); }
.stats-chart .hit { fill: transparent; }
.stats-chart .day:hover .hit { fill: var(--primary-soft); }
.stats-chart .line { fill: none; stroke: var(--warn); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.legend { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.lg-bar { background: var(--primary); } .lg-line { height: 2px; background: var(--warn); margin-left: 8px; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar { width: 90px; height: 8px; display: block; }
.hbar .track { fill: var(--surface-2); } .hbar .fill { fill: var(--primary); }
.hours-chart { width: 100%; height: auto; display: block; }
.hours-chart .bar { fill: var(--primary); } .hours-chart .hit { fill: transparent; }
.hours-chart g:hover .hit { fill: var(--primary-soft); }
.hours-chart text { font-size: 7px; fill: var(--muted); }
.inline-form { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
meter { accent-color: var(--primary); }
.add-zone { margin: 14px 0 4px; align-items: flex-end; } .add-zone .field { min-width: 260px; flex: 1; }

/* ---------- Messagerie ---------- */
.mail-steps { display: flex; flex-direction: column; gap: 0; }
.mail-steps > li.mail-step { padding: 14px 0; justify-content: flex-start; text-align: left; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mail-steps > li.mail-step:first-child { border-top: 0; padding-top: 4px; }
.mail-step-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mail-step p { margin: 0; }
.mail-yaml { width: 100%; }
.mail-yaml pre { max-height: 320px; overflow: auto; margin: 8px 0 0; }
.input-suffix > span:last-child { border-left: 0; border-right: 1px solid var(--border-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-suffix input { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.hbar .fill-danger { fill: var(--danger); }
.sheet { max-width: 720px; margin: 32px auto; padding: 0 16px; }
.sheet h1 { margin: 4px 0; word-break: break-all; }
.sheet h2 { font-size: 16px; margin: 24px 0 8px; }
.sheet-tools { display: flex; justify-content: flex-end; }
.sheet .table { width: 100%; }
@media print { .sheet-tools, .copy-btn { display: none !important; } .sheet { margin: 0; } body.bare { background: #fff; } }
.input-suffix input { min-width: 0; flex: 1; }

.mail-step .job { width: 100%; max-width: 640px; }
.mail-step .steps-list li { display: list-item; padding: 2px 0; border: 0; }
#diagnostic .list li { align-items: flex-start; }
#diagnostic .list li > .i { flex: none; margin-top: 2px; }
.mail-steps > li.mail-step { border-bottom: 0; }
.list .mail-step .muted, #diagnostic .list li .muted { margin-left: 0; }
#diagnostic .list li { flex-wrap: nowrap; }
.fresh-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.fresh-row:last-of-type { border-bottom: 0; }
.fresh-row .creds { margin: 0; min-width: 0; }
.sheet .table th, .sheet .table td { padding: 8px 6px; }
.sheet code { word-break: break-all; }
@media (max-width: 560px) { .sheet .table thead { display: none; } .sheet .table tr { display: grid; grid-template-columns: 1fr auto auto; } .sheet .table th { grid-column: 1 / -1; } }
.update-list li { display: block; }
.update-list summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list.update-list li .muted { margin-left: 0; }
.section-title { font-size: 15px; display: flex; gap: 8px; align-items: center; margin: 24px 0 12px; }
.hbar-wide { width: 100%; max-width: 360px; margin-bottom: 12px; }
