/* ISP Manager — interface styles.
   Palette grounded in fibre plant hardware: SC/UPC connector blue, single-mode jacket yellow,
   and the TIA-598 fibre colour code for PON ports. Type: Anek Bangla (Latin + Bangla). */

@font-face {
  font-family: 'Anek Bangla';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  src: url(../fonts/anek-bangla-bengali-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}
@font-face {
  font-family: 'Anek Bangla';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  src: url(../fonts/anek-bangla-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Anek Bangla';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  src: url(../fonts/anek-bangla-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f1f4f3;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --ink: #1b2a33;
  --ink-2: #3a4a54;
  --muted: #64737c;
  --line: #d9e0de;
  --line-2: #e8edeb;

  --brand: #1e5bb8;
  --brand-hover: #184c9c;
  --brand-soft: #e7effa;
  --strand: #f2c200;

  --ok: #16834a;
  --ok-soft: #e1f3e8;
  --weak: #b98300;
  --weak-dot: #e2ad0e;
  --weak-soft: #fbf1d6;
  --vweak: #d05c0d;
  --vweak-soft: #fde8da;
  --bad: #c3302c;
  --bad-soft: #fbe4e3;
  --none: #7565a3;
  --none-soft: #ece8f5;
  --grey-soft: #eceff0;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow-pop: 0 10px 30px rgba(27, 42, 51, .16), 0 2px 6px rgba(27, 42, 51, .08);

  --side-w: 236px;
  --top-h: 58px;

  font-family: 'Anek Bangla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(30, 91, 184, .35); outline-offset: 1px; border-radius: 4px; }
[v-cloak] { display: none; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.gap-s { gap: 6px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 16px; }
.hide-sm {}
.show-sm { display: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.icon.sm { width: 15px; height: 15px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brandbox { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid var(--line-2); }
.brandmark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-stretch: 85%; font-size: 17px; letter-spacing: .02em;
  box-shadow: inset 0 -3px 0 var(--strand);
}
.brandname { font-weight: 650; font-size: 15.5px; line-height: 1.2; }
.brandsub { font-size: 12px; color: var(--muted); }
.nav { padding: 10px 10px 24px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 12.5px; color: var(--muted); padding: 12px 10px 3px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 14.5px;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a.active::before {
  content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--strand);
}
.nav .count { margin-left: auto; font-size: 12px; background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-weight: 600; }
.side-foot { margin-top: auto; padding: 12px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: rgba(241, 244, 243, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.top .menu-btn { display: none; }
.gsearch { position: relative; flex: 1; max-width: 460px; }
.gsearch input, .gsearch input[type=search] { width: 100%; padding-left: 36px; background: var(--surface); }
.gsearch .icon { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.gsearch .drop {
  position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden; z-index: 40;
}
.gsearch .drop a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.gsearch .drop a:last-child { border-bottom: 0; }
.gsearch .drop a:hover, .gsearch .drop a.sel { background: var(--brand-soft); text-decoration: none; }
.demo-flag { font-size: 13px; background: var(--weak-soft); color: #7a5600; border: 1px solid #f0d98c; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.usermenu > button:hover { background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.menu-pop { position: absolute; right: 0; top: 44px; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; z-index: 50; }
.menu-pop button, .menu-pop a { display: flex; width: 100%; align-items: center; gap: 9px; background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); font-size: 14px; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); text-decoration: none; }

.page { padding: 22px 26px 60px; max-width: 1440px; width: 100%; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 650; letter-spacing: -.005em; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 6px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 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)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }

/* readouts: numbers set condensed like an instrument display */
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.readout { padding: 14px 16px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); min-width: 0; margin-right: -1px; margin-bottom: -1px; }
.readouts { overflow: hidden; }
.readout .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.readout .value { font-size: 30px; line-height: 1.15; font-weight: 600; font-stretch: 80%; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.readout .value small { font-size: 15px; font-weight: 500; color: var(--muted); font-stretch: 90%; margin-left: 3px; }
.readout .hint { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
a.readout { color: inherit; display: block; }
a.readout:hover { background: var(--surface-2); text-decoration: none; }
.readout.ok .value { color: var(--ok); }
.readout.bad .value { color: var(--bad); }
.readout.warn .value { color: var(--vweak); }
.readout.brand .value { color: var(--brand); }
.dotlabel::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* the "online now" band on the dashboard */
.pulse { display: grid; grid-template-columns: auto 1fr; gap: 22px 34px; align-items: center; padding: 20px 22px; }
.pulse .big { font-size: 64px; line-height: .95; font-weight: 640; font-stretch: 75%; font-variant-numeric: tabular-nums; color: var(--ink); }
.pulse .big .of { font-size: 22px; font-weight: 500; color: var(--muted); font-stretch: 90%; margin-left: 6px; }
.pulse .cap { font-size: 14px; color: var(--muted); margin-top: 6px; }
.lightbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--grey-soft); }
.lightbar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.money-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-2); }
.money-line > div { padding: 14px 22px; border-right: 1px solid var(--line-2); }
.money-line > div:last-child { border-right: 0; }

/* ---------- forms ---------- */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], input[type=email], input[type=tel], select, textarea {
  height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 0;
}
textarea { height: auto; padding: 8px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 91, 184, .15); }
select { padding-right: 28px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.field .help { font-size: 12.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 14px; font-weight: 600; margin: 6px 0 -2px; color: var(--ink-2); grid-column: 1 / -1; border-top: 1px solid var(--line-2); padding-top: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { width: 260px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-size: 14px; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14.5px; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #c9d2cf; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.danger { color: var(--bad); border-color: #efc4c2; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 13px; }
.btn.icon-only { padding: 0; width: 36px; }
.btn.sm.icon-only { width: 30px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fafcfb; }
table.t tr.click { cursor: pointer; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); }
.cell-main { font-weight: 550; color: var(--ink); }
.cell-sub { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
.pager .grow { flex: 1; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 550; padding: 2px 9px; border-radius: 20px; white-space: nowrap; line-height: 1.5; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-warn { background: var(--weak-soft); color: #8a6100; }
.b-orange { background: var(--vweak-soft); color: var(--vweak); }
.b-grey { background: var(--grey-soft); color: var(--ink-2); }
.b-dark { background: #dfe3e5; color: #2e3a41; }
.b-violet { background: var(--none-soft); color: var(--none); }
.b-blue { background: var(--brand-soft); color: var(--brand); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.d-online { background: var(--ok); }
.d-weak { background: var(--weak-dot); }
.d-vweak { background: var(--vweak); }
.d-offline { background: var(--bad); }
.d-none { background: var(--none); }
.d-grey { background: #a8b3b8; }
.dbm { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.dbm.good { color: var(--ok); }
.dbm.warning { color: var(--weak); }
.dbm.critical { color: var(--vweak); }
.dbm.high { color: var(--brand); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.due { color: var(--bad); font-weight: 600; }
.money.adv { color: var(--ok); font-weight: 600; }
.pon-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; white-space: nowrap; }
.pon-chip::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--fiber, #999); }

/* ---------- modal & toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(27, 42, 51, .45); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: var(--shadow-pop); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 17.5px; font-weight: 600; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.toast.err { background: #8f201d; }
.toast.ok .icon { color: #8ee0b0; }
.toast.warn { background: #6b4b00; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.note { padding: 10px 14px; border-radius: var(--radius); background: var(--brand-soft); color: #173f7a; font-size: 14px; border: 1px solid #c9daf3; }
.note.warn { background: var(--weak-soft); color: #6b4b00; border-color: #efd88f; }
.note.bad { background: var(--bad-soft); color: #7e1d1a; border-color: #f0c3c1; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; font-weight: 600; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--grey-soft); color: var(--ink-2); }

/* bars chart */
.barchart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px; align-items: end; height: 190px; padding: 6px 4px 0; }
.barchart .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barchart .pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.barchart .bar { width: 38%; max-width: 26px; border-radius: 4px 4px 0 0; min-height: 2px; }
.barchart .lbl { font-size: 12.5px; color: var(--muted); }

/* ---------- login / setup ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  linear-gradient(90deg, transparent 0, transparent calc(50% - .5px), rgba(30,91,184,.08) calc(50% - .5px), rgba(30,91,184,.08) calc(50% + .5px), transparent calc(50% + .5px)), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 28px 24px; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { margin: 14px 0 4px; font-size: 24px; font-weight: 650; }
.auth-card p.lead { margin: 0 0 18px; color: var(--muted); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.choice label.on { border-color: var(--brand); background: var(--brand-soft); }
.choice input { display: none; }
.choice b { font-weight: 600; }
.choice span { font-size: 13px; color: var(--muted); }

/* ---------- network views ---------- */
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); align-items: center; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.tree-box { position: relative; height: calc(100vh - 250px); min-height: 460px; overflow: auto; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.map-box { position: relative; height: calc(100vh - 240px); min-height: 480px; overflow: hidden; background:
  radial-gradient(circle, #dfe6e3 1px, transparent 1.2px) 0 0 / 22px 22px, var(--surface-2); border-top: 1px solid var(--line-2); cursor: grab; }
.map-box:active { cursor: grabbing; }
.tree-box svg, .map-box svg { display: block; }
.tree-node text { font-family: inherit; }
.svg-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 8px 10px; border-radius: 6px; box-shadow: var(--shadow-pop); z-index: 5; max-width: 260px; line-height: 1.4; }
.pon-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding: 14px; }
.onu-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.onu-chip { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; cursor: pointer; border: 0; font-variant-numeric: tabular-nums; }
.onu-chip.online { background: var(--ok); }
.onu-chip.warning { background: var(--weak-dot); color: #3d2c00; }
.onu-chip.critical { background: var(--vweak); }
.onu-chip.offline { background: var(--bad); }
.onu-chip.nocust { outline: 2px solid var(--none); outline-offset: 1px; }
.cause { display: inline-flex; flex-direction: column; gap: 2px; }
.side-tag { font-size: 12px; color: var(--muted); }
.why { font-size: 13px; color: var(--ink-2); }
.advice { font-size: 13px; color: var(--brand); margin-top: 2px; }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sum-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--weak-dot); border-radius: var(--radius); padding: 12px 14px; }
.sum-card.network { border-left-color: var(--bad); }
.sum-card.other { border-left-color: #a8b3b8; }
.sum-card .n { font-size: 28px; font-weight: 600; font-stretch: 80%; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sum-card .l { font-weight: 550; }
.sum-card .s { font-size: 12.5px; color: var(--muted); }
.sparkline { width: 100%; height: 120px; }
.ev-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.ev-list li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.ev-list li:last-child { border-bottom: 0; }

/* ---------- billing ledger ---------- */
.big-amount { font-size: 26px; line-height: 1.15; font-weight: 620; font-stretch: 82%; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-input { height: 46px !important; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { border-bottom: 1px solid var(--line-2); margin-bottom: -1px; }
.lines { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.lines .line { display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line-2); }
.lines .line:last-child { border-bottom: 0; }
.lines .line .num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }
.lines .line.total { font-weight: 650; background: var(--surface); }
table.t tr.detail > td { background: #fbfcfc; padding-top: 4px; padding-bottom: 14px; }
table.t tbody tr.detail:hover td { background: #fbfcfc; }
table.t tr.detail .lines { background: var(--surface); }
table.t tr.faded td { color: var(--muted); }
.tabs { display: flex; align-items: center; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs > button { border: 0; background: none; padding: 9px 14px 10px; cursor: pointer; font-size: 14.5px; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs > button:hover { color: var(--ink); }
.tabs > button.on { color: var(--brand); font-weight: 600; border-bottom-color: var(--strand); }
.tabs .n { font-size: 12px; background: var(--grey-soft); color: var(--ink-2); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 10px 14px; align-items: center; }
.readouts + .chips { border-top: 1px solid var(--line-2); }
.chip { font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 20px; padding: 2px 11px; white-space: nowrap; }
.chip b { font-weight: 620; font-variant-numeric: tabular-nums; }
.chip-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.kv.spread { grid-template-columns: 1fr max-content; }
.kv.spread dd { text-align: right; font-variant-numeric: tabular-nums; }
.kv .total { font-weight: 650; color: var(--ink); border-top: 1px solid var(--line); padding-top: 7px; }
.follow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 14px; }
.follow-item { padding: 5px 0; border-bottom: 1px dotted var(--line); }
.follow-item:last-of-type { border-bottom: 0; }
.check-item { border-top: 1px solid var(--line-2); padding-top: 12px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mini th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 0 0 6px; }
table.mini td { padding: 6px 0; border-top: 1px solid var(--line-2); }
table.mini .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.print-only { display: none; }
.print-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }

/* ---------- receipt (print) ---------- */
.receipt { max-width: 380px; margin: 0 auto; background: #fff; padding: 22px; border: 1px dashed var(--line); font-size: 14px; }
.receipt h2 { margin: 0; font-size: 19px; text-align: center; }
.receipt .rc-sub { text-align: center; color: var(--muted); font-size: 12.5px; }
.receipt .rc-amount { text-align: center; font-size: 34px; font-weight: 650; font-stretch: 80%; margin: 14px 0 4px; }
.receipt table { width: 100%; font-size: 13.5px; border-collapse: collapse; margin-top: 10px; }
.receipt td { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.receipt td:last-child { text-align: right; }
/* ---- smart lists ---- */
table.calls .rank { width: 34px; padding-right: 0; }
.reason { display: flex; align-items: baseline; gap: 7px; font-weight: 550; line-height: 1.35; }
.reason .dot { flex: none; transform: translateY(-1px); }
.reason.more { font-weight: 400; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.odd { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.tabs + .odd { border-top: 0; }
.odd > .dot { margin-top: 7px; flex: none; }
.odd-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 2px; }
.odd-actions { display: flex; gap: 6px; flex: none; }
ul.watch { margin: 8px 0; padding-left: 18px; color: var(--ink-2); }
ul.watch li { margin: 3px 0; }
.minispark { width: 110px; height: 30px; display: block; }
.summary-cards.six { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.outlog { padding: 4px 16px 8px; }
.outlog li { align-items: flex-start; gap: 12px; }
.outlog .icon { margin-top: 2px; flex: none; color: var(--muted); }
.outlog .icon.log-outage { color: var(--bad); }
.smart .icon { flex: none; color: var(--brand); }
.smart li { gap: 12px; }

/* ---- collect from a list ---- */
.g-list { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.g-list textarea { min-height: 236px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; }
.written { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; overflow-wrap: anywhere; }
table.clist td:nth-child(2) { min-width: 150px; max-width: 240px; }
table.clist td:nth-child(7) { min-width: 210px; }
table.clist td { vertical-align: top; }
table.clist .pickcol { width: 36px; padding-right: 0; }
table.clist .pickcol input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; }
table.clist input.amt { width: 116px; height: 34px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
table.clist tr.off td { background: var(--surface-2); }
table.clist tr.off .cell-main, table.clist tr.off .written { color: var(--ink-2); }
table.clist tr.need td { background: var(--weak-soft); }
.lnote { line-height: 1.4; margin-bottom: 3px; color: var(--ink-2); }
.lnote.warn { color: #8a6100; }
.lnote.bad { color: var(--bad); font-weight: 550; }
.lnote a { white-space: nowrap; }
.savebar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.panel.stale .table-wrap { opacity: .5; }
/* ---- the account window: what a customer owes, and putting it right ---- */
.owes { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.owes .icon { color: var(--muted); opacity: .6; flex: none; }
.owes:hover, .owes:focus-visible { background: var(--brand-soft); }
.owes:hover .icon, .owes:focus-visible .icon { color: var(--brand); opacity: 1; }
.setdue { border: 1px solid #c9daf3; background: var(--brand-soft); border-radius: var(--radius); padding: 14px 16px; }
.ownernote { color: #6b4b00; background: var(--weak-soft); border: 1px solid #efd88f; border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 8px; }
details.pays { margin-top: 14px; }
details.pays summary { cursor: pointer; font-weight: 550; padding: 4px 0; color: var(--ink-2); }
.fnote { line-height: 1.4; margin-bottom: 3px; color: var(--ink-2); overflow-wrap: anywhere; }
.fnote .badge { margin-right: 4px; }
.notebtn { margin-left: -8px; color: var(--ink-2); }
.newver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; background: var(--weak-soft); color: #6b4b00; border-bottom: 1px solid #efd88f; font-size: 14px; }
.newver .icon { flex: none; }

@media print {
  body * { visibility: hidden; }
  .printable, .printable * { visibility: visible; }
  .printable { position: absolute; left: 0; top: 0; width: 100%; }
  .receipt { border: 0; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .owes { padding: 0; margin: 0; }
  .owes .icon { display: none; }
  /* printing from a dialog (a receipt): leave out the list behind it */
  body.print-dialog .page .printable, body.print-dialog .page .printable * { visibility: hidden !important; }
  .printable .panel { border: 0; }
  .printable table.t th { position: static; }
  .printable .table-wrap { overflow: visible; }
  .printable table.calls td:nth-child(2) { width: 30%; }
  .printable table.calls td { padding-top: 6px; padding-bottom: 6px; }
  @page { margin: 12mm; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .side.open { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: rgba(27,42,51,.35); z-index: 85; }
  .top .menu-btn { display: inline-flex; }
  .top > .grow { display: none; }
  .top .gsearch { flex: 1; max-width: none; }
  .page { padding: 16px 16px 50px; }
  .top { padding: 0 12px; gap: 8px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .pulse { grid-template-columns: 1fr; }
  .pulse .big { font-size: 52px; }
  .money-line { grid-template-columns: 1fr; }
  .money-line > div { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .g-list { grid-template-columns: 1fr; }
  table.clist td:nth-child(2), table.clist td:nth-child(7) { min-width: 0; max-width: none; }
  /* a list row on a phone: the tick on the left; then what was written, the customer, what is owed with the amount beside it, the notes */
  table.clist.stack-sm tr { grid-template-columns: 28px minmax(0, 1fr) 132px; grid-template-areas: "tick written written" "tick cust cust" "tick owes amt" "tick notes notes"; gap: 5px 10px; }
  table.clist.stack-sm td.pickcol { grid-area: tick; width: auto; }
  table.clist.stack-sm td:nth-child(2) { grid-area: written; }
  table.clist.stack-sm td:nth-child(2) .cell-sub { display: inline; margin-left: 8px; }
  table.clist.stack-sm td:nth-child(3) { grid-area: cust; }
  table.clist.stack-sm td:nth-child(4) { grid-area: owes; text-align: left; align-self: center; }
  table.clist.stack-sm td:nth-child(4):not(:empty)::before { content: 'Owes '; color: var(--muted); font-size: 13px; }
  table.clist.stack-sm td:nth-child(4) .cell-sub { display: inline; margin-left: 6px; }
  table.clist.stack-sm td:nth-child(5) { grid-area: amt; }
  table.clist.stack-sm td:nth-child(7) { grid-area: notes; }
  table.clist.stack-sm input.amt { width: 100%; }
  table.clist.stack-sm tr.need { background: var(--weak-soft); }
  table.clist.stack-sm tr.off { background: var(--surface-2); }
  table.clist.stack-sm tr.need td, table.clist.stack-sm tr.off td { background: none; }
  .savebar { flex-wrap: wrap; }
  .hide-sm { display: none !important; }
  .show-sm { display: block; }
  table.t td, table.t th { padding-left: 8px; padding-right: 8px; }
  table.t .cell-main, table.t .cell-sub { overflow-wrap: anywhere; }
  table.t .btn.sm { padding: 0 8px; }
  .toolbar input[type=search] { width: 100%; }
  .page-head .actions { margin-left: 0; }
  .demo-flag { display: none; }
  .tree-box, .map-box { height: 70vh; }
  .odd { flex-wrap: wrap; }
  .odd-actions { width: 100%; padding-left: 22px; }
  .summary-cards, .summary-cards.six { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* on a phone, a row of these tables becomes a small block: two cells side by side, the wide ones below */
@media screen and (max-width: 900px) {
  table.stack-sm, table.stack-sm tbody, table.stack-sm tfoot { display: block; }
  table.stack-sm thead { display: none; }
  table.stack-sm tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; gap: 6px 12px; padding: 12px 14px; border-top: 1px solid var(--line-2); }
  table.stack-sm tbody tr:first-child { border-top: 0; }
  table.stack-sm td { display: block; padding: 0 !important; border: 0 !important; }
  table.stack-sm td.wide { grid-column: 1 / -1; }
  table.stack-sm td.right { text-align: left; }
  table.stack-sm .cell-main { font-size: 15.5px; }
  table.stack-sm tbody tr:hover td { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- profit share ---------- */
table.sums td { padding: 9px 16px; vertical-align: top; }
table.sums td.num { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.sums .sign { display: inline-block; width: 16px; color: var(--muted); font-weight: 600; }
table.sums tr.total td { font-weight: 650; border-top: 2px solid var(--line); background: var(--surface-2); }
table.sums tr.big td { font-size: 17px; }
table.sums tr.big td.num { font-size: 22px; font-stretch: 85%; }
table.sums a.small, table.sums .btn.xs { margin-left: 8px; }
details.cats { margin: 4px 0 0 16px; }
details.cats summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.cats .row { padding: 3px 0; gap: 10px; border-bottom: 1px dotted var(--line-2); max-width: 520px; align-items: center; }
details.cats .take .btn { margin-left: 0; }
.grid.owners { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
.owner .panel-head { display: flex; align-items: baseline; gap: 10px; }
.settle { border-top: 1px solid var(--line-2); }
.note.ok { background: var(--ok-soft, #e6f4ec); color: #14532d; border-color: #b9dfc8; }
.field .fixed { padding: 8px 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
label.lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
table.t tr.sel td { background: var(--brand-soft); }
@media print { details.cats > summary { display: none; } .grid.owners { grid-template-columns: 1fr 1fr; } }
.btn.activate { margin-left: 6px; color: var(--ok); border-color: #b9dfc8; }
details.earlier { margin: 2px 0 2px 0; }
.fnote.old { color: var(--muted); font-size: 12.5px; }

/* ---------- statement: one day ---------- */
tr.dayrow { cursor: pointer; }
tr.dayrow:hover td { background: var(--surface-2); }
tr.dayrow td { vertical-align: top; }
.daylink { color: var(--brand); font-weight: 600; }
.what { max-width: 420px; white-space: normal; }
.what .out { color: var(--bad); } .what .in { color: var(--ok); }
.daynote { margin-top: 3px; font-size: 13px; color: #6b4b00; background: var(--weak-soft); border-radius: 6px; padding: 2px 8px; display: inline-flex; gap: 5px; align-items: center; max-width: 420px; white-space: normal; }
.readouts.tight .readout { padding: 8px 12px; } .readouts.tight .readout .value { font-size: 21px; }
h4.daysec { margin: 0 0 4px; font-size: 14px; }
table.t.compact td { padding: 6px 8px; }
.daywin textarea { width: 100%; }
.btn.newline { margin-left: 6px; }
.tree-box { cursor: grab; }
.tree-box.dragging { cursor: grabbing; user-select: none; }

/* ---------- date and month fields (the same in every browser, day-month-year) ---------- */
.dateinput { position: relative; display: inline-flex; width: 150px; min-width: 0; vertical-align: middle; }
.dateinput > input { width: 100%; padding-right: 34px; font-variant-numeric: tabular-nums; }
.dateinput > input.bad { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(195, 48, 44, .15); }
.dateinput .calbtn { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dateinput .calbtn:hover { color: var(--brand); background: var(--surface-2); }
.field > .dateinput, .field .row > .dateinput { width: 100%; }
.calpop { position: fixed; z-index: 120; width: 262px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 10px; font-size: 14px; }
.calhead { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.calhead b { flex: 1; text-align: center; font-weight: 600; }
.calhead button { width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 17px; line-height: 1; color: var(--ink-2); }
.calhead button:hover { background: var(--surface-2); color: var(--brand); }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calgrid .wd { text-align: center; font-size: 11.5px; color: var(--muted); padding: 3px 0; }
.calgrid button { height: 32px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums; color: var(--ink); }
.calgrid button:hover:not(:disabled) { background: var(--brand-soft); }
.calgrid button.out { color: #a9b3b9; }
.calgrid button.now { box-shadow: inset 0 0 0 1.5px var(--strand); font-weight: 600; }
.calgrid button.sel { background: var(--brand); color: #fff; font-weight: 600; }
.calgrid button:disabled { color: #cfd6d9; cursor: default; }
.calfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.calfoot button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.calfoot button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.monthinput { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.monthinput select.mo { width: 128px; }
.monthinput select.yr { width: 96px; }
.monthinput .mstep { width: 30px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-size: 17px; line-height: 1; color: var(--ink-2); }
.monthinput .mstep:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.monthinput .mstep:disabled { opacity: .4; cursor: default; }
.field > .monthinput select.mo { flex: 1; width: auto; }
@media print { .calpop { display: none; } }

/* ---------- customer page: the Actions panel ---------- */
#custactions .panel-head { gap: 12px; align-items: baseline; }
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 8px; padding: 14px 16px 16px; }
.act { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: center; line-height: 1.2; transition: filter .12s, box-shadow .12s; }
.act:hover { filter: brightness(.97); box-shadow: 0 1px 4px rgba(27, 42, 51, .12); text-decoration: none; }
.act span { overflow-wrap: anywhere; }
.act.pri { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.act.pri:hover { filter: none; background: var(--brand-hover); }
.act.m { background: var(--brand-soft); border-color: #b9cdea; color: #173f7a; }
.act.t { background: #fff6dc; border-color: #ecd58a; color: #6b4b00; }
.act.v { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.act.c { background: #efe9fb; border-color: #cfc3ee; color: #45357c; }
.act.ok { background: var(--ok-soft); border-color: #b9dfc8; color: #14532d; }
.act.d { background: var(--bad-soft); border-color: #efc4c2; color: #8a201d; }
.act.n { background: #e2f4f5; border-color: #b5dfe2; color: #0f5d63; }
@media (max-width: 560px) { .acts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; } }

/* chips that can be clicked to filter */
button.chip.pick { cursor: pointer; font-family: inherit; color: inherit; line-height: inherit; }
button.chip.pick:hover { border-color: var(--brand, #1d4ed8); }
button.chip.pick.on { background: var(--brand, #1d4ed8); border-color: var(--brand, #1d4ed8); color: #fff; }
button.chip.pick.on .muted { color: rgba(255,255,255,.8); }

/* collect from a list: how each row was paid, and amounts the program filled in */
.clist .amtrow { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.clist select.meth { padding: 2px 22px 2px 6px; font-size: 12.5px; height: auto; min-height: 0; width: auto; min-width: 82px; max-width: 104px; flex: none; color: var(--muted); border-color: var(--line-2); background-color: transparent; }
.clist select.meth.own { color: #7a4a00; border-color: #e5c07b; background-color: #fff7e0; font-weight: 600; }
.clist .filled { color: #8a6100; white-space: nowrap; }

/* collect from a list: how the collector gave the money to the office, one box under the other */
.handgrid { display: grid; grid-template-columns: max-content minmax(0, 220px); gap: 6px 12px; align-items: center; }
.handgrid label { margin: 0; font-weight: 500; color: var(--text, inherit); }
.handgrid input, .handgrid select { width: 100%; }
.handgrid input { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- 1.22: Telegram, lists that wait, salary, undo in the history ---- */
.tgtext { margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; color: var(--ink); }
.waitlist { padding: 14px 16px; border-top: 1px solid var(--line-2); }
.panel-head + .waitlist { border-top: 0; }
.salkv dt.sub { padding-left: 14px; font-size: 13.5px; }
.salkv dt a.small { margin-left: 6px; font-weight: 400; }
.salkv dd.remaining { font-size: 17px; }
table.salentries td { vertical-align: top; }
.staffcard .panel-head { align-items: flex-start; }
.staffcard .panel-head .actions { margin-left: auto; }
.undocell { display: inline-flex; align-items: center; }
tr.undone > td { color: var(--muted); }
tr.undone > td .cell-sub { opacity: .8; }
a.badge { text-decoration: none; }
a.badge:hover { filter: brightness(.96); }

/* a tab bar with many tabs breaks into lines instead of running out of the page */
.tabs.wrap { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
/* what was said with the Telegram bot (1.24.3) */
.tgconv { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; background: var(--surface-2); }
.tgmsg { max-width: 78%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface, #fff); }
.tgmsg.tgin { align-self: flex-start; }
.tgmsg.tgout { align-self: flex-end; background: var(--brand-soft); }
.tgmeta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.tgbody { white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
@media (max-width: 640px) { .tgmsg { max-width: 94%; } }
/* photos of receipts (1.25) */
img.rcpt { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-2); vertical-align: middle; }
/* complaints (1.26) */
.mb-s { margin-bottom: 8px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.tabs > button .count { background: var(--bad); color: #fff; border-radius: 10px; font-size: 11.5px; padding: 0 6px; line-height: 18px; }

/* business health (1.39) */
.bizlv { font-size: 15.5px; margin: 18px 0 8px; }
.bizlv:first-of-type { margin-top: 6px; }
.bizcard { border: 1px solid var(--line-2); border-left: 5px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; background: var(--surface, #fff); }
.bizcard.lv-red { border-left-color: var(--bad); }
.bizcard.lv-yellow { border-left-color: #e2ad0e; }
.bizcard.lv-green { border-left-color: var(--ok); }
.bizcard.lv-info { border-left-color: var(--brand); }
.bizcard.done { opacity: .7; border-left-color: var(--ok); }
.bizcard-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 15px; }
.bizline { display: grid; grid-template-columns: 78px 1fr; gap: 8px; margin: 3px 0; }
.bizl { color: var(--muted); font-size: 13px; padding-top: 1px; }
.bizh { font-size: 15px; margin: 16px 0 8px; }
.bizbars { width: 100%; height: auto; max-height: 230px; display: block; }
.bizbars-l { font-size: 12px; fill: var(--muted); }
.bizkey { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 560px) { .bizline { grid-template-columns: 1fr; gap: 0; } }

/* বিকাশ / নগদ (1.40) */
td.pos, .pos { color: var(--ok, #16834a); }
td.neg, .neg { color: var(--bad, #c3302c); }
.readout .value.small-v { font-size: 17px; }
select.wl-open { border-color: #e2ad0e; background: var(--weak-soft); }
.wl-steps { margin: 8px 0 10px; padding-left: 22px; line-height: 1.7; }
#wlalerts .note { margin-bottom: 8px; }
#wlrows tr.muted td { opacity: .55; text-decoration: line-through; }
#wlrows tr.muted td:last-child { text-decoration: none; opacity: 1; }
#wlrows select { max-width: 220px; }
@media screen and (max-width: 900px) { #wlrows select { max-width: 100%; width: 100%; } }

/* ---------- the AI helper (1.41) ---------- */
.aichat { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 190px); min-height: 460px; }
.aimsgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.aimsg { max-width: min(880px, 92%); border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.aimsg .aibody { padding: 10px 14px; font-size: 14.5px; line-height: 1.6; word-break: break-word; }
.aiuser { align-self: flex-end; background: var(--brand-soft); border-color: #c9daf3; }
.aiuser .aibody { white-space: pre-wrap; }
.aibot { align-self: flex-start; }
.aibot.aierr { border-color: #f0c3c1; background: var(--bad-soft); color: #7e1d1a; }
.aiwait .aibody { color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aimd p { margin: 0 0 8px; } .aimd p:last-child { margin-bottom: 0; }
.aimd h4 { margin: 10px 0 6px; font-size: 15px; font-weight: 650; }
.aimd ul, .aimd ol { margin: 4px 0 8px; padding-left: 22px; } .aimd li { margin: 2px 0; }
.aimd code { background: var(--grey-soft); padding: 0 4px; border-radius: 4px; font-size: 13px; }
.aimd hr { border: 0; border-top: 1px solid var(--line-2); margin: 10px 0; }
.aimd .table-wrap { margin: 6px 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
table.aimd-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.aimd-t th, table.aimd-t td { padding: 5px 9px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
table.aimd-t th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.aifoot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 4px 10px 6px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); }
.aisteps { padding: 6px 14px 10px; font-size: 12.5px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 3px; }
.aistep { word-break: break-word; } .aistep.bad { color: #8a4b00; }
.bad-t { color: var(--bad); } .ok-t { color: var(--ok); }
.aiinput { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.aiinput textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 220px; font: inherit; }
.aistart { margin: auto; max-width: 900px; width: 100%; padding: 10px 0; }
.aihello { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 600; margin-bottom: 14px; color: var(--ink-2); }
.aihello .icon { color: var(--strand); }
.aisuggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.aisg { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.aisg-t { font-weight: 600; font-size: 14px; }
.aiq { text-align: left; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); }
.aiq:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.aiq:disabled { opacity: .55; cursor: default; }
.aih3 { margin: 0; font-size: 16px; font-weight: 600; }
.aiprov { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); flex-wrap: wrap; }
.aiprov.off { opacity: .6; }
.aiprov-main { flex: 1; min-width: 240px; } .aiprov-t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 2px; }
.aiprov-act { display: flex; gap: 4px; flex-wrap: wrap; }
.aipresets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.aipreset { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.aipreset .small { color: var(--muted); font-size: 12.5px; } .aipreset .small.ok-t { color: var(--ok); }
.aipreset.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.aiprivacy { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 14px; background: var(--surface-2); font-size: 14px; }
.aiprivacy ul { margin: 8px 0 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.aihline .ellipsis { max-width: 100%; }
@media (max-width: 720px) {
  .aisuggest, .aipresets { grid-template-columns: 1fr; }
  .aichat { height: auto; min-height: 0; }
  .aimsgs { max-height: 64vh; min-height: 280px; padding: 10px; }
  .aiinput { position: sticky; bottom: 0; z-index: 2; }
  .aimsg { max-width: 100%; }
  .aiinput { padding: 8px; }
}
