:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f1f3f6;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #17202b;
  --muted: #5d6877;
  --faint: #8a94a3;
  --accent: #0f766e;
  --accent-hover: #0b5f58;
  --accent-soft: #e3f3f1;
  --ok: #15803d;
  --ok-soft: #e5f5ea;
  --warn: #b45309;
  --warn-soft: #fdf1df;
  --bad: #b91c1c;
  --bad-soft: #fde8e8;
  --info: #1d4ed8;
  --info-soft: #e6edfd;
  --side: #10181f;
  --side-text: #b9c3cd;
  --side-active: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 16px rgba(16, 24, 32, .06);
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --panel: #151b23;
    --panel-2: #1b222c;
    --border: #262f3b;
    --border-strong: #354151;
    --text: #e4e9ef;
    --muted: #9aa6b4;
    --faint: #6f7b89;
    --accent: #2bb3a6;
    --accent-hover: #3cc9bb;
    --accent-soft: #12302e;
    --ok: #4ade80;
    --ok-soft: #12291b;
    --warn: #f59e0b;
    --warn-soft: #2e2311;
    --bad: #f87171;
    --bad-soft: #321718;
    --info: #7aa2ff;
    --info-soft: #172241;
    --side: #0a0e13;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* layout */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; font-size: 16px; padding: 4px 10px 18px; letter-spacing: .2px; }
.brand svg, .brand .logo { flex: none; }
.logo { display: block; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.login .logo-big { margin: 0 0 4px; }
.brand small { display: block; font-weight: 400; color: var(--side-text); font-size: 11.5px; opacity: .8; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7785; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 7px 10px; border-radius: 6px; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(43,179,166,.16); color: var(--side-active); }
.nav a .count { margin-left: auto; background: #b91c1c; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot a { color: var(--side-text); }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 0; }
.topbar h1 { font-size: 21px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.content { padding: 18px 28px 48px; }
.mobile-nav { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; z-index: 50; width: 240px; }
  .mobile-nav { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}

/* components */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-b { padding: 14px 16px; }
.card + .card, .grid + .card, .card + .grid { margin-top: 16px; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid > .card { margin-top: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } .g4 .stat .value { font-size: 22px; } }

.stat { padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }
.stat .hint { font-size: 12px; color: var(--faint); }
.stat.ok .value { color: var(--ok); } .stat.bad .value { color: var(--bad); } .stat.warn .value { color: var(--warn); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 550; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
td .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=email], input[type=search], input[type=date], select, textarea {
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
textarea { font-family: var(--mono); font-size: 12.5px; width: 100%; min-height: 160px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .help { font-size: 12px; color: var(--faint); }
.field input, .field select { width: 100%; }
.field input[type=checkbox], .field input[type=radio] { width: auto; flex: none; }
.field label.check { display: flex; font-weight: 400; text-transform: none; letter-spacing: 0; color: inherit; margin-bottom: 6px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin-bottom: 10px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }
.hbar { display: grid; grid-template-columns: 1fr 120px 40px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.hbar .bar { height: 7px; }

pre.out { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.copy-block { position: relative; }
.copy-block pre { padding-right: 70px; }
.copy-block .btn { position: absolute; top: 6px; right: 6px; }

.check-list .item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.check-list .item:last-child { border-bottom: 0; }
.check-list .item .t { font-weight: 550; }
.check-list .item .d { color: var(--muted); font-size: 12.5px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 12, 18, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 560px; max-width: 100%; border: 1px solid var(--border); }
.modal.wide { width: 860px; }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 15px; flex: 1; }
.modal-b { padding: 16px 18px; max-height: 70vh; overflow-y: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 380px; animation: tin .18s ease-out; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 360px; padding: 26px; }
.login h1 { font-size: 19px; margin: 12px 0 4px; }
.login p { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.err-text { color: var(--bad); font-size: 13px; margin-bottom: 10px; }

.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.rule-box { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--panel-2); }
.rule-box .head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.rule-box .head select { flex: 1; }
.pill-input { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.callout { border-left: 3px solid var(--info); background: var(--info-soft); padding: 10px 12px; border-radius: 4px; font-size: 13px; margin-bottom: 14px; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.bad { border-color: var(--bad); background: var(--bad-soft); }
.selbar { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.icon { width: 16px; height: 16px; }

.bad { color: var(--bad); }

/* ---- elements with the hidden attribute stay hidden, whatever their display style ---- */
[hidden] { display: none !important; }

/* ---- buttons with icons ---- */
.btn svg { width: 15px; height: 15px; flex: none; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
select.sm { padding: 3px 6px; font-size: 12.5px; height: 28px; }
.dot.bad { background: var(--bad); }
.right-align { text-align: right; }

/* ---- remote desktop ---- */
.rd-wrap { display: flex; flex-direction: column; gap: 10px; }
.rd-wrap.fs { background: #0b0d10; padding: 8px; height: 100vh; }
.rd-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.rd-bar .spacer { flex: 1; }
.rd-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rd-screen { position: relative; height: calc(100vh - 190px); min-height: 320px; background: #0b0d10; border-radius: var(--radius); overflow: hidden; }
.rd-wrap.fs .rd-screen { height: auto; flex: 1; }
.rd-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #c9d1d9; font-size: 14px; text-align: center; padding: 20px; z-index: 2; }
.rd-msg[hidden] { display: none; }
.rd-clip { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.rd-clip textarea { min-height: 70px; font-family: inherit; }
.rd-clip pre { max-height: 120px; overflow: auto; }

/* ---- files ---- */
.files-bar { flex-wrap: wrap; gap: 6px; }
.files-path { flex: 1; min-width: 200px; }
.files-path input { width: 100%; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
.fname { display: inline-flex; align-items: center; gap: 8px; }
.fname svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
a.fname svg { color: var(--accent); }
table.files td { padding-top: 6px; padding-bottom: 6px; }

/* ---- chat ---- */
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 240px); min-height: 360px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.chat-msg.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.chat-msg .who { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.chat-msg .txt { white-space: pre-wrap; word-wrap: break-word; }
.chat-msg .tick { margin-left: 4px; }
.chat-msg .tick.ok { color: var(--ok, #12805c); }
.chat-sys { align-self: center; font-size: 12.5px; color: var(--muted); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; min-height: 44px; height: 44px; resize: vertical; font-family: inherit; }
@media (max-width: 700px) {
  .rd-screen { height: 60vh; }
  .chat-msg { max-width: 90%; }
}

.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tr-path { min-width: 220px; }
.tr-path .mono { word-break: break-all; }

/* ---- remote desktop in its own window (one monitor per window) ---- */
body.popup .side, body.popup .topbar { display: none; }
body.popup .shell { display: block; }
body.popup .main, body.popup .content { padding: 0; margin: 0; max-width: none; }
body.popup .rd-wrap { height: 100vh; gap: 0; }
body.popup .rd-bar { border-radius: 0; border-width: 0 0 1px; padding: 5px 8px; }
body.popup .rd-screen { height: auto; flex: 1; border-radius: 0; }
.dot.warn { background: var(--warn, #b54708); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--border); }
.seg input { margin: 0; }

.totp-qr { width: 220px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.totp-qr svg { display: block; width: 100%; height: auto; }

.notes { white-space: pre-wrap; word-break: break-word; }
a.card.stat { color: inherit; text-decoration: none; }
#af-notes { font-family: inherit; font-size: 13.5px; min-height: 72px; }

/* ---- tracking: fleet view ---- */
.fleet { background: #141414; border-radius: 20px; padding: 18px 18px 14px; color: #ddd; }
.fleet-map { background: #3b3b3b; border-radius: 14px; overflow: hidden; line-height: 0; }
.fleet-map svg { width: 100%; height: auto; display: block; }
.fm-land { fill: #4a4a4a; stroke: #565656; stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fm-border { fill: none; stroke: #3d3d3d; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.fm-wrap { position: relative; }
.fleet-map svg { cursor: grab; user-select: none; -webkit-user-select: none; }
.fleet-map.panning svg { cursor: grabbing; }
.fm-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 1px; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.35); line-height: 1; }
.fm-zoom button { width: 34px; height: 34px; border: 0; background: #1c1c1c; color: #e6e6e6; font: 600 18px var(--mono); cursor: pointer; padding: 0; }
.fm-zoom button:hover:not(:disabled) { background: #2a2a2a; color: #fff; }
.fm-zoom button:disabled { color: #5b5b5b; cursor: default; }
.fm-zoom button:focus-visible { outline: 2px solid #86e08f; outline-offset: -2px; }
.fm-title { fill: #b9b9b9; font: 500 26px var(--mono); letter-spacing: 2px; }
.fm-dot { fill: #7ee08a; cursor: pointer; }
.fm-dot.warn { fill: #e9b949; }
.fm-dot.bad { fill: #e0245e; stroke: rgba(224,36,94,.35); stroke-width: 10; }
.fm-dot:hover { stroke: #fff; stroke-width: 3; }
.fm-site, .fm-review { cursor: pointer; }
.fm-diamond { fill: none; stroke: #4fc760; stroke-width: 3; }
.fm-lead { stroke: #4fc760; stroke-width: 2; fill: none; }
.fm-lead.bad { stroke: #e0245e; }
.fm-pill { fill: #86e08f; }
.fm-pill.bad { fill: #1c1c1c; stroke: #e0245e; stroke-width: 2.5; }
.fm-pill-t { fill: #102a14; font: 600 26px var(--mono); letter-spacing: 2px; text-anchor: middle; }
.fm-pill-t.bad { fill: #fff; }
.fm-site:hover .fm-pill { fill: #a5ecac; }
.fleet-legend { display: flex; flex-wrap: wrap; gap: 8px 30px; padding: 16px 6px 2px; font: 600 13.5px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: #e6e6e6; }
.fleet-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; vertical-align: 0; }
.fl-ok { background: #4fc760; } .fl-warn { background: #e0b020; } .fl-none { background: #555; } .fl-bad { background: #e0245e; }

/* ---- tracking: device list ---- */
.fleet-list { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; background: color-mix(in srgb, var(--text) 5%, var(--panel)); }
.chip { font: inherit; font-size: 15px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--text); color: var(--panel); border-color: var(--text); font-weight: 600; }
.chip.review { border-color: #e0245e; color: var(--text); font-weight: 600; }
.chip.review i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e0245e; margin-right: 8px; vertical-align: 1px; }
.chip.review.on { background: #e0245e; color: #fff; }
.chip.review.on i { background: #fff; }
.fleet-search { padding: 0 16px 12px; background: color-mix(in srgb, var(--text) 5%, var(--panel)); }
.fleet-search input { width: min(420px, 100%); }
.fleet-table th { font: 600 11.5px var(--mono); letter-spacing: 1.4px; line-height: 1.5; vertical-align: bottom; padding-top: 14px; padding-bottom: 10px; }
.fleet-table td { padding-top: 14px; padding-bottom: 14px; font-size: 14.5px; vertical-align: top; }
.fleet-table .sub2 { color: var(--muted); margin-top: 2px; }
.fleet-table .flag { color: #d0164f; font-size: 12.5px; margin-top: 3px; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: 1px; background: #8a8a8a; }
.sdot.online { background: #1f9d3a; } .sdot.offline { background: var(--text); } .sdot.idle { background: #8a8a8a; } .sdot.bad { background: #e0245e; }

/* ---- tracking: device location ---- */
.loc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.loc-status { color: var(--muted); }
.loc-status.bad { color: #c8174a; }
.loc-map-wrap { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #e8e8ea; }
.loc-map { height: 560px; }
.loc-map .leaflet-tile-pane { filter: grayscale(1) contrast(.82) brightness(1.06); }
.loc-card { position: absolute; top: 24px; right: 24px; z-index: 500; width: 360px; max-width: calc(100% - 48px); background: #fff; color: #1b1b1b; border-radius: 16px; padding: 22px 24px 18px; box-shadow: 0 6px 30px rgba(0,0,0,.14); border: 1px solid #e3e3e3; }
.lc-t { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.lc-u { font: 500 13px var(--mono); letter-spacing: 1.6px; color: #555; margin-top: 2px; }
.lc-a { font-size: 17px; line-height: 1.5; margin: 12px 0 10px; }
.lc-kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.lc-kv td { padding: 6px 0; border-bottom: 1px solid #e6e6e6; color: #444; }
.lc-kv td + td { font-family: var(--mono); font-size: 13px; color: #222; text-align: right; padding-left: 12px; }
.lc-s { color: #c8174a; margin-top: 12px; font-size: 14.5px; line-height: 1.45; }
.lc-links { margin-top: 10px; font-size: 13px; }
.lc-links a { color: #3b4fe4; }
.loc-hist { position: absolute; left: 24px; bottom: 24px; z-index: 500; background: #fff; color: #1b1b1b; border-radius: 14px; padding: 12px 16px 10px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.12); border: 1px solid #e3e3e3; }
.lh-t, .lh-s { font: 500 13px var(--mono); letter-spacing: 1.6px; color: #444; }
.lh-b { display: flex; gap: 8px; margin: 8px 0; justify-content: center; }
.lh-btn { min-width: 48px; height: 40px; border-radius: 8px; border: 1px solid #cfcfcf; background: #fff; color: #111; font-size: 15px; cursor: pointer; }
.lh-btn.now { min-width: 86px; font-weight: 700; font-size: 16px; }
.lh-btn:disabled { opacity: .35; cursor: default; }
.lh-btn:not(:disabled):hover { background: #f2f2f2; }
.leaflet-container { font: inherit; }
.site-row { display: grid; grid-template-columns: 1.2fr 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .loc-map .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(.85) brightness(.9); }
}
:root[data-theme="dark"] .loc-map .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(.85) brightness(.9); }
@media (max-width: 700px) {
  .loc-map { height: 420px; }
  .loc-card { position: static; width: auto; max-width: none; border-radius: 0; box-shadow: none; border: 0; border-top: 1px solid #e3e3e3; }
  .loc-hist { left: 12px; bottom: auto; top: 12px; padding: 8px 10px; }
  .fleet { padding: 10px; border-radius: 14px; }
  .fm-zoom { right: 6px; top: 6px; border-radius: 7px; }
  .fm-zoom button { width: 26px; height: 24px; font-size: 14px; }
  .fleet-legend { gap: 6px 16px; font-size: 11.5px; }
  .site-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .fleet-table th:nth-child(3), .fleet-table td:nth-child(3), .fleet-table th:nth-child(6), .fleet-table td:nth-child(6) { display: none; }
  .chips { padding: 12px; gap: 8px; } .chip { font-size: 13.5px; padding: 6px 12px; }
}
/* ---- HTTPS certificate card ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 8px 4px 0; }
.tbl td { padding: 4px 8px 4px 0; vertical-align: middle; overflow-wrap: anywhere; }
.ok-text { color: var(--ok); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.rd-body { display: flex; gap: 10px; align-items: stretch; }
.rd-body .rd-screen { flex: 1; min-width: 0; }
.rd-wrap.fs .rd-body { flex: 1; min-height: 0; }
.rd-files { width: 470px; max-width: 45%; flex: none; height: calc(100vh - 190px); min-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.rd-files[hidden] { display: none; }
.rd-wrap.fs .rd-files { height: auto; }
.rd-files .card { margin: 0; }
.rd-files .files-bar { flex-wrap: wrap; }
.rd-files .files-path { flex: 1 1 100%; order: 10; }
.rd-files .tr-path .mono { word-break: break-all; }
.rd-drop { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(46, 125, 230, .28); border: 3px dashed #7fb2ff; border-radius: var(--radius); color: #fff; font-size: 20px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; }
.rd-drop[hidden], .rd-sending[hidden] { display: none; }
.rd-sending { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; background: rgba(13, 17, 23, .88); color: #e6edf3; padding: 8px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; }
@media (max-width: 800px) { .rd-body { flex-direction: column; } .rd-files { width: auto; max-width: none; height: auto; } }
.rd-files .tr-path { max-width: 170px; }
.rd-files #f-tr td { padding-left: 8px; padding-right: 8px; }
