@font-face { font-family: "Lato"; font-weight: 300; font-display: swap; src: url("./fonts/lato-300.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("./fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("./fonts/lato-700.woff2") format("woff2"); }

:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --tint1: #f7f8fa;
  --tint2: #f1f4f6;
  --border: #e6e9ec;
  --border-strong: #d6dade;
  --ink: #1f2933;
  --muted: #7b8794;
  --faint: #aeb6bf;
  --accent: #006fff;
  --accent-soft: #eaf2ff;
  --link: #0559c9;
  --green: #12b76a;
  --amber: #f79009;
  --red: #f04438;
  --grey: #b7bec6;
  --topbar: 50px;
  --rail: 50px;
  --sidepanel: 232px;
  --appbar: 26px;
  --detail: 356px;
  --font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 13px/1.35 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select { font: inherit; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
svg { display: block; }

/* buttons */
.btn { border: 1px solid var(--border-strong); background: #fff; border-radius: 5px; padding: 6px 12px; font-weight: 600; }
.btn:hover { background: #f2f4f6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0063e6; }
.btn.block { width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #d92d20; }
.btn:disabled { opacity: .55; cursor: default; }

/* login */
.login-wrap { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 24px rgba(20,30,45,.07); padding: 26px; width: 312px; }
.login-logo { width: 40px; height: 40px; border-radius: 9px; background: url("./favicon.svg") center/cover no-repeat; margin-bottom: 14px; }
.login-card h1 { margin: 0 0 2px; font-size: 19px; }
.login-card .sub { margin: 0 0 20px; color: var(--muted); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .sp-search input { width: 100%; padding: 8px 10px; font: inherit; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; }
.field input:focus, .sp-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.err { color: var(--red); font-size: 12px; margin: 9px 0 0; min-height: 15px; }

/* shell grid — the footer is its own row, so scrolling content ends above it
   instead of running underneath and getting clipped mid-row. */
#shell { display: grid; height: 100vh; position: relative;
  grid-template-columns: var(--rail) var(--sidepanel) 1fr;
  grid-template-rows: var(--topbar) 1fr var(--appbar); }
#rail { grid-row: 1 / 4; grid-column: 1; }
#topbar { grid-row: 1; grid-column: 2 / 4; }
#sidepanel { grid-row: 2; grid-column: 2; }
#content { grid-row: 2; grid-column: 3; }
#appbar { grid-row: 3; grid-column: 2 / 4; }

/* App footer: version (opens the changelog) on the left, credit on the right. */
#appbar { display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 11px; color: var(--muted); background: var(--tint2);
  border-top: 1px solid var(--border); box-shadow: 0 -1px 3px rgba(16,24,40,.05); z-index: 4; }
#appbar-ver { background: none; border: 0; padding: 0; font: inherit; color: var(--muted);
  cursor: pointer; }
#appbar-ver:hover { color: var(--ink); text-decoration: underline; }
#appbar-credit { opacity: .85; }
/* Softens the cut where the scroll area meets the bar. */
#content-fade { position: absolute; left: calc(var(--rail) + var(--sidepanel)); right: 0;
  bottom: var(--appbar); height: 22px; pointer-events: none; z-index: 3;
  background: linear-gradient(to bottom, transparent, var(--panel)); }

/* rail */
#rail { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 0 0 8px; gap: 6px; z-index: 3; }
.rail-logo { width: 100%; height: var(--topbar); background: url("./logo.svg") center/cover no-repeat; border-bottom: 1px solid var(--border); margin-bottom: 4px; flex: 0 0 auto; }
.rail-avatar { width: 31px; height: 31px; border-radius: 50%; border: 1px solid var(--border-strong); background: #fff; font-weight: 700; font-size: 12px; margin-bottom: 3px; }
.rail-avatar:hover { border-color: var(--accent); color: var(--accent); }
.rail-nav { display: flex; flex-direction: column; gap: 3px; }
.rail-icon { width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.rail-icon svg { width: 19px; height: 19px; }
.rail-icon:hover { background: #f0f2f4; color: var(--ink); }
.rail-icon.active { background: var(--accent-soft); color: var(--accent); }

/* topbar */
#topbar { background: var(--tint2); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 12px; z-index: 2; }
.tb-title { font-size: 14px; font-weight: 700; }
.tb-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.tb-spacer { flex: 1; }
.tb-user { position: relative; }
#user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; font-weight: 600; }
#user-btn:hover { background: #f2f4f6; }
.tb-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.tb-menu { position: absolute; right: 0; top: 40px; width: 190px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 24px rgba(20,30,45,.12); overflow: hidden; z-index: 20; }
.tb-menu-head { padding: 11px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.tb-menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; font-weight: 600; }
.tb-menu-item:hover { background: #f2f4f6; }
.tb-menu-ver { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.tb-menu-ver.clickable { cursor: pointer; }
.tb-menu-ver.clickable:hover { background: #f2f4f6; color: var(--accent); }

/* changelog */
.cl-panel { width: min(760px, 92vw); }
.cl-body { max-height: 72vh; overflow-y: auto; }
.cl-body h2 { font-size: 17px; margin: 0 0 10px; }
.cl-body h3 { font-size: 15px; margin: 22px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.cl-body h3:first-child { margin-top: 0; }
.cl-body h4 { font-size: 12px; margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cl-body p { margin: 6px 0; line-height: 1.55; }
.cl-body ul, .cl-body ol { margin: 4px 0 10px; padding-left: 20px; }
.cl-body li { margin: 4px 0; line-height: 1.55; }
.cl-body code { font-family: var(--mono); font-size: 11.5px; background: var(--tint2); padding: 1px 4px; border-radius: 3px; }
.cl-body a { color: var(--link); }

/* sidepanel */
#sidepanel { background: var(--panel); border-right: 1px solid var(--border); overflow-y: auto; }
.sp-head { padding: 11px 15px 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sp-head h1 { margin: 0; font-size: 16px; font-weight: 700; }
.sp-search { padding: 2px 12px 8px; }
.sp-filters { padding: 2px 5px 10px; }
.filter-group { padding: 5px 10px; }
.filter-group h4 { margin: 0 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.filter-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 5px; cursor: pointer; }
.filter-row:hover { background: #f2f4f6; }
.filter-row.on { background: var(--accent-soft); }
.filter-row .lbl { flex: 1; }
.filter-row .cnt { color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-row .dot { width: 7px; height: 7px; border-radius: 50%; }

/* content + table */
/* Room at the bottom so the floating + never covers the last row's actions —
   it hovers over empty space instead, and you can always scroll past it. */
#content { overflow: auto; background: var(--panel); padding-bottom: 78px; }
.empty { padding: 48px; text-align: center; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 8px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tbody td { padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--panel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tbody tr.sel td { background: var(--accent-soft); }
.tbl .name { font-weight: 600; }
.tbl .name-wrap { display: flex; align-items: center; gap: 8px; }
.tbl .sub { color: var(--muted); font-size: 11px; font-weight: 400; }
.td-mono { font-family: var(--mono); font-size: 12px; }
.td-date { color: var(--muted); white-space: nowrap; }

/* last seen: date over time */
.td-seen .seen-d { color: var(--ink); }
.td-seen .seen-t { color: var(--muted); font-size: 11px; }

/* editable location cell */
.th-loc { width: 150px; }
.td-loc { max-width: 170px; }
.loc-cell { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding: 2px 6px; margin: -2px -6px; border-radius: 5px; cursor: text;
  border: 1px solid transparent; }
.loc-cell:hover { border-color: var(--border-strong); background: #fff; }
.loc-cell.empty { color: var(--border-strong); font-style: italic; }
.loc-input { width: 100%; box-sizing: border-box; font: inherit; padding: 3px 6px;
  border: 1px solid var(--accent); border-radius: 5px; outline: none; }

/* status colours */
.status-txt { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status-txt .dot { width: 7px; height: 7px; border-radius: 50%; }
.c-green { color: var(--green); } .bg-green { background: var(--green); }
.c-amber { color: var(--amber); } .bg-amber { background: var(--amber); }
.c-red { color: var(--red); } .bg-red { background: var(--red); }
.c-grey { color: var(--grey); } .bg-grey { background: var(--grey); }
.c-blue { color: var(--accent); } .bg-blue { background: var(--accent); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #f1f3f5; color: var(--muted); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.green { color: var(--green); background: #e7f8ef; }
.badge.amber { color: var(--amber); background: #fef3e7; }
.badge.red { color: var(--red); background: #fdeceb; }
.badge.blue { color: var(--accent); background: var(--accent-soft); }
.badge.grey { color: var(--grey); background: #f1f3f5; }

/* detail panel */
#detail { position: fixed; top: var(--topbar); right: 0; bottom: 0; width: var(--detail);
  background: var(--tint1); border-left: 1px solid var(--border); overflow-y: auto; z-index: 20;
  box-shadow: -14px 0 34px rgba(20, 30, 45, .16); }
.dt-head { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--tint1); z-index: 2; }
.dt-head h2 { margin: 0; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.dt-close { border: 0; background: transparent; color: var(--muted); width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; font-size: 18px; }
.dt-close:hover { background: #f0f2f4; color: var(--ink); }
.dt-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.dt-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.dt-section { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; }
.dt-section h3 { margin: 0 0 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.dt-actions { display: flex; flex-direction: column; gap: 7px; }

/* overlay + modals */
.overlay { position: fixed; inset: 0; z-index: 50; }
.ss-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .18); }

/* site selector overlay */
.ss-panel { position: absolute; left: var(--rail); top: var(--topbar); bottom: 0; width: 300px; background: var(--panel); border-right: 1px solid var(--border); box-shadow: 4px 0 24px rgba(20,30,45,.1); display: flex; flex-direction: column; }
.ss-head { padding: 12px 16px 6px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.ss-search { padding: 0 12px 8px; }
.ss-search input { width: 100%; padding: 8px 10px; font: inherit; border: 1px solid var(--border-strong); border-radius: 5px; }
.ss-colhead { display: flex; justify-content: space-between; padding: 5px 16px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 700; }
.ss-list { overflow-y: auto; padding-bottom: 10px; flex: 1; }
.ss-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; cursor: pointer; }
.ss-row:hover { background: #f2f4f6; }
.ss-row.on { background: var(--accent-soft); }
.ss-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ss-row .nm .sub { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.ss-row .crit { color: var(--muted); font-variant-numeric: tabular-nums; align-self: center; }
.ss-foot { padding: 10px 12px; border-top: 1px solid var(--border); }

/* generic centered modal */
.modal-panel { position: relative; z-index: 1; width: min(440px, 94vw); margin: 12vh auto 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.22); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--border); font-weight: 700; }
.modal-body { padding: 15px; }
.modal-head .sub { margin-left: 6px; font-weight: 400; color: var(--muted); }
/* .modal-head is a flex row, so the space in `Web Admin <span>` is trimmed
   away with the text node — the title read "Web AdminVIRT-PEP-007". */

/* Web Admin proxy — near-full-screen: it renders someone else's whole UI, and
   a router admin in a small box is unusable. */
.wa-panel { width: 96vw; height: 92vh; max-width: none; display: flex; flex-direction: column;
  /* .modal-panel drops the box 12vh down the page; at 92vh tall that is 104vh
     and the bottom falls off the screen. */
  margin: 4vh auto 0; }
.wa-body { flex: 1; min-height: 0; background: #fff; }
.wa-frame { width: 100%; height: 100%; border: 0; display: block; }
.wa-hint { margin-left: auto; margin-right: 12px; font-size: 11px; font-weight: 400; color: var(--muted); }
.th-act, .td-act { width: 96px; text-align: right; white-space: nowrap; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* row action icons (Web Admin, Update firmware, Move) */
.row-act { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 5px;
  vertical-align: middle; line-height: 0; }
.row-act svg { width: 17px; height: 17px; }
.row-act:hover { background: var(--accent-soft); color: var(--accent); }

/* firmware column */
.th-fw, .td-fw { white-space: nowrap; }
.fw-ver { font-variant-numeric: tabular-nums; font-size: 12px; }

/* move-to-site modal */
.mv-list { margin: 8px 0 4px; max-height: 46vh; overflow-y: auto; }
.mv-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px;
  padding: 8px 6px; border-radius: 6px; cursor: pointer; }
.mv-row:hover { background: #f2f4f6; }
.mv-row.current { opacity: .55; cursor: default; }
.mv-nm { font-weight: 600; }
.mv-sub { color: var(--muted); font-size: 12px; }

.af { display: flex; flex-direction: column; gap: 4px; margin-bottom: 11px; font-size: 12px; color: var(--muted); }
.af span { font-weight: 600; }
.af input, .af select { padding: 8px 10px; font: inherit; color: var(--ink); border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
.af input:focus, .af select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.af-row { display: flex; gap: 10px; }
.af-row .af { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.confirm-msg { font-size: 13px; line-height: 1.5; margin-bottom: 16px; }

/* ---- Tunnel setup: a replica of the device's IPsec VPN Profile form (§4c) ----
   Deliberately mimics the Peplink Web Admin layout so the two screens can be put
   side by side and copied 1:1 — a flat list of field names is too easy to misread. */
.tun-panel { position: relative; z-index: 1; width: min(880px, 96vw); margin: 4vh auto 0;
  max-height: 90vh; display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.22); overflow: hidden; }
.tun-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--tint2); }
.tun-head h2 { margin: 0; font-size: 14px; }
.tun-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.tun-body { overflow-y: auto; padding: 14px; }
.tun-lead { font-size: 12.5px; line-height: 1.5; color: var(--ink); margin: 0 0 12px; }
.tun-lead b { font-weight: 700; }
.tun-legend { display: inline-block; background: #fdf6e7; border: 1px solid #f5d9a8; color: #8a5b00;
  border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 600; margin-left: 4px; }

/* the form replica itself */
.pep-form { border: 1px solid #999; border-radius: 3px; overflow: hidden; font-size: 12.5px; }
.pep-title { background: linear-gradient(#4a4a4a, #2e2e2e); color: #ffb300; font-weight: 700;
  padding: 6px 10px; font-size: 12.5px; }
.pep-row { display: flex; align-items: stretch; border-top: 1px solid #ccc; }
.pep-row:first-of-type { border-top: 0; }
.pep-row.hl .pep-ctl { background: #fdf6e7; }
.pep-lbl { flex: 0 0 240px; background: #ebebeb; border-right: 1px solid #ccc; padding: 7px 9px;
  color: #333; display: flex; align-items: center; gap: 5px; }
.pep-ctl { flex: 1; padding: 6px 9px; display: flex; align-items: center; gap: 8px; background: #fff; min-width: 0; }
.pep-in { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; background: #fff;
  border: 1px solid #7a7a7a; border-radius: 2px; padding: 4px 6px; overflow-x: auto; white-space: nowrap; }
.pep-sel { font-family: var(--font); font-size: 12px; background: #fff; border: 1px solid #7a7a7a;
  border-radius: 2px; padding: 3px 22px 3px 6px; position: relative; }
.pep-sel::after { content: "▾"; position: absolute; right: 6px; color: var(--muted); }
.pep-radio { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; color: #333; }
.pep-radio .rb { width: 11px; height: 11px; border: 1px solid #666; border-radius: 50%; display: inline-block; position: relative; }
.pep-radio.on .rb::after { content: ""; position: absolute; inset: 2px; background: var(--accent); border-radius: 50%; }
.pep-radio.on { font-weight: 700; color: var(--accent); }
.pep-cb { width: 12px; height: 12px; border: 1px solid #666; border-radius: 2px; display: inline-grid;
  place-items: center; font-size: 10px; line-height: 1; color: #fff; background: #fff; }
.pep-cb.on { background: var(--accent); border-color: var(--accent); }
.pep-cb.off { background: #fff; }
.pep-suffix, .pep-static { color: #333; font-size: 12px; }
.pep-strike { color: var(--muted); text-decoration: line-through; }
.tun-copy { flex: 0 0 auto; border: 1px solid var(--border-strong); background: #fff; color: var(--muted);
  border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 600; }
.tun-copy:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tun-copy.done { border-color: var(--green); color: var(--green); }
.pep-note { padding: 5px 9px 7px 249px; font-size: 11px; color: #8a5b00; background: #fffdf7;
  border-top: 1px dashed #e8dcc0; line-height: 1.45; }
.tun-crypto { font-size: 11px; color: var(--faint); margin-top: 10px; line-height: 1.5; }

/* credential reveal rows (enrollment result) */
.cred-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.cred-lbl { width: 96px; font-size: 12px; color: var(--muted); }
.cred-val { flex: 1; font-family: var(--mono); font-size: 12px; background: var(--accent-soft); padding: 6px 8px; border-radius: 6px; overflow: auto; white-space: nowrap; }
.cred-note { font-size: 12px; color: var(--amber); margin-top: 10px; line-height: 1.45; }

/* leading status dot + device thumbnail */
.th-dot, .td-dot { width: 22px; padding-right: 0 !important; }
.th-thumb, .td-thumb { width: 44px; padding-left: 8px !important; }
.state-dot { display: block; width: 8px; height: 8px; border-radius: 50%; }
.type-ph { width: 36px; height: 26px; object-fit: contain; display: block; }
.type-ic { display: block; color: var(--muted); }
.type-ic svg { width: 26px; height: 26px; display: block; }

.tun-key { font-family: var(--mono); font-size: 11px; word-break: break-all; background: var(--accent-soft);
  padding: 6px 8px; border-radius: 5px; line-height: 1.5; }

/* lockdown */
.lock-list { margin: 8px 0 12px; padding-left: 18px; font-size: 12px; color: var(--ink); line-height: 1.7; }
.lock-list b { font-weight: 600; }
.lock-list-warn li { color: var(--muted); }
.lock-caveat { margin: 14px 0 2px; font-size: 12px; color: var(--amber); }

/* uplinks */
.td-uplink { white-space: nowrap; }
/* Stacked, not side by side: two uplinks on one line read as a jumble. Each on
   its own row, the connection dot leading it. */
.uplink { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.5; }
.uplink .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.uplink-up { color: var(--ink); font-weight: 600; }
.uplink-down { color: var(--muted); }

/* provider */
.td-carrier { white-space: nowrap; }
.carrier { font-weight: 600; }
.carrier-down { color: var(--muted); }
.carrier-state { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.carrier-roam { display: inline-block; margin-left: 5px; padding: 0 4px; border-radius: 3px;
  background: #fef3e7; color: var(--amber); font-size: 10px; font-weight: 700; }

/* LTE signal columns */
/* The four LTE columns sit as a tight cluster: narrow width + slim side padding
   so SINR/RSRP/RSRQ/RSSI read as one group rather than four spread-out columns. */
.th-sig { text-align: right !important; width: 44px; padding-left: 5px !important; padding-right: 8px !important; }
.td-sig { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
  padding-left: 5px !important; padding-right: 8px !important; }
.sig { font-weight: 600; }
.sig-u { color: var(--muted); font-size: 10px; margin-left: 2px; }
.sig-na { color: var(--border-strong); }

/* FAB */
#fab { position: fixed; right: 22px; bottom: calc(var(--appbar) + 18px); width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; font-size: 30px; font-weight: 300; line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 111, 255, .35); cursor: pointer; z-index: 30; transition: background .12s, transform .12s, opacity .15s; }
#fab:hover { background: #0063e6; transform: translateY(-1px); }
#fab::after { content: attr(data-tip); position: absolute; right: 62px; top: 50%; transform: translateY(-50%);
  background: #0f172a; color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
#fab:hover::after { opacity: 1; }
#shell.detail-open #fab { opacity: 0; pointer-events: none; }

/* toast */
#toast-host { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1f2933; color: #fff; padding: 9px 16px; border-radius: 7px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,.2); opacity: 0; transform: translateY(6px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--red); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* settings gear at the foot of the rail */
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; }

/* settings menu lives in the sidepanel (like the device filters) */
.sp-settings { padding: 12px 10px; }
.sp-nav-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-weight: 600; color: var(--ink); }
.sp-nav-row:hover { background: #f0f2f4; }
.sp-nav-row.on { background: var(--accent-soft); color: var(--accent); }
.sp-nav-ic svg { width: 17px; height: 17px; display: block; }
.sp-nav-row .lbl { font-size: 13px; }

/* full-page settings section (rendered into #content) */
.pg-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.pg-head h2 { margin: 0; font-size: 17px; }
.pg-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pg-spacer { flex: 1; }
.pg-body { padding: 18px; }

/* General (site/event) form */
.pg-form { max-width: 560px; }
.pg-form textarea { padding: 8px 10px; font: inherit; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; resize: vertical; }
.pg-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.pg-form-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px;
  padding-top: 14px; border-top: 1px solid var(--border); }
.pg-meta { color: var(--muted); font-size: 12px; }

/* user management table */
.um-table { width: 100%; border-collapse: collapse; }
.um-table th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); }
.um-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.um-th-ga { width: 130px; }
.um-th-act { width: 44px; }
.um-uname { font-weight: 600; }
.um-you { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.um-role select { padding: 5px 8px; font: inherit; border: 1px solid var(--border-strong);
  border-radius: 5px; background: #fff; color: var(--ink); }
.um-role select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.um-act { text-align: right; }
.um-remove:hover { background: #fdeceb; color: var(--red); }
.um-remove:disabled { opacity: .3; pointer-events: none; }

/* Global-Admin switch */
.um-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.um-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.um-toggle span { width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .15s; }
.um-toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.um-toggle input:checked + span { background: var(--accent); }
.um-toggle input:checked + span::after { transform: translateX(14px); }
.um-toggle input:disabled + span { opacity: .45; }

/* ---------- full-page device detail (experiment) ---------- */
.dv-page { padding-bottom: 24px; }
.dv-top { display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.dv-back { color: var(--accent); font-weight: 600; cursor: pointer; margin-right: 4px; }
.dv-back:hover { text-decoration: underline; }
.dv-top h1 { font-size: 17px; margin: 0; }
.dv-top .state-dot { width: 9px; height: 9px; border-radius: 50%; }
.dv-spacer { flex: 1; }
.dv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 18px; align-items: start; }
@media (max-width: 900px) { .dv-cols { grid-template-columns: 1fr; } }
.dv-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
.dv-card-h { padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.dv-info, .dv-status { padding: 4px 14px 12px; }

/* Information key/values — label and value meet in the middle: the label is
   right-aligned up to the centre gutter, the value left-aligned away from it. */
/* label right-aligned to a fixed gutter (~42%), every value left-aligned to the
   same edge — so all values line up in one column, like the Peplink dashboard. */
.dv-kv { display: grid; grid-template-columns: 42% 1fr; column-gap: 16px; padding: 5px 0; }
.dv-kv dt { color: var(--muted); text-align: right; }
.dv-kv dd { margin: 0; text-align: left; font-weight: 500; }

/* Section dividers: label sits at the RIGHT end of the rule (not centered). */
.dv-sec { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px;
  color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.dv-sec::before { content: ""; flex: 1; height: 1px; background: var(--border); }
.dv-sec::after { content: ""; width: 14px; height: 1px; background: var(--border); }
/* Priority tags: right-aligned, faint — a light group marker, not a heading. */
.dv-prio { text-align: right; color: var(--faint); font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; margin: 8px 0 2px; }
.dv-row { display: grid; grid-template-columns: 42% 1fr; column-gap: 16px; align-items: center; padding: 5px 0; }
.dv-lbl { color: var(--muted); text-align: right; }
.dv-val { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
.dv-sq { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dv-b { font-size: 10px; padding: 1px 6px; }
.dv-muted { color: var(--muted); }
.dv-empty { color: var(--muted); padding: 5px 0; }

/* signal bars */
.dv-bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 13px; }
.dv-bar { width: 3px; background: var(--border-strong); border-radius: 1px; }
.dv-bar.on { background: var(--accent); }

/* cellular signal grid */
.dv-sigs { display: flex; gap: 14px; flex-wrap: wrap; }
.dv-sig { display: flex; align-items: baseline; gap: 4px; }
.dv-sig-l { color: var(--muted); font-size: 11px; }

/* location / map placeholder */
.dv-map { margin: 0 18px; }
.dv-map-body { padding: 14px; }
.dv-map-loc { font-weight: 600; }

/* CPU meter + map on the device page */
.dv-meter { display: inline-block; width: 96px; height: 8px; border-radius: 4px;
  background: var(--tint2); overflow: hidden; vertical-align: middle; }
.dv-meter-fill { display: block; height: 100%; border-radius: 4px; }
.dv-meter-n { margin-left: 7px; font-variant-numeric: tabular-nums; }
.dv-map-frame { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dv-map-frame iframe { display: block; width: 100%; height: 260px; border: 0; }
.dv-maplink { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; }
.dv-maplink:hover { text-decoration: underline; }

/* API access page */
.ak-docs { margin-top: 22px; max-width: 720px; }
.ak-docs h3 { font-size: 13px; margin: 0 0 6px; }
.ak-ep { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ak-ep code { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.ak-ep span { color: var(--muted); font-size: 12px; }
.ak-pre { font-family: var(--mono); font-size: 12px; background: var(--tint2); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; overflow-x: auto; }
.ak-keybox { display: flex; align-items: center; gap: 8px; background: var(--tint2); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; margin: 4px 0 8px; }
.ak-keybox code { font-family: var(--mono); font-size: 12px; word-break: break-all; flex: 1; }
.ak-revoked td { opacity: .5; }
