/* ==========================================================================
   4iNTE Supervision — feuille de style
   Charte : bleu 4iNTE #469BE6 · orange #F7A13E · marine #111F35
   ========================================================================== */
:root {
  --blue: #469BE6; --blue-600: #2F84D1; --blue-700: #2369AD; --blue-50: #EAF3FC;
  --orange: #F7A13E; --orange-600: #E58A22; --orange-50: #FEF4E8;
  --navy: #111F35; --navy-900: #0A1424; --navy-800: #0F1B2E; --navy-700: #182A47;
  --ok: #16A34A; --ok-bg: #E8F7EE; --warn: #D97706; --warn-bg: #FEF3E2; --crit: #DC2626; --crit-bg: #FDECEC; --info: #2F84D1; --info-bg: #EAF3FC;
  --bg: #F3F6FA; --surface: #FFFFFF; --surface-2: #F8FAFD; --border: #E3E9F1; --border-strong: #CBD5E1;
  --text: #0F1B2E; --text-2: #334155; --muted: #64748B; --faint: #94A3B8;
  --shadow-sm: 0 1px 2px rgba(15, 27, 46, .05);
  --shadow: 0 1px 2px rgba(15, 27, 46, .04), 0 6px 24px -8px rgba(15, 27, 46, .10);
  --shadow-lg: 0 24px 60px -12px rgba(15, 27, 46, .35);
  --radius: 14px; --radius-sm: 10px;
  --sidebar: 264px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1322; --surface: #101C30; --surface-2: #0D1828; --border: #1C2C46; --border-strong: #2A3E5E;
  --text: #E7EEF8; --text-2: #C3D0E2; --muted: #8A9DB8; --faint: #5F7393;
  --ok-bg: rgba(22, 163, 74, .14); --warn-bg: rgba(217, 119, 6, .16); --crit-bg: rgba(220, 38, 38, .16); --info-bg: rgba(70, 155, 230, .14);
  --blue-50: rgba(70, 155, 230, .14); --orange-50: rgba(247, 161, 62, .14);
  --ok: #34D399; --warn: #FBBF24; --crit: #F87171; --info: #7CB9F0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px -10px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--blue-600); text-decoration: none; }
a:not(.btn):hover { color: var(--blue-700); }
:root[data-theme="dark"] a:not(.btn) { color: var(--blue); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }
.hidden { display: none !important; }
::selection { background: rgba(70, 155, 230, .25); }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #C9D6EA;
  background: radial-gradient(120% 60% at 0% 0%, rgba(70, 155, 230, .18), transparent 60%), linear-gradient(180deg, var(--navy-800), var(--navy-900));
  border-right: 1px solid rgba(255, 255, 255, .04); z-index: 40;
}
.brand { padding: 22px 22px 18px; display: block; }
.brand img { height: 34px; display: block; }
.brand .sub { margin-top: 8px; font-size: 10.5px; letter-spacing: .32em; color: #7FA6D3; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.brand .sub::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, rgba(247, 161, 62, .6), transparent); }
.nav { padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #5E7699; padding: 16px 12px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 10px; color: #B8C7DD; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(70, 155, 230, .22), rgba(70, 155, 230, .06)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav a.active svg { color: var(--blue); }
.nav .count { margin-left: auto; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav .count.soft { background: rgba(255, 255, 255, .1); color: #C9D6EA; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.user-card .who { flex: 1; min-width: 0; }
.user-card .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who span { font-size: 11.5px; color: #7F93B2; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: rgba(127, 147, 178, .14); }
.sidebar .icon-btn { color: #9FB2CF; }
.side-status { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #7F93B2; padding: 4px 10px 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; opacity: .6; }
.search { position: relative; margin-left: auto; width: min(420px, 40vw); }
.search input { width: 100%; height: 40px; padding: 0 70px 0 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; outline: none; transition: border .15s, box-shadow .15s; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(70, 155, 230, .15); }
.search > svg { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.search kbd { position: absolute; right: 10px; top: 9px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 420px; overflow: auto; }
.search-results.open { display: block; }
.search-results .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 8px 10px 4px; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--blue-50); }
.search-results small { color: var(--muted); margin-left: auto; }

.content { padding: 28px 32px 48px; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- boutons & formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: all .15s; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, #55A6EA, var(--blue-600)); border-color: var(--blue-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(47, 132, 209, .6); }
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
a.btn.primary, a.btn.primary:visited, a.btn.primary:hover, a.btn.primary:focus { color: #fff; }
.btn.accent { background: linear-gradient(180deg, #F9AE55, var(--orange-600)); border-color: var(--orange-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(229, 138, 34, .6); }
.btn.danger { color: var(--crit); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.xs svg { width: 13px; height: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; outline: none; transition: border .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
textarea.input.code { font-family: var(--mono); font-size: 12.5px; min-height: 180px; background: var(--navy-900); color: #D6E4F5; border-color: var(--navy-700); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(70, 155, 230, .15); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.card-head h3 svg { color: var(--blue); }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 20px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 500; font-size: 13px; }
.kpi .chip { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.kpi .chip.orange { background: var(--orange-50); color: var(--orange-600); }
.kpi .chip.ok { background: var(--ok-bg); color: var(--ok); }
.kpi .chip.crit { background: var(--crit-bg); color: var(--crit); }
.kpi .value { font-size: 32px; font-weight: 750; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; }
.kpi .value small { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi .foot { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(70, 155, 230, .08), transparent 70%); }

/* ---------------------------------------------------------------- badges, jauges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.crit { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.muted { color: var(--muted); }
.dot.pulse { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); }

.score { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.score.ok { background: var(--ok-bg); color: var(--ok); }
.score.warn { background: var(--warn-bg); color: var(--warn); }
.score.crit { background: var(--crit-bg); color: var(--crit); }
.score.muted { background: var(--surface-2); color: var(--faint); }

.meter { height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; min-width: 60px; }
.meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4FB477, var(--ok)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.meter.warn span { background: linear-gradient(90deg, #F8B84E, var(--warn)); }
.meter.crit span { background: linear-gradient(90deg, #F2706F, var(--crit)); }
.meter-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.meter-row .meter { grid-column: 1 / -1; }

.ring { --p: 0; --c: var(--ok); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring > div { position: relative; text-align: center; }
.ring b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; display: block; line-height: 1; }
.ring span { font-size: 12px; color: var(--muted); }
.ring.sm { width: 84px; height: 84px; }
.ring.sm::before { inset: 8px; }
.ring.sm b { font-size: 22px; }

/* ---------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.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 { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr[data-href], .table tr.row-link { cursor: pointer; }
.alert-item.row-link { cursor: pointer; } .alert-item.row-link:hover { background: color-mix(in srgb, var(--accent, #469BE6) 6%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted, .muted { color: var(--muted); }
.table .strong { font-weight: 600; }
.table.compact td, .table.compact th { padding: 8px 14px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: ' ↕'; opacity: .35; }
th.sort-asc::after { content: ' ↑'; opacity: 1; }
th.sort-desc::after { content: ' ↓'; opacity: 1; }
.dev-cell { display: flex; align-items: center; gap: 12px; }
.dev-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); flex: none; }
.dev-ico.off { background: var(--surface-2); color: var(--faint); }
.dev-cell b { display: block; }
.dev-cell small { color: var(--muted); }

dl.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; margin: 0; }
dl.kv dt { color: var(--muted); padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
dl.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px dashed var(--border); font-weight: 500; overflow-wrap: anywhere; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }

/* ---------------------------------------------------------------- onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--blue-600); border-color: var(--blue); }
:root[data-theme="dark"] .tabs a.active { color: var(--blue); }
.tabs a .n { font-size: 11px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tabs a .n.crit { background: var(--crit); border-color: var(--crit); color: #fff; }

/* ---------------------------------------------------------------- clients */
.client-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; transition: transform .18s, box-shadow .18s; color: var(--text); }
.client-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.client-card .head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 750; color: #fff; font-size: 16px; flex: none; letter-spacing: .02em; background: var(--blue); box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .12); }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.client-card h3 { font-size: 16px; }
.client-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.client-card .stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; }
.client-card .stats b { display: block; font-size: 18px; }
.client-card .stats span { font-size: 11.5px; color: var(--muted); }
.client-card .alerts-line { display: flex; gap: 6px; flex-wrap: wrap; min-height: 24px; }
.add-card { border: 2px dashed var(--border-strong); background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 220px; color: var(--muted); cursor: pointer; font-weight: 600; }
.add-card:hover { border-color: var(--blue); color: var(--blue-600); }
.add-card div { text-align: center; display: grid; gap: 10px; place-items: center; }

.hero { padding: 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 120% at 100% 0%, rgba(70, 155, 230, .10), transparent 60%); pointer-events: none; }
.hero h1 { font-size: 24px; }
.hero .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; font-size: 13px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .meta svg { width: 15px; height: 15px; }
.hero .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------------------------------------------------------------- alertes & listes */
.alert-item { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.alert-item:last-child { border-bottom: 0; }
.alert-item .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-item .ico.critical { background: var(--crit-bg); color: var(--crit); }
.alert-item .ico.warning { background: var(--warn-bg); color: var(--warn); }
.alert-item .ico.info { background: var(--info-bg); color: var(--info); }
.alert-item .body { flex: 1; min-width: 0; }
.alert-item .body b { display: block; font-weight: 600; }
.alert-item .body small { color: var(--muted); }
.alert-item .when { font-size: 12px; color: var(--faint); white-space: nowrap; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.empty .big svg { width: 26px; height: 26px; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--info-bg); color: var(--text-2); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.callout.crit { background: var(--crit-bg); border-color: color-mix(in srgb, var(--crit) 25%, transparent); }
.callout svg { color: var(--info); margin-top: 1px; }
.callout.warn svg { color: var(--warn); }
.callout.crit svg { color: var(--crit); }

.codebox { position: relative; background: var(--navy-900); color: #D6E4F5; border-radius: 12px; padding: 14px 52px 14px 16px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--navy-700); }
.codebox .copy { position: absolute; right: 8px; top: 8px; color: #9FB2CF; }
pre.output { margin: 0; background: var(--navy-900); color: #CFE0F5; border-radius: 10px; padding: 12px 14px; font: 12px/1.55 var(--mono); max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.sec-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.sec-item .i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sec-item.ok .i { background: var(--ok-bg); color: var(--ok); }
.sec-item.warn .i { background: var(--warn-bg); color: var(--warn); }
.sec-item.crit .i { background: var(--crit-bg); color: var(--crit); }
.sec-item.muted .i { background: var(--surface); color: var(--faint); }
.sec-item b { display: block; font-size: 13px; }
.sec-item small { color: var(--muted); font-size: 12px; }

.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.action-tile { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: var(--text); transition: all .15s; }
.action-tile:hover { border-color: var(--blue); background: var(--blue-50); transform: translateY(-1px); }
.action-tile .i { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--blue-600); border: 1px solid var(--border); flex: none; }
.action-tile.danger .i { color: var(--crit); }
.action-tile b { font-size: 13px; display: block; }
.action-tile small { font-size: 11.5px; color: var(--muted); line-height: 1.3; display: block; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 190px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font: 600 12px var(--font); color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- modales & toasts */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(620px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 20, 36, .55); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 22px 24px; max-height: 70vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }

.toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 10px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 420px; padding: 13px 16px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); animation: slide .25s ease-out; font-weight: 500; }
.toast.success svg { color: #4ADE80; }
.toast.error svg { color: #F87171; }
.toast.info svg { color: var(--blue); }
@keyframes slide { from { transform: translateY(14px); opacity: 0; } }

/* ---------------------------------------------------------------- connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-visual { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; background: radial-gradient(80% 60% at 20% 10%, rgba(70, 155, 230, .35), transparent 60%), radial-gradient(60% 50% at 90% 90%, rgba(247, 161, 62, .22), transparent 60%), linear-gradient(160deg, #0F1B2E, #0A1424); }
.auth-visual .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); }
.auth-visual img.logo { height: 46px; width: auto; align-self: flex-start; object-fit: contain; position: relative; }
.auth-visual h2 { font-size: 40px; line-height: 1.1; margin-top: auto; position: relative; letter-spacing: -.03em; }
.auth-visual h2 em { font-style: normal; background: linear-gradient(90deg, var(--blue), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-visual p { color: #A9BBD6; max-width: 460px; position: relative; font-size: 15px; }
.auth-visual .feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; position: relative; max-width: 520px; }
.auth-visual .feats div { display: flex; gap: 10px; align-items: center; color: #D2DDEE; font-size: 13.5px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); padding: 10px 12px; border-radius: 12px; }
.auth-visual .feats svg { color: var(--orange); }
.auth-visual .foot { margin-top: 40px; color: #5E7699; font-size: 12.5px; position: relative; }
.auth-visual .mark { position: absolute; right: -80px; top: 80px; width: 420px; opacity: .08; }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.auth-form form { width: min(400px, 100%); }
.auth-form h1 { font-size: 26px; margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); margin: 0 0 28px; }
.auth-form .btn { width: 100%; height: 44px; margin-top: 6px; }
.err { padding: 11px 14px; border-radius: 10px; background: var(--crit-bg); color: var(--crit); margin-bottom: 16px; font-weight: 500; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- utilitaires */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.filters .input { height: 36px; width: auto; min-width: 160px; }
.filters .input.grow { flex: 1; min-width: 220px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.progress-list { display: grid; gap: 14px; }
.progress-list .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-list .lbl span { color: var(--muted); }
details.more summary { cursor: pointer; color: var(--blue-600); font-weight: 600; padding: 10px 0; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar { padding: 12px 16px; }
  .topbar .menu-btn { display: inline-grid; }
  .content { padding: 20px 16px 40px; }
  .cols-21, .cols-12, .cols-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .crumbs { display: none; }
  .search { width: 100%; }
}
@media (max-width: 640px) { .cols-4, .cols-3 { grid-template-columns: 1fr; } .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .page-head h1 { font-size: 22px; } }

/* ---------------------------------------------------------------- ajustements */
.hero > div:nth-child(2) { flex: 1; min-width: 300px; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.sec-item.ok { border-color: color-mix(in srgb, var(--ok) 22%, var(--border)); }
.sec-item.warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); background: color-mix(in srgb, var(--warn-bg) 45%, var(--surface-2)); }
.sec-item.crit { border-color: color-mix(in srgb, var(--crit) 40%, var(--border)); background: color-mix(in srgb, var(--crit-bg) 55%, var(--surface-2)); }

/* cases à cocher : grande zone cliquable */
.table .sel-cell { width: 52px; padding: 0 !important; text-align: center; cursor: pointer; }
.table td.sel-cell:hover { background: var(--blue-50); }
.table .sel-cell input[type=checkbox] { width: 18px; height: 18px; margin: 14px 17px; cursor: pointer; accent-color: var(--blue); vertical-align: middle; }

/* historique des alertes (menu dépliant) */
.alert-history > summary::-webkit-details-marker { display: none; }
.alert-history:not([open]) > summary { border-bottom: 0; }
.alert-history .hist-close, .alert-history[open] .hist-open { display: none; }
.alert-history[open] .hist-close { display: inline; }
.alert-history .hist-chev { width: 16px; height: 16px; transition: transform .2s; vertical-align: -3px; }
.alert-history[open] .hist-chev { transform: rotate(180deg); }

/* historique des actions à distance */
.hist-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); }
.hist-item > summary { display: flex; gap: 10px; align-items: center; cursor: pointer; list-style: none; flex-wrap: wrap; }
.hist-item > summary::-webkit-details-marker { display: none; }
.hist-item[open] { background: var(--surface); }
.hist-item pre.output { max-height: 240px; }

.callout.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--text); }
#cmdResult.callout { margin-top: 14px; font-size: 14px; }

/* Terminal interactif */
.term-screen { background: #0A0F1A; color: #D7E3F4; border: 1px solid #1E2A3D; border-radius: 10px; height: 52vh; overflow: auto; padding: 12px 14px;
  font: 13px/1.45 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace; cursor: text; }
.term-screen pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; }
.term-screen .term-sys { color: #F7A13E; }
.term-screen .term-in { color: #7EC0F5; }
.term-line { display: flex; gap: 6px; align-items: center; }
.term-line span { color: #7EC0F5; white-space: nowrap; }
.term-line input { flex: 1; background: transparent; border: 0; outline: 0; color: #FFFFFF; font: inherit; padding: 0; }
