:root {
  color-scheme: light;
  --bg: #f2f4f8; --surface: #ffffff; --surface-2: #eef1f7; --border: #dde3ee;
  --text: #0b1630; --text-2: #4a5470; --muted: #7a839c;
  --nav: #0a1f44; --nav-text: #c3cfe6; --nav-active: #15315f; --brand: #f47c20; --brand-ink: #0a1f44;
  --accent: #ee7420; --accent-ink: #0a1f44;   /* orange buttons, navy text (5:1) */
  --link: #1b3f8f;
  --s1: #2a78d6; --s2: #eb6834;
  --good: #11875d; --good-bg: #e3f4ec; --warn: #9a6500; --warn-bg: #fbf0d9;
  --bad: #c23b3a; --bad-bg: #fbe5e4; --info-bg: #e5eefa;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px var(--border);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a1020; --surface: #111a2e; --surface-2: #18233b; --border: #26324e;
    --text: #eef2fa; --text-2: #b7c1d8; --muted: #8590ab;
    --nav: #060d1d; --nav-text: #aab8d4; --nav-active: #13264a; --brand: #f7913a; --brand-ink: #0a1630;
    --accent: #f7913a; --accent-ink: #0a1630;
    --link: #9ab9f5;
    --s1: #3987e5; --s2: #d95926;
    --good: #4cc995; --good-bg: #15302a; --warn: #e8b04a; --warn-bg: #33290f;
    --bad: #ef7d7c; --bad-bg: #3a1a1a; --info-bg: #17253a;
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a1020; --surface: #111a2e; --surface-2: #18233b; --border: #26324e;
    --text: #eef2fa; --text-2: #b7c1d8; --muted: #8590ab;
    --nav: #060d1d; --nav-text: #aab8d4; --nav-active: #13264a; --brand: #f7913a; --brand-ink: #0a1630;
    --accent: #f7913a; --accent-ink: #0a1630;
    --link: #9ab9f5;
    --s1: #3987e5; --s2: #d95926;
    --good: #4cc995; --good-bg: #15302a; --warn: #e8b04a; --warn-bg: #33290f;
    --bad: #ef7d7c; --bad-bg: #3a1a1a; --info-bg: #17253a;
  }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* layout */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--nav); color: var(--nav-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px;
  padding: 4px 10px 18px; }
.logo span { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center;
  color: var(--brand-ink); font-size: 15px; font-weight: 800; }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin: 16px 10px 6px; }
.side a { display: flex; align-items: center; gap: 10px; color: var(--nav-text); padding: 7px 10px; border-radius: 7px; }
.side a:hover { background: var(--nav-active); text-decoration: none; color: #fff; }
.side a.on { background: var(--nav-active); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.side svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: inset 0 3px 0 var(--brand); position: sticky; top: 0; z-index: 5; }
.top form { flex: 1; max-width: 420px; }
.top .who { margin-left: auto; color: var(--text-2); display: flex; gap: 14px; align-items: center; }
.top .menu-btn { display: none; }
.page { padding: 24px 28px 48px; max-width: 1400px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head .sub { color: var(--text-2); margin-top: 2px; }

/* building blocks */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi .l { color: var(--text-2); font-size: 12.5px; }
.kpi .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .n { color: var(--muted); font-size: 12px; }
.kpi a.v { color: var(--text); display: block; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono, td .mono { white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: -6px -10px; }
.empty { color: var(--muted); padding: 22px 10px; text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 12px;
  font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-active, .b-paid, .b-online, .b-closed.ok { background: var(--good-bg); color: var(--good); }
.b-suspended, .b-unpaid, .b-pending, .b-high { background: var(--warn-bg); color: var(--warn); }
.b-disabled, .b-void, .b-reject, .b-offline { background: var(--bad-bg); color: var(--bad); }
.b-lead, .b-open { background: var(--info-bg); color: var(--s1); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer;
  white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }

label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 550; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.fields .wide { grid-column: 1 / -1; }
.field-row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.field-row > div { flex: 1; min-width: 140px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); }
.check input { width: auto; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: var(--good-bg); color: var(--good);
  font-weight: 550; word-break: break-word; }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 5px 12px; border-radius: 99px; color: var(--text-2); }
.tabs a.on { background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-weight: 600; }
details.box { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; margin-top: 12px; }
details.box summary { cursor: pointer; font-weight: 600; }
pre.code { background: var(--surface-2); padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--good); }
.muted { color: var(--muted); }
.right { text-align: right; }

/* bar chart */
.viz-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
  vertical-align: -1px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; border-bottom: 1px solid var(--border);
  padding-top: 8px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: stretch; height: 100%; position: relative; }
.bars .pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bars .bar { width: min(26px, 40%); border-radius: 4px 4px 0 0; }
.bars .stack { width: 100%; display: flex; flex-direction: column-reverse; gap: 2px; }
.bars .stack .bar { width: 100%; border-radius: 0; }
.bars .stack .bar:last-child { border-radius: 3px 3px 0 0; }
.bars.dense { gap: 3px; }
.bars .col:hover .bar { filter: brightness(1.12); }
.bars .col:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 5px 8px; border-radius: 6px;
  font-size: 12px; white-space: pre; z-index: 3; pointer-events: none; }
.x-labels { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.x-labels span { flex: 1; text-align: center; }
.bars.dense + .x-labels { gap: 3px; }
.f1 { background: var(--s1); } .f2 { background: var(--s2); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth .logo { color: var(--text); padding: 0 0 18px; }

/* portal */
.portal-top { background: var(--nav); color: #fff; border-bottom: 3px solid var(--brand); }
.portal-top .in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 14px 20px; }
.portal-top .logo { padding: 0; }
.portal-top nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.portal-top nav a { color: var(--nav-text); padding: 6px 10px; border-radius: 7px; }
.portal-top nav a:hover, .portal-top nav a.on { background: var(--nav-active); color: #fff; text-decoration: none; }
.portal { max-width: 1040px; margin: 0 auto; padding: 24px 20px 60px; }

/* thread */
.msg { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin-bottom: 10px; max-width: 760px; }
.msg.cust { background: var(--info-bg); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; }

/* invoice */
.invoice { max-width: 820px; margin: 24px auto; background: #fff; color: #111; padding: 44px; border-radius: 10px;
  box-shadow: var(--shadow); }
.invoice table th { color: #555; border-color: #ddd; } .invoice table td { border-color: #eee; }
.invoice .totals { margin-left: auto; width: 300px; margin-top: 12px; }
.invoice .totals td { border: 0; padding: 4px 10px; }
.invoice .totals tr.grand td { font-size: 17px; font-weight: 700; border-top: 2px solid #111; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.pre { white-space: pre-line; }
.noprint { max-width: 820px; margin: 18px auto 0; display: flex; gap: 8px; }
@media print {
  .noprint { display: none; }
  body { background: #fff; }
  .invoice { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

@media (max-width: 1000px) {
  .g-side, .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 240px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; }
  .top .who span { display: none; }
  .page { padding: 16px; }
  .invoice { padding: 22px; margin: 12px 16px; }
  .inv-head { flex-direction: column; }
  .invoice .totals { width: 100%; }
  .bars { gap: 4px; }
}

/* sidebar counter */
.side a .count { margin-left: auto; background: var(--brand); color: var(--brand-ink); border-radius: 99px;
  font-size: 11.5px; padding: 0 7px; line-height: 18px; font-weight: 700; }

/* WhatsApp inbox */
.wa-list a.row, .wa-list .rowlink { display: flex; gap: 12px; padding: 12px 10px; color: var(--text); }
.wa-list a.row { border-bottom: 1px solid var(--border); }
.wa-list .row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.wa-list .row .rowlink { flex: 1; min-width: 0; padding-left: 4px; }
.wa-list a.row:hover, .wa-list .row:hover { background: var(--surface-2); text-decoration: none; }
.wa-list .rowlink:hover { text-decoration: none; }
.wa-list .row:last-child, .wa-list a.row:last-child { border-bottom: 0; }
.wa-list .row .sel { display: flex; align-items: center; padding: 0 4px 0 8px; cursor: pointer; }
.wa-list .row .sel input { width: 17px; height: 17px; margin: 0; }
.wa-list .row.picked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wa-selall input { width: 17px; height: 17px; margin: 0; flex: none; }
.wa-selall { white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); padding: 6px 8px 8px; cursor: pointer; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--nav); color: #fff; display: grid;
  place-items: center; font-weight: 700; flex: none; }
.wa-list .meta { flex: 1; min-width: 0; }
.wa-list .line1 { display: flex; gap: 8px; align-items: baseline; }
.wa-list .line1 strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-list .when { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.wa-list .preview { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.unread { background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: 11.5px; padding: 0 7px;
  font-weight: 700; line-height: 18px; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; padding: 0; overflow: hidden; }
.thread { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2); }
.bubble { max-width: min(560px, 80%); padding: 8px 12px; border-radius: 12px; word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: #ffe7d3; color: #2a1606; border-top-right-radius: 4px; }
.bubble.bot { background: #dfe8fa; color: #0b1630; }
.bubble.failed { outline: 2px solid var(--bad); }
.bubble .txt { white-space: pre-wrap; }
.bubble .bmeta { display: block; font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; white-space: nowrap; }
.bubble img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; margin-bottom: 4px; }
.day-sep { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--surface); padding: 2px 10px;
  border-radius: 99px; margin: 8px 0; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); align-items: end; }
.composer textarea { min-height: 42px; max-height: 160px; height: 42px; }
.window-note { padding: 10px 14px; background: var(--warn-bg); color: var(--warn); font-size: 13px;
  border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bubble.out { background: #5a2e10; color: #fff3e8; }
  :root:not([data-theme="light"]) .bubble.bot { background: #1c2d52; color: #e7eefc; }
}
:root[data-theme="dark"] .bubble.out { background: #5a2e10; color: #fff3e8; }
:root[data-theme="dark"] .bubble.bot { background: #1c2d52; color: #e7eefc; }
@media (max-width: 760px) { .chat { height: calc(100vh - 170px); } }

/* monitoring charts */
.side a .count.alarm { background: var(--bad); color: #fff; }
.mchart { position: relative; min-height: 220px; }
.mcharts .mchart + .mchart { margin-top: 0; }
.mchart-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.mchart-now { margin-left: auto; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mchart svg { display: block; overflow: visible; touch-action: pan-y; }
.mchart-tip { position: absolute; top: 40px; background: var(--surface); box-shadow: var(--shadow), 0 4px 14px rgba(0,0,0,.12);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; pointer-events: none; white-space: nowrap; z-index: 4; }
.mchart-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.mchart-tip b { font-variant-numeric: tabular-nums; }
.badge.b-none { background: var(--surface-2); color: var(--muted); }

/* live (RouterOS API) charts */
.lchart { position: relative; }
.lchart-body svg { display: block; overflow: visible; touch-action: pan-y; }
.meter-sm { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter-sm i { display: block; height: 100%; background: var(--s1); border-radius: 99px; }
.meter-sm i.hot { background: var(--s2); }

/* CPE section on the customer page */
.cpe-section { margin: 16px 0; scroll-margin-top: 80px; }
.cpe-section > .card:first-child { border-top: 3px solid var(--brand); }
.cpe-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.cpe-stats span { display: block; font-size: 12px; color: var(--muted); }
.cpe-stats b { font-weight: 600; word-break: break-all; }
.cpe-section .grid > form.card { margin-top: 0; }

/* customer profile */
.profile { margin-bottom: 16px; }
.profile .info-cols { gap: 8px 28px; }
.profile .dl { grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); align-content: start; }
.chip { display: inline-block; margin: 2px 4px 0 0; padding: 1px 8px; border-radius: 99px; font-size: 12px; text-decoration: none;
        background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.chip.on { background: var(--brand); color: #fff; }
.filters { margin: 0 0 14px; flex-wrap: wrap; align-items: center; }
.filters > div:first-of-type { flex: 1 1 240px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 7px 14px; margin: 0; cursor: pointer; font-size: 14px; color: var(--text); }
.seg label + label { border-left: 1px solid var(--border); }
.seg input { width: auto; margin: 0; }
.seg label:has(input:checked) { background: color-mix(in srgb, var(--brand) 14%, transparent); font-weight: 600; }
.comment-new textarea { width: 100%; resize: vertical; }
.comments { margin-top: 10px; max-height: 420px; overflow-y: auto; }
.comment { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.comment .body { flex: 1; min-width: 0; }
.comment .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.comment.todo .txt::before { content: "To-do · "; font-weight: 600; color: var(--warn); }
.comment.done .txt { text-decoration: line-through; color: var(--muted); }
.comment.done .txt::before { color: var(--muted); }
.tick { width: 20px; height: 20px; flex: none; margin-top: 1px; border: 2px solid var(--border); border-radius: 5px; background: var(--surface);
        cursor: pointer; padding: 0; font-size: 13px; line-height: 16px; color: #fff; }
.comment.done .tick { background: var(--good, #16a34a); border-color: var(--good, #16a34a); }
.linkbtn { background: none; border: 0; padding: 0 0 0 6px; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; }
#custform > .card { margin-top: 16px; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: var(--surface-2); }

/* ---------------------------------------------------------------- scheduling */
:root { --k-installation: #2563eb; --k-fault: #dc2626; --k-maintenance: #d97706; --k-relocation: #7c3aed;
        --k-collection: #0d9488; --k-survey: #0891b2; --k-other: #64748b; }
.k-installation { --k: var(--k-installation); } .k-fault { --k: var(--k-fault); } .k-maintenance { --k: var(--k-maintenance); }
.k-relocation { --k: var(--k-relocation); } .k-collection { --k: var(--k-collection); } .k-survey { --k: var(--k-survey); }
.k-other { --k: var(--k-other); }
.kind-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--k); margin-right: 10px; vertical-align: 2px; }
.badge.s-new { background: var(--surface-2); color: var(--text-2); }
.badge.s-scheduled { background: color-mix(in srgb, var(--k-installation) 14%, transparent); color: var(--k-installation); }
.badge.s-in_progress { background: var(--warn-bg); color: var(--warn); }
.badge.s-on_hold { background: color-mix(in srgb, var(--k-relocation) 14%, transparent); color: var(--k-relocation); }
.badge.s-done { background: var(--good-bg); color: var(--good); }
.badge.s-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.tabs .count { margin-left: 4px; }
.task-list { display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0;
            padding: 12px 16px; text-decoration: none; color: var(--text); border-left: 4px solid var(--k); }
.task-row:hover { border-color: var(--k); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.task-row.closed { opacity: .65; }
.task-row .when b { display: block; } .task-row .when span { font-size: 13px; color: var(--text-2); }
.task-row .kind { color: var(--k); font-weight: 600; font-size: 13px; }
.task-row .t2 { font-weight: 600; margin: 2px 0; overflow-wrap: anywhere; }
.task-row .t3 { font-size: 13px; }
.task-row .who { text-align: right; font-size: 13px; }
@media (max-width: 640px) {
  .task-row { grid-template-columns: 1fr; gap: 4px; }
  .task-row .when { display: flex; gap: 8px; } .task-row .who { text-align: left; display: flex; gap: 10px; flex-wrap: wrap; }
}
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .day { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; min-height: 160px; }
.week .day.weekend { background: var(--surface-2); }
.week .day.today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.week .dh { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.week .dh b { color: var(--text); } .week .dh .add { margin-left: auto; text-decoration: none; font-weight: 700; }
.week .ev { display: block; border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 9%, var(--surface));
            border-radius: 6px; padding: 5px 7px; margin-bottom: 6px; text-decoration: none; color: var(--text); font-size: 12.5px; }
.week .ev.closed { opacity: .55; }
.week .ev span { display: block; overflow-wrap: anywhere; }
.week .ev .tm { font-weight: 600; } .week .ev .ts { color: var(--text-2); font-size: 11.5px; }
.week .free { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .week .day { min-height: 0; } }
.lookup { border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; max-height: 260px; overflow-y: auto; background: var(--surface); }
.lookup button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; }
.lookup button:hover { background: var(--surface-2); }
.picked { padding: 8px 0; font-weight: 600; } .picked a { font-weight: 400; margin-left: 6px; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .tl { border-left: 2px solid var(--border); padding: 2px 0 12px 14px; position: relative; }
.timeline .tl::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline .tl.system::before, .timeline .tl.status::before { background: var(--muted); }
.timeline .tl.system, .timeline .tl.status { color: var(--text-2); font-size: 13.5px; }
.timeline .meta { font-size: 12px; color: var(--muted); }
.log-form { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.log-form textarea, #complete textarea { width: 100%; }
.photo-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-pick .pick-info { font-size: 12px; }
.pick-preview { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.pick-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 6px; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.photos figcaption { font-size: 11px; color: var(--muted); margin-top: 2px; }
.photos figcaption a { text-decoration: none; margin-left: 4px; }
.done-report { border-top: 3px solid var(--good); }
.task-mini { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.task-mini .kind-dot { margin-right: 0; flex: none; width: 9px; height: 9px; }
.task-mini span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tabs .count { background: var(--brand); color: var(--brand-ink); border-radius: 99px; padding: 0 7px; font-size: 11.5px; font-weight: 700; }
.tabs .count.alarm { background: var(--bad); color: #fff; }

/* ping availability */
.avail-now { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); margin-bottom: 12px; font-size: 15px; }
.avail-now.up { background: var(--good-bg); } .avail-now.down { background: var(--bad-bg, #fde8e8); }
.avail-now .dot { margin-right: 6px; }
.avail-table td { vertical-align: middle; }
.pctcell { min-width: 170px; white-space: nowrap; }
.pctcell b { display: inline-block; min-width: 64px; text-align: right; }
.pctbar { display: inline-block; width: 90px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.pctbar i { display: block; height: 100%; } .pctbar i.ok { background: var(--good); } .pctbar i.warn { background: var(--warn); } .pctbar i.bad { background: var(--bad); }

/* SolidOps brand (artwork: static/brand/ — logo, mark, wordmark; the -dark versions are for the navy bars) */
.logo.brand-so { display: flex; align-items: center; gap: 10px; }
.logo.brand-so .so-mark { width: 40px; height: 40px; flex: none; object-fit: contain; }
.logo.brand-so .so-word { display: block; height: 22px; width: auto; }
.logo.brand-so b { font-size: 20px; font-weight: 800; color: #fff; }
.logo .noc-tag { font-style: normal; width: auto; height: auto; font-size: 12px; font-weight: 700; letter-spacing: .1em;
  background: var(--brand); color: var(--brand-ink); border-radius: 5px; padding: 1px 6px; }
.noc-top .logo.brand-so .so-word { height: 24px; }
/* staff login: navy page, logo on a navy hero */
body.thor-login { background: radial-gradient(ellipse at top, #13336b 0%, #0a1f44 55%, #050f24 100%); min-height: 100vh; }
.thor-login .auth .card { max-width: 420px; padding: 0; overflow: hidden; border: 1px solid rgba(150,170,255,.25);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 20px 60px rgba(0,0,0,.5); }
.so-hero { background: linear-gradient(160deg, #0d2652 0%, #0a1f44 60%, #081a3a 100%); padding: 30px 30px 24px;
  border-bottom: 3px solid var(--brand); text-align: center; }
.so-hero img { display: block; width: 100%; max-width: 330px; height: auto; margin: 0 auto; }
.so-hero-sm { padding: 18px 30px 14px; } .so-hero-sm img { max-width: 220px; }
.so-hero .so-name { color: #fff; font-size: 30px; font-weight: 800; }
.thor-body { padding: 18px 26px 26px; }
.thor-body h2 { text-align: center; }

/* "Powered by" under the staff logo */
.logo.brand-so .brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.powered { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(220,230,245,.62); margin-top: 5px; font-style: normal; white-space: nowrap; }
.powered em { font-style: normal; color: #ffb15c; }
.login-powered { text-align: center; color: var(--muted); margin: -4px 0 12px; }
.login-powered em { color: var(--brand); }
.logo.brand-so .brand-txt b { align-self: flex-start; }

/* connecting companies */
.co-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700;
  color: var(--co); background: color-mix(in srgb, var(--co) 13%, transparent); border: 1px solid color-mix(in srgb, var(--co) 40%, transparent);
  text-decoration: none; white-space: nowrap; vertical-align: 1px; }
a.co-chip:hover { text-decoration: none; background: color-mix(in srgb, var(--co) 22%, transparent); }
.co-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.co-filter a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.co-filter a i { width: 9px; height: 9px; border-radius: 50%; background: var(--co); }
.co-filter a b { font-size: 12px; color: var(--muted); font-weight: 600; }
.co-filter a.on { border-color: var(--co, var(--brand)); box-shadow: inset 0 0 0 1px var(--co, var(--brand)); color: var(--text); font-weight: 600; }
.co-list { display: grid; gap: 12px; align-content: start; }
.co-list .card { margin: 0; }
.co-card { border-left: 5px solid var(--co); } .co-card.inactive { opacity: .7; }
.co-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 16px; }
.co-stats span { display: block; font-size: 12px; color: var(--muted); } .co-stats b { font-size: 18px; }
input[type=color] { width: 64px; height: 38px; padding: 3px; cursor: pointer; }

/* stock & warranty */
.badge.w-active { background: var(--good-bg); color: var(--good); }
.badge.w-expiring { background: var(--warn-bg); color: var(--warn); }
.badge.w-expired { background: var(--surface-2); color: var(--muted); }
.badge.i-in_stock { background: var(--info-bg); color: var(--k-installation, #2563eb); }
.badge.i-sold { background: var(--good-bg); color: var(--good); }
.badge.i-faulty, .badge.i-rma { background: var(--bad-bg); color: var(--bad); }
.badge.i-written_off { background: var(--surface-2); color: var(--muted); }
.badge.c-open, .badge.c-sent { background: var(--warn-bg); color: var(--warn); }
.badge.c-repaired, .badge.c-replaced, .badge.c-closed { background: var(--good-bg); color: var(--good); }
.badge.c-rejected { background: var(--bad-bg); color: var(--bad); }
.pline { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.pline:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.pline textarea { width: 100%; }
.claim { border-top: 1px solid var(--border); padding: 10px 0; } .claim:first-of-type { border-top: 0; }
.claim.open { border-left: 3px solid var(--warn); padding-left: 10px; }
tr.muted td { color: var(--muted); }
.bulkbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 10px; }

/* maps */
.geomap { position: relative; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); z-index: 0; }
.map-big { height: calc(100vh - 290px); min-height: 420px; }
.picker-map { height: 300px; }
.map-err { position: absolute; inset: auto 10px 10px 10px; z-index: 1000; background: var(--bad-bg); color: var(--bad); padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px; }
.maplayer { gap: 6px; } .maplayer .lc { font-size: 12px; color: var(--muted); font-weight: 600; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.mk { display: inline-block; box-sizing: border-box; background: var(--f); border: 2px solid var(--s); box-shadow: 0 1px 4px rgba(0,0,0,.35); vertical-align: middle; }
.mk-circle { border-radius: 50%; } .mk-square { border-radius: 3px; } .mk-diamond { transform: rotate(45deg); border-radius: 2px; }
.mk-pin { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.map-pop { font: 13px/1.4 Inter, system-ui, sans-serif; min-width: 180px; color: #0f172a; }
.map-pop .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.map-pop .s { color: #475569; font-size: 12px; margin: 2px 0 6px; }
.map-pop a { margin-right: 10px; font-weight: 600; }
.picker-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.picker-bar input { flex: 1 1 160px; min-width: 0; }

/* ---- email & SMS */
.bad-txt { color: var(--bad); }
.badge.ms-sent, .badge.ms-received { background: var(--info-bg); color: var(--s1); }
.badge.ms-delivered { background: var(--good-bg); color: var(--good); }
.badge.ms-failed { background: var(--bad-bg); color: var(--bad); }
.badge.ms-queued { background: var(--warn-bg); color: var(--warn); }
.badge.ms-skipped, .badge.ms-cancelled { background: var(--surface-2); color: var(--muted); }
.badge.src { background: var(--surface-2); color: var(--text-2); font-weight: 500; }
.comm-log { margin-top: 12px; border-top: 1px solid var(--border); }
.comm { border-bottom: 1px solid var(--border); }
.comm summary { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; list-style: none; font-size: 13px; }
.comm summary::-webkit-details-marker { display: none; }
.comm summary .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm.in summary .txt { font-weight: 600; }
.comm .meta { font-size: 12px; color: var(--muted); }
.comm .body { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; margin: 6px 0 10px; }
.ch { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); min-width: 28px; text-align: center; }
.ch.ch-sms { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.ch.ch-email { background: var(--info-bg); color: var(--s1); }
.msg.note { background: var(--warn-bg); }
.msg .meta .ch { margin-right: 4px; }
.msg .sent-to { font-size: 12px; color: var(--muted); margin-top: 6px; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.attach img { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; display: block; }
.attach a.img { padding: 2px; }
.reply-box .seg { margin-bottom: 8px; }
.reply-box .sendvia { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 8px; }
.audience { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.aud-count { font-size: 28px; font-weight: 700; line-height: 1.1; }
.aud-line { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.preview-mail { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.preview-mail .pm-head { padding: 8px 12px; background: var(--surface-2); font-size: 13px; }
.preview-mail .pm-body { padding: 12px; white-space: pre-wrap; font-size: 14px; }
.preview-sms { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; max-width: 340px; }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-list button { font: 12px ui-monospace, monospace; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.progress { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }
.progress .p-ok { background: var(--good); } .progress .p-sent { background: var(--s1); } .progress .p-bad { background: var(--bad); }
.setup-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.setup-row:last-child { border-bottom: 0; }
.setup-row .state { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.setup-row .state.ok { background: var(--good); } .setup-row .state.bad { background: var(--bad); }
.setup-row .what { flex: 1; min-width: 0; }
.steps { padding-left: 20px; margin: 6px 0; } .steps li { margin: 4px 0; }
code.k { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

/* ---- OLTs, ONUs, switch ports */
.sig { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.sig-good { color: var(--good); } .sig-weak { color: var(--warn); } .sig-bad { color: var(--bad); } .sig-none { color: var(--muted); font-weight: 400; }
.badge.o-online { background: var(--good-bg); color: var(--good); }
.badge.o-offline, .badge.o-inactive { background: var(--bad-bg); color: var(--bad); }
.badge.o-disabled, .badge.o-removed, .badge.o-unknown { background: var(--surface-2); color: var(--muted); }
.pon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pon { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); color: inherit; text-decoration: none; }
.pon:hover { border-color: var(--s1); }
.pon.on { outline: 2px solid var(--s1); }
.pon .pn { font-weight: 700; font-family: ui-monospace, monospace; }
.pon .pc { font-size: 22px; font-weight: 700; margin: 2px 0; }
.pon .pc small { font-size: 13px; color: var(--muted); font-weight: 500; }
.pon .pbar { height: 6px; border-radius: 4px; background: var(--bad-bg); overflow: hidden; }
.pon .pbar i { display: block; height: 100%; background: var(--good); }
.pon.alarm { border-color: var(--bad); background: var(--bad-bg); }
.faceplate { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; background: #1b2232; border-radius: 10px; }
.fp-port { position: relative; width: 44px; height: 38px; border-radius: 5px; background: #2d3446; border: 2px solid #3b4358; display: flex; align-items: flex-end; justify-content: center; font: 600 10px ui-monospace, monospace; color: #cfd6e6; padding-bottom: 3px; text-decoration: none; cursor: pointer; }
.fp-port::before { content: ""; position: absolute; top: 4px; left: 50%; width: 24px; height: 12px; margin-left: -12px; border-radius: 2px; background: #11151f; }
.fp-port.up { border-color: #2fbf71; } .fp-port.up::before { background: #1e6f45; box-shadow: 0 0 6px #2fbf71; }
.fp-port.down { border-color: #4a5266; }
.fp-port.disabled { border-color: #8a5a00; opacity: .6; }
.fp-port.err::after { content: "!"; position: absolute; top: -7px; right: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 10px; line-height: 14px; text-align: center; }
.fp-port.sel { outline: 2px solid #f28c28; outline-offset: 1px; }
.fp-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.fp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.port-row.sel td { background: var(--info-bg); }
.macs { font: 12px ui-monospace, monospace; columns: 3 180px; margin: 6px 0 0; }
.chart-onu { width: 100%; height: auto; display: block; }
.chart-onu .grid-l { stroke: var(--border); stroke-width: 1; }
.chart-onu text { fill: var(--muted); font-size: 10px; }
.chart-onu .rx { fill: none; stroke: var(--s1); stroke-width: 2; }
.raw-out { max-height: 280px; overflow: auto; font-size: 12px; }

/* ---- settings */
.set-row { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 6px 18px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: start; }
.set-row > label { font-weight: 500; padding-top: 8px; margin: 0; }
.set-row .check { padding-top: 6px; }
@media (max-width: 700px) { .set-row { grid-template-columns: 1fr; } .set-row > label { padding-top: 0; } }
.src { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); vertical-align: 1px; }
.src.src-db { background: var(--info-bg); color: var(--s1); }
.ch.ch-whatsapp { background: color-mix(in srgb, #25d366 18%, transparent); color: #128c4a; }

/* ---- live notifications */
.top .bell { position: relative; background: none; border: 0; padding: 4px; border-radius: 8px; color: var(--text-2); cursor: pointer; display: inline-flex; }
.top .bell:hover { background: var(--surface-2); color: var(--text); }
.top .bell .mute { display: none; }
.top .bell.muted { color: var(--muted); } .top .bell.muted .mute { display: inline; }
.top .bell .count { position: absolute; top: -4px; right: -7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--s2, #f28c28); color: #fff; font: 700 10px/16px system-ui; text-align: center; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); text-decoration: none; animation: toast-in .25s ease-out; transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast .ti { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 11px system-ui; background: var(--info-bg); color: var(--s1); }
.toast.t-whatsapp .ti { background: #25d366; color: #fff; }
.toast.t-slawarn { border-left: 4px solid var(--warn); } .toast.t-slawarn .ti { background: var(--warn); color: #fff; }
.toast.t-slaover { border-left: 4px solid var(--bad); } .toast.t-slaover .ti { background: var(--bad); color: #fff; }
.toast .tb { flex: 1; min-width: 0; font-size: 13px; }
.toast .tb b { display: block; font-size: 13px; }
.toast .tb span { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast button { flex: none; background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- WhatsApp bot editor */
.bot-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.bot-side { position: sticky; top: 70px; }
@media (max-width: 1100px) { .bot-wrap { grid-template-columns: 1fr; } .bot-side { position: static; order: -1; } }
.bot-node { border-left: 4px solid var(--border); scroll-margin-top: 80px; }
.bot-node.t-menu { border-left-color: var(--accent); } .bot-node.t-ask { border-left-color: #6b6bd6; }
.bot-node.t-handover { border-left-color: var(--good); } .bot-node.t-end { border-left-color: var(--muted); }
.bot-node:target { box-shadow: 0 0 0 2px var(--accent); }
.bn-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.bn-head .bn-title { font-weight: 600; font-size: 15px; flex: 1; }
.bn-head .bn-key { max-width: 150px; font-size: 12.5px; }
.bt { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px;
  border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.bt-menu { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
.bt-ask { background: color-mix(in srgb, #6b6bd6 18%, transparent); }
.bt-handover { background: var(--good-bg); color: var(--good); }
.chips { margin-top: 4px; } .chips .chip { cursor: pointer; font-family: ui-monospace, monospace; font-size: 11px; }
.opts { width: 100%; margin-top: 4px; } .opts th { padding: 4px 6px; } .opts td { padding: 3px 6px 3px 0; border: 0; }
.opts tr.blank input { border-style: dashed; }
.tree { list-style: none; margin: 0; padding: 0; } .tree li { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.tree li:last-child { border-bottom: 0; } .tree a { font-weight: 600; margin-right: 6px; }
.kw td { vertical-align: top; } .kw textarea { width: 100%; }
.sim-log { height: 420px; overflow-y: auto; background: var(--surface-2); border-radius: 8px; padding: 10px; margin: 8px 0;
  display: flex; flex-direction: column; gap: 6px; }
.sim-b { max-width: 85%; padding: 7px 10px; border-radius: 10px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.4; }
.sim-b.me { align-self: flex-end; background: #d9fdd3; color: #111; border-bottom-right-radius: 3px; }
.sim-b.bot { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 3px; }
.sim-b.note { align-self: center; max-width: 100%; color: var(--muted); font-size: 12px; text-align: center; }
.sim-b.err { align-self: center; color: var(--bad); font-size: 12px; }
.sim-opts { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
.sim-opt { background: none; border: 0; color: #0a7cff; font-weight: 600; cursor: pointer; padding: 3px; text-align: center; font-size: 13px; }
.sim-opt:hover { text-decoration: underline; }
.sim-lb { text-align: center; color: #0a7cff; font-size: 12px; }
.sim-in { display: flex; gap: 6px; } .sim-in input { flex: 1; }
.o-menu { margin-top: 14px; }

/* ---- WhatsApp side panel (every page) */
:root { --dock-w: 380px; }
.wadock-tab { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 12px; border-radius: 99px; border: 0; background: #1fa855; color: #fff; font: 600 14px system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: pointer; }
.wadock-tab:hover { background: #17924a; }
.wadock-tab svg { width: 18px; height: 18px; }
.wadock-tab .count { background: #fff; color: #17924a; border-radius: 99px; font-size: 12px; padding: 0 7px; line-height: 19px; }
.wadock-tab.has { animation: wd-pulse 2.4s ease-in-out 3; }
@keyframes wd-pulse { 50% { box-shadow: 0 0 0 8px rgba(31,168,85,.25), 0 6px 18px rgba(0,0,0,.22); } }
body:has(.wadock-tab:not([hidden])) #toasts { bottom: 70px; }
.wadock { position: fixed; top: 0; right: 0; bottom: 0; width: var(--dock-w); z-index: 950; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0,0,0,.08); }
.wadock[hidden], .wd-listview[hidden], .wd-chatview[hidden] { display: none; }
@media (min-width: 1280px) { body.wadock-open .shell { margin-right: var(--dock-w); } body.wadock-open #toasts { right: calc(var(--dock-w) + 16px); } }
@media (max-width: 1279px) { .wadock { box-shadow: -12px 0 40px rgba(0,0,0,.25); } }
@media (max-width: 520px) { :root { --dock-w: 100vw; } }
.wd-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 14px; background: #1fa855; color: #fff; flex: none; }
.wd-title { flex: 1; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-ico, .wd-back { background: rgba(255,255,255,.14); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; font-size: 16px; line-height: 1; text-decoration: none; }
.wd-back { font-size: 24px; padding-bottom: 3px; }
.wd-ico:hover, .wd-back:hover { background: rgba(255,255,255,.28); text-decoration: none; }
.wd-listview, .wd-chatview { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wd-tools { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex: none; }
.wd-tabs { display: flex; gap: 4px; }
.wd-tabs button { flex: 1; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 4px 8px;
  font-size: 13px; cursor: pointer; }
.wd-tabs button.on { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 600; }
.wd-list { flex: 1; overflow-y: auto; }
.wd-row { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: var(--text); cursor: pointer; font: inherit; }
.wd-row:hover { background: var(--surface-2); }
.wd-row .avatar { width: 34px; height: 34px; flex: none; font-size: 14px; }
.wd-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wd-l1 { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.wd-l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.wd-when { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.wd-prev { flex: 1; min-width: 0; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-l2 { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-l2 i, .wd-sub i { font-style: normal; }
.st-waiting { color: var(--warn); font-weight: 600; } .st-open { color: var(--good); } .st-bot { color: var(--s1, #3a6fd8); }
.wd-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.wd-sub { padding: 6px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); flex: none; }
.wd-thread { flex: 1; padding: 12px; }
.wd-thread .bubble { max-width: 88%; font-size: 13.5px; }
.wd-thread .bubble img { max-width: 220px; }
.wd-err { padding: 6px 12px; background: var(--bad-bg); color: var(--bad); font-size: 12.5px; flex: none; }
.wd-closed { padding: 8px 12px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; flex: none; }
.wd-compose { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); align-items: flex-end; flex: none; }
.wd-compose[hidden] { display: none; }
.wd-compose textarea { flex: 1; resize: none; min-height: 36px; max-height: 140px; font: inherit; font-size: 14px; }
.wd-actions { display: flex; gap: 6px; padding: 0 10px 10px; flex-wrap: wrap; flex: none; }
.wd-actions [hidden] { display: none; }
@media print { .wadock, .wadock-tab { display: none !important; } }

/* ---- two-step sign-in */
.otp { font: 600 22px ui-monospace, monospace; letter-spacing: .25em; text-align: center; }
.mfa-steps { padding-left: 20px; margin: 8px 0 14px; } .mfa-steps li { margin-bottom: 10px; }
.qr { margin: 8px 0; } .qr svg { display: block; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.secret { word-break: break-all; font-size: 13px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; padding: 12px 14px; border: 1px dashed var(--border);
  border-radius: 8px; background: var(--surface-2); font-size: 15px; }
.mfa-codes-box { border: 2px solid var(--accent); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.who .me { color: inherit; } .mfa-off { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--warn-bg); color: var(--warn); font-size: 11px; font-weight: 700; }

/* ---- switch port changes + config backups */
.alias-form { display: flex; gap: 4px; align-items: center; min-width: 180px; }
.alias-form input { padding: 3px 7px; font-size: 13px; border-color: transparent; background: transparent; }
.alias-form input:hover, .alias-form input:focus { border-color: var(--border); background: var(--surface); }
.alias-form button { visibility: hidden; }
.alias-form:focus-within button { visibility: visible; }
.cfg-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cfg-wrap { grid-template-columns: 1fr; } }
.cfg-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.cfg-list a:hover { background: var(--surface-2); text-decoration: none; }
.cfg-list a.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cfg-text { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow: auto; max-height: 70vh;
  background: var(--surface-2); border-radius: 8px; padding: 12px; margin: 0; }
.cfg-diff div { white-space: pre; padding: 0 8px; } .cfg-diff .d-add { background: var(--good-bg); color: var(--good); }
.cfg-diff .d-del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.cfg-diff .d-hunk { color: var(--muted); background: var(--surface); margin-top: 6px; }

/* ---- status page (staff) */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.st-cell { border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--good-bg); color: var(--good); }
.st-cell b { color: var(--text); } .st-cell span { font-size: 12.5px; font-weight: 600; }
.st-degraded { background: var(--warn-bg); color: var(--warn); } .st-outage { background: var(--bad-bg); color: var(--bad); }
.st-maintenance { background: var(--info-bg); color: var(--s1, #3a6fd8); }
.portal-alert { border-left: 4px solid var(--bad); }
.router-box { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); scroll-margin-top: 20px; }
.rb-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.rb-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.router-box.on .rb-dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }
.router-box.off .rb-dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.router-box .btn[disabled] { opacity: .55; cursor: not-allowed; }
/* portal: network in your area */
.net-card { margin-bottom: 16px; border-left: 4px solid var(--good); }
.net-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.net-pill { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--good-bg); color: var(--good); white-space: nowrap; }
.net-outage, .net-checking { border-left-color: var(--bad); } .net-outage .net-pill, .net-checking .net-pill { background: var(--bad-bg); color: var(--bad); }
.net-degraded { border-left-color: var(--warn); } .net-degraded .net-pill { background: var(--warn-bg); color: var(--warn); }
.net-maintenance { border-left-color: #3a6fd8; } .net-maintenance .net-pill { background: var(--info-bg); color: #3a6fd8; }
.net-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 18px; margin-top: 12px; }
.net-bars i { border-radius: 2px; background: var(--good); opacity: .8; } .net-bars i.s-outage { background: var(--bad); }
.net-bars i.s-degraded { background: var(--warn); } .net-bars i.s-maintenance { background: #3a6fd8; } .net-bars i.s-future { background: var(--border); }
.net-inc { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 14px; }
.net-fixed b { color: var(--good); }
/* simple dropdown menu (details/summary) */
.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; cursor: pointer; } .dropdown > summary::-webkit-details-marker { display: none; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; }
.dropdown .menu a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.dropdown .menu a:hover { background: var(--surface-2); text-decoration: none; }
#prog .bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
#prog .bar i { display: block; height: 100%; background: var(--accent); animation: prog-slide 1.4s ease-in-out infinite; transform-origin: left; }
@keyframes prog-slide { 0% { transform: translateX(-100%) scaleX(.3); } 100% { transform: translateX(100%) scaleX(.3); } }
.alert-grid { max-width: 560px; } .alert-grid th.c, .alert-grid td.c { text-align: center; width: 90px; }
.alert-grid td { padding: 6px 8px; } .alert-grid input[type=checkbox] { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 11.5px; padding: 0; font-weight: 500; }
/* bulk actions on the client list */
.bulk-bar { position: sticky; top: 64px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px;
  margin-bottom: 12px; background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.bulk-bar[hidden] { display: none; } .bulk-bar .b-val[hidden] { display: none; }
.bulk-bar select, .bulk-bar input { width: auto; min-width: 140px; }
.bb-count { margin-right: 6px; white-space: nowrap; }
.tab-n { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.tabs a.on .tab-n { color: inherit; opacity: .8; }
.more-filters { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.more-filters[hidden] { display: none; } .more-filters > div { max-width: 210px; }

/* WhatsApp attachments */
.bubble video.wa-video { max-width: 280px; max-height: 260px; border-radius: 8px; display: block; margin-bottom: 4px; }
.bubble audio.wa-audio { width: 240px; max-width: 100%; display: block; margin-bottom: 4px; }
.bubble .wa-transcript { font-size: 13px; font-style: italic; margin: 2px 0 4px; max-width: 420px; white-space: pre-wrap; }
.wa-file { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, currentColor 7%, transparent); border-radius: 8px; padding: 6px 8px; margin-bottom: 4px; max-width: 300px; }
.wa-file a { color: inherit; text-decoration: none; }
.wa-open { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.wa-fi { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; background: var(--brand); color: #fff; border-radius: 5px; padding: 6px 5px; min-width: 36px; text-align: center; }
.wa-fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.wa-open:hover .wa-fn { text-decoration: underline; }
.wa-dl { flex: none; font-size: 17px; opacity: .7; padding: 0 4px; } .wa-dl:hover { opacity: 1; }
.attach-btn { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 18px; }
.attach-btn:hover { color: var(--text); border-color: var(--text-2); }
.attach-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.att-list:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 99px; padding: 3px 4px 3px 10px; font-size: 12.5px; max-width: 260px; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 2px 6px; }
.att-chip.bad { background: var(--bad-bg); color: var(--bad); }
.chat.dragging, .wadock.dragging { outline: 2px dashed var(--brand); outline-offset: -6px; }
.wd-att { padding: 6px 10px 0; }

/* ---- data-usage chart (client page) */
.usage-card .u-ranges { margin-bottom: 12px; }
.usage-card.loading .u-chart, .usage-card.loading .u-stats { opacity: .5; transition: opacity .15s; }
.u-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.u-stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.u-stat .l { font-size: 12px; color: var(--text-2); }
.u-stat .v { font-size: 20px; font-weight: 650; color: var(--text); margin-top: 2px; white-space: nowrap; }
.u-stat .n { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .u-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.u-chart { position: relative; min-height: 230px; }
.u-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.u-chart svg:focus { outline: none; }
.u-chart svg:focus-visible { outline: 2px solid var(--s1); outline-offset: 4px; border-radius: 6px; }
.u-ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.u-col path, .u-col rect:not([fill="transparent"]) { transition: opacity .12s; }
.u-col.dim path, .u-col.dim rect:not([fill="transparent"]) { opacity: .5; }
.u-empty { display: grid; place-items: center; height: 230px; color: var(--muted); font-size: 13.5px;
  border: 1px dashed var(--border); border-radius: 10px; }
.u-tip { position: absolute; top: 4px; z-index: 5; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; min-width: 150px; }
.u-tip-h { color: var(--text-2); margin-bottom: 4px; white-space: nowrap; }
.u-tip-r { display: flex; align-items: center; gap: 8px; line-height: 1.6; white-space: nowrap; }
.u-tip-r i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.u-tip-r i.none { background: transparent; }
.u-tip-r b { color: var(--text); font-variant-numeric: tabular-nums; min-width: 64px; }
.u-tip-r b.soft { font-weight: 500; color: var(--text-2); }
.u-tip-r span { color: var(--muted); }
.u-tip-n { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* light / dark switch (top bar) — shows the moon in light mode, the sun in dark mode */
.top .theme-btn { background: none; border: 0; padding: 4px; border-radius: 8px; color: var(--text-2); cursor: pointer; display: inline-flex; }
.top .theme-btn:hover { background: var(--surface-2); color: var(--text); }
.top .theme-btn:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }
.theme-btn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: inline; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
:root[data-theme="dark"] .theme-btn .sun { display: inline; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }

/* ping / traceroute output (Network tools, client page) */
.netrun-out pre, .nt-out pre { margin: 0; max-height: 420px; overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 12px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.nt-sum { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
.nt-sum b { font-variant-numeric: tabular-nums; }

.paylink { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; font-size: 13px; color: var(--muted); }
.paylink input { width: 340px; max-width: 50vw; font-family: ui-monospace, monospace; font-size: 12px; padding: 6px 8px; }
table.nowrap td, table.nowrap th { white-space: nowrap; }

/* WhatsApp: which number a chat is on */
.wa-line { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  color: var(--text); background: color-mix(in srgb, var(--lc, #25d366) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc, #25d366) 45%, transparent); white-space: nowrap; }
.wa-line::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lc, #25d366); }
.wa-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---- network topology ---- */
.topo-sites { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-top: 4px; scrollbar-width: thin; }
.tchip { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); }
.tchip:hover { border-color: var(--accent); }
.tchip.on { background: var(--nav); color: #fff; border-color: var(--nav); }
.tchip .n { font-weight: 500; opacity: .7; font-size: 12.5px; }
.tchip .bad, .tchip .warn { font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.tchip .bad { background: var(--bad-bg); color: var(--bad); } .tchip .warn { background: var(--warn-bg); color: var(--warn); }
.tchip .ci { width: 15px; height: 15px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.st-up { background: var(--good); } .dot.st-down { background: var(--bad); } .dot.st-warn { background: var(--warn); }
.topo-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: stretch; }
.topo-wrap.full { position: fixed; inset: 0; z-index: 900; background: var(--bg); padding: 12px; grid-template-columns: minmax(0, 1fr) 340px; }
.topo-wrap.full .topo { height: auto; }
.topo { --topo-link: #8a96ad; position: relative; height: 72vh; min-height: 460px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background-color: var(--surface); background-image: radial-gradient(color-mix(in srgb, var(--border) 85%, transparent) 1.2px, transparent 1.2px); background-size: 24px 24px; }
:root[data-theme="dark"] .topo { --topo-link: #5d6b88; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topo { --topo-link: #5d6b88; } }
.topo svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; }
.topo svg:active { cursor: grabbing; }
.topo-tools { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.topo-tools > * { pointer-events: auto; }
.topo-tools input#topo-find { width: 190px; padding: 6px 10px; font-size: 13px; box-shadow: var(--shadow); }
.topo-tools .btn { box-shadow: var(--shadow); }
.topo-tools .seg { display: inline-flex; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.topo-tools .seg button { border: 0; background: none; padding: 6px 11px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.topo-tools .seg button + button { border-left: 1px solid var(--border); }
.topo-tools .seg button:hover { background: var(--surface-2); }
.topo-tools .tog { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); box-shadow: var(--shadow); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.topo-tools .tog input { margin: 0; }
.topo-legend { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; max-width: calc(100% - 20px);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(4px); border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--text-2); box-shadow: var(--shadow); }
.topo-legend span { display: inline-flex; align-items: center; gap: 5px; } .topo-legend .dot { width: 8px; height: 8px; }
.topo-legend .sep { width: 1px; height: 12px; background: var(--border); }
.topo-legend .ln { width: 22px; height: 0; border-top: 3px solid var(--topo-link); }
.topo-legend .ln.dash { border-top-style: dashed; } .topo-legend .ln.dot2 { border-top-style: dotted; }
.topo-legend .ln.flow { border-top: 3px dotted var(--good); }
.topo-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
/* links */
.topo .edge { cursor: pointer; } .topo .edge .hit { stroke: transparent; stroke-width: 16; }
.topo .edge.sel .wire { filter: drop-shadow(0 0 4px var(--accent)); }
.topo .edge.cross .wire { stroke-opacity: .7; }
.topo .edge .flow { stroke: var(--good); stroke-dasharray: 1.5 14; stroke-linecap: round; pointer-events: none; animation: topo-flow linear infinite; opacity: .9; }
@keyframes topo-flow { to { stroke-dashoffset: -31; } }
.topo .elabel rect { fill: var(--surface); stroke: var(--border); }
.topo .elabel text { fill: var(--text-2); font-size: 11px; font-weight: 600; text-anchor: middle; }
.topo .plabel { fill: var(--muted); font-size: 10px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; font-family: ui-monospace, monospace; }
/* node cards */
.topo foreignObject { overflow: visible; }
.tn { box-sizing: border-box; width: 100%; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(15,30,60,.08); padding: 10px 11px 9px 13px; position: relative; overflow: hidden;
  font-size: 12px; color: var(--text); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.tn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--muted); }
.tn.st-up::before { background: var(--good); } .tn.st-warn::before { background: var(--warn); } .tn.st-down::before { background: var(--bad); }
.tn.st-down { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 16%, transparent), 0 4px 14px rgba(0,0,0,.1); }
.tn:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.tn.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 18px rgba(0,0,0,.12); }
.tn.hit { outline: 2px dashed var(--link); outline-offset: 3px; }
.unlocked .tn { cursor: move; }
.tn-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tn-ic { --k: #64748b; width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; color: var(--k);
  background: color-mix(in srgb, var(--k) 14%, transparent); }
.tn-ic svg { width: 19px; height: 19px; } .tn-ic.sm { width: 24px; height: 24px; border-radius: 7px; } .tn-ic.sm svg { width: 15px; height: 15px; }
.k-router { --k: #2563eb; } .k-switch { --k: #0891b2; } .k-olt { --k: #7c3aed; } .k-radio { --k: #d97706; } .k-ap { --k: #16a34a; }
.k-server, .k-other { --k: #64748b; } .k-site { --k: #ee7420; }
:root[data-theme="dark"] .tn-ic { --k-mix: 22%; }
.tn-id { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.tn-id b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-id span { color: var(--text-2); font-size: 11.5px; font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site .tn-id span { font-family: inherit; }
.tn-pill { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); }
.st-up .tn-pill { background: var(--good-bg); color: var(--good); } .st-warn .tn-pill { background: var(--warn-bg); color: var(--warn); }
.st-down .tn-pill { background: var(--bad-bg); color: var(--bad); }
.tn-met { display: flex; flex-wrap: nowrap; gap: 5px; margin-top: 9px; overflow: hidden; }
.tn-met span { background: var(--surface-2); border-radius: 6px; padding: 2px 6px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.tn-met b { color: var(--text); } .tn-met .warn { background: var(--warn-bg); color: var(--warn); } .tn-met .bad { background: var(--bad-bg); color: var(--bad); }
.tn.pon { padding: 8px 10px 8px 12px; border-radius: 10px; background: var(--surface-2); }
.tn.pon .tn-top { gap: 7px; } .tn.pon b { font-size: 12.5px; } .tn-cnt { margin-left: auto; font-size: 12px; color: var(--text-2); }
.tn-bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--bad) 30%, var(--surface)); margin-top: 8px; overflow: hidden; }
.tn-bar i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.tn.ghost { display: flex; align-items: center; gap: 9px; border-style: dashed; background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: none; padding: 8px 11px 8px 13px; }
.tn.ghost .tn-id span { font-family: inherit; }
.tn.site { padding: 12px 13px 11px 15px; }
.tn-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; min-height: 9px; }
.tn-dots .d { width: 9px; height: 9px; border-radius: 3px; background: var(--muted); }
.tn-dots .d.st-up { background: var(--good); } .tn-dots .d.st-down { background: var(--bad); }
/* side panel */
.topo-side { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; max-height: 72vh; min-height: 460px; overflow: auto; font-size: 13px; }
.topo-wrap.full .topo-side { max-height: none; }
.ts-head { display: flex; align-items: center; gap: 10px; position: relative; padding-right: 22px; }
.ts-head h3 { margin: 0; font-size: 16px; line-height: 1.2; text-transform: none; letter-spacing: normal; color: var(--text); } .ts-head .muted { font-size: 12px; }
.ts-head .x { position: absolute; top: -4px; right: -6px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.topo-side h4 { margin: 16px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tk { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin: 12px 0 6px; }
.tk > div { background: var(--surface-2); border-radius: 10px; padding: 9px 10px; }
.tk b { display: block; font-size: 19px; line-height: 1.1; } .tk span { font-size: 11.5px; color: var(--text-2); }
.tk .ok b { color: var(--good); } .tk .warn b { color: var(--warn); } .tk .bad b { color: var(--bad); }
.ts-status { display: inline-flex; gap: 6px; margin: 10px 0 4px; padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: 12.5px; background: var(--surface-2); color: var(--muted); }
.ts-status span { font-weight: 500; opacity: .85; }
.ts-status.st-up { background: var(--good-bg); color: var(--good); } .ts-status.st-warn { background: var(--warn-bg); color: var(--warn); } .ts-status.st-down { background: var(--bad-bg); color: var(--bad); }
.topo-side .dl { margin-top: 8px; font-size: 12.5px; }
.ts-list { list-style: none; margin: 0; padding: 0; }
.ts-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; }
.ts-list li:hover { background: var(--surface-2); }
.ts-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ts-list .muted { font-size: 12px; white-space: nowrap; } .ts-list .bad, .ts-list .warn { font-size: 11.5px; font-weight: 700; }
.ts-list .bad { color: var(--bad); } .ts-list .warn { color: var(--warn); }
.ts-site { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ok-txt { color: var(--good); font-weight: 600; margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .topo .edge .flow { animation: none; } }
@media (max-width: 1000px) {
  .topo-wrap { grid-template-columns: 1fr; } .topo { height: 64vh; min-height: 380px; } .topo-side { max-height: none; min-height: 0; }
  .topo-wrap.full { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .topo-wrap.full .topo-side { max-height: 35vh; }
}
@media (max-width: 640px) { .topo-tools input#topo-find { width: 130px; } .topo-legend { display: none; } }

/* ---- ONU report */
.report-sheet .rep-top { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--brand); padding-bottom: 8px; }
.report-sheet h3 { margin: 0 0 8px; font-size: 15px; }
@media print {
  body:has(.report-sheet) .side, body:has(.report-sheet) .top, .no-print { display: none !important; }
  body:has(.report-sheet) main, body:has(.report-sheet) .main { margin: 0 !important; padding: 0 !important; }
  .report-sheet { box-shadow: none; }
  .report-sheet details { display: block; } .report-sheet details > * { display: block; }
}
@page fleet { size: A4 landscape; margin: 10mm; }
table.fleet { font-size: 13px; }
table.fleet td, table.fleet th { padding: 6px 8px; vertical-align: top; }
table.fleet .r { text-align: right; white-space: nowrap; }
table.fleet tr.grp td { background: var(--surface-2); font-weight: 600; padding-top: 8px; }
@media print {
  .report-sheet:has(table.fleet) { page: fleet; }
  table.fleet { font-size: 9.5px; } table.fleet td, table.fleet th { padding: 3px 4px; }
  .report-sheet .table-wrap { overflow: visible; }
}

/* ---- client page: easier to read */
.cust-page { font-size: 14.5px; line-height: 1.5; }
.cust-page .card h2 { font-size: 17px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 12px; }
.cust-page .card .head h2 { margin: 0; }
.cust-page .dl { gap: 9px 22px; }
.cust-page .dl dt { color: var(--text-2); font-size: 13px; font-weight: 500; padding-top: 1px; }
.cust-page .dl dd { color: var(--text); font-weight: 500; }
.cust-page .dl dd .muted { font-weight: 400; }
.cust-page .card { padding: 20px 22px; }
.cust-head h1 { font-size: 27px; }
.cust-head .sub { font-size: 14px; margin-top: 4px; }
.menu-more { position: relative; }
.menu-more > summary { list-style: none; cursor: pointer; } .menu-more > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px; background: var(--surface); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 0 0 1px var(--border); padding: 6px; display: flex; flex-direction: column; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 7px;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-decoration: none; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.danger { color: var(--bad); } .menu-pop form { margin: 0; }
/* at-a-glance tiles */
.cust-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.cust-sum .cs { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 16px 12px; color: var(--text); text-decoration: none; border-top: 4px solid var(--border); min-width: 0; }
.cust-sum .cs:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); text-decoration: none; }
.cust-sum .l { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.cust-sum b { font-size: 21px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sum .n { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sum .good { border-top-color: var(--good); } .cust-sum .good b { color: var(--good); }
.cust-sum .warn { border-top-color: var(--warn); } .cust-sum .warn b { color: var(--warn); }
.cust-sum .bad { border-top-color: var(--bad); } .cust-sum .bad b { color: var(--bad); }
.cust-sum .muted b { color: var(--text-2); }
/* section bar */
.cust-nav, .cust-tabs { position: sticky; top: 64px; z-index: 25; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px;
  padding: 6px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border-radius: 12px; box-shadow: var(--shadow); }
.cust-nav::-webkit-scrollbar, .cust-tabs::-webkit-scrollbar { display: none; }
.cust-nav a, .cust-tabs a { flex: none; padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.cust-nav a:hover, .cust-tabs a:hover { background: var(--surface-2); color: var(--text); }
.cust-nav a.on, .cust-tabs a.on { background: var(--accent); color: var(--accent-ink); }
.cust-page [id] { scroll-margin-top: 130px; }
/* history */
.hist-filter { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.hist-filter button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.hist-filter button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.hist { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.hist::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.hist li { position: relative; display: flex; gap: 14px; padding: 9px 0; }
.hist li[hidden] { display: none; }
.h-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--surface); border: 3px solid var(--muted); position: relative; z-index: 1; }
.h-client .h-dot { border-color: #2563eb; } .h-service .h-dot { border-color: #7c3aed; } .h-payment .h-dot, .h-invoice .h-dot, .h-mandate .h-dot { border-color: var(--good); }
.h-onu .h-dot { border-color: #0891b2; } .h-created .h-dot { background: var(--accent); border-color: var(--accent); }
.h-removed .h-dot, .h-deleted .h-dot, .h-voided .h-dot { border-color: var(--bad); }
.h-body { flex: 1; min-width: 0; }
.h-top { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.h-top b { font-size: 14.5px; } .h-meta { font-size: 12.5px; color: var(--text-2); margin-left: auto; white-space: nowrap; }
.h-text { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.h-changes { list-style: none; margin: 5px 0 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.h-changes li { display: block; padding: 0; }
.h-f { color: var(--text-2); font-weight: 600; }
.h-old { text-decoration: line-through; color: var(--muted); } .h-arrow { color: var(--muted); } .h-new { color: var(--text); font-weight: 600; }
@media (max-width: 700px) { .cust-head h1 { font-size: 23px; } .cust-sum { grid-template-columns: 1fr 1fr; } .cust-sum b { font-size: 18px; }
  .cust-page .card { padding: 16px; } .h-meta { margin-left: 0; width: 100%; } .cust-nav, .cust-tabs { top: 56px; }
  .cust-page .profile .dl { grid-template-columns: 40% minmax(0, 1fr); } }
.hist-more { margin: 6px 0 0 30px; }

/* ---- client list */
.cl-glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 2px 0 14px; }
.cl-glance .cg { display: flex; flex-direction: column; gap: 1px; padding: 12px 15px 11px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; border-top: 4px solid var(--border); min-width: 0; }
.cl-glance .cg:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); text-decoration: none; }
.cl-glance .cg.on { box-shadow: 0 0 0 2px var(--accent); }
.cl-glance .l { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.cl-glance b { font-size: 23px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-glance .n { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-glance .good { border-top-color: var(--good); } .cl-glance .good b { color: var(--good); }
.cl-glance .warn { border-top-color: var(--warn); } .cl-glance .warn b { color: var(--warn); }
.cl-glance .bad { border-top-color: var(--bad); } .cl-glance .bad b { color: var(--bad); }
.cl-filter { padding: 14px 16px 10px; margin-bottom: 14px; }
.cl-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-row > select { width: auto; max-width: 220px; flex: 0 1 auto; }
.cl-search { flex: 1 1 320px; position: relative; display: flex; align-items: center; margin: 0; }
.cl-search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.cl-search input { padding-left: 38px; height: 42px; font-size: 15px; }
.cl-row2 { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.cl-status { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.cl-status a { padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.cl-status a span { font-weight: 500; opacity: .75; margin-left: 2px; font-size: 12.5px; }
.cl-status a:hover { color: var(--text); }
.cl-status a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cl-active { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cl-clear { font-size: 13px; font-weight: 600; }
.cl-filter .more-filters { margin-top: 10px; }
.cl-card { padding: 4px 6px 8px; }
.cl-table { font-size: 14.5px; }
.cl-table th { font-size: 11.5px; padding-top: 12px; padding-bottom: 10px; }
.cl-table td { padding-top: 12px; padding-bottom: 12px; vertical-align: middle; }
.cl-table tbody tr[data-href] { cursor: pointer; }
.cl-table tbody tr[data-href]:hover td { background: var(--surface-2); }
.cl-table tbody tr:has(.b-row:checked) td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cl-who { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cl-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--co); background: color-mix(in srgb, var(--co) 15%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--co) 45%, transparent); }
.cl-id { min-width: 0; }
.cl-name { font-weight: 650; font-size: 15px; color: var(--text); }
.cl-name:hover { color: var(--link); }
.cl-meta { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.cl-meta .chip { margin-left: 4px; font-size: 11px; padding: 0 7px; }
.co-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--co); margin-right: 4px; vertical-align: 1px; }
.cl-conn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.cl-conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.cl-conn.on { color: var(--good); } .cl-conn.on i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.cl-conn.off { color: var(--bad); } .cl-conn.off i { background: var(--bad); }
.cl-phone { color: var(--text); font-weight: 500; white-space: nowrap; }
.cl-owe { color: var(--bad); font-weight: 700; } .cl-credit { color: var(--good); font-weight: 600; }
.cl-empty { text-align: center; padding: 34px 10px !important; color: var(--text-2); }
@media (max-width: 760px) {
  .cl-glance { grid-template-columns: 1fr 1fr; } .cl-glance b { font-size: 19px; }
  .cl-row > select { max-width: none; flex: 1 1 45%; } .cl-row > .btn { flex: 1 1 auto; }
  .cl-table thead { display: none; }
  .cl-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px 8px; border-bottom: 1px solid var(--border); }
  .cl-table td { padding: 0 !important; border: 0 !important; }
  .cl-table td.c-who { grid-column: 2 / 3; grid-row: 1; } .cl-table td.c-loc, .cl-table td.c-contact { display: none; }
  .cl-table td.c-conn { grid-column: 2 / 3; grid-row: 2; } .cl-table td.c-status { grid-column: 3; grid-row: 2; text-align: right; }
  .cl-table td.c-bal { grid-column: 3; grid-row: 1; text-align: right; }
  .cl-table td.c-sel { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .cl-table tr:not(:has(.c-sel)) { grid-template-columns: 1fr auto; }
  .cl-table tr:not(:has(.c-sel)) td.c-who, .cl-table tr:not(:has(.c-sel)) td.c-conn { grid-column: 1; }
  .cl-table tr:not(:has(.c-sel)) td.c-bal, .cl-table tr:not(:has(.c-sel)) td.c-status { grid-column: 2; }
  .cl-who { min-width: 0; }
}

/* ---- WhatsApp inbox */
.wa-glance { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.wa-list .row.is-unread strong { font-weight: 800; }
.wa-list .row.is-unread .preview { color: var(--text); font-weight: 600; }
.wa-av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: color-mix(in srgb, var(--lc, #25d366) 75%, var(--text)); background: color-mix(in srgb, var(--lc, #25d366) 16%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--lc, #25d366) 45%, transparent); }
.wa-list .rowlink { align-items: center; }
.wa-list .line1 strong { font-size: 15px; }
.wa-list .preview { font-size: 13.5px; }
.wa-right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: none; }
.wa-st { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.wa-st.st-waiting { background: var(--warn-bg); color: var(--warn); } .wa-st.st-open { background: var(--info-bg); color: var(--link); }
.wa-st.st-bot { background: color-mix(in srgb, #7c3aed 12%, var(--surface)); color: #7c3aed; } .wa-st.st-closed { color: var(--muted); }
.wa-wait { font-size: 11.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.wa-wait.warn { color: var(--warn); } .wa-wait.bad { color: var(--bad); }
.wa-agent { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800;
  background: var(--nav); color: #fff; flex: none; }
.wa-empty { padding: 34px 10px; text-align: center; color: var(--text-2); }
@media (max-width: 760px) { .wa-right .wa-st { display: none; } .wa-av { width: 36px; height: 36px; font-size: 12.5px; } }
/* ---- WhatsApp chat: three panes */
.wa-app { display: grid; grid-template-columns: 320px minmax(0, 1fr) 320px; gap: 14px; height: calc(100vh - 110px); min-height: 520px; }
.wa-side, .wa-info { min-height: 0; }
.wa-side { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.wa-side-head { display: flex; gap: 8px; align-items: center; padding: 12px 12px 8px; }
.wa-side-head select { flex: 1; padding: 6px 8px; font-size: 13.5px; }
.wa-back { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.wa-side-q { padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
.wa-side-q input { padding: 7px 10px; font-size: 13.5px; }
.wa-side-list { flex: 1; overflow-y: auto; }
.wa-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.wa-item[hidden] { display: none; }
.wa-item:hover { background: var(--surface-2); text-decoration: none; }
.wa-item.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }
.wa-av.sm { width: 36px; height: 36px; font-size: 12.5px; }
.wa-it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wa-it1, .wa-it2 { display: flex; gap: 6px; align-items: center; min-width: 0; }
.wa-it1 b { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-it .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.wa-it .preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-item.is-unread b { font-weight: 800; } .wa-item.is-unread .preview { color: var(--text); font-weight: 600; }
.wa-main.chat { height: auto; min-height: 0; }
.wa-chat-head { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.wa-ch-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.wa-ch-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-ch-id b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wa-ch-name .wa-line { flex: none; }
.wa-ch-id > span { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-ch-right { display: flex; gap: 6px; align-items: center; flex: none; }
.wa-back-m, .wa-info-btn { display: none; }
.wa-back-m { font-size: 20px; font-weight: 700; text-decoration: none; padding: 0 4px; }
.wa-main .thread { background-color: color-mix(in srgb, var(--surface-2) 70%, var(--bg));
  background-image: radial-gradient(color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px); background-size: 18px 18px; padding: 18px 22px; }
.wa-main .bubble { box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 14.5px; }
.wa-main .bubble.out { background: #d9fdd3; color: #0b1a0e; }
.wa-main .bubble.bot { background: #e4ecfb; color: #0b1630; }
:root[data-theme="dark"] .wa-main .bubble.out { background: #134d37; color: #e9fff3; }
:root[data-theme="dark"] .wa-main .bubble.bot { background: #1c2d52; color: #e7eefc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-main .bubble.out { background: #134d37; color: #e9fff3; } }
.wa-media-missing { display: block; font-weight: 600; } .wa-media-missing span { font-weight: 400; opacity: .6; font-size: 12px; }
.wa-info { overflow-y: auto; }
.wa-info .card { margin-top: 0; margin-bottom: 14px; }
.wa-info .card h3 { margin-top: 0; }
@media (max-width: 1280px) { .wa-app { grid-template-columns: 280px minmax(0, 1fr) 290px; } }
@media (max-width: 1100px) {
  .wa-app { grid-template-columns: 260px minmax(0, 1fr); } .wa-info { display: none; } .wa-info-btn { display: inline-flex; }
  .wa-app.show-info { grid-template-columns: 260px minmax(0, 1fr) 300px; } .wa-app.show-info .wa-info { display: block; }
}
@media (max-width: 760px) {
  .wa-app { grid-template-columns: 1fr; height: calc(100vh - 80px); } .wa-side { display: none; } .wa-back-m { display: inline; }
  .wa-app.show-info { grid-template-columns: 1fr; height: auto; } .wa-app.show-info .wa-main { display: none; }
  .wa-ch-right .btn:not(.wa-info-btn) { display: none; } .wa-ch-right .wa-st { display: none; }
}

.wa-side-co { padding: 6px 14px 0; font-size: 12.5px; color: var(--muted); }
.wa-numbers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.wa-numbers a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
.wa-numbers a:hover { border-color: var(--lc, var(--accent)); }
.wa-numbers a i { width: 9px; height: 9px; border-radius: 50%; background: var(--lc, var(--accent)); }
.wa-numbers a span { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.wa-numbers a em { font-style: normal; font-size: 12px; font-weight: 700; color: #b45309; }
.wa-numbers a.on { border-color: var(--lc, var(--accent)); box-shadow: inset 0 0 0 1px var(--lc, var(--accent));
  background: color-mix(in srgb, var(--lc, var(--accent)) 12%, var(--card)); }
.wa-numbers a.off { opacity: .6; }
:root[data-theme="dark"] .wa-numbers a em { color: #fbbf24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-numbers a em { color: #fbbf24; } }

/* client list: column picker + extra columns */
.cl-tools { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 0 2px 8px; }
.cl-sort { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.cl-sort select { width: auto; padding: 5px 8px; font-size: 13px; }
.cl-sorth { color: inherit; text-decoration: none; } .cl-sorth:hover { color: var(--text); }
.cl-cols { position: relative; }
.cl-cols > summary { list-style: none; } .cl-cols > summary::-webkit-details-marker { display: none; }
.cl-cols-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; width: 300px; max-width: calc(100vw - 32px); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 12px; }
.cl-cols-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; font-size: 13px; }
#cl-cols-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
#cl-cols-list li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 14px; }
#cl-cols-list li:hover { background: var(--surface-2); }
#cl-cols-list li.dragging { opacity: .45; }
#cl-cols-list li label { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; font-weight: 500; cursor: pointer; }
#cl-cols-list li input { width: auto; min-width: 0; margin: 0; }
#cl-cols-list .grip { width: 14px; color: var(--muted); cursor: grab; font-size: 12px; letter-spacing: -2px; }
#cl-cols-list .mv { display: flex; gap: 2px; }
#cl-cols-list .mv button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 6px; width: 24px; height: 24px; padding: 0; cursor: pointer; font-size: 12px; }
#cl-cols-list .mv button:hover { border-color: var(--text-2); }
.cl-cols-f { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cl-svc + .cl-svc { margin-top: 4px; }
.cl-table td.c-x { font-size: 13.5px; }
@media (max-width: 760px) { .cl-table td.c-x { display: none; } }

/* WhatsApp reply target (SLA) */
.wa-sla { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.wa-sla.l-ok { background: var(--good-bg); color: var(--good); }
.wa-sla.l-warn { background: var(--warn-bg); color: var(--warn); }
.wa-sla.l-bad { background: var(--bad-bg); color: var(--bad); }
.wa-sla.l-paused { background: var(--surface-2); color: var(--muted); }

/* weekly hours editor (settings) */
.hrs-grid { display: flex; flex-direction: column; gap: 6px; }
.hrs-day { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.hrs-day .check { min-width: 120px; margin: 0; font-weight: 600; }
.hrs-t { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.hrs-t input[type=time] { width: auto; padding: 4px 6px; }
.hrs-day .hrs-closed { display: none; }
.hrs-day.off { background: var(--surface-2); }
.hrs-day.off .hrs-t, .hrs-day.off .hrs-add { display: none; }
.hrs-day.off .hrs-closed { display: inline; }
.hrs-quick { margin-top: 4px; }

/* ---- dashboard (home) ---- */
.db-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.db-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.db-head .sub { color: var(--muted); margin-top: 3px; }
.db-att { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin-bottom: 16px; }
.db-a { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; border-left: 4px solid var(--warn); }
.db-a:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, .1); }
.db-a.l-bad { border-left-color: var(--bad); }
.db-ai { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--warn-bg); color: var(--warn); }
.db-a.l-bad .db-ai { background: var(--bad-bg); color: var(--bad); }
.db-at { font-size: 14px; line-height: 1.3; min-width: 0; } .db-at b { font-size: 16px; }
.db-at small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-ago { color: var(--muted); }
.db-ok { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--good-bg); color: var(--good); font-weight: 600; margin-bottom: 16px; }
.db-ok span { width: 26px; height: 26px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-size: 14px; }
.db-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.db-k { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; position: relative; overflow: hidden; }
a.db-k:hover { text-decoration: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.db-k .l { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.db-k b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.db-k b small { font-size: 15px; color: var(--muted); font-weight: 600; }
.db-k .n { font-size: 12px; color: var(--muted); }
.db-k .n i.up { font-style: normal; color: var(--good); font-weight: 700; }
.db-k.warn::before, .db-k.bad::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warn); }
.db-k.bad::before { background: var(--bad); }
.db-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.db-main, .db-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.db-card { margin: 0; }
.db-ch { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.db-ch h2 { margin: 0; font-size: 16px; } .db-ch .muted { font-size: 12.5px; }
.db-big { text-align: right; } .db-big b { display: block; font-size: 24px; color: var(--good); line-height: 1; } .db-big span { font-size: 12px; color: var(--muted); }
.db-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; height: 180px; align-items: end; margin: 8px 0 6px; }
.db-col { display: flex; flex-direction: column; height: 100%; gap: 6px; }
.db-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.db-pair i { width: 38%; max-width: 26px; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.db-pair i.f1 { background: var(--accent); opacity: .35; } .db-pair i.f2 { background: var(--accent); }
.db-col.now .db-pair i.f1 { opacity: .5; }
.db-col span { text-align: center; font-size: 12px; color: var(--muted); } .db-col.now span { color: var(--text); font-weight: 700; }
.db-card .viz-legend .f1 { background: var(--accent); opacity: .35; } .db-card .viz-legend .f2 { background: var(--accent); }
.db-jobs, .db-down, .db-co, .db-pay { list-style: none; margin: 0; padding: 0; }
.db-jobs li a { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.db-jobs li:first-child a { border-top: 0; }
.db-jobs li a:hover { background: var(--surface-2); }
.db-time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.db-jt { min-width: 0; } .db-jt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.db-jt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.db-kind { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); text-transform: capitalize; }
.db-kind.k-fault { background: var(--bad-bg); color: var(--bad); } .db-kind.k-installation { background: var(--good-bg); color: var(--good); }
.db-who { font-size: 12.5px; font-weight: 600; } .db-who.none { color: var(--warn); }
.db-down li a { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 4px; color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }
.db-down li:first-child a { border-top: 0; }
.db-down i { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.db-since { font-size: 12px; }
.db-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.db-site { position: relative; padding: 8px 10px 12px; border-radius: 10px; background: var(--surface-2); display: flex; justify-content: space-between; font-size: 13px; overflow: hidden; }
.db-site span { color: var(--muted); font-variant-numeric: tabular-nums; }
.db-site i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); background: var(--good); }
.db-site.bad { background: var(--bad-bg); } .db-site.bad i { background: var(--bad); }
.db-wa { color: var(--text); text-decoration: none; display: block; } .db-wa:hover { text-decoration: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.db-wag { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.db-wag span { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.db-wag b { display: block; font-size: 22px; color: var(--text); line-height: 1.1; }
.db-wag .warn { background: var(--warn-bg); } .db-wag .warn b { color: var(--warn); }
.db-wag .bad { background: var(--bad-bg); } .db-wag .bad b { color: var(--bad); }
.db-co li a { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 2px; color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }
.db-co li:first-child a { border-top: 0; }
.db-con { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; } .db-con i { width: 10px; height: 10px; border-radius: 3px; }
.db-cov { font-size: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.db-cob { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; } .db-cob i { display: block; height: 100%; border-radius: 999px; }
.db-pay li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.db-pay li:first-child a { border-top: 0; }
.db-pay small { display: block; color: var(--muted); font-size: 12px; } .db-pay b { font-size: 14px; }
.db-amt { font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 1000px) { .db-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .db-jobs li a { grid-template-columns: 46px 1fr auto; } .db-kind { display: none; } .db-bars { height: 140px; gap: 6px; } }

/* ---- NOC pages: outages, maintenance, router logs, uptime ---- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 > .card { margin: 0 0 16px; }
.crumbs { font-size: 13px; margin-bottom: 2px; } .crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a::after { content: " ›"; }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.out-list { display: flex; flex-direction: column; gap: 8px; }
.out-row { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--border); border-left: 4px solid var(--bad); border-radius: 10px; text-decoration: none; color: inherit; }
.out-row:hover { background: var(--surface-2); }
.out-row.k-sessions { border-left-color: var(--warn); }
.out-ic { font-size: 20px; text-align: center; color: var(--bad); }
.out-t b { display: block; } .out-t small { color: var(--muted); }
.out-n { font-size: 13px; color: var(--muted); white-space: nowrap; } .out-n b { font-size: 18px; color: var(--text); }
@media (max-width: 640px) { .out-row { grid-template-columns: 26px 1fr; } .out-n, .out-s { grid-column: 2; } }
details.inline-pop { display: inline-block; position: relative; }
details.inline-pop > summary { list-style: none; } details.inline-pop > summary::-webkit-details-marker { display: none; }
details.inline-pop .pop { position: absolute; right: 0; z-index: 20; width: min(360px, 86vw); text-align: left; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.15); }
table.log td { vertical-align: top; padding-top: 5px; padding-bottom: 5px; }
.lvl { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--border); white-space: nowrap; }
.lvl.l0, .lvl.l1, .lvl.l2, .lvl.l3 { background: var(--bad-bg); color: var(--bad); }
.lvl.l4 { background: var(--warn-bg); color: var(--warn); }
.lvl.l7 { opacity: .6; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.up-cell { border: 1px solid var(--border); border-top: 4px solid var(--good); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.up-cell.warn { border-top-color: var(--warn); } .up-cell.bad { border-top-color: var(--bad); }
.up-pct { font-size: 22px; font-weight: 700; } .up-cell small { color: var(--muted); }

/* ---- VoIP card ---- */
.voip-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.voip-bal { text-align: right; } .voip-bal span { display: block; font-size: 12px; } .voip-bal b { font-size: 20px; }

/* ---- collapsible sidebar sections ---- */
.side .nav-grp { margin: 2px 0; }
.side .nav-grp > summary.grp { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 10px 6px;
  margin: 10px 0 2px; border-radius: 7px; user-select: none; }
.side .nav-grp > summary.grp::-webkit-details-marker { display: none; }
.side .nav-grp > summary.grp:hover { opacity: .9; background: var(--nav-active); }
.side .nav-grp > summary.grp span { flex: 1; }
.side .nav-grp .chev { width: 14px; height: 14px; transition: transform .15s; opacity: .8; }
.side .nav-grp[open] .chev { transform: rotate(90deg); }
.side .grp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: 1; }
.side .grp-dot.alarm { background: var(--bad); }
.side .nav-grp[open] .grp-dot { display: none; }
#jobcard .pbar { border-radius: 6px; background: var(--surface-2); overflow: hidden; }
#jobcard .pbar i { display: block; height: 100%; background: var(--brand); transition: width .4s; }

/* ---- canned WhatsApp replies ---- */
.canned-btn { flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px;
  width: 36px; min-height: 36px; cursor: pointer; font-size: 16px; line-height: 1; align-self: flex-end; }
.canned-btn:hover { background: var(--surface-2); } .canned-btn:disabled { opacity: .4; cursor: default; }
form:has(> .canned-menu), .composer { position: relative; }
.canned-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 40; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; }
.canned-search { width: 100%; margin-bottom: 4px; }
.canned-item { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); padding: 7px 9px;
  border-radius: 7px; cursor: pointer; font: inherit; }
.canned-item:hover, .canned-item.on { background: var(--surface-2); }
.canned-item b { font-size: 13.5px; } .canned-item small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.canned-sc { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.canned-mine { font-size: 10.5px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--info-bg); }
.canned-empty { padding: 8px 9px; color: var(--muted); font-size: 13px; }
.canned-foot { display: block; padding: 6px 9px 2px; font-size: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.wd-compose .canned-btn { width: 30px; min-height: 30px; font-size: 14px; }

/* ---- team chat ---- */
.tc { display: grid; grid-template-columns: 290px 1fr; gap: 14px; height: calc(100vh - 120px); min-height: 480px; }
.tc-side, .tc-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 12px); display: flex; flex-direction: column; min-height: 0; }
.tc-side-h { padding: 14px 14px 6px; } .tc-side-h h1 { font-size: 18px; margin: 0; }
.tc-new { padding: 0 14px 8px; position: relative; } .tc-new > summary { list-style: none; display: inline-block; }
.tc-new > summary::-webkit-details-marker { display: none; }
.tc-new-pop { position: absolute; z-index: 30; left: 10px; right: -160px; top: 38px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.tc-people { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.tc-rooms { overflow-y: auto; flex: 1; padding: 4px 6px 8px; }
.tc-room { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; color: var(--text); text-decoration: none; }
.tc-room:hover { background: var(--surface-2); text-decoration: none; } .tc-room.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.tc-room.muted { opacity: .65; }
.tc-rt { flex: 1; min-width: 0; } .tc-rt b { display: block; font-size: 14px; font-weight: 600; }
.tc-room.unread .tc-rt b { font-weight: 800; }
.tc-rt small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-n { font-style: normal; background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.tc-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--info-bg); color: var(--text); }
.tc-av.grp { border-radius: 9px; font-size: 16px; } .tc-av.sm { width: 30px; height: 30px; font-size: 11px; }
.tc-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tc-thread { flex: 1; overflow-y: auto; padding: 10px 16px; }
.tc-more { text-align: center; margin: 4px 0 10px; }
.tc-day { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 6px; }
.tc-sys { text-align: center; color: var(--muted); font-size: 12.5px; margin: 8px 0; font-style: italic; }
.tc-msg { display: flex; gap: 10px; margin-top: 10px; }
.tc-msg.cont { margin-top: 2px; } .tc-msg.cont .tc-av, .tc-msg.cont .tc-meta b, .tc-msg.cont .tc-meta time { visibility: hidden; height: 0; }
.tc-msg.cont .tc-meta { height: 0; }
.tc-b { min-width: 0; flex: 1; }
.tc-meta { font-size: 12.5px; } .tc-meta time { color: var(--muted); font-size: 11.5px; }
.tc-text { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.45; }
.tc-msg.me.read .tc-meta time::after { content: " · seen"; }
.tc-at { color: var(--link); background: var(--info-bg); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.tc-file img { max-width: 320px; max-height: 260px; border-radius: 8px; margin-top: 4px; display: block; border: 1px solid var(--border); }
.tc-tools { margin-left: 8px; opacity: 0; } .tc-msg:hover .tc-tools { opacity: 1; }
.tc-tools button { border: 0; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 0 4px; }
.tc-tools button:hover { color: var(--link); text-decoration: underline; }
.tc-msg.cont:hover .tc-meta { height: auto; } .tc-msg.cont:hover .tc-meta time { visibility: visible; height: auto; }
.tc-compose { border-top: 1px solid var(--border); padding: 10px 12px; position: relative; }
.tc-row { display: flex; gap: 8px; align-items: flex-end; }
.tc-row textarea { flex: 1; resize: none; min-height: 40px; max-height: 180px; }
.tc-mention { bottom: calc(100% + 4px); }
@media (max-width: 760px) { .tc { grid-template-columns: 1fr; height: auto; } .tc-side { max-height: 260px; } .tc-main { height: 70vh; } .tc-new-pop { right: 10px; } }

body:has(.tc) .wadock-tab { bottom: 96px; }      /* keep the WhatsApp button off the team chat's Send button */

/* ---- emoji picker & reactions ---- */
.ep-pop { position: fixed; z-index: 2000; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 6px; width: max-content; max-width: calc(100vw - 16px); }
.ep-pop.quick { width: auto; display: flex; gap: 2px; border-radius: 99px; padding: 4px 6px; }
.ep-e { border: 0; background: none; font-size: 22px; line-height: 1; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.ep-e:hover { background: var(--surface-2); transform: scale(1.12); }
.ep-pop.quick .ep-e { border-radius: 50%; }
.ep-more { font-size: 16px; color: var(--muted); }
.ep-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 4px; }
.ep-tabs button { border: 0; background: none; font-size: 18px; padding: 4px 8px; border-radius: 7px; cursor: pointer; opacity: .6; }
.ep-tabs button.on { background: var(--surface-2); opacity: 1; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 36px); max-height: 220px; overflow-y: auto; overflow-x: hidden; }
.ep-grid .ep-e { width: 100%; }
.tc-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tc-rx-chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; font-size: 13px;
  cursor: pointer; color: var(--text); line-height: 1.6; }
.tc-rx-chip.mine { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); }
.tc-rx-chip.add { opacity: 0; color: var(--muted); } .tc-msg:hover .tc-rx-chip.add { opacity: 1; }
.tc-react-btn { font-size: 12px !important; }

.wa-tpl-row[data-window="1"] { display: none !important; }
select.to-pick { width: auto; display: inline-block; padding: 2px 6px; font-size: 13px; }

.cn-row { display: flex; gap: 10px; align-items: flex-start; }
.cn-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.cn-img img, .cn-prev { max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); display: block; margin: 4px 0 6px; }

.wa-svc { padding: 4px 0 6px; border-bottom: 1px dashed var(--border); } .wa-svc:last-child { border-bottom: 0; }
.wa-svc .btn { margin-top: 4px; }
.wa-svc .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: 1px; }
.wa-svc .dot.on { background: var(--good); }

/* ---- staff avatars & profiles ---- */
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; object-fit: cover;
  vertical-align: middle; letter-spacing: .02em; line-height: 1; }
img.av { background: var(--surface-2); }
.top .me { display: inline-flex; align-items: center; gap: 8px; }
.me-st { font-size: 12px; color: var(--muted); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-who { display: flex; align-items: center; gap: 8px; }
.wa-agent-av .av { box-shadow: 0 0 0 2px var(--surface); }
.pf-top { display: flex; gap: 16px; align-items: center; }
.pf-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-col input { position: absolute; opacity: 0; }
.pf-col span { display: inline-block; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.pf-col input:checked + span { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.pf-col.auto span { width: auto; height: 28px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); font-size: 12px; line-height: 20px; }
.pf-status { font-size: 16px; margin-top: 0; }
.pf-presets { display: flex; flex-wrap: wrap; gap: 4px; } .pf-presets .chip { cursor: pointer; border: 1px solid var(--border); background: var(--surface); }

.tc-hl { display: flex; gap: 10px; align-items: center; }
.tc-st { font-weight: 400; font-size: 13px; }
img.tc-av { object-fit: cover; padding: 0; }

.staff-tbl td { vertical-align: middle; }
.st-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.st-id span { font-size: 12px; }
.st-acts { white-space: normal !important; }
.st-acts > * { margin: 2px 0 2px 4px; }
.staff-tbl tr.pick { cursor: pointer; }

/* client portal notice */
.portal-notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--info-bg); border-left: 4px solid #3b7dd8; line-height: 1.5; }
.portal-notice.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.portal-notice.urgent { background: var(--bad-bg); border-left-color: var(--bad); font-weight: 600; }
.portal-notice a { font-weight: 600; }

/* AI */
.ai-text { white-space: pre-wrap; line-height: 1.55; }
.ai-btn { border: 0; background: transparent; cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1; }
.ai-btn:disabled { opacity: .4; cursor: default; }
.ai-btn.busy { animation: ai-pulse 1s infinite; }
@keyframes ai-pulse { 50% { opacity: .35; } }
.ai-sum { background: var(--info-bg); border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 13.5px; white-space: pre-wrap; position: relative; }
.ai-sum .x { position: absolute; top: 4px; right: 8px; cursor: pointer; border: 0; background: none; font-size: 16px; color: inherit; }
.ai-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.ai-chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--info-bg); white-space: nowrap; }
.ai-chip.u-high { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.ai-chip.m-angry, .ai-chip.m-frustrated { background: var(--warn-bg); color: var(--warn); }
.ai-err { color: var(--bad); font-size: 12.5px; }

/* client portal: WhatsApp support */
.btn.wa-btn { background: #25d366; border-color: #1eb757; color: #fff; gap: 6px; }
.btn.wa-btn:hover { background: #1eb757; color: #fff; }
.portal-top nav a.wa-nav { background: #25d366; color: #fff; font-weight: 600; }
.portal-top nav a.wa-nav:hover { background: #1eb757; }
.staff-view { background: #7c3aed; color: #fff; text-align: center; padding: 8px 16px; font-size: 13.5px; position: sticky; top: 0; z-index: 50; }
.staff-view a { color: #fff; font-weight: 700; text-decoration: underline; margin-left: 6px; }

/* ------------------------------------------------------------------ scheduling calendar */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-nav .icon { font-size: 18px; line-height: 1; padding: 4px 10px; }
.cal-title { font-size: 20px; margin: 0 0 0 8px; }
.cal-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-tools select { width: auto; padding: 6px 8px; font-size: 13.5px; }
.cal-views button { border: 0; background: none; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.cal-views button + button { border-left: 1px solid var(--border); }
.cal-views button.on { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; }
.cal-main { min-width: 0; }
.cal-side { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: 78vh; overflow: auto; position: sticky; top: 10px; }
.cal-side h3 { margin: 0 0 6px; font-size: 14px; }
.wt { display: flex; gap: 8px; align-items: flex-start; padding: 7px 6px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.wt + .wt { border-top-color: var(--border); }
.wt.can { cursor: grab; } .wt:hover { background: var(--surface-2); }
.wt .kind-dot { margin: 5px 0 0; flex: none; }
.wt b { font-size: 13px; } .wt small { display: block; color: var(--muted); font-size: 11.5px; }

/* month */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--border); gap: 1px; }
.mh { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); padding: 6px 8px; }
.mc { background: var(--surface); min-height: 112px; padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc.we { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.mc.out { opacity: .55; }
.mc.today .mcd a:first-child { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 6px; }
.mc.hover { outline: 2px dashed var(--brand); outline-offset: -3px; }
.mcd { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; }
.mcd a { color: var(--text); text-decoration: none; } .madd { opacity: 0; color: var(--muted) !important; padding: 0 4px; }
.mc:hover .madd { opacity: 1; }
.mchip { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 5px; border-radius: 4px;
  background: color-mix(in srgb, var(--k) 14%, var(--surface)); border-left: 3px solid var(--k); color: var(--text); text-decoration: none; cursor: pointer; }
.mchip.closed { opacity: .55; text-decoration: line-through; }
.mmore { font-size: 11.5px; color: var(--muted); }

/* week / day time grid */
.tg { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.tg-head, .tg-grid { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(110px, 1fr)); }
.tg-head { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tg-corner { display: flex; align-items: center; justify-content: center; }
.tg-ch { padding: 7px 6px; font-size: 13px; text-align: center; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ch a { color: var(--text); text-decoration: none; } .tg-ch.today { box-shadow: inset 0 -3px 0 var(--brand); } .tg-ch .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.tg-scroll { max-height: 72vh; overflow: auto; }
.tg-grid { position: relative; background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 24px); background-position: 0 0; background-size: 100% 48px; }
.tg-times { position: relative; }
.tg-times div { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-1px); }
.tg-col { position: relative; border-left: 1px solid var(--border); }
.tg-col.we { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: #e11d48; z-index: 3; }
.tg-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e11d48; }
.ev2 { position: absolute; z-index: 2; overflow: hidden; border-radius: 6px; padding: 3px 6px 6px; font-size: 12px; line-height: 1.3;
  background: color-mix(in srgb, var(--k) 16%, var(--surface)); border-left: 4px solid var(--k); color: var(--text); text-decoration: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.ev2:hover { z-index: 4; box-shadow: 0 3px 10px rgb(0 0 0 / .18); }
.ev2.can { cursor: grab; touch-action: pan-y; }
.ev2.closed { opacity: .55; } .ev2.closed .n { text-decoration: line-through; }
.ev2 .t { display: block; font-weight: 600; font-size: 11px; color: var(--text-2); }
.ev2 .n { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev2 .s { display: block; color: var(--text-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev2.short { padding-top: 1px; } .ev2.short .t { display: inline; margin-right: 4px; } .ev2.short .n { display: inline; } .ev2.short .s { display: none; }
.ev2 .pri { color: #dc2626; }
.ev2 .rs { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ev2 .rs::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--k) 60%, transparent); opacity: 0; }
.ev2:hover .rs::after { opacity: 1; }
.dragging { opacity: .35; }
.ghost { position: fixed !important; z-index: 1000; pointer-events: none; opacity: .92; box-shadow: 0 8px 22px rgb(0 0 0 / .25); transform: rotate(-1deg); }
.drop-hint { position: absolute; left: 2px; right: 2px; z-index: 5; border: 2px dashed var(--brand); border-radius: 6px; background: color-mix(in srgb, var(--brand) 12%, transparent);
  font-size: 11px; font-weight: 700; padding: 2px 5px; color: var(--text); pointer-events: none; }
.linkish { border: 0; background: none; color: var(--text-2); font-size: 11px; cursor: pointer; text-decoration: underline; padding: 0; }
#cal-toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 1001; padding: 9px 16px; border-radius: 8px; font-size: 13.5px; color: #fff; background: #0f7a4b; box-shadow: 0 6px 18px rgb(0 0 0 / .2); }
#cal-toast.err { background: #b42318; }
@media (max-width: 900px) {
  .cal-body { grid-template-columns: 1fr; }
  .cal-side { position: static; max-height: none; }
  .mc { min-height: 74px; } .mchip b { display: none; }
  .tg-head, .tg-grid { grid-template-columns: 44px repeat(var(--cols), minmax(92px, 1fr)); }
  .tg { overflow-x: auto; }
}
.ev2:hover, .ev2:hover *, .mchip:hover { text-decoration: none; }
.cal-layers { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin-bottom: 6px; font-size: 13.5px; }
.cal-layers .check { margin: 0; }
.cal-body:has(.cal-side[hidden]) { grid-template-columns: 1fr; }
.tg-strip { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(110px, 1fr)); border-bottom: 1px solid var(--border); background: var(--surface); }
.tg-sc { border-left: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sup, .mnt { display: block; font-size: 11.5px; padding: 1px 6px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--sc, #64748b) 15%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--sc, #64748b) 40%, transparent); }
.mnt { --sc: #d97706; text-decoration: none; border-style: dashed; }
.sup small, .mnt small { color: var(--text-2); }
.cal-feed { padding: 8px 0; border-top: 1px solid var(--border); }
@media (max-width: 900px) { .tg-strip { grid-template-columns: 44px repeat(var(--cols), minmax(92px, 1fr)); } }
.hs-checks { list-style: none; padding: 0; margin: 0; }
.hs-checks li { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.hs-checks li.hs-bad { font-weight: 600; }
.hs-checks code { display: block; margin-top: 4px; font-weight: 400; background: var(--surface); padding: 4px 8px; border-radius: 6px; font-size: 12px; white-space: pre-wrap; }
.np td { vertical-align: middle; } .np-c { text-align: right; white-space: nowrap; }
.np .seg label { padding: 5px 10px; font-size: 13px; }
@media (max-width: 700px) { .np-c { white-space: normal; text-align: left; } .np tr { display: grid; gap: 6px; } }

/* client's MikroTik card (client page, WhatsApp chat) */
.cpefw-r { padding: 8px 0; border-bottom: 1px solid var(--border); }
.cpefw-r:last-of-type { border-bottom: 0; }
.cpefw-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.cpefw-ver { text-align: right; } .cpefw-ver .badge { font-size: 11px; }
.cpefw-btns { margin-top: 8px; gap: 6px; flex-wrap: wrap; align-items: center; }
.cpefw-btns form { margin: 0; }
.cpefw-job { margin-top: 6px; font-size: 12.5px; }
.wa-cpefw .cpefw-ver { text-align: left; }

/* WhatsApp chat panel: the client's TR-069 router */
.wa-acs-r { padding: 6px 0 10px; border-bottom: 1px solid var(--border); }
.wa-acs-r:last-of-type { border-bottom: 0; }
.wa-acs-wifi summary { cursor: pointer; font-size: 13.5px; }
.wa-acs-w { display: grid; gap: 4px; margin-top: 8px; }
.wa-acs-w label { margin: 0; font-size: 12.5px; color: var(--muted); }

.wa-tk-r { padding: 6px 0; border-bottom: 1px solid var(--border); } .wa-tk-r:last-of-type { border-bottom: 0; }

.voip-money { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.voip-use { flex-basis: 100%; text-align: right; font-size: 12px; } .voip-use .bar { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin: 4px 0 2px auto; max-width: 260px; } .voip-use .bar i { display: block; height: 100%; }
.voip-nums { margin-top: 10px; } .voip-nums > summary { cursor: pointer; padding: 6px 0; }

.cpe-read { font-size: 12.5px; } .cpe-read .linkbtn { margin-left: 6px; }

.sf { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.sf-h { font-size: 13.5px; margin-bottom: 4px; } .sf-r { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.sf-r input { margin-top: 3px; } .sf-ok { color: var(--good); font-weight: 700; width: 13px; }

/* WhatsApp template picker */
.wt { display: flex; flex-direction: column; gap: 6px; }
.wt-row { display: flex; gap: 6px; align-items: center; }
.wt-row .wt-pick { flex: 1; min-width: 0; }
.wt-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 10px; }
.wt-slot label { font-size: 12.5px; color: var(--muted); }
.wt-ph { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wt-ph button { font: 12px var(--mono, monospace); border: 1px solid var(--border); background: var(--surface-2); color: inherit; border-radius: 6px; padding: 1px 6px; cursor: pointer; }
.wt-prev { max-width: 420px; }
.wt-msg:empty { display: none; }
.wa-tplbox { border-top: 1px solid var(--border); padding: 6px 14px; background: var(--surface); }
.wa-tplbox > summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 2px 0; }
.wa-tplbox[open] { max-height: 55vh; overflow: auto; }
.wa-tplbox[open] > summary { margin-bottom: 6px; }
/* client MikroTik: current WiFi + PPPoE cards */
.cpefw-set { margin-top: 8px; }
.cpefw-set .mt-card { margin: 8px 0 0; padding: 12px; box-shadow: none; border: 1px solid var(--border); }
.mt-wifi + .mt-wifi { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.mt-wifi-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.mt-ppp { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 4px 0; }
.mt-ppp > div { flex-basis: 100%; }
td.dev-client { min-width: 190px; }
.day-sep.wa-via { font-style: italic; }

/* client page: tabs + connection card */
.cust-panel[hidden] { display: none !important; }
.cust-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cust-col > .card, .cust-col > div > .card { margin: 0; }
.cust-col #services { display: flex; flex-direction: column; gap: 16px; }
.cust-panel > .grid { align-items: start; }
.conn-row + .conn-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.conn-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn-up { margin-top: 4px; font-size: 15px; } .conn-up b { font-size: 18px; font-variant-numeric: tabular-nums; }
.conn-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
/* client page tabs: underlined, like a document's section tabs */
.cust-tabs { gap: 2px; padding: 0 8px; border-radius: 12px 12px 0 0; box-shadow: none; background: var(--surface);
  border-bottom: 1px solid var(--border); margin: 0 0 18px; }
.cust-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 14px 14px 12px; border-radius: 0; font-size: 14px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; letter-spacing: .005em; transition: color .15s, border-color .15s; }
.cust-tabs a svg { opacity: .75; flex: none; }
.cust-tabs a:hover { background: none; color: var(--text); border-bottom-color: var(--border); }
.cust-tabs a.on { background: none; color: var(--text); border-bottom-color: var(--accent); }
.cust-tabs a.on svg { opacity: 1; color: var(--accent); }
.cust-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 6px; }
.cust-tabs .ct-n { font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-2); }
.cust-tabs .ct-bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
/* "find a client" picker */
.custpick { position: relative; min-width: 260px; flex: 1; }
.custpick .cp-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg, var(--shadow)); max-height: 320px; overflow-y: auto; padding: 4px; }
.custpick .cp-list button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px;
  padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.custpick .cp-list button small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.custpick .cp-list button.hi, .custpick .cp-list button:hover { background: var(--surface-2); }
.custpick .cp-none { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.custpick.cp-picked .cp-q { border-color: var(--ok, #1f9d55); }
/* passkey sign-in */
.pk-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12.5px; }
.pk-or::before, .pk-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pk-or[hidden] { display: none; }
.pk-btn { gap: 8px; }

.wa-abuse { display: inline-block; font-size: 11px; font-weight: 700; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.wa-masked { cursor: pointer; }

/* ---- WhatsApp bot editor: map + collapsible steps with a live preview */
.bot-map .fmap { display: flex; flex-direction: column; gap: 2px; }
.fm-row { display: flex; align-items: center; gap: 8px; padding: 3px 0 3px calc(var(--d) * 26px); position: relative; font-size: 13.5px; min-width: 0; }
.fm-row::before { content: ""; position: absolute; left: calc(var(--d) * 26px - 14px); top: 0; bottom: 50%; width: 10px; border-left: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); border-bottom-left-radius: 6px; }
.fm-row[style*="--d:0"]::before { display: none; }
.fm-via { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.fm-step { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; background: var(--surface-2); text-decoration: none; color: var(--text); font-weight: 600; min-width: 0; max-width: 100%; }
.fm-step:hover { box-shadow: 0 0 0 2px var(--accent); }
.fm-txt { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fm-back { color: var(--muted); font-size: 12.5px; }
.fm-missing { color: var(--bad); font-size: 12.5px; font-weight: 600; }
.fm-unused { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 13px; }
.bot-steps { display: flex; flex-direction: column; gap: 10px; }
.bot-node > summary { list-style: none; cursor: pointer; } .bot-node > summary::-webkit-details-marker { display: none; }
.bn-sum { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; }
.bn-sum .badge, .bn-sum .bt { justify-self: start; }
.bn-name { font-size: 15px; }
.bn-edit { grid-column: 3; grid-row: 1; font-size: 13px; color: var(--accent); font-weight: 600; }
.bot-node[open] .bn-edit { visibility: hidden; }
.bn-pv { grid-column: 1 / -1; display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.bot-node[open] .bn-pv { display: none; }
.bn-links { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); padding-top: 4px; }
.bn-links b { color: var(--text); }
.bn-form { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.bn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .bn-grid { grid-template-columns: 1fr; } }
.bn-live { position: sticky; top: 80px; background: #e9e2d6; border-radius: 12px; padding: 10px; }
[data-theme="dark"] .bn-live { background: #0b141a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bn-live { background: #0b141a; } }
.wa-pv { max-width: 300px; }
.wa-pv-b { background: var(--surface); color: var(--text); border-radius: 10px 10px 10px 3px; padding: 8px 10px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-pv-btns { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.wa-pv-btns span { background: var(--surface); border-radius: 8px; text-align: center; color: #0a7cff; font-weight: 600; font-size: 13px; padding: 6px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-pv-list { background: var(--surface); border-radius: 8px; margin-top: 3px; padding: 4px 10px; font-size: 13px; }
.wa-pv-list div { padding: 4px 0; border-bottom: 1px solid var(--border); } .wa-pv-list div:last-child { border-bottom: 0; }
.wa-pv-list small { display: block; color: var(--muted); }
.wa-pv-warn { color: var(--bad); font-size: 12px; margin-top: 4px; }
.opt-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.opt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; grid-template-areas: "l a g x" "d d d ."; gap: 4px 6px; align-items: center;
  padding: 6px; border: 1px solid var(--border); border-radius: 10px; }
.opt-row[hidden] { display: none; }
.opt-l { grid-area: l; position: relative; } .opt-arrow { grid-area: a; } .opt-row .goto { grid-area: g; } .opt-x { grid-area: x; }
.opt-desc { grid-area: d; font-size: 12.5px; padding-top: 4px; padding-bottom: 4px; }
.opt-l input { padding-right: 46px; }
.opt-l .cc { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); }
.opt-l .cc.over { color: var(--bad); font-weight: 700; }
.opt-arrow { color: var(--muted); }
.bn-adv { margin-top: 12px; } .bn-adv > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.fm-name { white-space: nowrap; } .fm-step .bt { flex: none; }
@media (max-width: 1100px) { .bot-wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .fm-row { flex-wrap: wrap; padding-left: calc(var(--d) * 14px); } .fm-row::before { display: none; }
  .fm-txt { display: none; } .fm-name { white-space: normal; } .bot-map .field-row { flex-wrap: wrap; } }
@media (max-width: 700px) { .opt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l x" "g g" "d d"; } .opt-arrow { display: none; } }

.bubble .wa-pop { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.wa-fwd { display: inline-block; margin-left: 4px; } .wa-fwd > summary { cursor: pointer; color: var(--accent); list-style: none; display: inline; }
.wa-fwd > summary::-webkit-details-marker { display: none; }
.wa-fwd form { display: flex; gap: 4px; margin-top: 4px; } .wa-fwd input { font-size: 12px; padding: 3px 6px; min-width: 0; width: 180px; }
.wa-fwd form { flex-wrap: wrap; } .wa-fwd-tell { display: flex; align-items: center; gap: 4px; font-size: 11.5px; width: 100%; }

/* ---- WhatsApp extras: team notes, events, quotes, translation, presence, tools, calls ---- */
.wa-note { align-self: center; width: min(560px, 92%); background: #fff6c8; color: #3a2f00; border: 1px dashed #d8b400;
  border-radius: 10px; padding: 7px 12px; font-size: 13.5px; }
.wa-note .wa-note-h { display: block; font-size: 11.5px; opacity: .75; margin-bottom: 2px; }
.wa-note .txt { white-space: pre-wrap; } .wa-at { color: #7a4d00; }
.wa-event { align-self: center; max-width: 92%; background: var(--surface-2); color: var(--muted); border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; text-align: center; }
.wa-event .wa-ev-t { opacity: .7; font-size: 11px; } .wa-event.k-call { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-note { background: #3a3110; color: #fff2c0; border-color: #8a7420; }
  :root:not([data-theme="light"]) .wa-at { color: #ffd166; } }
:root[data-theme="dark"] .wa-note { background: #3a3110; color: #fff2c0; border-color: #8a7420; } :root[data-theme="dark"] .wa-at { color: #ffd166; }
.bubble { position: relative; }
.bubble .wa-quote { display: block; border-left: 3px solid var(--accent); background: rgba(0,0,0,.05); border-radius: 6px;
  padding: 4px 8px; margin-bottom: 5px; font-size: 12.5px; color: inherit; text-decoration: none; max-width: 420px; }
.bubble .wa-quote b { display: block; font-size: 11.5px; color: var(--accent); }
.bubble .wa-quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: .85; }
.bubble .wa-rep { position: absolute; top: 4px; right: -30px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; opacity: 0; transition: opacity .15s; font-size: 14px; color: var(--text); }
.bubble.out .wa-rep { right: auto; left: -30px; }
.bubble:hover .wa-rep, .bubble .wa-rep:focus-visible { opacity: 1; }
@media (hover: none) { .bubble .wa-rep { opacity: .7; position: static; display: inline-block; margin-left: 6px; width: 24px; height: 24px; } }
.bubble .wa-tr { font-size: 13px; margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(0,0,0,.15); white-space: pre-wrap; }
.bubble .wa-tr i { font-style: normal; opacity: .7; }
.bubble .wa-tr-btn { display: inline-block; margin-top: 3px; border: 0; background: none; padding: 0; font-size: 12px; color: var(--accent); cursor: pointer; }
.bubble.wa-flash, .wa-note.wa-flash { outline: 3px solid var(--warn); }
.wa-presence { padding: 6px 14px; font-size: 13px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--border); }
.wa-presence.typing { font-weight: 600; }
.wa-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; border-top: 1px solid var(--border); background: var(--surface); }
.wa-mode { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.wa-mode button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.wa-mode button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.wa-plus { margin-left: auto; position: relative; } .wa-plus .menu-pop { bottom: calc(100% + 6px); top: auto; min-width: 300px; }
.wa-plus-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 4px 0; }
.wa-plus-row span { width: 100%; font-size: 13px; } .wa-plus-row select { width: auto; flex: 1; min-width: 0; }
.menu-pop button[disabled] { opacity: .45; cursor: not-allowed; }
.wa-main .composer { border-top: 0; }
#composer.is-note .composer { background: #fff9dc; } #composer.is-note textarea { background: #fffdf0; border-color: #d8b400; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #composer.is-note .composer { background: #2c2610; }
  :root:not([data-theme="light"]) #composer.is-note textarea { background: #1f1b0b; } }
:root[data-theme="dark"] #composer.is-note .composer { background: #2c2610; } :root[data-theme="dark"] #composer.is-note textarea { background: #1f1b0b; }
.wa-quoting, .wa-sched { display: flex; align-items: center; gap: 8px; margin: 6px 12px 0; padding: 6px 10px; border-radius: 8px;
  background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 13px; }
.wa-quoting[hidden], .wa-sched[hidden] { display: none; }
.wa-quoting .wq-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-quoting button { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.wa-sched input { width: auto; }
.wa-snooze { position: relative; } .wa-snz-at { display: flex; gap: 6px; padding: 6px 12px; } .wa-snz-at input { flex: 1; min-width: 0; }
.wa-viewing, .wa-snz, .wa-src { font-size: 11.5px; border-radius: 999px; padding: 1px 8px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.wa-viewing { background: var(--warn-bg); color: var(--warn); }
.wa-info-p { margin: 0 0 8px; font-size: 13.5px; }
.wa-sch-row { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.wa-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: #1f2937; color: #fff;
  padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 14px; max-width: min(92vw, 520px); }
.wa-toast.bad { background: #8b1d1d; }
.wc-panel { position: fixed; right: 18px; bottom: 18px; z-index: 95; width: min(360px, calc(100vw - 32px)); background: var(--surface);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.28); padding: 14px; border: 1px solid var(--border); }
.wc-panel.ringing { animation: wc-pulse 1.2s ease-in-out infinite; border-color: var(--good); }
@keyframes wc-pulse { 50% { box-shadow: 0 10px 40px rgba(17,135,93,.45); } }
@media (prefers-reduced-motion: reduce) { .wc-panel.ringing { animation: none; } }
.wc-who { display: flex; gap: 10px; align-items: center; } .wc-who b { display: block; } .wc-st { font-size: 13px; color: var(--muted); }
.wc-ic { font-size: 26px; } .wc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wc-btns .wc-decline, .wc-btns .wc-hang { color: var(--bad); }
@media (max-width: 640px) { .wa-bar { flex-wrap: wrap; } .wa-plus .menu-pop { right: 0; left: auto; min-width: min(300px, 92vw); } }
.wa-chat-head { flex-wrap: wrap; row-gap: 8px; } .wa-ch-id { min-width: 150px; } .wa-ch-right { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
@media (max-width: 760px) { .wa-ch-right #wa-call-btn { display: inline-flex; } }
.bubble .wa-tr-btn { display: block; margin-top: 4px; }
.menu-pop .wa-plus-row select { width: auto; flex: 1; min-width: 0; padding: 6px 8px; }
.menu-pop .wa-plus-row button { width: auto; flex: none; border: 1px solid var(--border); background: var(--surface-2); padding: 6px 14px; text-align: center; font-weight: 600; }
#composer.is-note #tr-btn, #composer.is-note #sched-btn { display: none; }
@media (max-width: 640px) {
  .wa-main .composer { flex-wrap: wrap; }
  .wa-main .composer textarea { order: -1; flex: 1 1 100%; }
  .wa-main .composer #send-btn { margin-left: auto; }
  body:has(#wa-app) .wadock-tab { display: none; }          /* the chat page already is the chat */
}

/* ==== WhatsApp chat, polished: icon toolbar, "send the client" chips, pill composer, rich messages ==== */
summary.wa-ib, summary.wa-chip { list-style: none; }
summary.wa-ib::-webkit-details-marker, summary.wa-chip::-webkit-details-marker { display: none; }
.wa-ib { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; }
.wa-ib:hover { background: var(--surface-2); color: var(--text); }
.wa-ib:focus-visible, .wa-chip:focus-visible, .wa-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wa-ib.on, .wa-ib[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.wa-ib:disabled, .wa-ib[aria-disabled="true"] { opacity: .38; pointer-events: none; }
.wa-ib-call { color: var(--good); }
.wa-ib-call:hover { background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); }
.wa-ib.wa-info-btn { align-items: center; justify-content: center; }
.wa-tb { display: flex; align-items: center; gap: 2px; padding-left: 6px; margin-left: 2px; border-left: 1px solid var(--border); }
.wa-close-btn { display: inline-flex; align-items: center; gap: 5px; }
.wa-snooze .menu-pop { min-width: 250px; }
.wa-pop-h { padding: 8px 12px 4px; font-size: 12.5px; color: var(--muted); }
.wa-pop-f { padding: 6px 12px 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 4px; }

/* the row above the reply box: Reply / Team note + things to send the client */
.wa-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px 4px; border-top: 1px solid var(--border); background: var(--surface); }
.wa-mode button { display: inline-flex; align-items: center; gap: 5px; }
.wa-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.wa-acts.off { opacity: .5; } .wa-acts.off summary { pointer-events: none; }
.wa-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .12s, border-color .12s; }
.wa-chip .ic { color: var(--accent); flex: none; }
.wa-chip:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.wa-chip.on, .wa-chipmenu[open] > .wa-chip { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); border-color: var(--accent); }
.wa-chip:disabled { opacity: .45; cursor: not-allowed; }
.wa-chipmenu { position: relative; }
.wa-chipmenu > .wa-chip .ic:last-child { color: var(--muted); margin: 0 -3px 0 -2px; }
.wa-chipmenu .menu-pop { top: auto; bottom: calc(100% + 8px); right: 0; min-width: 270px; }
.wa-note-hint { display: none; margin-left: auto; font-size: 12.5px; color: var(--warn); }
.wa-main.noting .wa-acts { display: none; } .wa-main.noting .wa-note-hint { display: block; }
.wa-main .wa-tplbox > summary { display: none; }
.wa-main .wa-tplbox:not([open]) { display: none; }
.wa-main .wa-tplbox[open] { border-top: 1px solid var(--border); padding: 10px 14px; }

/* the reply box */
.wa-main .composer.wa-compose { align-items: flex-end; gap: 2px; padding: 6px 10px 10px; border-top: 0; background: var(--surface); }
.wa-compose textarea { flex: 1; min-width: 0; min-height: 40px; height: 40px; max-height: 180px; resize: none; margin: 0 4px;
  padding: 9px 15px; line-height: 1.4; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); }
.wa-compose textarea:focus { background: var(--surface); border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.wa-compose .wa-ib { width: 36px; height: 40px; }
.wa-compose .attach-btn, .wa-compose .canned-btn { border: 0; background: transparent; min-height: 0; font-size: inherit; }
.wa-send { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; height: 40px; padding: 0 17px 0 14px; margin-left: 4px;
  border: 0; border-radius: 20px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.wa-send:hover { filter: brightness(1.07); } .wa-send:disabled { opacity: .45; cursor: not-allowed; filter: none; }
#composer.is-note .wa-send { background: #b8860b; }
#composer.is-note .composer.wa-compose { background: #fffbea; }
#composer.is-note .wa-compose textarea { background: #fffef6; border-color: #e0b100; }
.wa-quoting, .wa-sched { margin: 6px 12px 0; border-radius: 10px; }
.wa-sched .ic { color: var(--accent); flex: none; }

/* who else is here */
.wa-presence { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 12.5px; font-weight: 500;
  background: color-mix(in srgb, var(--warn) 9%, var(--surface)); color: var(--warn); border-bottom: 1px solid var(--border); }
.wa-presence[hidden] { display: none; }
.wa-presence.typing::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: wa-blink 1s ease-in-out infinite; flex: none; }
@keyframes wa-blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .wa-presence.typing::before { animation: none; } }

/* messages: events, notes, buttons, lists, forms */
.wa-main .thread { gap: 5px; }
.wa-event { display: inline-flex; align-items: center; gap: 7px; align-self: center; max-width: 88%; margin: 3px 0; padding: 4px 11px;
  border-radius: 8px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text-2);
  font-size: 12px; line-height: 1.35; text-align: left; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.wa-event .wa-ev-t { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.wa-event.k-call { background: var(--surface); color: var(--text); }
.wa-ev-ic { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.wa-note { align-self: stretch; width: auto; margin: 4px 7%; padding: 7px 12px 8px; border: 0; border-left: 3px solid #e0b100;
  border-radius: 4px 10px 10px 4px; background: #fff7d1; color: #3d3100; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.wa-note .wa-note-h { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; color: #8a6d00; opacity: 1; font-size: 11.5px; }
.wa-note .wa-note-t { margin-left: auto; }
.bubble .wa-tap { display: inline-flex; align-items: center; gap: 3px; margin-bottom: 2px; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.bubble .wa-btns { display: flex; flex-direction: column; margin: 8px -12px -8px; border-top: 1px solid rgba(0,0,0,.08); }
.bubble .wa-btns > a, .bubble .wa-btns > span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px;
  border-top: 1px solid rgba(0,0,0,.06); color: #0284c7; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.bubble .wa-btns > :first-child { border-top: 0; }
.bubble .wa-btns > a:hover { background: rgba(0,0,0,.03); }
.bubble .wa-rows { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; padding: 7px 10px; border-radius: 8px; background: rgba(0,0,0,.045); font-size: 13px; }
.bubble .wa-rows-h { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; font-size: 11.5px; opacity: .7; }
.bubble .wa-rows > span { display: flex; gap: 7px; } .bubble .wa-rows > span::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 4px; border: 1.5px solid currentColor; border-radius: 50%; opacity: .45; }
.bubble .wa-formcard { min-width: 230px; }
.wa-formcard .wfc-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(0,0,0,.08); font-weight: 700; color: var(--accent); }
.wa-formcard dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13.5px; }
.wa-formcard dt { color: var(--muted); } .wa-formcard dd { margin: 0; white-space: pre-wrap; }
.bubble .wa-rep { display: grid; place-items: center; color: var(--text-2); }
.bubble .wa-tr, .bubble .wa-tr-btn { display: flex; align-items: center; gap: 5px; }
.bubble .wa-tr { align-items: flex-start; } .bubble .wa-tr .ic { margin-top: 2px; flex: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wa-note { background: #362e10; color: #fdf1c7; border-left-color: #c9a227; }
  :root:not([data-theme="light"]) .wa-note .wa-note-h { color: #e8c75a; }
  :root:not([data-theme="light"]) .bubble .wa-btns > a, :root:not([data-theme="light"]) .bubble .wa-btns > span { color: #53bdeb; border-color: rgba(255,255,255,.08); }
  :root:not([data-theme="light"]) .bubble .wa-btns, :root:not([data-theme="light"]) .wa-formcard .wfc-h { border-color: rgba(255,255,255,.1); }
  :root:not([data-theme="light"]) .bubble .wa-rows { background: rgba(255,255,255,.06); }
  :root:not([data-theme="light"]) #composer.is-note .composer.wa-compose { background: #29240f; }
  :root:not([data-theme="light"]) #composer.is-note .wa-compose textarea { background: #1f1b0b; }
}
:root[data-theme="dark"] .wa-note { background: #362e10; color: #fdf1c7; border-left-color: #c9a227; }
:root[data-theme="dark"] .wa-note .wa-note-h { color: #e8c75a; }
:root[data-theme="dark"] .bubble .wa-btns > a, :root[data-theme="dark"] .bubble .wa-btns > span { color: #53bdeb; border-color: rgba(255,255,255,.08); }
:root[data-theme="dark"] .bubble .wa-btns, :root[data-theme="dark"] .wa-formcard .wfc-h { border-color: rgba(255,255,255,.1); }
:root[data-theme="dark"] .bubble .wa-rows { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] #composer.is-note .composer.wa-compose { background: #29240f; }
:root[data-theme="dark"] #composer.is-note .wa-compose textarea { background: #1f1b0b; }

@media (max-width: 760px) {
  .wa-tb { border-left: 0; padding-left: 0; }
  .wa-note { margin: 4px 2%; }
}
@media (max-width: 640px) {
  .wa-acts { margin-left: 0; justify-content: flex-start; }
  .wa-chip > span { display: none; } .wa-chip { padding: 0 9px; }
  .wa-chipmenu .menu-pop { right: auto; left: 0; min-width: min(290px, 88vw); }
  .wa-main .composer.wa-compose { flex-wrap: wrap; }
  .wa-compose textarea { order: -1; flex: 1 1 100%; margin: 0 0 6px; }
  .wa-compose .wa-send { margin-left: auto; }
}
/* the chat column decides how much fits (it's narrow when the client panel is open) */
.wa-main { container-type: inline-size; container-name: wachat; }
@container wachat (max-width: 820px) {
  .wa-chip > span, .wa-chipmenu > .wa-chip .ic:last-child { display: none; }
  .wa-chip { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .wa-chip .ic { width: 17px; height: 17px; }
}
@container wachat (max-width: 600px) {
  .wa-send > span { display: none; } .wa-send { width: 40px; padding: 0; }
  .wa-acts { margin-left: 0; justify-content: flex-start; }
}
.wa-chipmenu .wa-plus-row { margin: 0; border: 0; padding: 10px 12px; }
.wa-chipmenu .wa-plus-row select { flex: 1 1 130px; }
.wa-chipmenu .wa-plus-row button { flex: 1 1 100%; margin-top: 2px; }
