/* Billing App - one stylesheet, no outside fonts or libraries (works offline and on any hosting). */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #5f6b7a;
  --line: #dfe3e8;
  --brand: #1f5fbf;
  --brand-ink: #ffffff;
  --brand-soft: #e8f0fc;
  --good: #1a7f4b;
  --good-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --side: #0f1b33;
  --side-ink: #c9d3e6;
  --side-muted: #7f8ca6;
  --side-on: #1f3a6b;
  --blue: #2563eb; --blue-soft: #e7efff;
  --green: #16a34a; --green-soft: #e5f6ec;
  --amber: #d97706; --amber-soft: #fdf2e1;
  --red: #dc2626; --red-soft: #fde9e8;
  --violet: #7c3aed; --violet-soft: #efe8fd;
  --teal: #0d9488; --teal-soft: #e0f4f2;
  --slate: #475569; --slate-soft: #eef1f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b2029; --ink: #e6e9ee; --muted: #9aa4b2; --line: #2c3340;
    --brand: #5b9bf0; --brand-ink: #0d1117; --brand-soft: #1d2a40;
    --good: #4cc38a; --good-soft: #15291f; --warn: #e7b04a; --warn-soft: #2e2512; --bad: #f2766a; --bad-soft: #321a18;
    --shadow: none;
    --side: #0b111d; --side-on: #1b2a45;
    --blue: #6b9cff; --blue-soft: #18233a;
    --green: #4cc38a; --green-soft: #142a1f;
    --amber: #f0b44c; --amber-soft: #2c2312;
    --red: #f2766a; --red-soft: #33191a;
    --violet: #a98bff; --violet-soft: #241c3a;
    --teal: #4fd1c5; --teal-soft: #11292a;
    --slate: #a3afc2; --slate-soft: #1e2532;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* Layout: dark sidebar on the left, content on the right; on phones the sidebar slides in. */
.side-toggle { position: absolute; opacity: 0; pointer-events: none; }
.side { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.15; }
.side-brand:hover { text-decoration: none; }
.side-brand small { display: block; font-weight: 500; font-size: 12px; color: var(--side-muted); }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff; font-weight: 800; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.side-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); font-size: 14px; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.side-nav a.on { background: var(--side-on); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #60a5fa; }
.ico { width: 18px; height: 18px; flex: none; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px; }
.me { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 14px; line-height: 1.2; margin-bottom: 10px; }
.me small { display: block; color: var(--side-muted); font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #334155; color: #fff; font-weight: 700; flex: none; }
.side-actions { display: flex; gap: 6px; }
.side-actions form { margin: 0; flex: 1; }
.side-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .12); background: transparent; color: var(--side-ink); font: inherit; font-size: 13px; cursor: pointer; }
.side-actions > a.side-btn { flex: 1; }
.side-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.side-btn .ico { width: 15px; height: 15px; }
.mobilebar { display: none; }
.side-shade { display: none; }
main { max-width: 1280px; margin: 0 auto; padding: 22px 20px 48px; }
main.main-side { margin-left: 236px; max-width: none; padding: 22px 28px 48px; }
.brand { font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--brand); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.mode-note { display: flex; gap: 10px; align-items: center; }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .side-toggle:checked ~ .side { transform: none; }
  .side-toggle:checked ~ .side-shade { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
  .mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .menu-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); margin: 0; cursor: pointer; color: var(--ink); }
  main.main-side { margin-left: 0; padding: 16px 16px 40px; }
}

/* Panels */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: block; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.good .value { color: var(--good); }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--bg); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* Messages */
.flash { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid transparent; }
.flash.success { background: var(--good-soft); color: var(--good); }
.flash.warning, .flash.info { background: var(--warn-soft); color: var(--warn); }
.flash.info { background: var(--brand-soft); color: var(--brand); }
.flash.error { background: var(--bad-soft); color: var(--bad); }

/* Forms */
form.stack > * + * { margin-top: 12px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
input[readonly] { background: var(--bg); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { min-width: 140px; }
.filters .grow { flex: 1; min-width: 200px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0; font-weight: 500; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
details summary { cursor: pointer; font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* Login */
.bare { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .card { padding: 24px; }

/* Receipt */
.receipt { max-width: 420px; margin: 0 auto; }
.receipt .head { text-align: center; border-bottom: 1px dashed var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.receipt .amount { font-size: 30px; font-weight: 800; text-align: center; margin: 8px 0; }
@media print {
  .topbar, .no-print, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .card { border: 0; box-shadow: none; }
}
@media (max-width: 640px) {
  .who .name { display: none; }
  dl.kv { grid-template-columns: 110px 1fr; }
  h1 { font-size: 19px; }
}

/* Small utilities (the security policy blocks inline style="", so everything lives here) */
.text-center { text-align: center; }
.mb-16 { margin-bottom: 16px; }
.mt-0 { margin-top: 0; }
.w-full { width: 100%; }
.narrow { max-width: 460px; }
.mid { max-width: 640px; margin: 40px auto; }
.inline { display: inline; }
.hidden { display: none; }

/* billing tabs, meters, charts */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tabs a { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; }
.tabs a.on { background: var(--brand-soft); color: var(--brand); border-color: transparent; font-weight: 600; }
.tabs a:hover { text-decoration: none; border-color: var(--brand); }
.meter { margin-top: 8px; }
.meter svg { display: block; width: 100%; height: 6px; }
.meter-bg { fill: var(--line); }
.meter-fg { fill: var(--good); }
.chart svg.bars { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--brand); }
.chart .bar.today { fill: var(--good); }
.chart .axis { fill: var(--muted); font-size: 9px; }
.chart .grid { stroke: var(--line); stroke-width: 0.5; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cards-off { opacity: .5; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 400; }
.check input { width: auto; }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h1 { font-size: 24px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.hero-card { border-radius: var(--radius); padding: 18px 20px; color: #fff; display: block; position: relative; overflow: hidden; min-height: 118px; }
.hero-card:hover { text-decoration: none; filter: brightness(1.05); }
.hero-card .ico { width: 22px; height: 22px; opacity: .9; }
.hero-card .label { font-size: 13px; opacity: .9; margin-top: 8px; }
.hero-card .value { font-size: 28px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hero-card .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.hero-card.blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.hero-card.green { background: linear-gradient(135deg, #16a34a, #0f7a37); }
.hero-card.violet { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.hero-card.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.hero-card .meter { margin-top: 10px; }
.hero-card .meter-bg { fill: rgba(255, 255, 255, .25); }
.hero-card .meter-fg { fill: #fff; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 6px 0 10px; color: var(--ink); }
.sec-title .ico { color: var(--muted); }
.sec-title .muted { font-weight: 400; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); box-shadow: var(--shadow); }
a.kpi:hover { border-color: var(--blue); text-decoration: none; transform: translateY(-1px); }
.kpi .bubble { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .bubble .ico { width: 21px; height: 21px; }
.kpi .label { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.kpi .value { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; }
.t-blue .bubble { background: var(--blue-soft); color: var(--blue); }
.t-green .bubble { background: var(--green-soft); color: var(--green); }
.t-amber .bubble { background: var(--amber-soft); color: var(--amber); }
.t-red .bubble { background: var(--red-soft); color: var(--red); }
.t-violet .bubble { background: var(--violet-soft); color: var(--violet); }
.t-teal .bubble { background: var(--teal-soft); color: var(--teal); }
.t-slate .bubble { background: var(--slate-soft); color: var(--slate); }
.t-red .value { color: var(--red); }
.t-green .value { color: var(--green); }
.split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 8px 0 4px; }
.split svg { width: 100%; height: 10px; display: block; }
.split .on { fill: var(--green); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.legend .g { background: var(--green); } .legend .s { background: var(--line); }
.chart .bar { fill: var(--blue); }
.chart .bar.today { fill: var(--green); }
.chart .val { fill: var(--muted); font-size: 8px; }
.empty-note { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 0 8px; }
.method-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.method-row:last-child { border-bottom: 0; }
.method-row .bubble { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.method-row .bubble .ico { width: 16px; height: 16px; }
.method-row .name { flex: 1; font-size: 14px; }
.method-row .amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 90px; }
.method-row .amt small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.rate-pill { display: inline-block; min-width: 44px; text-align: center; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.rate-pill.rp-hi { background: var(--green-soft); color: var(--green); }
.rate-pill.rp-mid { background: var(--amber-soft); color: var(--amber); }
.rate-pill.rp-lo { background: var(--red-soft); color: var(--red); }
@media (max-width: 600px) {
  .hero-card .value { font-size: 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px; gap: 10px; }
  .kpi .bubble { width: 36px; height: 36px; }
  .kpi .value { font-size: 19px; }
}
.mt-16 { margin-top: 18px; }
.section-title h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.section-title h2 .ico { color: var(--muted); }
.card .section-title { margin-bottom: 10px; }
.btn .ico { width: 16px; height: 16px; }
p .ico { width: 15px; height: 15px; vertical-align: -3px; }
.kpi-text { display: flex; flex-direction: column; min-width: 0; }
.rights th.c, .rights td.c { text-align: center; }
.rights td.c input { width: 18px; height: 18px; accent-color: var(--blue); }
.rights tr.group td { background: var(--bg); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
/* Areas: City > Area > Sub-area */
.city { padding: 0; overflow: visible; }
.city-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.city-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.city-head h2 .ico { color: var(--blue); }
.city > p, .city .add-area { padding: 12px 18px; margin: 0; }
.area-row { display: grid; grid-template-columns: minmax(180px, 240px) 1fr auto; gap: 12px; align-items: start; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.area-row.off, .city.off { opacity: .6; }
.area-name { display: flex; align-items: center; gap: 6px; }
.area-name .ico { color: var(--muted); width: 16px; height: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { position: relative; }
.chip > summary { list-style: none; cursor: pointer; padding: 4px 10px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; }
.chip > summary::-webkit-details-marker, .area-edit > summary::-webkit-details-marker { display: none; }
.chip.off > summary { background: var(--slate-soft); color: var(--muted); text-decoration: line-through; }
.chip > summary .muted { font-weight: 400; margin-left: 2px; }
.chip-add { display: flex; gap: 4px; }
.chip-add input { width: 150px; padding: 4px 10px; border-radius: 99px; font-size: 13px; }
.area-edit { position: relative; }
.area-edit > summary { list-style: none; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); min-width: 320px; }
.chip .pop { left: 0; right: auto; }
details > summary.sec-title { cursor: pointer; }
@media (max-width: 760px) { .area-row { grid-template-columns: 1fr; } .pop { position: static; min-width: 0; margin-top: 8px; } }
fieldset.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
fieldset.box legend { font-weight: 700; padding: 0 6px; font-size: 14px; }
.area-picks, .rights-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; margin-top: 8px; }
.area-city .check { font-size: 14px; margin: 2px 0; }
form.narrow { max-width: 860px; }
.bill-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }
.discount-amt { font-size: 20px; font-weight: 700; color: var(--green); padding-top: 6px; }
.bill-strike { text-decoration: line-through; color: var(--muted); font-size: 12px; margin-right: 4px; }

/* Billing desk */
.month-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.month-nav strong { min-width: 120px; text-align: center; }
table.desk tr.day-row td { background: var(--bg); font-weight: 600; font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
table.desk tr.day-row .ico { width: 15px; height: 15px; vertical-align: -2px; }
table.desk tr.day-row.late td { color: var(--bad); }
table.desk tr.day-row.today td { color: var(--warn); }
.pay-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(460px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.pay-dialog::backdrop { background: rgba(10, 15, 30, .55); }
.pay-dialog .pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pay-dialog .pay-head h2 { margin-bottom: 4px; }

.desk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.desk-bar p { margin: 0; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.btn.icon-btn { padding-left: 8px; padding-right: 8px; }
.btn.icon-btn span { display: none; }
.btn.wa { color: #128c4b; border-color: rgba(18, 140, 75, .4); }
.btn .ico, .badge .ico { width: 15px; height: 15px; vertical-align: -3px; }
.btn.wa .ico { margin-right: 2px; }
.due { color: var(--bad); font-weight: 600; }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.pay-sum div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.pay-sum dt { font-size: 12px; color: var(--muted); }
.pay-sum dd { margin: 2px 0 0; font-weight: 600; }
.pay-sum .tot { background: var(--brand-soft); }
.pay-sum .tot dd { color: var(--brand); font-size: 17px; }
.last-pay { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.last-pay .actions { margin-left: auto; }

/* Printed billing list */
.print-page { background: #fff; color: #111; padding: 24px; }
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.print-head h1 { margin: 0 0 4px; font-size: 20px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-table th, .print-table td { border: 1px solid #c9ced6; padding: 5px 7px; text-align: left; vertical-align: top; }
.print-table th { background: #eef1f5; }
.print-table .num { text-align: right; white-space: nowrap; }
.print-table td.remarks { min-width: 110px; }
.print-table tfoot td { background: #f6f7f9; }
@media print {
  .print-page { padding: 0; }
  .print-table { font-size: 10.5px; }
  .print-table thead { display: table-header-group; }
  .print-table tr { page-break-inside: avoid; }
}
details.inline-pop { position: relative; display: inline-block; }
details.inline-pop > summary { list-style: none; cursor: pointer; }
details.inline-pop > summary::-webkit-details-marker { display: none; }
details.inline-pop[open] > .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 320px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }

/* New connection page */
.newconn { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.newconn-main { display: grid; gap: 16px; min-width: 0; }
.newconn h2 { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.newconn h2 .ico { width: 18px; height: 18px; color: var(--brand); }
.newconn .sticky { position: sticky; top: 16px; }
.label-like { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-opt { margin: 0; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; padding: 9px 18px; font-weight: 600; border-right: 1px solid var(--line); }
.seg-opt:last-child span { border-right: 0; }
.seg-opt input:checked + span { background: var(--brand); color: var(--brand-ink); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.eq-row { align-items: end; }
.newconn section.stack > * + * { margin-top: 12px; }
.newconn .eq-rows > * + * { margin-top: 10px; }
dl.sum { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; margin: 0; }
dl.sum dt { color: var(--muted); }
dl.sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
dl.sum .total { font-weight: 700; font-size: 18px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 900px) { .newconn { grid-template-columns: 1fr; } .newconn .sticky { position: static; } }
.newconn-side { align-self: stretch; }
.short-box{display:grid;gap:6px}.short-box .label-like strong{color:var(--danger,#c0392b)}
/* Collection board (billing dashboard) and Collected tab */
.coll-board { margin-top: 24px; }
.coll-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.seg-links { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--panel); }
.seg-links a { padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; }
.seg-links a.on { background: var(--brand); color: #fff; }
.period-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { padding: 5px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.pchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.period-bar .range { display: flex; gap: 6px; align-items: center; }
.period-bar .range input { width: auto; padding: 5px 8px; }
table tfoot th { background: var(--bg); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.coll-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 12px; }
.coll-sum div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.coll-sum dt { font-size: 12px; color: var(--muted); }
.coll-sum dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
/* Internet usage card */
.usage-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.usage-sum > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); }
.usage-sum > div.main { background: var(--brand-soft); border-color: var(--brand); }
.usage-sum dt { font-size: 12px; color: var(--muted); }
.usage-sum dd { margin: 2px 0; font-size: 20px; font-weight: 700; }
.usage-chart { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; align-items: end; height: 150px; padding: 4px 0 18px; position: relative; }
.ubar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; }
.ubar .col { display: flex; flex-direction: column; justify-content: flex-end; background: var(--violet, #8b5cf6); border-radius: 3px 3px 0 0; min-height: 0; opacity: .55; }
.ubar .col .dn { display: block; background: var(--blue); border-radius: 3px 3px 0 0; }
.ubar:hover .col { opacity: 1; }
.ubar .lbl { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 2px 0 8px; }
.key.dn { background: var(--blue); } .key.up { background: var(--violet, #8b5cf6); opacity: .55; }
.mt-8 { margin-top: 8px; }
@media (max-width: 640px) { .ubar:nth-child(even) .lbl { visibility: hidden; } }
/* New users this month (overall dashboard) */
.newusers { margin: 16px 0; }
.nu-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; margin-bottom: 12px; }
.nu-count { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), var(--violet, #7c3aed)); color: #fff; text-decoration: none; }
.nu-count .label { font-weight: 600; opacity: .9; display: flex; gap: 6px; align-items: center; }
.nu-count .value { font-size: 44px; font-weight: 800; line-height: 1; }
.nu-count .sub { font-size: 13px; opacity: .9; }
.nu-facts { flex: 2 1 320px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.nu-facts > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.nu-facts > div.areas { grid-column: 1 / -1; }
.nu-facts dt { font-size: 12px; color: var(--muted); }
.nu-facts dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.nu-facts dd.small { font-size: 13px; font-weight: 400; display: flex; flex-wrap: wrap; gap: 4px; }
/* Day closing sheet */
.print-only { display: none; }
.closing-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr); gap: 20px; margin-bottom: 16px; }
@media (max-width: 760px) { .closing-grid { grid-template-columns: 1fr; } }
.closing-calc { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.closing-calc > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.closing-calc > div:last-child { border-bottom: 0; }
.closing-calc dt { color: var(--muted); }
.closing-calc dd { margin: 0; font-weight: 600; }
.closing-calc .tot { background: var(--brand-soft); }
.closing-calc .tot dt, .closing-calc .tot dd { color: var(--ink); font-weight: 800; font-size: 16px; }
.closing-form { margin: 0 0 16px; }
.sign-row { margin-top: 40px; justify-content: space-between; }
@media print {
  .print-only { display: block; }
  .sign-row.print-only { display: flex; }
  .side, aside, .sidebar, .side-toggle { display: none !important; }
  body.with-side main, body.with-side .main { margin-left: 0 !important; }
}
.closing-calc { align-self: start; }
.ubar.unknown .lbl { opacity: .45; } .ubar.unknown::before { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--line); }
.coll-sum .setup { background: var(--violet-soft, var(--panel)); }
/* New users card (overall dashboard) */
.newusers-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin: 16px 0; padding: 18px 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), var(--violet, #7c3aed)); color: #fff; text-decoration: none; }
.newusers-card:hover { filter: brightness(1.05); }
.newusers-card .nu-left, .newusers-card .nu-right { display: flex; flex-direction: column; gap: 4px; }
.newusers-card .nu-right { text-align: right; align-items: flex-end; }
.newusers-card .label { font-weight: 600; opacity: .9; display: flex; gap: 6px; align-items: center; }
.newusers-card .value { font-size: 44px; font-weight: 800; line-height: 1; }
.newusers-card .amt { font-size: 26px; font-weight: 800; }
.newusers-card .sub { font-size: 13px; opacity: .9; }
.kpi .kpi-text .sub { display: block; font-size: 12px; color: var(--muted); }
/* New users card (overall dashboard): count left, monthly bills right, click for the list */
.newusers-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 16px 0; padding: 18px 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), var(--violet, #7c3aed)); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.newusers-card:hover { filter: brightness(1.05); }
.newusers-card .nu-left, .newusers-card .nu-right { display: flex; flex-direction: column; gap: 4px; }
.newusers-card .nu-right { text-align: right; align-items: flex-end; }
.newusers-card .label { font-weight: 600; opacity: .9; display: flex; gap: 6px; align-items: center; }
.newusers-card .value { font-size: 44px; font-weight: 800; line-height: 1; }
.newusers-card .amt { font-size: 26px; font-weight: 800; }
.newusers-card .sub { font-size: 13px; opacity: .9; }
.setup-kpis .kpi .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.coll-sum div.setup { background: var(--violet-soft, var(--panel)); }
.newusers-card, .newusers-card * { text-decoration: none !important; color: #fff; }
.newusers-card { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.breakdown { margin-top: 20px; }
/* Billing: day bar */
.date-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.date-bar input[type=date] { width: auto; padding: 6px 10px; }
.date-bar .month-name { min-width: 110px; text-align: center; }
.date-bar .seg-links { margin-left: auto; }
.pay-ico { display: none; }
.pay-ico .ico { width: 18px; height: 18px; }

/* Billing list on phones: one compact card per customer, pay icon first */
@media (max-width: 760px) {
  .date-bar .seg-links { margin-left: 0; }
  table.desk, table.desk tbody { display: block; width: 100%; }
  table.desk thead { display: none; }
  table.desk tr { display: grid; grid-template-columns: 40px 1fr auto auto; column-gap: 10px; row-gap: 2px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.desk tr.day-row { display: block; padding: 0; }
  table.desk tr.day-row td { display: block; }
  table.desk td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  table.desk td.row-actions { display: contents; }
  table.desk .row-actions > * { grid-row: 3; }
  table.desk .row-actions > [data-pay], table.desk .row-actions > .badge, table.desk .row-actions > a.btn:not(.icon-btn) { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  table.desk .row-actions > [data-promise] { grid-column: 3; justify-self: end; }
  table.desk .row-actions > .wa { grid-column: 4; justify-self: end; }
  table.desk td.c-name { grid-column: 2; grid-row: 1; }
  table.desk td.c-pkg { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--muted); }
  table.desk td.c-phone { grid-column: 2; grid-row: 3; font-size: 12px; }
  table.desk td.c-total { grid-column: 3 / span 2; grid-row: 1 / span 2; text-align: right; }
  table.desk td.c-still { grid-column: 3 / span 2; grid-row: 3; text-align: right; font-size: 12px; }
  table.desk td.c-prev, table.desk td.c-cur, table.desk td.c-loc, table.desk td.c-when, table.desk td.c-receipt { display: none; }
  table.desk td.empty { grid-column: 1 / -1; padding: 16px 0; }
  table.desk .row-actions .btn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
  table.desk .row-actions > [data-pay] { width: 40px; height: 40px; }
  table.desk .row-actions > a.btn:not(.icon-btn):not([data-pay]) { width: auto; padding: 0 8px; }
  .pay-ico { display: inline-flex; }
  .pay-txt { display: none; }
  .desk-bar { flex-wrap: wrap; gap: 8px; }
}
.short-box[hidden], [hidden] { display: none !important; }
/* Accounting */
.inline-form { display: inline; }
.link-btn { background: none; border: 0; padding: 0 4px; color: var(--blue); cursor: pointer; font: inherit; }
.link-btn.small { font-size: 12px; }
.cat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cat-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.pl-group { border-bottom: 1px solid var(--line); padding: 8px 0; }
.pl-head, .pl-row { display: flex; justify-content: space-between; gap: 12px; }
.pl-row { font-size: 14px; padding: 2px 0 2px 12px; color: var(--muted); }
.pl-total { padding-top: 10px; font-size: 16px; }
.good-text { color: var(--good); } .bad-text { color: var(--bad); }
/* My money (phone-first) */
.money-page { max-width: 640px; margin: 0 auto; display: grid; gap: 14px; }
.myday { border-radius: 20px; padding: 18px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent, #0ea5a4)); box-shadow: 0 10px 30px rgba(79, 70, 229, .25); }
.myday-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.myday .label { font-size: 13px; opacity: .9; }
.myday .big { font-size: 36px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.myday .sub { font-size: 12px; opacity: .9; }
.date-pill { background: rgba(255,255,255,.18); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.myday-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.myday-grid > div { background: rgba(255,255,255,.14); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.myday-grid span { font-size: 11px; opacity: .9; }
.myday-grid strong { font-size: 16px; }
.myday-grid small { font-size: 11px; opacity: .8; }
.myday-alert { display: block; margin-top: 12px; background: rgba(255,255,255,.2); color: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.myday-alert:hover { text-decoration: none; background: rgba(255,255,255,.28); }
@media (max-width: 420px) { .myday-grid { grid-template-columns: 1fr 1fr; } .myday-grid > div:last-child { grid-column: 1 / -1; } }
.seg-tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 5px; overflow-x: auto; }
.seg-tabs a { flex: 1; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.seg-tabs a .ico { width: 20px; height: 20px; }
.seg-tabs a.on { background: var(--brand); color: #fff; }
.money-panel .stack { gap: 14px; }
.amount-field .amt-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 14px; background: var(--bg); }
.amount-field .amt-wrap:focus-within { border-color: var(--brand); }
.amount-field .amt-wrap span { font-weight: 700; color: var(--muted); }
.amount-field input { border: 0 !important; background: transparent !important; font-size: 28px; font-weight: 800; padding: 6px 0 !important; box-shadow: none !important; outline: none; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips-pick .pick { position: relative; }
.chips-pick .pick input { position: absolute; opacity: 0; pointer-events: none; }
.chips-pick .pick span { display: inline-block; padding: 9px 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; }
.chips-pick .pick input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chips-pick .pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.big-btn { width: 100%; padding: 14px; font-size: 16px; border-radius: 14px; }
.entry-list { padding: 4px 0; }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.entry:last-child { border-bottom: 0; }
a.entry:hover { text-decoration: none; background: var(--bg); }
.entry .dot { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.entry .dot .ico { width: 18px; height: 18px; }
.entry .dot.in { background: var(--green-soft); color: var(--green); }
.entry .dot.out { background: var(--red-soft); color: var(--red); }
.entry .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.entry .what small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .amt { font-weight: 800; white-space: nowrap; text-align: right; display: flex; flex-direction: column; }
.entry .amt small { font-weight: 500; font-size: 11px; color: var(--muted); }
.entry .amt.in { color: var(--green); } .entry .amt.out { color: var(--red); } .entry .amt.due { color: var(--amber); }
.entry.struck .what strong, .entry.struck .amt { text-decoration: line-through; opacity: .6; }
.empty { padding: 16px; text-align: center; }
/* Income vs expense ring (dashboard) */
.ring-card { display: flex; align-items: center; gap: 22px; margin: 16px 0; color: var(--ink); text-decoration: none; }
.ring-card:hover { text-decoration: none; border-color: var(--brand); }
.ring { width: 150px; height: 150px; flex: none; }
.ring circle { fill: none; stroke-width: 16; }
.ring .ring-bg { stroke: var(--line); }
.ring .ring-in { stroke: var(--green); stroke-linecap: butt; }
.ring .ring-out { stroke: var(--red); stroke-linecap: butt; }
.ring .ring-label { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.ring .ring-value { fill: var(--ink); font-size: 17px; font-weight: 800; text-anchor: middle; }
.ring-legend { flex: 1; display: grid; gap: 8px; min-width: 0; }
.ring-title { font-weight: 700; }
.ring-legend .lg { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; }
.ring-legend .lg.total { border-top: 1px solid var(--line); padding-top: 8px; }
.ring-legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.ring-legend .sw.in { background: var(--green); } .ring-legend .sw.out { background: var(--red); }
@media (max-width: 520px) { .ring-card { flex-direction: column; align-items: stretch; } .ring { margin: 0 auto; } }

/* ==================================================================
   Theme 2026: calm indigo + teal, soft surfaces, bigger touch targets.
   Overrides earlier tokens and shapes; works in light and dark.
   ================================================================== */
:root {
  --bg: #f4f5fb; --panel: #ffffff; --ink: #121633; --muted: #616a85; --line: #e3e6f2;
  --brand: #5046e5; --brand-ink: #ffffff; --brand-soft: #eceafe; --accent: #0ea5a4;
  --good: #0f8a5f; --good-soft: #e2f6ee; --warn: #b26a00; --warn-soft: #fff3dd; --bad: #d92d4b; --bad-soft: #ffe8ec;
  --blue: #3b6cf6; --blue-soft: #e9efff; --green: #12a372; --green-soft: #e0f6ee; --amber: #f2a20d; --amber-soft: #fff4dc;
  --red: #e5435f; --red-soft: #ffe9ed; --violet: #8b5cf6; --violet-soft: #f1ebff; --teal: #0ea5a4; --teal-soft: #ddf5f4;
  --slate: #5b6482; --slate-soft: #eef0f7;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 22, 51, .04), 0 6px 18px rgba(18, 22, 51, .05);
  --side: #17153b; --side-ink: #cfd0f5; --side-muted: #8c8dc0; --side-on: rgba(255, 255, 255, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f1d; --panel: #161829; --ink: #eceefb; --muted: #9ba1c2; --line: #262a44;
    --brand: #8b84ff; --brand-ink: #0e0f1d; --brand-soft: #24224d; --accent: #2dd4bf;
    --good: #3ed39a; --good-soft: #10291f; --warn: #f5bd4f; --warn-soft: #2d2412; --bad: #ff7088; --bad-soft: #351722;
    --blue: #7c9cff; --blue-soft: #1a2142; --green: #3ed39a; --green-soft: #10291f; --amber: #f5bd4f; --amber-soft: #2d2412;
    --red: #ff7088; --red-soft: #351722; --violet: #b49bff; --violet-soft: #251d45; --teal: #2dd4bf; --teal-soft: #0f2a2a;
    --slate: #a6adcc; --slate-soft: #1d2036;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --side: #0a0b17; --side-ink: #c3c5ea; --side-muted: #7476a6; --side-on: rgba(139, 132, 255, .16);
  }
}
body { font-size: 15px; letter-spacing: .005em; }
h1 { font-size: 24px; letter-spacing: -.01em; }
.card { border-radius: var(--radius); border-color: var(--line); }
.side { background: linear-gradient(180deg, var(--side), #1f1c52); }
@media (prefers-color-scheme: dark) { .side { background: linear-gradient(180deg, #0a0b17, #13123a); } }
.side-nav a { border-radius: 12px; padding: 10px 12px; }
.side-nav a.on { background: var(--side-on); box-shadow: inset 3px 0 0 var(--accent); }
.logo { background: linear-gradient(135deg, #6d5efc, #14b8a6); border-radius: 12px; }
.btn { border-radius: 12px; padding: 10px 16px; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.small { border-radius: 10px; padding: 6px 12px; }
.btn.primary { background: linear-gradient(135deg, var(--brand), #6a5cff); border-color: transparent; box-shadow: 0 4px 14px rgba(80, 70, 229, .25); }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--brand); box-shadow: none; } }
.btn.primary:hover { filter: brightness(1.06); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  border-radius: 12px; padding: 11px 12px; border-color: var(--line); background: var(--panel); min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); outline-offset: 0; border-color: var(--brand); }
label, .label-like { font-weight: 600; font-size: 13px; }
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow); }
th { background: transparent; border-bottom: 1px solid var(--line); text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
.kpi { border-radius: var(--radius); }
.kpi .bubble { border-radius: 14px; }
.tabs a { border-radius: 99px; }
.tabs a.on { background: var(--brand); color: #fff; }
.badge { border-radius: 99px; }
.flash { border-radius: 14px; }
.hero-card { border-radius: 20px; box-shadow: 0 10px 24px rgba(18, 22, 51, .12); }
.hero-card.blue { background: linear-gradient(135deg, #5046e5, #7a6dff); }
.hero-card.green { background: linear-gradient(135deg, #0ea5a4, #12a372); }
.hero-card.violet { background: linear-gradient(135deg, #8b5cf6, #c05cf6); }
.hero-card.amber { background: linear-gradient(135deg, #f59e0b, #f97316); }
.hero-card.red { background: linear-gradient(135deg, #f43f5e, #c026d3); }
.newusers-card { background: linear-gradient(135deg, #5046e5, #0ea5a4) !important; border-radius: 20px; }
.mobilebar { backdrop-filter: blur(8px); }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .page-head h1 { font-size: 22px; }
  .card { padding: 16px; }
}
.tabs a.on, .seg-tabs a.on, .seg-links a.on, .pchip.on { color: var(--brand-ink); }
.seg-tabs { overflow: visible; } .seg-tabs a { min-width: 0; padding: 8px 2px; }

/* ---- Locations & map (update 28) ---- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.geo-box { display: grid; gap: 6px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); }
.geo-status { font-size: 13px; color: var(--muted); min-height: 1em; }
.geo-status:empty { display: none; }
.geo-status.ok { color: var(--good); font-weight: 600; }
.geo-status.bad { color: var(--bad); font-weight: 600; }
.cust-map { height: calc(100vh - 230px); min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--slate-soft); margin: 10px 0; z-index: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lg-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; opacity: .45; color: var(--ink); }
.lg-pill.on { opacity: 1; }
.lg-pill b { font-variant-numeric: tabular-nums; }
.sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.sw.on { background: #12a372; } .sw.off { background: #e5435f; } .sw.exp { background: #8a8fa8; }
.map-filter select { min-width: 180px; }
.leaflet-popup-content { font: 13px/1.4 system-ui, sans-serif; display: grid; gap: 3px; }
@media (max-width: 720px) { .cust-map { height: calc(100vh - 260px); min-height: 320px; } }
.self-start { align-self: start; }

/* ---- Customer page (update 35) ---- */
.cust-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.cust-actions form { margin: 0; }
.cust-actions .btn .ico { width: 16px; height: 16px; }
.loc-form { display: inline-flex; flex-direction: column; gap: 2px; }
.loc-form .geo-status { font-size: 11px; }
.btn.good-solid { background: var(--good); border-color: var(--good); color: #fff; }
.btn.good-solid:hover { filter: brightness(1.05); }
.dc-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dc-banner form { margin: 0; }
.pkg-form { display: grid; gap: 4px; }
.pkg-row { display: flex; gap: 8px; align-items: center; }
.pkg-row select { flex: 1; min-width: 0; }
.dc-card summary { cursor: pointer; font-weight: 600; color: var(--bad); display: flex; align-items: center; gap: 8px; }
.dc-card summary .ico { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .cust-head { flex-direction: column; align-items: stretch; }
  .cust-actions { justify-content: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .cust-actions > .btn, .cust-actions form, .cust-actions form .btn { width: 100%; }
  .cust-actions .loc-form { display: flex; }
}
/* DC list: cards on phones */
@media (max-width: 760px) {
  table.cards-on-mobile, table.cards-on-mobile tbody { display: block; }
  table.cards-on-mobile thead { display: none; }
  table.cards-on-mobile tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  table.cards-on-mobile td { border: 0; padding: 0; }
  table.cards-on-mobile td:first-child, table.cards-on-mobile td:last-child { grid-column: 1 / -1; }
  table.cards-on-mobile td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  table.cards-on-mobile td.num { text-align: left; }
}

/* Live search: no Search button needed; results fade while they load */
form.live-form button[type=submit]:not([name]), form.live-form input[type=submit]:not([name]) { display: none; }
main.live-busy > *:not(.live-keep) { transition: opacity .15s; }
main.live-busy .table-wrap, main.live-busy table, main.live-busy .cards, main.live-busy .desk-bar, main.live-busy .kpis, main.live-busy .empty { opacity: .5; }

/* Complaints */
.mt { margin-top: 12px; }
.warn-text { color: var(--warn); }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ico.ico-xs { width: 14px; height: 14px; vertical-align: -2px; }
.cmp-list { display: grid; gap: 10px; }
a.card.cmp { display: grid; gap: 6px; color: inherit; text-decoration: none; border-left: 4px solid var(--line); }
a.card.cmp:hover { border-left-color: var(--brand); }
a.card.cmp.late { border-left-color: var(--bad); }
.cmp-top, .cmp-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.cmp-age { margin-left: auto; font-size: 13px; }
.sig-big .badge { font-size: 16px; padding: 4px 12px; }
.badge.sig { font-variant-numeric: tabular-nums; }
.fix-card { border: 2px solid var(--good); }
.verify-card { border: 2px solid var(--brand); }
details.manage-card > summary { cursor: pointer; list-style: none; }
details.manage-card > summary::-webkit-details-marker { display: none; }
ol.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
ol.timeline li { position: relative; }
ol.timeline li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
ol.timeline li.ev-fixed::before, ol.timeline li.ev-closed::before { background: var(--good); }
ol.timeline li.ev-check_failed::before, ol.timeline li.ev-dropped::before, ol.timeline li.ev-reopened::before { background: var(--bad); }
ol.timeline li.ev-assigned::before { background: var(--brand); }
@media (max-width: 640px) {
  .fix-card .btn-row .btn { width: 100%; justify-content: center; }
}
/* OLT / signal */
.sig-hist { display: flex; align-items: flex-end; gap: 2px; height: 46px; margin: 8px 0; }
.sig-hist span { flex: 1; min-width: 2px; background: var(--good); border-radius: 2px 2px 0 0; }
.sig-hist span.weak { background: var(--warn); }
.sig-hist span.bad, .sig-hist span.off { background: var(--bad); }
.walk-table td { font-family: ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; margin: 0; }

/* Live speed (vBNG) */
.live-card canvas { display: block; width: 100%; height: 180px; margin: 6px 0 4px; }
.live-now { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 15px; }
.live-now b { font-variant-numeric: tabular-nums; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 2px; vertical-align: middle; }
.live-dot.down { background: var(--good); }
.live-dot.up { background: var(--brand); }

/* Package prices per Admin / dealer */
.price-in { max-width: 130px; }
tr.row-on td:first-child { font-weight: 600; }
.pay-admin { border: 2px solid var(--brand); }
.pay-admin .big-input { font-size: 22px; font-weight: 700; max-width: 220px; }
.inline-pop { display: inline-block; position: relative; }
.inline-pop > summary { list-style: none; }
.inline-pop > summary::-webkit-details-marker { display: none; }
.dealer-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: inherit; margin-bottom: 18px; }
.dealer-banner:hover { text-decoration: none; }
.dealer-banner-value { font-size: 28px; font-weight: 800; }

/* Customer page (compact layout) */
.eq-card { padding: 10px 16px; }
.eq-card > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.eq-card > summary::-webkit-details-marker { display: none; }
.eq-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.eq-card[open] > summary .btn { visibility: hidden; }
.kv-cols { gap: 0 28px; }
.kv-cols dl.kv { margin: 0; }
.sig-card .sig-big { font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.mt-8 { margin-top: 8px; }
table.compact td, table.compact th { padding-top: 6px; padding-bottom: 6px; }
input.auto-filled { background: var(--brand-soft); font-weight: 600; }
.dealer-split { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; padding: 12px 16px; }

/* Auto renew switch (customer page, top right) */
.ar-form { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: var(--line); transition: background .2s; flex: none; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.switch.on { background: var(--good); }
.switch.on .knob { left: 23px; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ar-label { font-size: 13px; white-space: nowrap; }

/* ---------- Network operations (watch, alerts, devices, insights, wallet, bot) ---------- */
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
ul.tight, ol.steps { margin: 6px 0 0; padding-left: 20px; }
ul.tight li, ol.steps li { margin: 4px 0; }
.small-value { font-size: 16px !important; }
.muted-row td { color: var(--muted); }
input.tiny { width: 64px; padding: 4px 6px; }
.small-input { max-width: 200px; padding: 5px 8px; font-size: 13px; }
.learn-card { border-left: 4px solid var(--blue); }
.learn-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.learn-stats strong { font-size: 18px; }
.incident-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 16px; }
.incident { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); }
.incident:hover { text-decoration: none; border-color: var(--brand); }
.incident.bad { border-left-color: var(--bad); }
.incident.info { border-left-color: var(--blue); }
.incident-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.incident-title { font-size: 16px; }
.incident-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.incident-nums b { color: var(--ink); }
.bar { height: 6px; border-radius: 99px; background: var(--bad-soft); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.alert-list { display: grid; gap: 8px; }
.alert-item { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.alert-item.lvl-critical { border-left-color: var(--bad); }
.alert-item.lvl-warn { border-left-color: var(--warn); }
.alert-item.lvl-info { border-left-color: var(--blue); }
.alert-item.new { background: linear-gradient(90deg, var(--brand-soft), var(--panel) 40%); }
.alert-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tg-card p:last-child { margin-bottom: 0; }
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; font-size: 12px; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; padding: 10px; background: var(--bg); border-radius: 10px; }
.bubble-msg { max-width: 85%; padding: 7px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; }
.bubble-msg.me { align-self: flex-end; background: var(--green-soft); }
.bubble-msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.sim-form { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-form input[name=phone] { max-width: 150px; }
.sim-form input[name=text] { flex: 1; min-width: 120px; }
svg.bars { width: 100%; height: auto; max-height: 230px; display: block; }
svg.bars .bar { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 1; }
svg.bars .bar-now { fill: var(--blue); }
svg.bars .bar-val { font-size: 12px; font-weight: 700; fill: var(--ink); }
svg.bars .bar-lbl { font-size: 12px; fill: var(--muted); }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.pbar { position: relative; min-width: 120px; height: 22px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.pbar span { position: absolute; inset: 0 auto 0 0; background: var(--green-soft); border-right: 2px solid var(--good); }
.pbar.neg span { background: var(--red-soft); border-right-color: var(--bad); }
.pbar b { position: relative; display: block; padding: 2px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.wallet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.wallet-item { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.wallet-item.st-sure { border-left: 4px solid var(--blue); }
.wallet-item.st-suggested { border-left: 4px solid var(--warn); }
.wallet-item.st-unmatched { border-left: 4px solid var(--bad); }
.wallet-item.st-posted { border-left: 4px solid var(--good); }
.wallet-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wallet-amount { font-size: 20px; font-variant-numeric: tabular-nums; }
.wallet-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sms-text { background: var(--bg); border-radius: 8px; padding: 6px 8px; margin-top: 4px; white-space: pre-wrap; }
.wallet-post, .wallet-ignore { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wallet-post .check { width: 100%; margin: 0; }
.chart-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 16px; }
.chart-grid .card { margin: 0; }
svg.bars .bar-val { font-size: 15px; }
svg.bars .bar-lbl { font-size: 14px; }
.insight-kpis { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
input[type=month] { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.month-pick { align-items: flex-end; }
.insight-kpis { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.pbar { height: 26px; background: transparent; }
.pbar span { top: auto; height: 5px; bottom: 0; border-radius: 99px; background: var(--good); border: 0; }
.pbar.neg span { background: var(--bad); }
.pbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; border-radius: 99px; background: var(--bg); z-index: -1; }
.pbar { z-index: 0; }
.pbar b { padding: 0 0 6px; }
.bubble-msg { color: var(--ink); white-space: normal; }
.bubble-msg.me { background: #d9fdd3; color: #111b21; }

/* Small pop-up forms (Add charge / credit, etc.): open under the button, never off-screen */
details.inline-pop[open] > .pop { max-width: min(560px, calc(100vw - 32px)); }
.btn-row > details.inline-pop[open] > .pop { left: 0; right: auto; }
@media (max-width: 760px) {
  details.inline-pop[open] { display: block; width: 100%; }
  details.inline-pop[open] > .pop { position: static; min-width: 0; max-width: none; width: 100%; margin-top: 8px; box-shadow: none; }
  details.inline-pop[open] > .pop > div { flex: 1 1 100%; min-width: 0; }
  details.inline-pop[open] > .pop input, details.inline-pop[open] > .pop select { width: 100%; }
}

/* Billing: From – To dates */
.range-bar { align-items: flex-end; }
.range-bar label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.range-bar input[type=date] { min-width: 150px; }
.c-status .badge { white-space: nowrap; }
@media (max-width: 760px) { .range-bar > div { flex: 1 1 40%; } .range-bar input[type=date] { width: 100%; min-width: 0; } }
.map-links { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

/* Money section (expenses, Admin cash, team) */
.fin-cards .kpi { cursor: pointer; text-align: left; font: inherit; width: 100%; }
.fin-cards .kpi.on { outline: 2px solid var(--brand); outline-offset: -2px; }
.donut-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex: none; }
.donut-bg { fill: none; stroke: var(--line); stroke-width: 22; }
.donut-sl { fill: none; stroke-width: 22; cursor: pointer; transition: stroke-width .15s; }
.donut-sl:hover, .donut-sl:focus { stroke-width: 28; outline: none; }
.donut-label { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.donut-value { font-size: 17px; font-weight: 750; fill: var(--ink); text-anchor: middle; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; }
.donut-legend button { display: flex; width: 100%; gap: 8px; align-items: center; background: none; border: 0; padding: 6px 4px; border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.donut-legend button:hover { background: var(--line); }
.donut-legend .lg-name { flex: 1; }
.donut-legend .lg-pct { color: var(--muted); font-size: 12.5px; }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sl-0 { stroke: #5b5bd6; background: #5b5bd6; } .sl-1 { stroke: #12a372; background: #12a372; } .sl-2 { stroke: #e8a317; background: #e8a317; }
.sl-3 { stroke: #e5435f; background: #e5435f; } .sl-4 { stroke: #1f9bd1; background: #1f9bd1; } .sl-5 { stroke: #9b51e0; background: #9b51e0; }
.sl-6 { stroke: #f2711c; background: #f2711c; } .sl-7 { stroke: #20b2aa; background: #20b2aa; } .sl-8 { stroke: #8a8fa8; background: #8a8fa8; } .sl-9 { stroke: #c2185b; background: #c2185b; }
.empty-chart { padding: 24px 0; }
.linklike { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.fin-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 12px; }
.fin-sum > div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fin-sum dt { font-size: 12.5px; color: var(--muted); }
.fin-sum dd { margin: 2px 0 0; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.fin-sum dd small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.fin-sum .tot { border-color: var(--brand); }
.fin-heads { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fin-heads .chip { border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.fin-who > summary { list-style: none; margin-bottom: 8px; } .fin-who > summary::-webkit-details-marker { display: none; }
.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.team-card { margin: 0; }
.team-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.team-hold { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.team-nums { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; color: var(--muted); }
.team-nums strong { color: var(--ink); }
.team-send { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.fin-act { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.fin-act .inline-form { margin: 0; }
.fin-move { align-items: flex-end; }
@media (max-width: 760px) { .donut { width: 140px; height: 140px; } .fin-act { justify-content: flex-start; } }
.fin-cards .kpi .value { font-size: 20px; white-space: nowrap; }
.team-hold { white-space: nowrap; }
.team-hold small { font-size: 12px; font-weight: 600; }
@media (max-width: 760px) { .fin-cards .kpi .value { font-size: 17px; } }

/* Complaint dashboard */
.cd-kpis .kpi { color: inherit; text-decoration: none; }
.cd-kpis .sub { display: block; font-size: 12px; color: var(--muted); }
.cd-block .cd-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.cd-block .cd-row:last-child { border-bottom: 0; }
.cd-block .cd-row .small { flex-basis: 100%; color: var(--muted); }
.cd-item { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.cd-item:last-child { border-bottom: 0; }
.cd-item .btn-row { margin-top: 6px; }
.bad-border { border-color: var(--bad, #e5435f); }
.approval-card { border: 2px solid var(--bad, #e5435f); }

/* Owner panel / company Zal details */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.mb-0 { margin-bottom: 0; }
.owner-co { padding: 12px 0; border-bottom: 1px solid var(--line); }
.owner-co:last-child { border-bottom: 0; }
.owner-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 4px; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.owner-actions .filters { margin: 0; }
.secret-card { border: 2px solid var(--warn); }
.big-secret { font-size: 20px; font-weight: 700; letter-spacing: 1px; }

/* Company logo */
img.logo-img { object-fit: contain; background: #fff; padding: 2px; }
.login-logo { display: block; max-width: 140px; max-height: 110px; margin: 0 auto 10px; object-fit: contain; }
.logo-preview { max-width: 160px; max-height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
