/* =====================================================================
   KIVU Tracker — public/css/style.css
   Dark fleet-management design system: top bar + tree
   panel + map + inspector panel + timeline, themeable via variables.
   ===================================================================== */
:root {
  --bg: #0f1420;
  --bg-soft: #131a28;
  --panel: #161d2d;
  --panel-2: #1b2436;
  --panel-3: #212c42;
  --border: #263149;
  --border-soft: #1f2a3d;
  --text: #dfe6f2;
  --muted: #8ea2c0;
  --dim: #6b7b96;
  --accent: #2f9cf4;
  --accent-2: #7fd4ff;
  --ok: #2ecc71;
  --warn: #f1c40f;
  --danger: #e74c3c;
  --purple: #9b59b6;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 13.5px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 600; letter-spacing: .2px; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { color: var(--muted); }
code, .mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #2c3852; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a6b; }

/* ------------------------------------------------------------- layout -- */
.topbar {
  height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(180deg, #1a2333, #141b29); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar .brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar .brand .logo {
  width: 24px; height: 24px; border-radius: 7px; display: inline-block;
  background: conic-gradient(from 210deg, var(--accent), #16a085, var(--accent-2), var(--accent));
}
/* an uploaded platform logo replaces the CSS mark everywhere a brand appears */
.logo-img {
  display: inline-block; height: 30px; width: auto; max-width: 190px; object-fit: contain;
  border-radius: 8px; background: rgba(255, 255, 255, .07); padding: 2px 4px;
}
.topbar .brand .logo-img { height: 24px; max-width: 150px; }
.topbar-nav { display: flex; align-items: center; gap: 2px; }
.topbar .nav-toggle { display: none; }
[data-theme="light"] .logo-img { background: rgba(23, 35, 58, .06); }
.logo-card { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview {
  min-width: 190px; min-height: 74px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--panel-2); padding: 8px;
}
.logo-preview img { max-height: 58px; max-width: 100%; object-fit: contain; }
.logo-preview .empty { color: var(--dim); font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar .navlink { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.topbar .navlink:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.topbar .navlink.active { background: var(--panel-3); color: var(--accent-2); }
.topbar .who { color: var(--muted); font-size: 12.5px; text-align: right; line-height: 1.25; }
.topbar .who b { color: var(--text); display: block; }

.layout { display: flex; height: calc(100vh - 50px); overflow: hidden; }
.side { width: 320px; min-width: 260px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.inspector { width: 366px; min-width: 300px; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.center { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 240px; }
.scroll { overflow: auto; flex: 1; }
.pad { padding: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
.right { margin-left: auto; }
.hidden { display: none !important; }
.center-text { text-align: center; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.mono-num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ controls -- */
input, select, textarea, button { font: inherit; color: var(--text); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=email], input[type=tel], input[type=search], input[type=color], select, textarea {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px;
  width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 156, 244, .18); }
input[type=color] { padding: 2px; height: 34px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.btn {
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px;
  cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: #2a3750; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #05121f; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #05220f; }
.btn.danger { background: transparent; border-color: var(--danger); color: #ff9c93; }
.btn.danger:hover { background: rgba(231, 76, 60, .16); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.xs { padding: 2px 6px; font-size: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--accent); border-color: var(--accent); color: #05121f; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; background: var(--panel-3); border: 1px solid var(--border); color: var(--muted);
}
.chip.ok { color: #7ff0ae; border-color: #245c3c; background: rgba(46, 204, 113, .12); }
.chip.warn { color: #ffe07a; border-color: #6b5a12; background: rgba(241, 196, 15, .12); }
.chip.danger { color: #ff9c93; border-color: #6d2a22; background: rgba(231, 76, 60, .14); }
.chip.info { color: var(--accent-2); border-color: #1f4d70; background: rgba(47, 156, 244, .12); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* -------------------------------------------------------------- panels -- */
.panel-head {
  padding: 9px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); font-weight: 600; font-size: 13px;
}
.panel-foot { padding: 8px 12px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; background: var(--bg-soft); }
.tabs .tab {
  padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--accent-2); border-bottom-color: var(--accent); background: var(--panel); }
.tabbody { padding: 12px; }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ---------------------------------------------------------------- tree -- */
.tree { padding: 6px 0; }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; border-left: 3px solid transparent; }
.tree .node:hover { background: var(--panel-2); }
.tree .node.active { background: var(--panel-3); border-left-color: var(--accent); }
.tree .node .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .node .meta { color: var(--dim); font-size: 11.5px; }
.tree .group { padding: 8px 10px 4px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }

/* --------------------------------------------------------------- table -- */
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--border-soft); }
table.data th { color: var(--muted); font-weight: 600; background: var(--bg-soft); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.data tr:hover td { background: var(--panel-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; background: var(--bg-soft); }
.table-wrap { overflow: auto; max-height: 100%; border: 1px solid var(--border); border-radius: var(--radius); }

/* ----------------------------------------------------------------- map -- */
.map-wrap { position: relative; isolation: isolate; flex: 1; background: #0b1017; overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-toolbar {
  position: absolute; top: 10px; left: 10px; z-index: 2000; display: flex; gap: 6px; flex-wrap: wrap;
  background: rgba(18, 24, 38, .93); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  max-width: calc(100% - 20px);
}
.map-status {
  position: absolute; bottom: 10px; left: 10px; z-index: 2000; background: rgba(18, 24, 38, .93);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12px; max-width: 440px;
}
.map-legend {
  position: absolute; bottom: 10px; right: 10px; z-index: 2000; background: rgba(18, 24, 38, .93);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 11.5px;
}
.unit-marker {
  width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50% 50% 50% 4px; border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  color: #06121e; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); transform-origin: 50% 50%; cursor: pointer;
}
.unit-marker .lbl {
  position: absolute; left: 50%; top: -16px; transform: translateX(-50%); white-space: nowrap;
  background: rgba(10, 15, 25, .82); color: var(--text); border-radius: 5px; padding: 1px 5px; font-size: 10.5px;
  font-weight: 600; pointer-events: none;
}
.unit-marker.has-glyph span.g { font-size: 15px; line-height: 1; font-weight: 400; }
.asset-ico { flex: 0 0 auto; width: 18px; text-align: center; font-size: 13px; }
.leaflet-container { background: #0b1017; font: var(--font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-2); color: var(--text); }
.leaflet-popup-content { margin: 10px 12px; font-size: 12.5px; }
.leaflet-bar a { background: var(--panel-2); color: var(--text); border-bottom-color: var(--border); }
.leaflet-bar a:hover { background: var(--panel-3); }
.mk-pop b { color: var(--accent-2); }
.mk-pop table { border-collapse: collapse; }
.mk-pop td { padding: 1px 6px 1px 0; }

/* ------------------------------------------------------------ timeline -- */
.timeline { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 8px 12px; }
.timeline .bar { display: flex; align-items: center; gap: 10px; }
.timeline input[type=range] { flex: 1; accent-color: var(--accent); }

/* --------------------------------------------------------------- toast -- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 12px; min-width: 240px; max-width: 380px; box-shadow: var(--shadow);
  animation: slidein .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --------------------------------------------------------------- modal -- */
.modal-back {
  position: fixed; inset: 0; background: rgba(6, 10, 18, .66); z-index: 150; display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 14px; overflow: auto;
}
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); width: min(720px, 100%); }
.modal.wide { width: min(1050px, 100%); }
.modal-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 14px; max-height: 68vh; overflow: auto; }
.modal-foot { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
/* pass-through backdrop: the dialog stays on top while what is behind it
   (the map, draw buttons) remains clickable — used by the geofence editor
   so shapes and the circle radius can be placed with the form open.
   Close via ✕, Cancel or Escape instead of a backdrop click. */
.modal-back.pass { pointer-events: none; }
.modal-back.pass .modal { pointer-events: auto; }

/* --------------------------------------------------------------- login -- */
.auth-page { min-height: 100vh; height: auto; background: #f3f6fa; color: #162338; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) minmax(470px, 1.08fr); }
.auth-visual {
  position: relative; display: flex; min-height: 100vh; overflow: hidden; padding: clamp(30px, 5vw, 72px);
  background: radial-gradient(ellipse at 80% 18%, rgba(38, 107, 133, .34), transparent 38%),
    linear-gradient(145deg, #122638 0%, #102333 55%, #102c3a 100%); color: #fff;
}
.auth-visual::before, .auth-visual::after {
  content: ""; position: absolute; border: 1px solid rgba(147, 208, 218, .08); border-radius: 50%; pointer-events: none;
}
.auth-visual::before { width: 620px; height: 620px; right: -390px; top: -265px; }
.auth-visual::after { width: 480px; height: 480px; right: -320px; top: -195px; }
.auth-visual-inner { position: relative; z-index: 1; width: min(100%, 620px); margin: 0 auto; display: flex; flex-direction: column; }
.auth-brand { display: flex; align-items: center; gap: 11px; min-height: 36px; color: #fff; }
.auth-brand span.logo {
  display: inline-block; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  background: linear-gradient(145deg, #42c4b3, #3693df);
}
.auth-brand .logo-img { display: inline-block; width: auto; height: 34px; max-width: min(230px, 60vw); padding: 0; border-radius: 0; background: transparent; }
.auth-brand-name { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.auth-copy { margin-top: clamp(70px, 12vh, 130px); max-width: 470px; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #8fb6c3; font-size: 10px; font-weight: 700; letter-spacing: 1.35px; }
.auth-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #39cf9a; box-shadow: 0 0 12px rgba(57, 207, 154, .7); }
.auth-copy h1 { margin: 20px 0 14px; font-size: clamp(40px, 5vw, 66px); line-height: 1.02; letter-spacing: -2px; font-weight: 600; }
.auth-copy p { max-width: 400px; margin: 0; color: #a8bbc7; font-size: 15px; line-height: 1.75; }
.auth-map { position: relative; width: min(100%, 620px); margin: auto auto 10px; }
.auth-map img { display: block; width: 100%; height: auto; }
.auth-visual-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: #7793a0; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.auth-visual-footer i { width: 3px; height: 3px; border-radius: 50%; background: #48cfb2; }
.auth-main { display: grid; place-items: center; min-height: 100vh; padding: 46px clamp(28px, 6vw, 96px); }
.auth-card { width: min(100%, 410px); }
.auth-mobile-brand { display: none; }
.auth-welcome { margin-bottom: 31px; }
.auth-welcome .auth-eyebrow { color: #568a89; }
.auth-welcome h2 { margin: 11px 0 6px; color: #17283b; font-size: 28px; letter-spacing: -.7px; }
.auth-welcome p { margin: 0; color: #788697; font-size: 13px; }
.auth-card .field { margin-bottom: 19px; }
.auth-card label { margin-bottom: 7px; color: #3e5063; font-size: 12px; }
.auth-card input[type=text], .auth-card input[type=password] {
  min-height: 47px; border: 1px solid #d9e1e9; border-radius: 7px; background: #fff;
  color: #17283b; padding: 11px 13px; font-size: 13px; box-shadow: 0 1px 2px rgba(21, 43, 62, .025);
}
.auth-card input::placeholder { color: #a3afbb; }
.auth-card input:focus { border-color: #54aa9b; box-shadow: 0 0 0 3px rgba(61, 170, 151, .12); }
.auth-card .auth-submit { width: 100%; min-height: 48px; justify-content: space-between; padding: 0 15px;
  border: 1px solid #168f80; border-radius: 7px; background: #168f80; color: #fff; font-size: 13px; }
.auth-card .auth-submit:hover { border-color: #117c70; background: #117c70; color: #fff; }
.auth-error { min-height: 0; margin: 0; color: #bd3d3d; font-size: 12px; }
.auth-error:not(:empty) { margin-top: 12px; }
.auth-register { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-size: 12px; }
.auth-register > span { color: #788697; }
.auth-register a { color: #157f75; font-weight: 700; }
.auth-register small { flex-basis: 100%; padding-top: 3px; color: #9aa6b2; font-size: 11px; }
.auth-demo { margin-top: 25px; border-top: 1px solid #dfe5eb; padding-top: 16px; }
.auth-demo summary { color: #54677a; cursor: pointer; font-size: 12px; font-weight: 600; }
.auth-demo summary span { color: #94a1ad; font-weight: 400; }
.auth-demo .demo-logins { margin-top: 11px; }
.auth-demo .demo-logins button { min-width: 0; border-color: #dbe3eb; background: #fff; color: #43566b; white-space: normal; text-align: left; }
.auth-demo .demo-logins button:hover { background: #f1f6f8; }
.auth-server-note { margin-top: 23px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #718093; font-size: 11px; }
.auth-server-note b { color: #40586a; }
.auth-server-note code { margin-left: auto; color: #768697; font-size: 10px; }
.auth-server-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #e4f2ef; color: #168f80; font-size: 15px; }
.auth-legal { margin: 20px 0 0; color: #a3adb8; font-size: 10px; text-align: center; }
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: minmax(300px, .82fr) minmax(410px, 1.18fr); }
  .auth-visual { padding: 34px; }
  .auth-main { padding: 36px; }
  .auth-copy h1 { font-size: 48px; }
}
@media (max-width: 860px) {
  .auth-shell { min-height: 100vh; display: block; }
  .auth-visual { display: none; }
  .auth-main { min-height: 100vh; padding: 34px 22px 90px; }
  .auth-card { width: min(100%, 420px); }
  .auth-mobile-brand { display: flex; margin-bottom: 48px; color: #17283b; }
  .auth-mobile-brand .auth-brand-name { font-size: 17px; }
  .auth-welcome h2 { font-size: 26px; }
  .auth-server-note code { margin-left: 30px; }
}
.platform-powered-by {
  position: fixed; z-index: 39; left: 14px; bottom: 6px; max-width: min(60vw, 520px);
  padding: 3px 8px; overflow: hidden; color: #a6b4c4; background: rgba(15, 20, 32, .78);
  border-radius: 5px; font-size: 10px; line-height: 1.4; text-align: left;
  text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
}
[data-theme="light"] .platform-powered-by, .auth-page .platform-powered-by {
  color: #64748b; background: rgba(243, 246, 250, .9);
}
.hint { font-size: 12px; color: var(--dim); }
.demo-logins { display: grid; gap: 6px; margin-top: 14px; }
.demo-logins button { justify-content: space-between; }

/* -------------------------------------------------------------- landing -- */
.landing { max-width: 1080px; margin: 0 auto; padding: 36px 18px 70px; }
.landing .hero { display: grid; gap: 22px; grid-template-columns: 1.2fr .8fr; align-items: center; }
@media (max-width: 860px) { .landing .hero { grid-template-columns: 1fr; } }
.landing h1 { font-size: 30px; line-height: 1.22; }
.landing .brand h1 { font-size: 20px; }
.features { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 24px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.feature h3 { margin-bottom: 6px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
pre { color: var(--accent-2); }

/* -------------------------------------------------------------- reports -- */
.report-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.report-head h1 { margin: 0; }
.report h2 { margin-top: 22px; }
.report table.data { border: 1px solid var(--border); }
.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
.chart-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.chart-box h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
canvas.chart { width: 100%; height: 220px; display: block; }
.tile-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* -------------------------------------------------------- billing / plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 12px; }
.plan-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 2px;
}
.plan-card.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(47, 156, 244, .35); }
.plan-card h3 { margin: 0; font-size: 15px; }
.plan-card .tagline { font-size: 12px; color: var(--dim); min-height: 30px; }
.plan-price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.plan-price small { font-size: 12px; font-weight: 400; color: var(--dim); }
.plan-features { list-style: none; margin: 8px 0 12px; padding: 0; flex: 1; }
.plan-features li { font-size: 12.5px; color: var(--muted); padding: 2px 0 2px 15px; position: relative; }
.plan-features li:before { content: "\2713"; position: absolute; left: 0; color: var(--ok); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.badge-sandbox {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: #ffe07a;
  border: 1px solid #6b5a12; border-radius: 20px; padding: 1px 7px;
}
.banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); font-size: 12.5px;
}
.banner.warn { border-color: #6b5a12; background: rgba(241, 196, 15, .12); color: #ffe07a; }
.banner.danger { border-color: #6d2a22; background: rgba(231, 76, 60, .14); color: #ff9c93; }
.banner.info { border-color: #1f4d70; background: rgba(47, 156, 244, .12); color: #7fd4ff; }
.banner .spacer { flex: 1; }
.billing-wrap { max-width: 1150px; margin: 0 auto; padding: 14px; }
.pay-wrap { max-width: 560px; margin: 40px auto; padding: 14px; }
.pay-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.pay-amount { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }

.tile { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.tile .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 11.5px; color: var(--dim); }

/* ------------------------------------------------ colour-coded KPI tiles -- */
/* Every dashboard tile carries its own colour — tiles() assigns it around the
   palette and a metric can name one (`color`) or state its meaning (`tone`).
   The tint is theme-aware, the value colour darkens in the light theme. */
.tile[class*=" k-"], .stat[class*=" k-"] { border-left-width: 3px; border-left-style: solid; }
.tile.k-blue, .stat.k-blue { --kc: 47, 156, 244; }
.tile.k-green, .stat.k-green { --kc: 46, 204, 113; }
.tile.k-violet, .stat.k-violet { --kc: 165, 107, 255; }
.tile.k-amber, .stat.k-amber { --kc: 241, 196, 15; }
.tile.k-cyan, .stat.k-cyan { --kc: 23, 192, 201; }
.tile.k-orange, .stat.k-orange { --kc: 255, 138, 61; }
.tile.k-pink, .stat.k-pink { --kc: 255, 107, 181; }
.tile.k-teal, .stat.k-teal { --kc: 32, 178, 170; }
.tile.k-red, .stat.k-red { --kc: 231, 76, 60; }
.tile[class*=" k-"], .stat[class*=" k-"] {
  background: linear-gradient(180deg, rgba(var(--kc), .17), rgba(var(--kc), .05));
  border-color: rgba(var(--kc), .38);
}
.tile[class*=" k-"] .v, .stat[class*=" k-"] .v { color: rgb(var(--kc)); }
[data-theme="light"] .tile[class*=" k-"], [data-theme="light"] .stat[class*=" k-"] {
  background: linear-gradient(180deg, rgba(var(--kc), .20), rgba(var(--kc), .07));
  border-color: rgba(var(--kc), .45);
}
[data-theme="light"] .tile.k-blue .v, [data-theme="light"] .stat.k-blue .v { color: #1268c8; }
[data-theme="light"] .tile.k-green .v, [data-theme="light"] .stat.k-green .v { color: #10803d; }
[data-theme="light"] .tile.k-violet .v, [data-theme="light"] .stat.k-violet .v { color: #6a35c9; }
[data-theme="light"] .tile.k-amber .v, [data-theme="light"] .stat.k-amber .v { color: #8a6600; }
[data-theme="light"] .tile.k-cyan .v, [data-theme="light"] .stat.k-cyan .v { color: #0b6f75; }
[data-theme="light"] .tile.k-orange .v, [data-theme="light"] .stat.k-orange .v { color: #a8480c; }
[data-theme="light"] .tile.k-pink .v, [data-theme="light"] .stat.k-pink .v { color: #a12b6b; }
[data-theme="light"] .tile.k-teal .v, [data-theme="light"] .stat.k-teal .v { color: #0b6b64; }
[data-theme="light"] .tile.k-red .v, [data-theme="light"] .stat.k-red .v { color: #b02a1e; }

/* ------------------------------------------------------------- printing -- */
@media print {
  body { background: #fff; color: #111; }
  .topbar, .side, .inspector, .map-toolbar, .map-wrap, .timeline, .no-print, .toasts, .btn { display: none !important; }
  .layout { display: block; height: auto; overflow: visible; }
  .report, .printable { color: #111; }
  .report h1, .report h2, .report h3 { color: #111; }
  table.data th { background: #eee; color: #111; }
  table.data th, table.data td { border-color: #ccc; }
  .tile, .chart-box, .card, .feature { border-color: #ccc; background: #fafafa; }
  .muted, .hint, .small { color: #444; }
  a { color: #111; }
}

/* --------------------------------------------------------- light theme -- */
/* theme_mode (Platform settings): "user" lets everyone toggle dark/light in
   the top bar; "dark" / "light" lock the platform to one theme and hide the
   toggle — that is how both modes get disabled platform-wide. */
[data-theme="light"] {
  --bg: #eef2f8;
  --bg-soft: #e6ecf5;
  --panel: #ffffff;
  --panel-2: #f3f6fb;
  --panel-3: #e7edf7;
  --border: #ccd6e5;
  --border-soft: #dde5f0;
  --text: #17233a;
  --muted: #51617e;
  --dim: #7d8ba5;
  --accent: #1668c9;
  --accent-2: #0f5bb5;
  --ok: #1e9e57;
  --warn: #b8900a;
  --danger: #d43c2f;
  --purple: #7d43a8;
  --shadow: 0 10px 30px rgba(23, 35, 58, .12);
}
[data-theme="light"] .topbar { background: linear-gradient(180deg, #ffffff, #eef2f8); }
[data-theme="light"] ::-webkit-scrollbar-track { background: #e6ecf5; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #b9c6da; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #9fb1cb; }
[data-theme="light"] .map-wrap { background: #dfe7f2; }
[data-theme="light"] .leaflet-container { background: #dfe7f2; }
[data-theme="light"] .unit-marker { border-color: rgba(23, 35, 58, .25); box-shadow: 0 2px 8px rgba(23, 35, 58, .25); }
[data-theme="light"] .toast { background: #17233a; color: #f4f7fc; }
[data-theme="light"] table.data th { background: #eef2f8; }
[data-theme="light"] .modal-back { background: rgba(23, 35, 58, .45); }
[data-theme="light"] .unit-marker .lbl { background: rgba(255, 255, 255, .92); color: #17233a; }

/* -------------------------------------------------- side panel collapse -- */
.side-toggle {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 60;
  width: 16px; height: 68px; padding: 0; font-size: 13px; line-height: 1;
  border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0;
  background: var(--panel-2); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.side-toggle:hover { background: var(--panel-3); color: var(--text); }
.layout > .side { transition: margin-left .2s ease; }
.layout.side-collapsed > .side { margin-left: -321px; pointer-events: none; }
.side-open-btn, .side-close { display: none; }

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 900px) {
  .topbar { position: sticky; height: auto; min-height: 50px; flex-wrap: wrap; align-content: center; padding: 6px 10px; }
  .topbar .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .topbar .nav-toggle { display: inline-flex; margin-left: auto; }
  .topbar-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 41;
    max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 3px; padding: 8px 10px;
    background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .topbar.mobile-open .topbar-nav { display: flex; }
  .topbar-nav .navlink { padding: 10px 12px; }
  .topbar .spacer { display: none; }
  .topbar #accountPicker { max-width: 130px !important; }
  .topbar .who { max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 960px) {
  .layout {
    display: flex; flex-direction: column; height: auto; min-height: calc(100vh - 50px);
    min-height: calc(100dvh - 50px); overflow: visible;
  }
  .layout > .side, .layout > .inspector {
    width: 100%; min-width: 0; max-width: none; flex: 0 0 auto;
  }
  .layout > .center { width: 100%; min-width: 0; min-height: 55vh; min-height: 55svh; flex: 0 0 auto; }
  .layout > .side { min-height: 240px; max-height: 42svh; }
  .layout > .inspector { min-height: 380px; }
  .layout > .side > .scroll, .layout > .inspector > .scroll { min-height: 0; }
  .monitor-layout > .side { order: 1; height: 320px; max-height: 45svh; }
  .monitor-layout > .inspector { order: 2; height: 460px; }
  .report-layout { height: auto !important; }
  .report-layout > .side { height: clamp(200px, 35svh, 320px); }
  .topbar { gap: 6px; }
  .topbar .brand { margin-right: 4px; }
  .topbar .navlink { padding: 6px 7px; }
}
@media (max-width: 760px) {
  .tabbody { padding: 10px; }
  .pad { padding: 10px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .grid2[style*="grid-template-columns"], .grid3[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .grid3 > [style*="grid-column"] { grid-column: 1 / -1 !important; }
  .row > .grow { min-width: 0; }
  .row > .field { min-width: min(100%, 240px) !important; }
  .table-wrap { width: 100%; max-width: 100%; }
  .map-toolbar { right: 8px; left: 8px; top: 8px; gap: 4px; padding: 5px; }
  .map-toolbar .btn { padding: 4px 6px; font-size: 11px; }
  .map-status { left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .map-legend { right: 8px; bottom: 8px; max-width: 45%; }
  .timeline .bar { flex-wrap: wrap; gap: 6px; }
  .timeline .bar input[type="range"] { min-width: 100px; }
  .report-head { gap: 8px; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .modal-back { padding: 12px 8px; }
  .modal-body { max-height: 76vh; }
  .modal-foot { flex-wrap: wrap; }
  .toast { min-width: 0; width: min(380px, calc(100vw - 32px)); }
  .toasts { right: 8px; bottom: 8px; }
  .platform-powered-by { left: 8px; bottom: max(6px, env(safe-area-inset-bottom)); max-width: 55vw; }
  .support-assistant { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 540px) {
  .topbar .who { display: none; }
  .topbar #accountPicker { max-width: 105px !important; }
  .topbar > .btn { padding: 5px 7px; }
  .layout > .center { min-height: 52vh; min-height: 52svh; }
  .layout > .side { max-height: 38svh; }
  .layout > .inspector { min-height: 340px; }
  .monitor-layout > .side { height: 300px; max-height: 40svh; }
  .monitor-layout > .inspector { height: 420px; }
  .report-head > * { max-width: 100%; }
  .pay-wrap { margin: 14px auto; padding: 10px; }
  .pay-card { padding: 14px; }
  .pay-amount { font-size: 25px; }
  .landing { padding: 24px 12px 60px; }
  .landing h1 { font-size: 26px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .modal { border-radius: 9px; }
  .modal-head, .modal-body, .modal-foot { padding: 10px; }
  .grid2 > .card[style*="min-height"], .grid3 > .card[style*="min-height"] {
    min-height: min(420px, 55svh) !important;
  }
  .auth-main { padding: 28px 16px 84px; }
  .auth-mobile-brand { margin-bottom: 36px; }
  .auth-demo .demo-logins button { width: 100%; }
}
@media (max-width: 360px) {
  .topbar { padding: 0 6px; gap: 4px; }
  .topbar .brand { font-size: 13px; gap: 5px; }
  .topbar .brand .logo-img { max-width: 96px; }
  .nav-toggle { padding: 4px 6px; }
  .topbar #accountPicker { max-width: 82px !important; }
  .topbar > .btn { padding: 4px 5px; }
  .tabs .tab { padding: 8px; }
  .btn { white-space: normal; }
}

/* ------------------------------------------------------- support guide -- */
.support-assistant { position: fixed; right: 18px; bottom: 18px; z-index: 1000; }
.support-toggle {
  width: 52px; height: 52px; padding: 5px; border: 2px solid #43b5e5; border-radius: 50%;
  background: #102a43; color: #fff; box-shadow: 0 5px 18px rgba(0, 0, 0, .38); cursor: pointer;
  display: grid; place-items: center; overflow: hidden;
}
.support-toggle:hover { background: #183e5c; }
.support-toggle:focus-visible, .support-close:focus-visible, .support-suggestion:focus-visible {
  outline: 2px solid #43b5e5; outline-offset: 2px;
}
.support-toggle-logo {
  display: block; width: 100%; height: 100%; object-fit: contain; padding: 3px;
  border-radius: 50%; background: #fff;
}
.support-toggle-logo[hidden], .support-toggle-mark[hidden] { display: none; }
.support-toggle-mark {
  width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(145deg, #1575b8, #13a68b); color: #fff;
  font: 800 24px/1 "Segoe UI", system-ui, sans-serif;
}
.support-panel {
  position: absolute; right: 0; bottom: 60px; width: min(360px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 100px)); display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.support-panel[hidden] { display: none !important; }
.support-heading {
  padding: 11px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.support-heading strong, .support-status { display: block; }
.support-status { color: var(--muted); font-size: 11px; }
.support-close {
  background: transparent; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); padding: 4px 7px; cursor: pointer;
}
.support-messages { padding: 10px; overflow-y: auto; flex: 1; min-height: 110px; }
.support-message {
  max-width: 94%; margin: 0 0 9px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel-2); color: var(--text); overflow-wrap: anywhere;
}
.support-message.user { margin-left: auto; background: rgba(47, 156, 244, .14); border-color: rgba(47, 156, 244, .35); }
.support-suggestions { padding: 0 10px 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.support-suggestion {
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2);
  color: var(--accent-2); padding: 4px 8px; cursor: pointer; font-size: 11px; text-align: left;
}
.support-form { padding: 9px 10px; display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--border); }
.support-form input { min-width: 0; }
.support-privacy { margin: 0; padding: 0 10px 9px; color: var(--dim); font-size: 10.5px; }
@media (max-width: 480px) {
  .support-assistant { right: 12px; bottom: 12px; }
  .support-panel { max-height: calc(100vh - 84px); }
}
/* ------------------------------- inspector collapse (right, desktop) ------ */
.layout > .inspector { transition: margin-right .2s ease; }
.layout.insp-collapsed > .inspector { margin-right: -367px; pointer-events: none; }
.insp-toggle {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 60;
  width: 16px; height: 68px; padding: 0; font-size: 13px; line-height: 1;
  border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px;
  background: var(--panel-2); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.insp-toggle:hover { background: var(--panel-3); color: var(--text); }
.insp-open-btn { display: none; }

/* -------------------------- mobile: panels visible, tap to hide/show ------ */
@media (max-width: 960px) {
  /* a collapse state saved on desktop must never trap the panel off-screen */
  .layout.side-collapsed > .side { margin-left: 0 !important; }
  .layout.insp-collapsed > .inspector { margin-right: 0 !important; }
  .layout.side-hidden > .side {
    max-height: 0 !important; min-height: 0 !important; opacity: 0; pointer-events: none;
  }
  .layout.insp-hidden > .inspector {
    max-height: 0 !important; min-height: 0 !important; opacity: 0; pointer-events: none;
  }
  .side-toggle, .insp-toggle { display: none; }
  .side-open-btn, .insp-open-btn { display: inline-flex; }
  .side-close { display: none; }
  /* units first under the map; the Details button scrolls details into view */
  .monitor-layout > .side { order: 1; }
  .monitor-layout > .inspector { order: 2; }
  .layout > .side, .layout > .inspector { scroll-margin-top: 56px; }
  /* units list: tall enough to show at least 5 devices */
  .layout > .side { height: 420px !important; min-height: 340px !important; max-height: 65svh !important; }
  .monitor-layout > .side { height: 420px !important; max-height: 65svh !important; }
  /* inspector (details): taller panel; its content scrolls when details are many */
  .layout > .inspector { height: 520px !important; min-height: 400px !important; max-height: 80svh !important; }
  .monitor-layout > .inspector { height: 520px !important; max-height: 80svh !important; }
  /* the devices list scrolls inside its panel — the page never takes the swipe */
  .layout > .side, .layout > .inspector { overflow: hidden; }
  .layout > .side > .scroll, .layout > .inspector > .scroll {
    flex: 1 1 auto; min-height: 0;
    overflow-x: hidden; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
}
@media (max-width: 960px) {
  /* smoother, more responsive touch on mobile */
  html { scroll-behavior: smooth; }
  .layout > .side, .layout > .inspector {
    transition: max-height .28s ease, min-height .28s ease, opacity .2s ease;
  }
  .btn, .tree .node, .tabs .tab, .side-toggle, .insp-toggle,
  input, select, textarea { touch-action: manipulation; }
  body { -webkit-tap-highlight-color: rgba(47, 156, 244, .18); }
  .btn:active { transform: scale(.97); }
  .tree .node:active { background: var(--panel-3); }
  .tabs .tab:active { color: var(--accent-2); }
}
@media print {
  .side-toggle, .insp-toggle, .side-open-btn, .insp-open-btn { display: none !important; }
}

/* ---------------------------------------------- mobile map overlays (v8) -- */
.map-fleet { display: none; }
@media (max-width: 960px) {
  /* all six tabs visible at once - never swipe the tab strip */
  .tabs { overflow-x: visible; flex-wrap: wrap; }
  .tabs .tab { flex: 1 1 33.3%; min-width: 33.3%; padding: 8px 6px; font-size: 11.5px; text-align: center; }
  /* fleet status (parked/moving/idle/offline) floats on the map */
  .layout > .side > .panel-foot { display: none; }
  .map-fleet {
    position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2000;
    display: flex; gap: 4px; flex-wrap: wrap;
  }
  .map-fleet .chip { font-size: 10.5px; padding: 1px 6px; }
  .map-status { bottom: 48px; }
  /* pinch / double-tap zooms on mobile; frees the corner for the stats row */
  .leaflet-container .leaflet-control-zoom { display: none; }
}

/* --------------------------------- red hide/unhide toggles v2 (both themes) -- */
.topbar .btn.side-open-btn, .topbar .btn.insp-open-btn {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}
.topbar .btn.side-open-btn:hover, .topbar .btn.insp-open-btn:hover {
  background: #c0392b !important; border-color: #c0392b !important;
}
.topbar .btn.side-open-btn:active, .topbar .btn.insp-open-btn:active {
  background: #a93226 !important; border-color: #a93226 !important;
}

/* -------------------------- mobile: map fills the screen when panels hidden -- */
@media (max-width: 960px) {
  .layout > .center { transition: min-height .3s ease; }
  .layout.side-hidden.insp-hidden > .center {
    min-height: calc(100vh - 50px);
    min-height: calc(100dvh - 50px);
  }
}

/* ---------------------------------------------------------- alert bell -- */
.topbar .alert-btn { position: relative; padding: 4px 9px; }
.topbar .alert-btn .bell-ico { font-size: 15px; line-height: 1; }
.alert-badge {
  position: absolute; top: -5px; right: -7px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  border: 1px solid #141b29; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="light"] .alert-badge { border-color: #dfe7f2; }
.alert-badge.alert-pulse { animation: alertPulse .55s ease 2; }
@keyframes alertPulse { 50% { transform: scale(1.4); } }
.alert-panel {
  position: absolute; top: calc(100% + 6px); right: 8px; z-index: 70;
  width: min(430px, calc(100vw - 16px)); background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden;
}
.alert-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.alert-head .right { display: flex; gap: 6px; margin-left: auto; }
.alert-list { max-height: min(62vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.alert-item { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); }
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: var(--panel-2); }
.alert-item .a-top { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.alert-item .a-when { margin-left: auto; font-weight: 400; color: var(--dim); font-size: 11px; white-space: nowrap; }
.alert-item .a-text { font-size: 12.5px; margin-top: 3px; }
.alert-item .a-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* --------------------------------------------- brand links to monitoring -- */
.topbar a.brand { color: inherit; text-decoration: none; }
.topbar a.brand:hover, .topbar a.brand:focus { color: inherit; text-decoration: none; }
.topbar a.brand:active { opacity: .8; }


/* ----------------------------------------------- website content manager -- */
/* /cms — pages on the left, the block editor on the right. */
.cms-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.cms-page-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
  color: inherit; cursor: pointer; font: inherit;
}
.cms-page-item:hover { border-color: var(--accent); }
.cms-page-item.active { border-color: var(--accent); background: rgba(47, 156, 244, .12); }
.cms-page-item .t { font-weight: 600; }
.cms-page-item .s { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cms-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; background: var(--panel-2); }
.cms-block.off { opacity: .55; }
.cms-block-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.cms-block-head .kind { font-weight: 600; }
.cms-block textarea { width: 100%; min-height: 62px; font-family: inherit; }
.cms-block .f { margin-top: 6px; }
.cms-block .f label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.cms-blocked { max-width: 620px; margin: 60px auto; text-align: center; }
@media (max-width: 900px) { .cms-layout { grid-template-columns: 1fr; } }

