:root {
  --bg: #3d444b;
  --bg-2: #353b41;
  --panel: #2f353a;
  --panel-2: #383f45;
  --line: #4a525a;
  --side: #2b3035;
  --side-hover: #353b41;
  --text: #e8ecef;
  --muted: #a7b0b8;
  --link: #4fa8e8;
  --accent: #3a7bc0;
  --orange: #f0a020;
  --blue: #3e6a96;
  --red: #e2483d;
  --green: #11b886;
  --teal: #17a2b8;
  --yellow: #f5c518;
  --ok: #1fa463;
  --bad: #d9443a;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,.35);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; vertical-align: -3px; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app.collapsed { grid-template-columns: 0 1fr; }
.sidebar { background: var(--side); overflow-y: auto; height: 100vh; position: sticky; top: 0; border-right: 1px solid #23282c; }
.app.collapsed .sidebar { overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #3a4046; }
.brand .logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #18b6a4, #f0a020 60%, #8a4fd8); display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.brand b { font-size: 18px; display: block; }
.brand span { font-size: 11.5px; color: var(--muted); }
.nav { padding: 8px 10px 30px; }
.nav h6 { margin: 16px 10px 6px; font-size: 12px; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: #d6dbe0; border-radius: var(--radius); margin: 1px 0; font-size: 14.5px; }
.nav a:hover { background: var(--side-hover); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a .badge { margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; background: var(--bg-2); border-bottom: 1px solid #2b3035; position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.iconbtn { background: none; border: 0; color: var(--text); padding: 6px; border-radius: var(--radius); cursor: pointer; display: inline-flex; }
.iconbtn:hover { background: rgba(255,255,255,.08); }
.locsel { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; font-size: 14px; max-width: 240px; }
.quick { position: relative; }
.quick input { width: 260px; }
.usermenu { position: relative; }
.usermenu .who { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 8px; border-radius: var(--radius); }
.usermenu .who:hover { background: rgba(255,255,255,.06); }
.dropdown { position: absolute; right: 0; top: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.4); min-width: 200px; padding: 6px; z-index: 40; }
.dropdown a { display: block; padding: 8px 10px; color: var(--text); border-radius: 3px; }
.dropdown a:hover { background: var(--panel-2); text-decoration: none; }
.content { padding: 20px 22px 60px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: 26px; font-weight: 500; }
.pagehead .crumb { color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards (dashboard boxes) ---------- */
.grid { display: grid; gap: 18px; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.card > .hd { display: flex; align-items: center; gap: 8px; padding: 13px 16px; font-size: 17px; font-weight: 600; color: #fff; background: var(--panel-2); }
.card > .hd .tools { margin-left: auto; display: flex; gap: 6px; }
.card > .hd.orange { background: var(--orange); }
.card > .hd.blue { background: var(--blue); }
.card > .hd.red { background: var(--red); }
.card > .hd.green { background: var(--green); }
.card > .hd.teal { background: var(--teal); }
.card > .bd { padding: 14px 16px; }
.card > .bd.flush { padding: 0; }
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 10px 14px; border-top: 1px solid #3f464d; font-size: 14.5px; }
.kv tr:first-child td { border-top: 0; }
.kv td:last-child { text-align: right; white-space: nowrap; }
.kv td a { font-variant-numeric: tabular-nums; }
.kv .amt { color: var(--text); margin-left: 6px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--accent); }
.tile .lbl { color: var(--muted); font-size: 13px; }
.tile .val { font-size: 25px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile.orange { border-color: var(--orange); } .tile.green { border-color: var(--green); } .tile.red { border-color: var(--red); } .tile.teal { border-color: var(--teal); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: #cfd6dc; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
table.t td { padding: 9px 12px; border-top: 1px solid #3f464d; vertical-align: top; }
table.t tbody tr:hover { background: rgba(255,255,255,.03); }
table.t td.actions-cell { white-space: nowrap; text-align: right; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: 20px; background: var(--panel-2); color: #d6dbe0; font-size: 13px; cursor: pointer; border: 1px solid transparent; }
.chip.on { background: var(--accent); color: #fff; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11.5px; font-weight: 700; line-height: 1.5; background: #59626b; color: #fff; }
.badge.yes, .badge.ok, .badge.paid, .badge.active, .badge.converted, .badge.accept, .badge.resolved { background: var(--ok); }
.badge.no, .badge.bad, .badge.cancelled, .badge.disabled, .badge.reject, .badge.lost, .badge.urgent { background: var(--bad); }
.badge.open, .badge.high, .badge.warn, .badge.expired, .badge.drop { background: #d98a10; }
.badge.in_progress, .badge.feasibility, .badge.cabling, .badge.activation, .badge.info { background: #2f7fc1; }
.badge.yellow { background: var(--yellow); color: #222; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #6c757d; margin-right: 6px; }
.dot.on { background: #22d07a; box-shadow: 0 0 6px #22d07a; }

/* ---------- forms ---------- */
input, select, textarea {
  background: #252a2f; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; font: inherit; font-size: 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 2px rgba(79,168,232,.2); }
input[type=checkbox] { width: auto; }
textarea { min-height: 70px; resize: vertical; }
label.f { display: block; font-size: 13px; color: #c7ced5; margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; font-weight: 600; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0 12px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: var(--radius); padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; background: #5a636c; color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); }
.btn.success { background: var(--ok); }
.btn.danger { background: var(--bad); }
.btn.warn { background: #d98a10; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sm { padding: 5px 9px; font-size: 13px; }
.inline-search { display: flex; gap: 6px; }
.inline-search input { padding: 5px 8px; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 6px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal.wide { max-width: 860px; }
.modal .mh { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.modal .mh .x { margin-left: auto; }
.modal .mb { padding: 18px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; right: 22px; background: #1f2428; color: #fff; padding: 12px 18px; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 200; border-left: 4px solid var(--ok); max-width: 420px; }
.toast.err { border-color: var(--bad); }
.err-box { background: rgba(217,68,58,.15); border: 1px solid var(--bad); color: #ffb3ad; padding: 9px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14px; }
.info-box { background: rgba(47,127,193,.15); border: 1px solid #2f7fc1; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; flex-wrap: wrap; background: var(--panel); }
.tabs a { padding: 12px 14px; color: var(--link); border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--text); border-color: var(--accent); background: var(--panel-2); }
.tabs a:hover { text-decoration: none; }

/* ---------- subscriber profile ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 16px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.profile-head h2 { margin: 0 0 4px; font-size: 21px; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; padding: 0 16px 16px; }
.facts div small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.notes-list .n { padding: 10px 0; border-top: 1px solid #3f464d; }
.notes-list .n:first-child { border-top: 0; }

/* ---------- charts ---------- */
.chart { width: 100%; height: 190px; display: block; }
.chart text { fill: var(--muted); font-size: 10.5px; }
.chart .bar { fill: var(--green); }
.chart .bar:hover { fill: #2ee0a8; }
.chart .grid-l { stroke: #444c54; stroke-width: 1; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 30% 20%, #4a535c, #2b3035 70%); }
.login { width: 100%; max-width: 380px; background: var(--panel); border-radius: 8px; padding: 30px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.login .brand { border: 0; padding: 0 0 20px; justify-content: center; }
.login .brand .logo { width: 52px; height: 52px; font-size: 20px; }
.login .brand b { font-size: 24px; }

/* ---------- print (invoice / receipt) ---------- */
.doc { background: #fff; color: #222; max-width: 820px; margin: 0 auto; padding: 36px 40px; border-radius: 4px; font-size: 14px; }
.doc a { color: #222; }
.doc h2 { margin: 0; font-size: 26px; color: #1b4f86; }
.doc .row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.doc th, .doc td { border: 1px solid #ccc; padding: 8px 10px; text-align: left; }
.doc th { background: #f1f4f7; }
.doc .tot td { font-weight: 700; }
.doc .stamp { display: inline-block; border: 3px solid; padding: 4px 14px; font-weight: 800; font-size: 20px; transform: rotate(-6deg); letter-spacing: 2px; }
.doc .stamp.paid { color: #1fa463; } .doc .stamp.open { color: #d9443a; } .doc .stamp.cancelled { color: #777; }
.print-bar { max-width: 820px; margin: 0 auto 14px; display: flex; gap: 8px; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .print-bar, .no-print { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1250px) { .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } .stat-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } .quick input { width: 170px; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 260px; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .app.mobile-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .app.collapsed { grid-template-columns: 1fr; }
  .cols-3, .cols-2, .cols-4, .form-grid { grid-template-columns: 1fr; }
  .quick { display: none; }
  .content { padding: 14px 12px 50px; }
  .usermenu .name { display: none; }
}

/* key/value tables whose values can be long (TR-069 device page): wrap instead of cutting off */
.kv.wrap td { vertical-align: top; }
.kv.wrap td:first-child { width: 34%; min-width: 120px; color: var(--muted, #9aa4ad); font-weight: 600; white-space: normal; }
.kv.wrap td:last-child { text-align: left; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.kv.wrap td:last-child .mono { overflow-wrap: anywhere; }
.acs-dev { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.acs-cmds { overflow-x: auto; }
.acs-cmds td { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1500px) { .acs-dev { grid-template-columns: 1fr; } }

/* live traffic */
.live-chart { width: 100%; height: 220px; }
.live-line-d { fill: none; stroke: #34d399; stroke-width: 2; vector-effect: non-scaling-stroke; }
.live-line-u { fill: none; stroke: #60a5fa; stroke-width: 2; vector-effect: non-scaling-stroke; }
.live-area-d { fill: rgba(52, 211, 153, .16); stroke: none; }
.live-area-u { fill: rgba(96, 165, 250, .12); stroke: none; }
.live-key-d, .live-key-u { display: inline-block; width: 12px; height: 3px; vertical-align: middle; border-radius: 2px; background: #34d399; }
.live-key-u { background: #60a5fa; }
.live-d { color: #34d399; } .live-u { color: #60a5fa; }
.live-bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.live-bar span { display: block; height: 100%; background: #34d399; border-radius: 4px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); vertical-align: middle; }
.tile.blue { border-color: #60a5fa; }

/* ---- menu: page search + foldable groups ---- */
.navfind { width: calc(100% - 4px); margin: 4px 2px 6px; padding: 9px 12px; border-radius: var(--radius); border: 1px solid #3a4046; background: #1d2125; color: var(--text); font-size: 14px; }
.nav h6[data-g] { cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.nav h6 .chev { transition: transform .15s; font-size: 12px; }
.nav h6.folded .chev { transform: rotate(-90deg); }
.navgrp.folded:not(.searching) { display: none; }
.navback, .tabbar, .msearch { display: none; }

/* ---- phones ---- */
@media (max-width: 860px) {
  .sidebar { width: 84vw; max-width: 320px; }
  .nav a { padding: 13px 14px; font-size: 16px; gap: 14px; }
  .nav a svg { width: 22px; height: 22px; }
  .nav h6 { font-size: 13px; padding: 10px 0 6px; margin: 12px 10px 4px; }
  .navfind { font-size: 16px; padding: 12px 14px; }
  .app.mobile-open .navback { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; }
  .msearch { display: block; padding: 10px 12px 0; }
  .msearch input { width: 100%; padding: 13px 14px; font-size: 16px; border-radius: 12px; border: 1px solid #3a4046; background: var(--panel); color: var(--text); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg-2); border-top: 1px solid #2b3035;
    padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--muted); font-size: 12px; text-decoration: none; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { color: #fff; }
  .tabbar a.on svg { color: var(--accent, #3b82f6); }
  .content { padding: 12px 12px 90px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar .locsel { max-width: 46vw; font-size: 14px; }
  .pagehead h1 { font-size: 22px; }
  /* tables scroll sideways instead of squeezing words onto many lines */
  table.t td { white-space: nowrap; }
  .tablewrap { -webkit-overflow-scrolling: touch; }
  .btn { min-height: 40px; }
  .stat-tiles .tile .val { font-size: 24px; }
}

/* phones: the open menu is part of the page (scrolls with it), not a box with its own scroll */
@media (max-width: 860px) {
  .app.mobile-open .sidebar { position: absolute; height: auto; min-height: 100vh; overflow: visible; padding-bottom: 80px; }
}
.mt-keys{display:flex;flex-wrap:wrap;gap:8px 18px}
.mt-keys label{display:flex;align-items:center;gap:6px;font-size:14px;cursor:pointer}
.mt-sec .hd{font-size:15px}
.ok-box { background: rgba(31,138,76,.15); border: 1px solid var(--ok, #1f8a4c); color: #9be2b5; padding: 9px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14px; }
.mt-page .card{margin-bottom:16px}

/* ================= light theme (phones by default; toggle in the menu) ================= */
html[data-theme="light"] {
  --bg: #f2f4f7; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #f6f8fa; --line: #dde2e7; --side: #ffffff; --side-hover: #eef2f6;
  --text: #1f2933; --muted: #6b7682; --link: #1976d2; --accent: #1e88e5;
}
html[data-theme="light"] body { background: var(--bg); }
html[data-theme="light"] .sidebar { border-right-color: var(--line); }
html[data-theme="light"] .brand { border-bottom-color: var(--line); }
html[data-theme="light"] .nav a { color: #2d3842; }
html[data-theme="light"] .nav a.active { color: #fff; }
html[data-theme="light"] .topbar { border-bottom-color: var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
html[data-theme="light"] .iconbtn:hover, html[data-theme="light"] .usermenu .who:hover { background: rgba(0,0,0,.05); }
html[data-theme="light"] .card { box-shadow: 0 1px 4px rgba(16,24,40,.08); }
html[data-theme="light"] .card > .hd { color: #1f2933; }
html[data-theme="light"] .card > .hd[class*=" "] { color: #fff; }
html[data-theme="light"] .kv td, html[data-theme="light"] table.t td, html[data-theme="light"] .notes-list .n { border-top-color: var(--line); }
html[data-theme="light"] table.t th { color: #3b4752; }
html[data-theme="light"] table.t tbody tr:hover { background: rgba(0,0,0,.025); }
html[data-theme="light"] .chip { color: #2d3842; background: #e9edf1; }
html[data-theme="light"] .chip.on { color: #fff; background: var(--accent); }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { background: #fff; color: var(--text); border-color: #cfd6dd; }
html[data-theme="light"] label.f { color: #44505c; }
html[data-theme="light"] .btn { background: #e3e8ed; color: #1f2933; }
html[data-theme="light"] .btn.primary { background: var(--accent); color: #fff; }
html[data-theme="light"] .btn.success { background: #18a058; color: #fff; }
html[data-theme="light"] .btn.danger { background: #e2483d; color: #fff; }
html[data-theme="light"] .btn.warn { color: #fff; }
html[data-theme="light"] .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
html[data-theme="light"] .err-box { color: #a8261d; background: #fdecea; }
html[data-theme="light"] .ok-box { color: #136c3e; background: #e8f6ee; }
html[data-theme="light"] .info-box { background: #e9f3fc; }
html[data-theme="light"] .navfind { background: #f2f4f7; border-color: var(--line); }
html[data-theme="light"] .msearch input { border-color: var(--line); }
html[data-theme="light"] .tabbar { border-top-color: var(--line); box-shadow: 0 -1px 4px rgba(0,0,0,.05); }
html[data-theme="light"] .tabbar a.on { color: var(--accent); }
html[data-theme="light"] .toast { background: #263238; }
html[data-theme="light"] .chart .grid-l { stroke: #e3e7eb; }
html[data-theme="light"] .login-wrap { background: radial-gradient(circle at 30% 20%, #ffffff, #e3e8ee 70%); }
html[data-theme="light"] .live-bar { background: rgba(0,0,0,.06); }

/* ================= phone drawer + card lists (like the XceedNet app) ================= */
.dhead, .dfoot { display: none; }
.clist { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.citem { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.ctop { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.ctop .ctitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.cgrid .cl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cgrid .cv { font-size: 14px; overflow-wrap: anywhere; }
.cgrid .cw { grid-column: 1 / -1; }
.cact { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cact:empty { display: none; }
@media (max-width: 860px) {
  .sidebar { padding-top: 0; }
  .sidebar .brand { display: none; }
  .dhead { display: block; background: linear-gradient(135deg, #1e88e5, #1565c0); color: #fff; padding: 18px 16px 16px; position: relative; }
  .dhead .av { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.95); color: #1e88e5; display: grid; place-items: center; font-size: 24px; font-weight: 700; float: left; margin-right: 12px; }
  .dhead b { display: block; font-size: 18px; margin-top: 2px; }
  .dhead .role { font-size: 12.5px; opacity: .85; }
  .dhead select { clear: both; display: block; width: 100%; margin-top: 14px; background: rgba(255,255,255,.15) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.7) !important; border-radius: 8px; padding: 9px 10px; font-size: 15px; }
  .dhead select option { color: #222; }
  .dhead .x { position: absolute; right: 10px; top: 10px; background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; padding: 6px; cursor: pointer; }
  .nav a { border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
  .nav a::after { content: '›'; margin-left: auto; font-size: 22px; color: var(--muted); line-height: 1; }
  .nav a .badge + ::after, .nav a.active::after { color: #fff; }
  .dfoot { display: block; padding: 8px 10px 16px; }
  .dfoot a { display: flex; align-items: center; gap: 14px; padding: 14px 14px; font-size: 16px; color: var(--text); border-top: 1px solid var(--line); text-decoration: none; }
  .dfoot a .sw { margin-left: auto; font-size: 20px; }
  .citem .btn { min-height: 38px; }
}
@media (max-width: 860px) {
  /* online / offline as a coloured label on the right of each customer card */
  .ctop .dot { order: 3; width: auto; height: auto; margin: 0; padding: 3px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 700; color: #fff; background: #d9443a; box-shadow: none; }
  .ctop .dot::after { content: 'offline'; }
  .ctop .dot.on { background: #18a058; }
  .ctop .dot.on::after { content: 'online'; }
  /* compact list toolbars: filters in one swipeable row */
  .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 7px 13px; font-size: 13.5px; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { flex: 1 1 140px; min-width: 0; width: auto !important; }
  .toolbar .spacer { display: none; }
  .pagehead { flex-wrap: wrap; gap: 8px; }
  .pagehead .btn { padding: 7px 11px; font-size: 13.5px; min-height: 36px; }
  .clist { padding: 8px 0; }
}

/* phones: long values in key/value tables (HTTPS card, certificates, links) wrap instead of running off the screen */
@media (max-width: 700px) {
  .kv td { padding: 9px 10px; }
  .kv td:last-child { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .kv td:first-child { width: 34%; vertical-align: top; }
  .kv td .mono, .kv td a { overflow-wrap: anywhere; word-break: break-all; }
}

/* ---- phone: nothing may run past the screen edge ---- */
@media (max-width: 700px) {
  .main, .content, #view, .card, .card-b, .card-body, fieldset, form, .grid > *, .row > *, .f, label { min-width: 0; max-width: 100%; }
  .card, .card-b, fieldset, .info-box, .hint, .muted, .small, label, p, li, h1, h2, h3, h4, b, strong, span, code, .mono, td, th, a, pre {
    overflow-wrap: anywhere; word-break: break-word;
  }
  pre, code { white-space: pre-wrap; max-width: 100%; }
  input, select, textarea, button, .btn { max-width: 100%; box-sizing: border-box; }
  input[type=file] { width: 100%; min-width: 0; }
  .grid, .row, .grid2, .grid3, .cols, .form-row, .split { grid-template-columns: 1fr !important; flex-wrap: wrap; }
  .row > *, .form-row > * { flex: 1 1 100%; }
  .info-box, fieldset { box-sizing: border-box; }
  table.kv, .kv.wrap { table-layout: auto; width: 100%; }
  .check, label.check { align-items: flex-start; }
  .table-wrap, .tbl, .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}
@media (max-width: 700px) {
  input[type=radio], input[type=checkbox] { width: auto !important; min-width: 0; flex: none; margin-right: 6px; }
  label.chk, label.check { display: flex !important; align-items: flex-start; gap: 4px; }
  table.t { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 700px) {
  table.t.evt { display: block; overflow: visible; }
  table.t.evt thead { display: none; }
  table.t.evt tbody, table.t.evt tr { display: block; }
  table.t.evt tr { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
  table.t.evt td { display: block; width: auto !important; border: 0; padding: 4px 0; text-align: left !important; }
  table.t.evt td[data-l] { display: flex; align-items: center; gap: 10px; }
  table.t.evt td[data-l]::before { content: attr(data-l); }
  table.t.evt td[data-l] input { order: -1; }
}
@media (max-width: 700px) {
  table.t.evt td > input, table.t.evt td > textarea { display: block; width: 100%; box-sizing: border-box; }
}
@media (max-width: 700px) { label.f { box-sizing: border-box; width: 100%; } .form-grid { grid-template-columns: 1fr !important; } }

/* ================= colour styles (skins): chosen per device in the menu ================= */
html[data-skin="a"][data-theme="dark"]{--bg:#0f2238;--bg-2:#0c1b2e;--panel:#16304d;--panel-2:#1c3a5c;--line:#2a4a6b;--side:#0a1726;--side-hover:#14304d;--text:#e8ecef;--muted:#a9b4bf;--accent:#14b8a6;--link:#14b8a6;--radius:6px}
html[data-skin="a"][data-theme="light"]{--bg:#eaf1f7;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f1f6fa;--line:#d5e0ea;--side:#ffffff;--side-hover:#e3eef6;--text:#1f2933;--muted:#66717d;--accent:#14b8a6;--link:#14b8a6;--radius:6px}
html[data-skin="a"] .nav a.active,html[data-skin="a"] .btn.primary,html[data-skin="a"] .chip.on{color:#fff}
html[data-skin="a"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="b"][data-theme="dark"]{--bg:#0e1014;--bg-2:#14161c;--panel:#1a1d25;--panel-2:#21252f;--line:#2c313c;--side:#12141a;--side-hover:#1d2029;--text:#e8ecef;--muted:#a9b4bf;--accent:#6366f1;--link:#6366f1;--radius:12px}
html[data-skin="b"][data-theme="light"]{--bg:#f3f4f8;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f6f7fb;--line:#e0e3ec;--side:#ffffff;--side-hover:#eceefa;--text:#1f2933;--muted:#66717d;--accent:#6366f1;--link:#6366f1;--radius:12px}
html[data-skin="b"] .nav a.active,html[data-skin="b"] .btn.primary,html[data-skin="b"] .chip.on{color:#fff}
html[data-skin="b"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="c"][data-theme="dark"]{--bg:#2a211c;--bg-2:#231b16;--panel:#33281f;--panel-2:#3c2f25;--line:#4d3c2e;--side:#1f1814;--side-hover:#33281f;--text:#e8ecef;--muted:#a9b4bf;--accent:#f97316;--link:#f97316;--radius:10px}
html[data-skin="c"][data-theme="light"]{--bg:#fff6ee;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#fff9f4;--line:#f1dccb;--side:#ffffff;--side-hover:#ffeddd;--text:#1f2933;--muted:#66717d;--accent:#f97316;--link:#f97316;--radius:10px}
html[data-skin="c"] .nav a.active,html[data-skin="c"] .btn.primary,html[data-skin="c"] .chip.on{color:#fff}
html[data-skin="c"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="d"][data-theme="dark"]{--bg:#0f1b33;--bg-2:#0b1428;--panel:#15264a;--panel-2:#1b3059;--line:#2a417a;--side:#0a1226;--side-hover:#16285a;--text:#e8ecef;--muted:#a9b4bf;--accent:#2563eb;--link:#2563eb;--radius:6px}
html[data-skin="d"][data-theme="light"]{--bg:#eef2fb;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f3f6fd;--line:#d3dcf0;--side:#ffffff;--side-hover:#e2eafc;--text:#1f2933;--muted:#66717d;--accent:#2563eb;--link:#2563eb;--radius:6px}
html[data-skin="d"] .nav a.active,html[data-skin="d"] .btn.primary,html[data-skin="d"] .chip.on{color:#fff}
html[data-skin="d"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="e"][data-theme="dark"]{--bg:#14221a;--bg-2:#101c15;--panel:#1b2e22;--panel-2:#223a2b;--line:#2f4d3a;--side:#0d1711;--side-hover:#1d3526;--text:#e8ecef;--muted:#a9b4bf;--accent:#16a34a;--link:#16a34a;--radius:14px}
html[data-skin="e"][data-theme="light"]{--bg:#eff7f1;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f4faf6;--line:#d4e6da;--side:#ffffff;--side-hover:#e1f2e7;--text:#1f2933;--muted:#66717d;--accent:#16a34a;--link:#16a34a;--radius:14px}
html[data-skin="e"] .nav a.active,html[data-skin="e"] .btn.primary,html[data-skin="e"] .chip.on{color:#fff}
html[data-skin="e"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="f"][data-theme="dark"]{--bg:#1a1426;--bg-2:#150f20;--panel:#231a35;--panel-2:#2b2042;--line:#3d2e5c;--side:#110c1b;--side-hover:#2a1f42;--text:#e8ecef;--muted:#a9b4bf;--accent:#7c3aed;--link:#7c3aed;--radius:12px}
html[data-skin="f"][data-theme="light"]{--bg:#f5f0fd;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f9f6fe;--line:#e2d8f4;--side:#ffffff;--side-hover:#ece2fb;--text:#1f2933;--muted:#66717d;--accent:#7c3aed;--link:#7c3aed;--radius:12px}
html[data-skin="f"] .nav a.active,html[data-skin="f"] .btn.primary,html[data-skin="f"] .chip.on{color:#fff}
html[data-skin="f"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="g"][data-theme="dark"]{--bg:#1b1b1b;--bg-2:#141414;--panel:#242424;--panel-2:#2c2c2c;--line:#3a3a3a;--side:#101010;--side-hover:#2a2a2a;--text:#e8ecef;--muted:#a9b4bf;--accent:#f5c518;--link:#f5c518;--radius:4px}
html[data-skin="g"][data-theme="light"]{--bg:#f4f3ee;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#faf9f4;--line:#dedcd2;--side:#ffffff;--side-hover:#f6efcf;--text:#1f2933;--muted:#66717d;--accent:#f5c518;--link:#f5c518;--radius:4px}
html[data-skin="g"] .nav a.active,html[data-skin="g"] .btn.primary,html[data-skin="g"] .chip.on{color:#1a1a1a}
html[data-skin="g"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="h"][data-theme="dark"]{--bg:#0f1f33;--bg-2:#0b1829;--panel:#162b45;--panel-2:#1c3553;--line:#2a4668;--side:#0a1523;--side-hover:#15304e;--text:#e8ecef;--muted:#a9b4bf;--accent:#10b981;--link:#10b981;--radius:10px}
html[data-skin="h"][data-theme="light"]{--bg:#edf3f8;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f2f7fb;--line:#d6e1ea;--side:#ffffff;--side-hover:#e0f0ec;--text:#1f2933;--muted:#66717d;--accent:#10b981;--link:#10b981;--radius:10px}
html[data-skin="h"] .nav a.active,html[data-skin="h"] .btn.primary,html[data-skin="h"] .chip.on{color:#fff}
html[data-skin="h"] .tabbar a.on svg{color:var(--accent)}
html[data-skin] .card,html[data-skin] .tile{border:1px solid var(--line)}
html[data-skin] .brand .logo{background:var(--accent)}
html[data-skin="g"][data-theme="light"] .nav a.active,html[data-skin="g"][data-theme="light"] .btn.primary{color:#1a1a1a}
html[data-skin="g"][data-theme="light"] .link,html[data-skin="g"][data-theme="light"] a{color:#8a6d00}
.skin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.skin-opt{border:2px solid var(--line);border-radius:12px;padding:10px;cursor:pointer;background:var(--panel-2);text-align:left;color:var(--text);font:inherit}
.skin-opt.on{border-color:var(--accent)}
.skin-opt .sw{display:flex;height:34px;border-radius:8px;overflow:hidden;margin-bottom:8px}
.skin-opt .sw i{flex:1}
.skin-opt b{display:block;font-size:14px}

/* ================= skin Home layouts (A..H) ================= */
.skh{max-width:560px;margin:0 auto 6px;color:var(--text)}
.skh a{color:inherit;text-decoration:none}
.skh .skc{display:block;background:var(--panel);border:1px solid var(--line);border-radius:calc(var(--radius) + 4px);color:var(--text)}
.skh .pad{padding:14px}
.skmu{color:var(--muted);font-size:12.5px}.skmu2{font-size:13px;opacity:.8}
.sknum{font-size:22px;font-weight:600;margin:8px 0 0;font-variant-numeric:tabular-nums}.sknum.big2{font-size:26px}
.skbig{font-size:28px;font-weight:600;margin:2px 0 8px;font-variant-numeric:tabular-nums}.skbig.sm{font-size:20px;margin:0}
.skt{margin:16px 4px 8px;font-size:14px;font-weight:600}
.skg2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.skg2.up{margin-top:-34px;padding:0 12px;position:relative}
.skg2 .tile{padding:12px;text-align:left;border-left-width:1px}
.sktop{display:flex;align-items:center;justify-content:space-between;gap:10px}.sktop.pad{padding:8px 4px 12px}
.skpill{display:inline-flex;align-items:center;gap:6px;background:rgba(127,127,127,.22);padding:6px 12px;border-radius:16px;font-size:13px}
.skpill svg{width:15px;height:15px}
.skpill2{display:inline-block;font-size:12px;background:rgba(255,255,255,.22);padding:5px 12px;border-radius:14px;margin-top:4px}
.skav{width:36px;height:36px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;flex:none;background:rgba(127,127,127,.2)}
.skav.acc{background:var(--accent);color:#fff}
.skico{width:32px;height:32px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center}
.skico svg,.skqi svg{width:19px;height:19px}
.green{--tn:#10b981}.amber{--tn:#f59e0b}.red{--tn:#f43f5e}.blue{--tn:#3b82f6}.purple{--tn:#8b5cf6}
.skico.green,.skqi.green{background:rgba(16,185,129,.18);color:#10b981}.skico.amber,.skqi.amber{background:rgba(245,158,11,.2);color:#f59e0b}
.skico.red,.skqi.red{background:rgba(244,63,94,.18);color:#f43f5e}.skico.blue,.skqi.blue{background:rgba(59,130,246,.18);color:#3b82f6}.skico.purple,.skqi.purple{background:rgba(139,92,246,.18);color:#8b5cf6}
.skq{display:grid;grid-template-columns:repeat(auto-fit,minmax(60px,1fr));gap:8px;text-align:center}
.skq a{display:flex;flex-direction:column;align-items:center;gap:4px}
.skqi{width:48px;height:48px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center}.skqi svg{width:22px;height:22px}
.skrow{display:flex;align-items:center;gap:10px;padding:11px 12px;border-top:1px solid var(--line)}.skrow:first-child{border-top:0}
.skgrow{flex:1;min-width:0;display:flex;flex-direction:column}.skgrow b{font-weight:600;font-size:14px}
.skplus{color:#10b981}
.skbar{height:8px;border-radius:4px;background:rgba(127,127,127,.22)}.skbar i{display:block;height:8px;border-radius:4px;background:var(--accent)}
.skhero{background:var(--hero,var(--panel));color:var(--herofg,var(--text));padding:14px 16px;border-radius:calc(var(--radius) + 6px)}
.skhero.tall{padding-bottom:46px}
.skhot{display:block;margin:8px 0;background:var(--accent);color:var(--accentfg,#fff)!important;border-radius:18px;padding:16px}
.skhot.big{padding:16px 18px;margin-top:6px}
.skshort{display:flex!important;align-items:center;gap:10px;padding:12px}.skshort svg{width:20px;height:20px}
.skadd{display:flex;justify-content:space-between;align-items:center;margin:12px 0;background:var(--accent);color:var(--accentfg,#fff)!important;border-radius:16px;padding:13px 14px;font-size:14px;font-weight:600}
.skadd svg{width:18px;height:18px;vertical-align:-3px}
.sksheet{background:var(--bg);border-radius:22px 22px 0 0;padding:14px 0 4px;margin-top:-10px;position:relative}
.ringcard{display:flex!important;align-items:center;gap:14px;margin:-34px 12px 0;padding:14px;position:relative;border-radius:20px!important}
.skh .bl{border-left:4px solid}.skh .bl.y{border-left-color:#facc15}.skh .bl.g{border-left-color:#4ade80}.skh .bl.o{border-left-color:#fb923c}.skh .bl.r{border-left-color:#f87171}
.skmore{margin:22px 0 10px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600}
html[data-skin="a"]{--hero:#0f2a4a;--herofg:#fff}
html[data-skin="d"]{--hero:#2563eb;--herofg:#fff}
html[data-skin="h"]{--hero:#0b1b33;--herofg:#fff}
html[data-skin="g"]{--accentfg:#1a1a1a}
html[data-skin="a"] .skhero .skpill,html[data-skin="h"] .skhero .skpill{background:rgba(255,255,255,.14)}
html[data-skin="c"] .skhot{border-radius:18px}
html[data-skin="e"] .skadd,html[data-skin="e"] .skhot{background:#166534}
.skunpaid{margin-top:14px;display:grid;gap:8px}
.skuphead{display:flex!important;align-items:center;gap:10px;padding:12px;border-left:4px solid #f43f5e!important}
.skdue{color:#f43f5e}

/* ===== more colour styles I..N (from the mobile admin references) ===== */
html[data-skin="i"][data-theme="dark"]{--bg:#120f2b;--bg-2:#17133a;--panel:#1c1745;--panel-2:#241d57;--line:#352c75;--side:#0e0b22;--side-hover:#241d57;--text:#ece9ff;--muted:#a5adbb;--accent:#8b5cf6;--link:#8b5cf6;--radius:14px}
html[data-skin="i"][data-theme="light"]{--bg:#f1eeff;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f6f3ff;--line:#ddd6fb;--side:#ffffff;--side-hover:#ece7ff;--text:#1f2933;--muted:#66717d;--accent:#8b5cf6;--link:#8b5cf6;--radius:14px}
html[data-skin="i"][data-theme="light"] .nav a.active,html[data-skin="i"][data-theme="light"] .btn.primary,html[data-skin="i"][data-theme="light"] .chip.on{color:#fff}
html[data-skin="i"][data-theme="dark"] .nav a.active,html[data-skin="i"][data-theme="dark"] .btn.primary,html[data-skin="i"][data-theme="dark"] .chip.on{color:#fff}
html[data-skin="i"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="j"][data-theme="dark"]{--bg:#0f1a12;--bg-2:#0c150f;--panel:#16251a;--panel-2:#1c2f21;--line:#2a4631;--side:#0a120c;--side-hover:#1a2e20;--text:#ece9ff;--muted:#a5adbb;--accent:#3fa75a;--link:#3fa75a;--radius:16px}
html[data-skin="j"][data-theme="light"]{--bg:#f3f7ef;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f7faf3;--line:#dfe9d6;--side:#ffffff;--side-hover:#e8f3df;--text:#1f2933;--muted:#66717d;--accent:#2f8f48;--link:#2f8f48;--radius:16px}
html[data-skin="j"][data-theme="light"] .nav a.active,html[data-skin="j"][data-theme="light"] .btn.primary,html[data-skin="j"][data-theme="light"] .chip.on{color:#fff}
html[data-skin="j"][data-theme="dark"] .nav a.active,html[data-skin="j"][data-theme="dark"] .btn.primary,html[data-skin="j"][data-theme="dark"] .chip.on{color:#fff}
html[data-skin="j"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="k"][data-theme="dark"]{--bg:#08090a;--bg-2:#0e1011;--panel:#141618;--panel-2:#1a1d20;--line:#23272b;--side:#050606;--side-hover:#1a1d20;--text:#ece9ff;--muted:#a5adbb;--accent:#22ff7a;--link:#22ff7a;--radius:16px}
html[data-skin="k"][data-theme="light"]{--bg:#f2f5f3;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f6f9f7;--line:#d5ddd8;--side:#ffffff;--side-hover:#e2f7ea;--text:#1f2933;--muted:#66717d;--accent:#12b455;--link:#12b455;--radius:16px}
html[data-skin="k"][data-theme="light"] .nav a.active,html[data-skin="k"][data-theme="light"] .btn.primary,html[data-skin="k"][data-theme="light"] .chip.on{color:#04210f}
html[data-skin="k"][data-theme="dark"] .nav a.active,html[data-skin="k"][data-theme="dark"] .btn.primary,html[data-skin="k"][data-theme="dark"] .chip.on{color:#04210f}
html[data-skin="k"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="l"][data-theme="dark"]{--bg:#1b1730;--bg-2:#221d3a;--panel:#2a2447;--panel-2:#322b55;--line:#463e72;--side:#15112a;--side-hover:#2f2850;--text:#ece9ff;--muted:#a5adbb;--accent:#7c6cf0;--link:#7c6cf0;--radius:18px}
html[data-skin="l"][data-theme="light"]{--bg:#f4eefa;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#faf6ff;--line:#e6dcf5;--side:#ffffff;--side-hover:#efe7fb;--text:#1f2933;--muted:#66717d;--accent:#7c6cf0;--link:#7c6cf0;--radius:18px}
html[data-skin="l"][data-theme="light"] .nav a.active,html[data-skin="l"][data-theme="light"] .btn.primary,html[data-skin="l"][data-theme="light"] .chip.on{color:#fff}
html[data-skin="l"][data-theme="dark"] .nav a.active,html[data-skin="l"][data-theme="dark"] .btn.primary,html[data-skin="l"][data-theme="dark"] .chip.on{color:#fff}
html[data-skin="l"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="m"][data-theme="dark"]{--bg:#10142e;--bg-2:#0d1126;--panel:#171d42;--panel-2:#1e2652;--line:#2f3a78;--side:#0a0d20;--side-hover:#1c2450;--text:#ece9ff;--muted:#a5adbb;--accent:#6366f1;--link:#6366f1;--radius:14px}
html[data-skin="m"][data-theme="light"]{--bg:#eef2ff;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f4f6ff;--line:#dfe4fb;--side:#ffffff;--side-hover:#e4e8ff;--text:#1f2933;--muted:#66717d;--accent:#4f46e5;--link:#4f46e5;--radius:14px}
html[data-skin="m"][data-theme="light"] .nav a.active,html[data-skin="m"][data-theme="light"] .btn.primary,html[data-skin="m"][data-theme="light"] .chip.on{color:#fff}
html[data-skin="m"][data-theme="dark"] .nav a.active,html[data-skin="m"][data-theme="dark"] .btn.primary,html[data-skin="m"][data-theme="dark"] .chip.on{color:#fff}
html[data-skin="m"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="n"][data-theme="dark"]{--bg:#0d0d0d;--bg-2:#111111;--panel:#151515;--panel-2:#1c1c1c;--line:#444444;--side:#0a0a0a;--side-hover:#1c1c1c;--text:#ece9ff;--muted:#a5adbb;--accent:#f5f5f5;--link:#f5f5f5;--radius:6px}
html[data-skin="n"][data-theme="light"]{--bg:#ffffff;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f6f6f6;--line:#d4d4d4;--side:#ffffff;--side-hover:#eeeeee;--text:#1f2933;--muted:#66717d;--accent:#111111;--link:#111111;--radius:6px}
html[data-skin="n"][data-theme="light"] .nav a.active,html[data-skin="n"][data-theme="light"] .btn.primary,html[data-skin="n"][data-theme="light"] .chip.on{color:#fff}
html[data-skin="n"][data-theme="dark"] .nav a.active,html[data-skin="n"][data-theme="dark"] .btn.primary,html[data-skin="n"][data-theme="dark"] .chip.on{color:#111}
html[data-skin="n"] .tabbar a.on svg{color:var(--accent)}
html[data-skin="i"]{--hero:linear-gradient(160deg,#3b2a8f,#1a1445);--herofg:#fff;--accentfg:#fff}
html[data-skin="j"]{--hero:linear-gradient(160deg,#a7e08a,#5fb36a);--herofg:#10331b;--accentfg:#fff}
html[data-skin="m"]{--hero:linear-gradient(135deg,#2563eb,#7c3aed);--herofg:#fff;--accentfg:#fff}
html[data-skin="k"]{--accentfg:#04210f}html[data-skin="l"],html[data-skin="n"]{--accentfg:#fff}
html[data-skin="n"][data-theme="dark"]{--accentfg:#111}
html[data-skin="l"] .skhot,html[data-skin="l"] .skadd{background:linear-gradient(135deg,#7c6cf0,#ff8fb8)}
html[data-skin="i"] .skhot,html[data-skin="i"] .skadd{background:linear-gradient(135deg,#8b5cf6,#22d3ee)}
html[data-skin="l"][data-theme="light"] body{background:linear-gradient(170deg,#ffe3f1,#dbe8ff 55%,#e6ddff);background-attachment:fixed}
html[data-skin="l"] .skc{background:rgba(255,255,255,.6);backdrop-filter:blur(8px)}
html[data-skin="l"][data-theme="dark"] .skc{background:rgba(255,255,255,.07)}
html[data-skin="i"] .skhero .skpill,html[data-skin="m"] .skhero .skpill{background:rgba(255,255,255,.18)}
.skh.sk-i .ringcard,.skh.sk-k .skglow{box-shadow:0 0 0 1px var(--accent),0 0 22px color-mix(in srgb,var(--accent) 50%,transparent)}
html[data-skin="n"] .skc,html[data-skin="n"] .card,html[data-skin="n"] .tile{border:1.5px solid #111}
html[data-skin="n"][data-theme="dark"] .skc,html[data-skin="n"][data-theme="dark"] .card,html[data-skin="n"][data-theme="dark"] .tile{border-color:#bbb}
.skinsheet{position:fixed;left:0;right:0;bottom:0;z-index:300;background:var(--panel);color:var(--text);border-top:1px solid var(--line);border-radius:18px 18px 0 0;box-shadow:0 -10px 40px rgba(0,0,0,.35);padding:12px 0 calc(12px + env(safe-area-inset-bottom));max-width:720px;margin:0 auto}
.skinsheet-hd{display:flex;justify-content:space-between;align-items:center;padding:0 14px 6px;font-size:16px}
.skinsheet-row{display:flex;gap:10px;overflow-x:auto;padding:4px 14px 12px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.skinsheet-row .skin-opt{flex:0 0 138px;scroll-snap-align:start}
.skinsheet-ft{display:grid;grid-template-columns:1fr 2fr;gap:10px;padding:0 14px}
.skinsheet-ft .btn{min-height:46px;justify-content:center;font-size:15px}

/* ===== Cyborg style (O): near-black, steel blue, sharp corners ===== */
html[data-skin="o"][data-theme="dark"]{--bg:#060606;--bg-2:#0d0d0d;--panel:#151515;--panel-2:#222222;--line:#2b2b2b;--side:#060606;--side-hover:#222222;--text:#c9cbcc;--muted:#888888;--accent:#2a9fd6;--link:#2a9fd6;--radius:2px}
html[data-skin="o"][data-theme="light"]{--bg:#eceeef;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#f4f5f6;--line:#d4d8db;--side:#ffffff;--side-hover:#e6eaed;--text:#222222;--muted:#6b7277;--accent:#2a9fd6;--link:#1b7fae;--radius:2px}
html[data-skin="o"]{--accentfg:#fff}
html[data-skin="o"] .nav a.active,html[data-skin="o"] .btn.primary,html[data-skin="o"] .chip.on{color:#fff}
html[data-skin="o"] .nav a,html[data-skin="o"] .tabbar a,html[data-skin="o"] .skmu,html[data-skin="o"] .skt,html[data-skin="o"] .tile .lbl{text-transform:uppercase;letter-spacing:.06em}
html[data-skin="o"] .nav a{font-size:13px}
html[data-skin="o"] .skh .skc,html[data-skin="o"] .card,html[data-skin="o"] .tile{border:1px solid var(--line);border-radius:2px}
html[data-skin="o"] .skg2 .tile{border-top:3px solid var(--accent)}
html[data-skin="o"] .skhot,html[data-skin="o"] .skadd,html[data-skin="o"] .skqi,html[data-skin="o"] .skico,html[data-skin="o"] .skav{border-radius:2px}
html[data-skin="o"] .btn{border-radius:2px;text-transform:uppercase;letter-spacing:.05em;font-size:12.5px}
html[data-skin="o"] .card > .hd{text-transform:uppercase;letter-spacing:.05em;font-size:14px}
html[data-skin="o"][data-theme="dark"] input,html[data-skin="o"][data-theme="dark"] select,html[data-skin="o"][data-theme="dark"] textarea{background:#060606;border-color:#2b2b2b}

/* ===== Pop Art style (P): comic colours, thick outlines, hard shadows, moving shapes ===== */
html[data-skin="p"][data-theme="light"]{--bg:#fff3a8;--bg-2:#ffffff;--panel:#ffffff;--panel-2:#ffe9f4;--line:#111111;--side:#ffffff;--side-hover:#ffe94d;--text:#111111;--muted:#4a4a5a;--accent:#ff2d95;--link:#d6007a;--radius:12px}
html[data-skin="p"][data-theme="dark"]{--bg:#1b1038;--bg-2:#241449;--panel:#2b1a5a;--panel-2:#3a2278;--line:#ffffff;--side:#241449;--side-hover:#3a2278;--text:#ffffff;--muted:#cbb9ff;--accent:#ffe600;--link:#5ee7ff;--radius:12px}
html[data-skin="p"] body{background-image:radial-gradient(rgba(0,0,0,.13) 1.4px,transparent 1.6px);background-size:14px 14px}
html[data-skin="p"][data-theme="dark"] body{background-image:radial-gradient(rgba(255,255,255,.09) 1.4px,transparent 1.6px)}
html[data-skin="p"] .card,html[data-skin="p"] .tile,html[data-skin="p"] .skh .skc,html[data-skin="p"] .topbar,html[data-skin="p"] .tabbar{border:3px solid var(--line);box-shadow:4px 4px 0 var(--line)}
html[data-skin="p"] .topbar{border-width:0 0 3px;box-shadow:none}html[data-skin="p"] .tabbar{border-width:3px 0 0;box-shadow:none}
html[data-skin="p"] .sidebar{border-right:3px solid var(--line)}
html[data-skin="p"] .btn{border:2px solid var(--line);box-shadow:3px 3px 0 var(--line);font-weight:700;text-transform:uppercase;letter-spacing:.03em}
html[data-skin="p"] .btn:active{transform:translate(3px,3px);box-shadow:0 0 0 var(--line)}
html[data-skin="p"] .btn.primary{color:#111}html[data-skin="p"][data-theme="light"] .btn.primary{background:var(--pc1,#ffe600)}
html[data-skin="p"] .nav a.active{background:var(--pc1,#ffe600);color:#111;border:2px solid #111;font-weight:700}
html[data-skin="p"] .chip.on{color:#111;background:var(--pc1,#ffe600)}
html[data-skin="p"] .card > .hd{border-bottom:3px solid var(--line);text-transform:uppercase;letter-spacing:.04em;font-weight:800}
html[data-skin="p"] .brand b,html[data-skin="p"] .pagehead h1{font-weight:900;text-transform:uppercase;letter-spacing:.02em}
html[data-skin="p"] .skhero{background:var(--phero,#00c8ff);color:#111;border:3px solid #111;box-shadow:5px 5px 0 #111;position:relative;overflow:hidden}
html[data-skin="p"] .skhero .skpill{background:#fff;border:2px solid #111;color:#111}
html[data-skin="p"] .skav.acc{background:var(--accent);color:#fff;border:2px solid #111}
html[data-skin="p"] .skbig{font-weight:900;text-transform:uppercase;letter-spacing:.01em}
html[data-skin="p"] .skg2 .tile{color:#111;transition:transform .15s}
html[data-skin="p"] .skg2 .tile:hover,html[data-skin="p"] .skg2 .tile:active{transform:rotate(-1.5deg) scale(1.03)}
html[data-skin="p"] .tile.popc1{background:var(--pc1,#ffe600)}html[data-skin="p"] .tile.popc2{background:var(--pc2,#00e0ff)}html[data-skin="p"] .tile.popc3{background:var(--pc3,#ff7ac6)}html[data-skin="p"] .tile.popc4{background:var(--pc4,#9bff5a)}
html[data-skin="p"] .tile .skmu,html[data-skin="p"] .tile .sknum{color:#111}
html[data-skin="p"] .skqi{border:3px solid #111;box-shadow:3px 3px 0 #111;background:#fff;color:#111;border-radius:50%}
html[data-skin="p"] .skq a:nth-child(1) .skqi{background:var(--pc1,#ffe600)}html[data-skin="p"] .skq a:nth-child(2) .skqi{background:var(--pc2,#00e0ff)}html[data-skin="p"] .skq a:nth-child(3) .skqi{background:var(--pc3,#ff7ac6)}html[data-skin="p"] .skq a:nth-child(4) .skqi{background:var(--pc4,#9bff5a)}
html[data-skin="p"] .skq a:hover .skqi{animation:popwig .5s ease-in-out}
html[data-skin="p"] .skt{text-transform:uppercase;font-weight:800;letter-spacing:.05em}
html[data-skin="p"] .skuphead{border-left:3px solid #111!important;background:var(--pc3,#ff7ac6)!important;color:#111!important}
html[data-skin="p"] .skuphead .skmu{color:#111}
html[data-skin="p"] .skadd,html[data-skin="p"] .skhot{background:var(--pc1,#ffe600);color:#111!important;border:3px solid #111;box-shadow:4px 4px 0 #111}
#popfx{position:fixed;inset:0;pointer-events:none;z-index:0;overflow:hidden}
#popfx i{position:absolute;display:block;opacity:.9;will-change:transform}
#popfx svg{width:100%;height:100%;display:block;overflow:visible}
html[data-skin="p"] .app,html[data-skin="p"] .main{position:relative;z-index:1}
@keyframes popfloat{0%,100%{transform:translateY(0) rotate(var(--r0,0deg))}50%{transform:translateY(-26px) rotate(calc(var(--r0,0deg) + 14deg))}}
@keyframes popspin{to{transform:rotate(360deg)}}
@keyframes popdrift{0%{transform:translateX(0) rotate(0)}50%{transform:translateX(38px) rotate(20deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes popwig{0%,100%{transform:rotate(0)}25%{transform:rotate(-12deg)}75%{transform:rotate(12deg)}}
@keyframes poppulse{0%,100%{transform:scale(1) rotate(-6deg)}50%{transform:scale(1.15) rotate(6deg)}}
@media (prefers-reduced-motion:reduce){#popfx i,html[data-skin="p"] .skq a:hover .skqi{animation:none!important}}

/* phones: while the menu is open the page behind it is hidden, so scrolling ends where the menu ends */
@media (max-width: 860px) {
  .app.mobile-open .main { display: none; }
  .app.mobile-open .sidebar { position: relative; height: auto; min-height: 0; padding-bottom: 96px; }
}

/* Dashboard is always the first thing in the menu, and the bottom bar (Home, Customers…) stays usable while the menu is open */
.nav .navpin { font-weight: 600; border: 1px solid var(--line); margin: 2px 2px 8px; }
@media (max-width: 860px) {
  .tabbar { z-index: 70; }
  .app.mobile-open .sidebar { padding-bottom: 110px; }
}

/* Pop Art variants Q..T: same comic style, different colours */
html[data-skin="p"][data-pop="q"]{--pc1:#ff9f1c;--pc2:#ffd23f;--pc3:#ff5d73;--pc4:#b983ff;--phero:#ff6b35}
html[data-skin="p"][data-pop="q"][data-theme="light"]{--bg:#ffd9b0;--accent:#e4002b;--link:#e4002b;--panel-2:#ffd9b0;--side-hover:#ff9f1c}
html[data-skin="p"][data-pop="q"][data-theme="dark"]{--bg:#2a0f1e;--bg-2:#3b1730;--panel:#3b1730;--panel-2:#4d1f40;--side:#3b1730;--side-hover:#4d1f40;--accent:#ffb400;--link:#ffb400}
html[data-skin="p"][data-pop="r"]{--pc1:#2de2c3;--pc2:#7be0ff;--pc3:#ff8fab;--pc4:#ffe66d;--phero:#3ddbb6}
html[data-skin="p"][data-pop="r"][data-theme="light"]{--bg:#c9fff0;--accent:#00a884;--link:#00a884;--panel-2:#c9fff0;--side-hover:#2de2c3}
html[data-skin="p"][data-pop="r"][data-theme="dark"]{--bg:#06241f;--bg-2:#0b342d;--panel:#0b342d;--panel-2:#10463c;--side:#0b342d;--side-hover:#10463c;--accent:#2de2c3;--link:#2de2c3}
html[data-skin="p"][data-pop="s"]{--pc1:#00f0ff;--pc2:#ff2bd6;--pc3:#fffb00;--pc4:#39ff14;--phero:#7b2cff}
html[data-skin="p"][data-pop="s"][data-theme="light"]{--bg:#e9e4ff;--accent:#c026d3;--link:#c026d3;--panel-2:#e9e4ff;--side-hover:#00f0ff}
html[data-skin="p"][data-pop="s"][data-theme="dark"]{--bg:#0a0a1f;--bg-2:#12123a;--panel:#12123a;--panel-2:#1b1b52;--side:#12123a;--side-hover:#1b1b52;--accent:#00f0ff;--link:#00f0ff}
html[data-skin="p"][data-pop="t"]{--pc1:#ff9ad5;--pc2:#9ad7ff;--pc3:#fff08a;--pc4:#b8ffc9;--phero:#ffb3e0}
html[data-skin="p"][data-pop="t"][data-theme="light"]{--bg:#ffe0f1;--accent:#ff3d9a;--link:#ff3d9a;--panel-2:#ffe0f1;--side-hover:#ff9ad5}
html[data-skin="p"][data-pop="t"][data-theme="dark"]{--bg:#2b1030;--bg-2:#3b1844;--panel:#3b1844;--panel-2:#4d2058;--side:#3b1844;--side-hover:#4d2058;--accent:#ff9ad5;--link:#ff9ad5}
html[data-skin="p"][data-pop="s"] .card,html[data-skin="p"][data-pop="s"] .tile,html[data-skin="p"][data-pop="s"] .skh .skc{border-color:#00f0ff;box-shadow:4px 4px 0 #ff2bd6,0 0 18px rgba(0,240,255,.35)}
html[data-skin="p"][data-pop="s"][data-theme="dark"] body{background-image:radial-gradient(rgba(0,240,255,.14) 1.4px,transparent 1.6px)}
html[data-skin="p"][data-pop="s"] .tile,html[data-skin="p"][data-pop="s"] .skhero{color:#0a0a1f}
html[data-skin="p"][data-pop="s"] .btn{border-color:#00f0ff;box-shadow:3px 3px 0 #ff2bd6}

/* logo in the top bar; version and copyright at the end of the menu */
.toplogo { display: inline-flex; align-items: center; flex: none; }
.tlogo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.aboutcard { margin: 10px 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--muted); font-size: 12px; line-height: 1.5; }
.aboutcard .ab1 { display: flex; align-items: center; gap: 8px; color: var(--text); margin-bottom: 4px; }
.ablogo { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; }
@media (max-width: 860px) { .app.mobile-open .sidebar { padding-bottom: 110px; } }
@media (max-width: 860px) {
  .topbar .locsel { min-width: 0; flex: 1 1 0; max-width: none; }
  .topbar .spacer { display: none; }
  .topbar .who { flex: none; }
  .topbar .who .badge { white-space: nowrap; }
}

/* PON outages: on/off switch */
.oltsw{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;background:none;border:0;color:inherit;padding:2px}
.oltsw i{width:42px;height:24px;border-radius:12px;background:#8a949e;position:relative;transition:background .15s;flex:none}
.oltsw i::after{content:"";position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s}
.oltsw[aria-checked=true] i{background:#18a957}.oltsw[aria-checked=true] i::after{transform:translateX(18px)}
.oltsw:focus-visible i{outline:2px solid var(--accent,#3a7bc0);outline-offset:2px}
.oltsw b{min-width:24px}

.lt-stale .stat-tiles,.lt-stale #lt-chart{opacity:.45;filter:grayscale(.6)}
