/* Anytime Monitoring Center — "Command" design: dark sidebar, HUD stats, client tiles. */
:root {
  --bg: #eef2f8; --panel: #ffffff; --panel-2: #f7f9fc; --ink: #0d1526; --muted: #5d6b82; --line: #e1e7f0; --line-2: #cfd8e6;
  --side: #070d1a; --side-2: #0f1830; --side-ink: #c6d3ee; --accent: #2f6bff; --accent-2: #4f86ff; --accent-soft: #e6eeff; --cyan: #22d3ee;
  --red: #e11d48; --red-soft: #ffe4ea; --orange: #f97316; --orange-soft: #ffedd5; --amber: #d99a06; --amber-soft: #fff6dc; --green: #10b981; --green-soft: #dcfaf0;
  --violet: #8b5cf6; --radius: 14px; --shadow: 0 1px 2px rgba(13,21,38,.05), 0 8px 24px rgba(13,21,38,.06);
  --input: #ffffff;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 15px;
}
[data-theme="dark"] {
  --bg: #060b16; --panel: #0e1628; --panel-2: #121c33; --ink: #e6edfb; --muted: #8a9ab8; --line: #1d2945; --line-2: #2a3a5e;
  --accent-soft: #14244a; --red-soft: #3a1020; --orange-soft: #3a2108; --amber-soft: #2f2608; --green-soft: #0b2e24; --input: #0b1324;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell: sidebar + content ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--side) 0%, #0a1430 100%); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 16px 12px; z-index: 1000; border-right: 1px solid rgba(255,255,255,.05); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { display: block; font-size: 14px; letter-spacing: .02em; }
.brand span { display: block; font-size: 11px; color: #7f95c4; text-transform: uppercase; letter-spacing: .14em; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--side-ink); padding: 9px 11px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(47,107,255,.35), rgba(47,107,255,.08)); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.nav a.active svg { opacity: 1; color: var(--cyan); }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.badge.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(225,29,72,.28); } }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.side-foot .who { display: flex; align-items: center; gap: 9px; color: #fff; font-size: 14px; }
.side-foot .who:hover { text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, #2f6bff, #22d3ee); flex: none; }
.side-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-btn { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); color: #dbe6ff; border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 13px; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.mode-pill { background: #f59e0b; color: #111; font-weight: 800; font-size: 10.5px; padding: 3px 8px; border-radius: 6px; letter-spacing: .06em; align-self: flex-start; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.side .link-btn { color: #8fa6d6; font-size: 13px; text-align: left; }
.mobile-bar { display: none; }
main { padding: 26px 30px; max-width: 1500px; width: 100%; }
main.full { padding: 0; max-width: none; }

/* ---------- layout ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; background: var(--input); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 74px; resize: vertical; }
.field { margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 14px; }
.fields .wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); margin: 0 12px 0 0; }
.check input { width: auto; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 650;
  cursor: pointer; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; white-space: nowrap; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 12px rgba(47,107,255,.25); }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn.secondary:hover { background: var(--panel-2); }
.btn.danger { background: linear-gradient(180deg, #f43f5e, var(--red)); box-shadow: 0 4px 12px rgba(225,29,72,.25); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--accent-soft); }
.c { text-align: center; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
.owed { color: var(--red); font-weight: 750; }

/* ---------- status ---------- */
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px var(--green-soft); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); } .dot.crit { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); } .dot.off { background: #94a3b8; box-shadow: none; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 750; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.critical, .tag.open { background: var(--red-soft); color: var(--red); border-color: transparent; }
.tag.serious { background: var(--orange-soft); color: #c2410c; border-color: transparent; }
.tag.warning, .tag.acknowledged { background: var(--amber-soft); color: #9a6a00; border-color: transparent; }
.tag.resolved, .tag.ok { background: var(--green-soft); color: #047857; border-color: transparent; }
.tag.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.message { background: var(--panel-2); color: var(--muted); }
[data-theme="dark"] .tag.serious { color: #fdba74; } [data-theme="dark"] .tag.warning, [data-theme="dark"] .tag.acknowledged { color: #fcd34d; }
[data-theme="dark"] .tag.resolved, [data-theme="dark"] .tag.ok { color: #6ee7b7; } [data-theme="dark"] .tag.critical, [data-theme="dark"] .tag.open { color: #fda4af; }

/* ---------- HUD stats ---------- */
.hud { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); text-align: left; font: inherit; color: var(--ink); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--accent)); }
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.stat.on { outline: 2px solid var(--k, var(--accent)); }
.stat.hot .n { color: var(--red); }

/* ---------- client tiles ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.tile.crit { border-color: rgba(225,29,72,.55); box-shadow: 0 0 0 3px var(--red-soft), var(--shadow); }
.tile.warn { border-color: rgba(217,154,6,.5); }
.tile-head { display: flex; gap: 11px; align-items: center; padding-right: 44px; }
.tile-head .avatar { width: 42px; height: 42px; font-size: 15px; border-radius: 12px; background: linear-gradient(135deg, #1e3a8a, #2f6bff); }
.tile.crit .tile-head .avatar { background: linear-gradient(135deg, #9f1239, #e11d48); }
.tile.warn .tile-head .avatar { background: linear-gradient(135deg, #a16207, #f59e0b); }
.tile.off .tile-head .avatar { background: #94a3b8; }
.tile-head .nm { font-weight: 750; font-size: 15px; color: var(--ink); }
.tile-head .sub { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 7px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--green-soft); color: #047857; }
.chip svg { width: 14px; height: 14px; }
.chip.yellow { background: var(--amber-soft); color: #9a6a00; } .chip.red { background: var(--red-soft); color: var(--red); animation: pulse 1.4s infinite; } .chip.off { background: var(--panel-2); color: var(--muted); }
[data-theme="dark"] .chip { color: #6ee7b7; } [data-theme="dark"] .chip.yellow { color: #fcd34d; } [data-theme="dark"] .chip.red { color: #fda4af; }
.tile-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); gap: 8px; }
.tile-actions { display: flex; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
.tile-actions .btn { flex: 1; justify-content: center; }
.flags { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 650; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

/* battery */
.batt { display: inline-flex; align-items: center; gap: 2px; }
.batt .bshell { position: relative; width: 46px; height: 17px; border: 2px solid var(--muted); border-radius: 5px; overflow: hidden; background: var(--panel); }
.batt .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); }
.batt .fill.mid { background: #f59e0b; } .batt .fill.low { background: var(--red); }
.batt .pct { position: absolute; inset: 0; font-size: 10px; font-weight: 800; text-align: center; line-height: 13px; color: var(--ink); }
.batt .nub { width: 3px; height: 7px; background: var(--muted); border-radius: 0 2px 2px 0; }
.sdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.sdot.yellow { background: #f59e0b; } .sdot.red { background: var(--red); } .sdot.off { background: #94a3b8; }
.row-menu-btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 9px; cursor: pointer; padding: 4px 9px; color: var(--ink); font-weight: 800; }
.menu-pop { position: absolute; z-index: 2500; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(13,21,38,.22); padding: 6px; min-width: 230px; }
.menu-pop button, .menu-pop a { display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px 11px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--accent-soft); text-decoration: none; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

/* ---------- timeline drawer ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(6,11,22,.45); z-index: 2600; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 2601; box-shadow: -20px 0 50px rgba(0,0,0,.25);
  display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 14px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.x-btn { border: 0; background: var(--panel-2); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--ink); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pill.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px 42px; }
.tl-item .ico { position: absolute; left: 4px; top: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 2px solid var(--line-2); font-size: 12px; }
.tl-item.critical .ico { background: var(--red); border-color: var(--red-soft); color: #fff; }
.tl-item.serious .ico { background: var(--orange); border-color: var(--orange-soft); color: #fff; }
.tl-item.warning .ico { background: #f59e0b; border-color: var(--amber-soft); color: #fff; }
.tl-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.tl-card input { margin-top: 3px; }
.tl-card .t { font-weight: 750; }
.tl-card .when { font-size: 12px; color: var(--muted); }

/* ---------- live map ---------- */
.live { display: grid; grid-template-columns: 340px 1fr; height: 100vh; }
.live-side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.live-side .head { padding: 14px; border-bottom: 1px solid var(--line); }
.live-list { overflow-y: auto; flex: 1; }
.live-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.live-item:hover { background: var(--panel-2); }
.live-item.selected { background: var(--accent-soft); }
.live-item .name { font-weight: 700; }
.live-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.live-item .dot { margin-top: 5px; }
.live-map { position: relative; min-height: 0; }
.map { width: 100%; height: 100%; min-height: 300px; border-radius: var(--radius); }
.live-map .map { border-radius: 0; }
.client-card { position: absolute; z-index: 600; right: 14px; top: 14px; width: 340px; max-height: calc(100% - 28px); overflow-y: auto; }
.client-card .close { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.alert-strip { position: absolute; z-index: 600; left: 14px; top: 14px; max-width: 440px; }
.alert-mini { background: var(--panel); border-left: 5px solid var(--red); border-radius: 10px; box-shadow: var(--shadow); padding: 9px 12px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.alert-mini.warning { border-left-color: #f59e0b; } .alert-mini.serious { border-left-color: var(--orange); }
.sim { border-top: 1px dashed #f59e0b; margin-top: 12px; padding-top: 10px; }

/* ---------- alerts ---------- */
.alert-row { display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: start; }
.alert-row .bar { align-self: stretch; border-radius: 4px; background: var(--red); }
.alert-row.warning .bar { background: #f59e0b; } .alert-row.serious .bar { background: var(--orange); } .alert-row.resolved .bar { background: #94a3b8; }
.alert-row + .alert-row { margin-top: 12px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 13px; color: var(--muted); font-size: 14px; font-weight: 650; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* ---------- zones ---------- */
.zone-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.zone-swatch { width: 14px; height: 14px; border-radius: 5px; margin-top: 3px; flex: none; }
.window-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px; background: var(--panel-2); border-radius: 10px; margin-bottom: 8px; }
.window-row input[type=time] { width: 124px; }
.days { display: flex; gap: 4px; }
.days label { margin: 0; }
.days input { display: none; }
.days span { display: inline-block; width: 36px; text-align: center; padding: 5px 0; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-weight: 700; cursor: pointer; font-size: 12px; }
.days input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- replay ---------- */
.playback { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.playback input[type=range] { flex: 1; }
#htable tr.selected td { background: var(--accent-soft); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 15% 10%, rgba(47,107,255,.45), transparent 60%), radial-gradient(700px 400px at 90% 90%, rgba(34,211,238,.25), transparent 60%), #050a15; }
.login-card { width: 100%; max-width: 390px; }
.login-card .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-card .logo img { width: 44px; }
.error { color: var(--red); font-size: 14px; margin: 8px 0; }

/* ---------- toasts + dialogs ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0d1526; color: #fff; padding: 11px 15px; border-radius: 12px; box-shadow: var(--shadow); max-width: 380px; font-size: 14px; border: 1px solid rgba(255,255,255,.08); }
.toast.err { background: var(--red); }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(480px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.35); background: var(--panel); color: var(--ink); }
dialog.wide { width: min(980px, 96vw); }
dialog::backdrop { background: rgba(6,11,22,.55); }
dialog form { padding: 20px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- switches (alert routing) ---------- */
.route-group { margin-bottom: 16px; }
.route-group h3 { display: flex; align-items: center; gap: 8px; }
.route-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 650; margin: 0; cursor: pointer; }
.switch input { display: none; }
.switch i { width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { left: 18px; }

/* ---------- client page ---------- */
.client-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.client-head .photo { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; background: linear-gradient(135deg, #1e3a8a, #2f6bff); display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 800; }
.suspend-banner { background: var(--amber-soft); border: 1px solid #f5c542; color: #8a5a00; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
[data-theme="dark"] .suspend-banner { color: #fcd34d; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 800; margin: 10px 0 10px; grid-column: 1 / -1; }
.report-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.report-list a { display: block; padding: 8px 11px; border-radius: 9px; color: var(--ink); font-size: 14px; }
.report-list a.active { background: var(--accent); color: #fff; }
.report-list a:hover { text-decoration: none; background: var(--accent-soft); }
.report-list a.active:hover { background: var(--accent); }
.photo-big { width: 180px; height: 180px; object-fit: cover; border-radius: 18px; background: var(--panel-2); display: grid; place-items: center; font-size: 60px; color: var(--muted); }

/* ---------- map markers ---------- */
.pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); background: var(--green); }
.pin.warn { background: #f59e0b; } .pin.crit { background: var(--red); animation: pulse 1.2s infinite; } .pin.off { background: #94a3b8; }
.pin-label { background: rgba(7,13,26,.88); color: #fff; border: 0; border-radius: 7px; padding: 2px 7px; font-size: 12px; font-weight: 650; box-shadow: none; }
.pin-label::before { display: none; }

@media (max-width: 1200px) { .hud { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 900; background: var(--side); color: #fff; padding: 10px 14px; }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
  .live { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .live-map { order: -1; height: 55vh; }
  .client-card { position: static; width: auto; max-height: none; margin: 10px; }
  .grid2, .grid3, .report-layout { grid-template-columns: 1fr !important; }
  main { padding: 14px; }
  .hud { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .side, .mobile-bar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .report-layout { display: block; }
}
.logged-out .shell { display: block; }
.logged-out .side, .logged-out .mobile-bar { display: none !important; }
