:root {
  color-scheme: dark;
  --bg: #05071d;
  --backdrop-opacity: .85;
  --surface: #0c1230;
  --surface-2: #131a3e;
  --surface-3: #1b244f;
  --line: #212b57;
  --line-strong: #344177;
  --text: #e9edf7;
  --muted: #9aa6c2;
  --faint: #6c7998;
  --accent: #6aa9ff;
  --accent-2: #9a86ff;
  --accent-strong: #3b7af0;
  --accent-soft: rgba(106, 169, 255, .14);
  --on-accent: #fff;
  --gold: #e8c26a;
  --gold-soft: rgba(232, 194, 106, .15);
  --ok: #55d6a0;
  --ok-soft: rgba(85, 214, 160, .14);
  --warn: #f0c065;
  --warn-soft: rgba(240, 192, 101, .14);
  --bad: #f2777f;
  --bad-soft: rgba(242, 119, 127, .13);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 14px 34px rgba(2, 6, 18, .5);
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f4fb;
  --backdrop-opacity: .55;
  --surface: #fff;
  --surface-2: #f4f7fd;
  --surface-3: #e7edfa;
  --line: #dde4f1;
  --line-strong: #c3cee5;
  --text: #17203a;
  --muted: #586685;
  --faint: #8491ad;
  --accent: #2c6be0;
  --accent-2: #6a55e6;
  --accent-strong: #2c6be0;
  --accent-soft: rgba(44, 107, 224, .1);
  --gold: #9a6d0c;
  --gold-soft: rgba(205, 152, 28, .16);
  --ok: #0f8759;
  --ok-soft: rgba(15, 135, 89, .12);
  --warn: #9a6400;
  --warn-soft: rgba(200, 135, 0, .15);
  --bad: #c5343e;
  --bad-soft: rgba(197, 52, 62, .1);
  --shadow: 0 14px 34px rgba(28, 48, 100, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("theme/background.webp") center / cover no-repeat; opacity: var(--backdrop-opacity); pointer-events: none; }
/* Le fond est sombre : on l'inverse en gardant sa teinte bleue pour le thème clair. */
[data-theme="light"] body::before { filter: invert(1) hue-rotate(180deg); }
.logo { display: block; aspect-ratio: 640 / 542; background: var(--text); -webkit-mask: url("theme/logo.png") center / contain no-repeat; mask: url("theme/logo.png") center / contain no-repeat; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; line-height: 1.3; }
h3 { font-size: 14px; font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.icon, .service-icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent-strong); color: var(--on-accent); }
.skip-link:focus { top: 10px; }

/* Layout */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; gap: 4px; height: 100vh; padding: 18px 12px 14px; overflow-y: auto; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.brand { display: block; padding: 6px 10px 16px; }
.brand .logo { width: 116px; margin: 0 auto; }
.palette-trigger { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.palette-trigger:hover { border-color: var(--line-strong); color: var(--text); }
.palette-trigger kbd { margin-left: auto; }
kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--muted); font: 11px var(--font); }
.nav-label { margin: 14px 10px 4px; color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 550; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.is-sub { min-height: 32px; padding-left: 14px; font-size: 13.5px; font-weight: 500; }
.nav-dot { width: 7px; height: 7px; margin: 0 5px; border-radius: 50%; background: var(--line-strong); }
.nav-link[aria-current="page"] .nav-dot { background: var(--accent); }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 14px; }
.services { display: flex; gap: 6px; }
.service { position: relative; display: grid; flex: 1; place-items: center; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--faint); cursor: help; }
.service[data-state="online"] { color: var(--ok); }
.service[data-state="offline"] { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.service[data-state="checking"] { color: var(--warn); }
.service-tip { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 40; display: none; width: max-content; max-width: 230px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); font-size: 12px; line-height: 1.4; pointer-events: none; }
.service:nth-child(3) .service-tip { left: auto; right: 0; }
.service-tip strong, .service-tip span { display: block; }
.service-tip span { color: var(--muted); }
.service:hover .service-tip, .service:focus-visible .service-tip { display: block; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.user-card-text { display: grid; min-width: 0; line-height: 1.25; }
.user-card-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.user-card-text span { color: var(--muted); font-size: 11.5px; }
.topbar { display: none; }
.main { width: 100%; max-width: 1320px; min-width: 0; margin: 0 auto; padding: 30px clamp(16px, 3.6vw, 44px) 64px; }
.main.is-bare { display: grid; max-width: none; min-height: 100vh; padding: 20px; place-items: center; }
.scrim { display: none; }

/* Page head */
.page-head { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 26px; padding-bottom: 30px; }
.page-head::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 17px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 4px); -webkit-mask-image: linear-gradient(to right, #000 10%, transparent 88%); mask-image: linear-gradient(to right, #000 10%, transparent 88%); opacity: .75; pointer-events: none; }
.page-head-text { display: grid; gap: 6px; min-width: 0; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; overflow-wrap: anywhere; }
.page-sub { color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--faint); font-size: 12.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.kicker { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

/* Surfaces */
.card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .icon { color: var(--accent); }
.card.is-danger { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.card.is-accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface); }
.grid { display: grid; gap: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--accent-strong); color: var(--on-accent); font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; transition: filter .15s, background .15s, border-color .15s; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn.is-ghost { border-color: var(--line-strong); background: transparent; color: var(--text); }
.btn.is-ghost:hover { background: var(--surface-2); filter: none; }
.btn.is-danger { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }
.btn.is-danger:hover { background: var(--bad); color: #fff; filter: none; }
.btn.is-small { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.btn.is-icon { width: 36px; padding: 0; }
.btn.is-icon.is-small { width: 28px; }
.btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
button:disabled, select:disabled, input:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
input, select, textarea { min-height: 36px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: inherit; font: inherit; }
input:hover, select:hover { border-color: var(--faint); }
input[type="checkbox"] { min-height: 0; accent-color: var(--accent-strong); }
input::placeholder { color: var(--faint); }
.field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.field > input, .field > select { width: 100%; color: var(--text); font-size: 14.5px; font-weight: 400; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-row > .field { flex: 1 1 170px; }
.form-row > .field.is-narrow { flex: 0 1 130px; }
.search-box { display: flex; flex: 1 1 280px; align-items: center; gap: 9px; max-width: 460px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; padding: 6px 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.segmented a { padding: 4px 12px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch { position: relative; display: inline-flex; flex: 0 0 auto; width: 44px; height: 26px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch span { width: 100%; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface-3); transition: background .15s, border-color .15s; }
.switch span::after { content: ""; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + span { border-color: var(--accent-strong); background: var(--accent-strong); }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.autosave-status { display: inline-flex; align-items: center; min-height: 1.4em; color: var(--muted); font-size: 12.5px; }
.autosave-status[data-state="error"] { color: var(--bad); }
.autosave-status[data-state="saved"] { color: var(--ok); }
.autosave-status[data-state="saving"]::before { content: ""; width: 14px; height: 12px; margin-right: 7px; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 3px 40% no-repeat, linear-gradient(var(--accent), var(--accent)) 50% 100% / 3px 100% no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 100% / 3px 60% no-repeat; animation: equalize .7s ease-in-out infinite alternate; }
@keyframes equalize { to { background-size: 3px 100%, 3px 35%, 3px 90%; } }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-family: var(--font); font-size: 12px; font-weight: 550; letter-spacing: 0; line-height: 1.5; white-space: nowrap; }
a.chip:hover { filter: brightness(1.15); text-decoration: none; }
.chip .icon { width: 13px; height: 13px; }
.chip.is-ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.chip.is-warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.chip.is-bad { border-color: transparent; background: var(--bad-soft); color: var(--bad); }
.chip.is-accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.chip.is-gold { border-color: transparent; background: var(--gold-soft); color: var(--gold); }
.chip.is-role { color: var(--text); }
.chip.is-role::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #99aab5); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.avatar { display: inline-grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--accent-strong), var(--accent-2)); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; object-fit: cover; }
.avatar.is-large { width: 60px; height: 60px; font-size: 20px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
a.person:hover { text-decoration: none; }
a.person:hover strong { color: var(--accent); }
.person-text { display: grid; min-width: 0; line-height: 1.3; }
.person-text span { color: var(--muted); font-size: 12px; }

/* Flash & empty */
.flash { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid transparent; border-radius: var(--radius-sm); }
.flash span { flex: 1; }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.flash.ok .icon { color: var(--ok); }
.flash.error { border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.flash.error .icon { color: var(--bad); }
.flash button { display: grid; padding: 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 34px 20px; color: var(--muted); text-align: center; }
.empty .icon { width: 34px; height: 34px; color: var(--line-strong); }

/* Tables & lists */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card > .table-wrap { margin: 0 -20px -20px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.is-end, th.is-end { text-align: right; }
td.is-center, th.is-center { text-align: center; }
.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
a.list-item:hover { border-color: var(--accent); text-decoration: none; }
.list-item > .icon:last-child { color: var(--faint); }
.list-item-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.tile { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tile-head > .icon { margin-top: 4px; color: var(--faint); }
.tile-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.kpi[aria-current="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.kpi-icon { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.kpi.is-ok .kpi-icon { background: var(--ok-soft); color: var(--ok); }
.kpi.is-warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.kpi.is-gold .kpi-icon { background: var(--gold-soft); color: var(--gold); }
.kpi-text { display: grid; min-width: 0; line-height: 1.25; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-hint { overflow: hidden; color: var(--faint); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.ring { position: relative; display: inline-grid; flex: 0 0 auto; width: 64px; height: 64px; place-items: center; color: var(--accent); }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--surface-3); }
.ring-value { stroke: currentColor; stroke-linecap: round; }
.ring.is-empty .ring-value { display: none; }
.ring.is-full { color: var(--ok); }
.ring strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.ring strong small { margin-left: 1px; color: var(--muted); font-size: 10px; }
.ring.is-large { width: 92px; height: 92px; }
.ring.is-large strong { font-family: var(--font-display); font-size: 25px; font-weight: 600; }
.ring.is-large strong small { font-family: var(--font); font-size: 12px; }
.meter { display: flex; align-items: center; gap: 9px; min-width: 110px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.meter-bar i { display: block; width: calc(var(--v) * 100%); height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.meter.is-full .meter-bar i { background: var(--ok); }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tab { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 6px 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tab[aria-current="page"], .tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tab .icon, .tab .service-icon { width: 16px; height: 16px; }
.sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort:hover { color: var(--text); }
th[aria-sort="ascending"] .sort::after { content: "▲"; font-size: 8px; }
th[aria-sort="descending"] .sort::after { content: "▼"; font-size: 8px; }
details > summary { color: var(--accent); font-weight: 600; cursor: pointer; }

/* Filter menu */
.filter-menu { position: relative; }
.filter-menu > summary { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; user-select: none; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary:hover { color: var(--text); }
.filter-menu.is-active > summary { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.filter-menu-list { position: absolute; top: calc(100% + 5px); left: 0; z-index: 20; display: grid; min-width: 210px; max-height: 320px; padding: 5px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: var(--shadow); }
.filter-menu-list button { position: relative; padding: 7px 10px 7px 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.filter-menu-list button:hover { background: var(--surface-3); }
.filter-menu-list button[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.filter-menu-list button[aria-checked="true"]::before { content: "✓"; position: absolute; left: 10px; }

/* Dialogs */
dialog { padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4, 8, 18, .6); backdrop-filter: blur(3px); }
.form-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px; overflow-y: auto; }
.form-dialog > p { margin-bottom: 16px; }
.member-picker { display: grid; gap: 12px; }
.function-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.function-choices { display: flex; flex-wrap: wrap; gap: 4px; min-width: 190px; margin: 0; padding: 0; border: 0; }
.function-choices label { position: relative; cursor: pointer; }
.function-choices input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.function-choices span { display: block; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.function-choices label:hover span { border-color: var(--accent); color: var(--text); }
.function-choices input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.function-choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.confirm { width: min(420px, calc(100vw - 32px)); padding: 22px; }
.confirm p { margin-bottom: 20px; }
.confirm h2 { margin-bottom: 16px; }
.confirm .field { margin-bottom: 8px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.palette { top: 12vh; width: min(560px, calc(100vw - 24px)); margin-top: 0; overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; min-height: 46px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.palette-results { max-height: min(52vh, 420px); padding: 6px; overflow-y: auto; }
.palette-group { padding: 8px 10px 4px; color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.palette-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.palette-item:hover { text-decoration: none; }
.palette-item span { color: var(--muted); font-size: 12px; }
.palette-item.is-active { background: var(--accent-soft); color: var(--accent); }
.palette-empty { padding: 22px; color: var(--muted); text-align: center; }

/* Home */
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.todo-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.todo-text { display: grid; flex: 1 1 220px; }
.week-status { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 1.15fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.week-status > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.week-status > .meter { width: 100%; min-width: 0; }
.week-status > .chip { justify-self: end; }
.feed { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.feed time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Calendar */
.cal-scroll { max-height: min(74vh, 860px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card > .cal-scroll { background: var(--bg); }
.cal { --hour-height: 56px; --cols-template: 52px repeat(7, minmax(108px, 1fr)); min-width: 820px; }
.cal-head, .cal-body, .cal-notes { display: grid; grid-template-columns: var(--cols-template); }
.cal-head { position: sticky; top: 0; z-index: 6; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-corner { position: sticky; left: 0; z-index: 2; background: var(--surface-2); }
.cal-day-head { display: grid; justify-items: center; gap: 3px; padding: 8px 6px 7px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cal-day-head strong { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--text); font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0; }
.cal-day-head.is-today { color: var(--accent); }
.cal-day-head.is-today strong { background: var(--accent-strong); color: var(--on-accent); }
.cal-day-head .btn { min-height: 22px; padding: 1px 8px; font-size: 10.5px; letter-spacing: .02em; text-transform: none; }
.eq { display: flex; align-items: flex-end; gap: 1px; width: 100%; max-width: 92px; height: 14px; }
.eq i { flex: 1; height: max(2px, calc(var(--v) * 100%)); border-radius: 1px; background: var(--ok); opacity: calc(.25 + var(--v) * .75); }
.cal-ruler, .cal-col { position: relative; height: calc(var(--hour-height) * var(--hours)); }
.cal-ruler { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.cal-ruler span { position: absolute; top: calc((var(--s) - var(--day-start)) / 60 * var(--hour-height)); right: 8px; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.cal-ruler span:first-child { transform: translateY(2px); }
.cal-ruler span:last-child { transform: translateY(calc(-100% - 2px)); }
.cal-col { border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour-height); }
.cal-col.is-today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.cal-col.is-editable { cursor: crosshair; }
.cal-col.is-unavailable { background-image: repeating-linear-gradient(135deg, var(--bad-soft) 0 8px, transparent 8px 16px); }
.cal-block { position: absolute; top: calc((var(--s) - var(--day-start)) / 60 * var(--hour-height) + 1px); left: calc(100% * var(--col, 0) / var(--cols, 1) + 3px); z-index: 2; width: calc(100% / var(--cols, 1) - 6px); height: calc((var(--e) - var(--s)) / 60 * var(--hour-height) - 3px); min-height: 18px; padding: 3px 7px; overflow: hidden; border-left: 3px solid var(--ok); border-radius: 6px; background: color-mix(in srgb, var(--ok) 20%, var(--surface)); color: var(--text); font-size: 11.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cal-block time, .cal-block-time { display: block; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.cal-block strong { display: block; }
.cal-block.is-own { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.cal-block.is-preview { z-index: 4; opacity: .75; pointer-events: none; }
.cal-block.is-invalid { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 28%, var(--surface)); }
.cal-block-name { display: block; width: 100%; min-height: 0; padding: 0 18px 0 0; border: 0; border-radius: 3px; background: transparent; font-size: 11.5px; font-weight: 600; }
.cal-block-name::placeholder { color: var(--muted); font-weight: 400; }
.cal-block-remove { position: absolute; top: 2px; right: 2px; display: grid; width: 18px; height: 18px; padding: 0; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.cal-block-remove:hover { background: var(--bad); color: #fff; }
.cal-block-resize { position: absolute; right: 0; bottom: 0; left: 0; height: 9px; cursor: ns-resize; touch-action: none; }
.cal-block-resize::after { content: ""; position: absolute; bottom: 2px; left: calc(50% - 10px); width: 20px; height: 3px; border-radius: 2px; background: var(--accent); opacity: .55; }
.cal-notes { border-top: 1px solid var(--line); background: var(--surface-2); }
.cal-notes > div { min-width: 0; padding: 6px; border-left: 1px solid var(--line); }
.cal-notes > div:first-child { position: sticky; left: 0; z-index: 2; display: grid; place-items: center; border-left: 0; background: var(--surface-2); color: var(--faint); font-size: 10.5px; }
.cal-notes input { width: 100%; min-height: 28px; padding: 3px 7px; font-size: 12px; }
.cal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--c); vertical-align: -1px; }
.slot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.slot-count { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-text { display: grid; min-width: 0; line-height: 1.35; }
.slot-text span { color: var(--muted); font-size: 12px; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.day-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.day-card h4 { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.day-card h4 span { color: var(--muted); font-size: 12px; font-weight: 400; }
.day-card ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.day-card li { display: grid; overflow-wrap: anywhere; }
.day-card li span { color: var(--muted); }

/* Permissions */
.matrix th, .matrix td { padding: 8px 12px; }
.matrix th:not(:first-child) { max-width: 130px; font-size: 10.5px; letter-spacing: .04em; text-align: center; white-space: normal; }
.matrix td:not(:first-child) { text-align: center; }
.perm { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.perm p { margin-top: 2px; color: var(--muted); font-size: 12.5px; }

/* Auth & errors */
.auth { position: relative; width: min(100%, 410px); margin: 0 auto; padding: 40px 36px 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.auth-logo { position: relative; width: 104px; margin: 0 auto 20px; }
.auth h1 { font-size: 30px; }
.auth h1 .auth-logo { width: 176px; margin-bottom: 0; }
.auth p { margin: 8px 0 24px; color: var(--muted); }
.auth .btn { width: 100%; min-height: 46px; }
.auth-code { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.auth-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.auth-actions .btn { width: auto; min-height: 38px; }
.dev-login { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.dev-login small { color: var(--faint); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.env-badge { padding: 1px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); font-size: 10px; font-weight: 700; letter-spacing: .08em; }

/* Supervision */
.monitor { --good: var(--ok); --warn-c: var(--warn); --bad-c: var(--bad); }
.monitor .card { margin: 0; }
.monitor h3 { display: flex; align-items: center; gap: 8px; }
.monitor h3 .icon, .monitor h3 .service-icon { color: var(--accent); }
.monitor-live { display: inline-flex; align-items: center; gap: 9px; padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.monitor-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.monitor-live[data-state="good"]::before { background: var(--good); animation: monitor-pulse 2s ease-out infinite; }
.monitor-live[data-state="error"]::before { background: var(--bad-c); }
@keyframes monitor-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } to { box-shadow: 0 0 0 9px transparent; } }
.monitor-hero { --state: var(--faint); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: center; gap: 18px 28px; margin-bottom: 16px; padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--state) 38%, var(--line)); border-radius: var(--radius); background: radial-gradient(560px 240px at 0 0, color-mix(in srgb, var(--state) 15%, transparent), transparent 72%), var(--surface); }
.monitor-hero[data-state="good"], .monitor-service[data-state="good"] { --state: var(--good); }
.monitor-hero[data-state="warning"], .monitor-service[data-state="warning"] { --state: var(--warn-c); }
.monitor-hero[data-state="error"], .monitor-service[data-state="error"] { --state: var(--bad-c); }
.monitor-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.monitor-orb { position: relative; display: grid; flex: 0 0 auto; width: 56px; height: 56px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--state) 16%, transparent); color: var(--state); }
.monitor-orb::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--state); border-radius: 50%; opacity: 0; animation: monitor-ring 2.6s ease-out infinite; }
.monitor-orb .icon { width: 26px; height: 26px; }
@keyframes monitor-ring { from { opacity: .55; transform: scale(.9); } to { opacity: 0; transform: scale(1.3); } }
.monitor-summary-text { display: grid; gap: 3px; min-width: 0; }
.monitor-summary-text strong { font-family: var(--font-display); font-size: clamp(19px, 2.2vw, 24px); font-weight: 600; line-height: 1.2; }
.monitor-summary-text span { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.monitor-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.monitor-service { --state: var(--faint); display: grid; gap: 9px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.monitor-service-icon { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.monitor-service-icon::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--state); box-shadow: 0 0 0 4px color-mix(in srgb, var(--state) 20%, transparent); }
.monitor-service small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.monitor-service strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.monitor [data-state="good"] { color: var(--good); }
.monitor [data-state="warning"] { color: var(--warn-c); }
.monitor [data-state="error"] { color: var(--bad-c); }
.monitor .monitor-hero[data-state], .monitor .monitor-service[data-state] { color: var(--text); }
.monitor .monitor-live { color: var(--muted); }
.monitor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.monitor-value { margin: 8px 0 4px; font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 600; font-variant-numeric: tabular-nums; }
.monitor-caption { min-height: 20px; color: var(--muted); font-size: 12px; }
.monitor-kpi { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.monitor-kpi > div { min-width: 0; }
.monitor-gauge { flex: 0 0 auto; width: 70px; height: 70px; color: var(--accent); transform: rotate(-90deg); }
.monitor-gauge circle { fill: none; stroke-width: 9; }
.gauge-track { stroke: var(--surface-3); }
.gauge-value { stroke: currentColor; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.monitor-value.is-compact { overflow: hidden; font-size: clamp(20px, 2.2vw, 25px); line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.monitor-spark { display: block; width: 100%; height: 22px; margin-top: 6px; }
.monitor-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.monitor-bar { height: 6px; overflow: hidden; border-radius: 4px; background: var(--surface-3); color: var(--accent); }
.monitor-bar i { display: block; height: 100%; border-radius: 4px; background: currentColor; transition: width .5s ease; }
.monitor-tabs { margin: 18px 0 0; }
.monitor-tabs .tab { flex: 1 0 auto; }
.monitor-tab-flag { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.monitor-panels > .is-wide { grid-column: 1 / -1; }
.monitor-cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 22px; }
.monitor-core { display: grid; grid-template-columns: 5.5em 1fr 4.5em; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.monitor-core span { color: var(--muted); }
.monitor-core b { font-weight: 600; text-align: right; }
.monitor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.monitor-stat { display: grid; gap: 2px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.monitor-stat span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.monitor-stat strong { overflow-wrap: anywhere; font-family: var(--font-display); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.monitor-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.monitor-action:first-of-type { padding-top: 0; }
.monitor-action:last-child { padding-bottom: 0; border: 0; }
.monitor-action strong { font-size: 13px; }
.monitor-action p { color: var(--muted); font-size: 12px; }
.monitor-action .monitor-result { grid-column: 1 / -1; margin: 0; }
.monitor-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.monitor-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.monitor-panel-head small { color: var(--muted); font-size: 11.5px; }
.monitor-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.monitor-controls label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.monitor-chart-wrap { position: relative; margin-top: 10px; }
.monitor-chart-wrap > span { position: absolute; left: 2px; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; pointer-events: none; }
.monitor-chart-wrap > span:first-of-type { top: 8px; }
.monitor-chart-wrap > span:last-of-type { bottom: 8px; }
.monitor-chart { display: block; width: 100%; height: 140px; overflow: hidden; color: var(--accent); touch-action: pan-y; cursor: crosshair; }
.monitor-chart .chart-grid { stroke: var(--line); stroke-width: 1; }
.monitor-chart polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.monitor-chart .chart-primary { stroke: var(--accent); }
.monitor-chart .chart-secondary { stroke: var(--gold); }
.monitor-chart .chart-cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.monitor-chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.monitor-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11.5px; }
.monitor-legend strong { color: var(--text); font-variant-numeric: tabular-nums; }
.monitor-legend span::before { content: ""; display: inline-block; width: 12px; height: 3px; margin: 0 6px 3px 0; background: var(--accent); }
.monitor-legend span + span::before { background: var(--gold); }
.monitor-list { display: grid; margin: 0; padding: 0; list-style: none; }
.monitor-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.monitor-list li:last-child { border: 0; }
.monitor-list span { min-width: 0; overflow-wrap: anywhere; }
.monitor-list small { color: var(--muted); }
.monitor-list b { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.monitor-list code { font-size: 12px; }
.monitor-list code + small { display: block; margin-top: 2px; }
.monitor-facts + #discord-teams, .monitor-facts + #automation-teams:not(:empty) { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.monitor-facts + .monitor-action { margin-top: 6px; border-top: 1px solid var(--line); }
.monitor-facts { margin: 0; }
.monitor-fact { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.monitor-fact:last-child { border: 0; }
.monitor-fact dt { color: var(--muted); }
.monitor-fact dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; text-align: right; }
.monitor-disk { padding: 12px 0; border-bottom: 1px solid var(--line); }
.monitor-disk:last-child { border: 0; }
.monitor-disk-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.monitor-disk p { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; }
.monitor-disk .monitor-bar { margin-top: 10px; }
.monitor-table { max-height: 350px; overflow: auto; }
.monitor-table thead { position: sticky; top: 0; background: var(--surface); }
.monitor-table td:last-child, .monitor-table th:last-child { text-align: right; }
#monitor-alerts { display: grid; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
#monitor-alerts:empty { margin: 0; }
#monitor-alerts li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-left: 3px solid var(--warn); border-radius: 6px; background: var(--warn-soft); color: var(--text); font-size: 12.5px; }
#monitor-alerts li[data-state="error"] { border-color: var(--bad); background: var(--bad-soft); }
#monitor-alerts button { flex: 0 0 auto; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
#monitor-alerts button:hover { text-decoration: underline; }
.monitor-note, .monitor-result, .monitor-empty { color: var(--muted); font-size: 12px; }
.monitor-note, .monitor-result { margin-top: 12px; }
.monitor-panel-head + .monitor-note { margin: -4px 0 12px; }
.monitor-result:empty { display: none; }

@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(280px, 86vw); height: auto; box-shadow: var(--shadow); transform: translateX(-102%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(4, 8, 18, .55); }
  .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .topbar .brand { flex: 1; padding: 0; }
  .topbar .brand .logo { width: 50px; margin: 0; }
  .main { padding-top: 20px; }
}
@media (max-width: 640px) {
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .card > .table-wrap { margin: 0 -16px -16px; }
  th, td { padding: 9px 10px; }
  .monitor-panels { grid-template-columns: minmax(0, 1fr); }
  .monitor-grid { grid-template-columns: minmax(0, 1fr); }
  .monitor-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-hero { padding: 18px 16px; }
  .auth { padding: 34px 22px 28px; }
  .cal { --hour-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
