/* StreamNest Reseller Panel: dark operator dashboard in the StreamNest palette.
   Summary strip, live credit balances, customer table; forms and the customer view open as dialogs. */
.check-field { align-content: end; }
.check-row { display: flex !important; align-items: center; gap: 8px; text-transform: none !important; letter-spacing: 0 !important; font-size: .92rem !important; color: var(--fg) !important; cursor: pointer; min-height: 38px; }
/* .field .check-row beats ".field input { width: 100% }", which stretched the box across the field */
.field .check-row input { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); }
/* "Copy …" buttons open a small menu: copy to clipboard, or send on WhatsApp (brand green) */
.caret { font-size: .7em; opacity: .7; margin-left: 2px; }
.btn[aria-expanded="true"] { border-color: var(--accent); }
.menu.share-menu { position: fixed; top: 0; left: 0; right: auto; min-width: 230px; z-index: 50; }
.share-menu button { display: flex; align-items: center; gap: 10px; }
.share-menu small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }
.share-menu .wa-item .wa-icon { color: #25d366; }
.wa-icon { width: 16px; height: 16px; flex: none; }
/* usernames, passwords and links copy themselves when clicked */
.copy-val { background: none; border: 0; padding: 1px 3px; margin: -1px -3px; border-radius: 4px; font: inherit; color: inherit; letter-spacing: inherit; text-align: left; cursor: copy; }
.copy-val:hover, .copy-val:focus-visible { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--fg); outline: none; }
.cred .copy-val { word-break: break-all; }
/* price list editor */
.pl-svc { border: 1px solid var(--rim); border-radius: 12px; padding: 12px 14px 14px; margin: 0 0 12px; display: grid; gap: 12px; min-width: 0; }
.pl-svc legend { font-weight: 700; padding: 0 6px; }
.pl-boxes { display: grid; gap: 6px; }
.pl-head { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pl-head small { text-transform: none; letter-spacing: 0; margin-left: 6px; }
.pl-box { display: grid; grid-template-columns: 18px minmax(0, 1fr) minmax(0, 2fr); gap: 8px; align-items: center; }
.pl-n { color: var(--muted); font-size: .8rem; text-align: center; }
.pl-box input { color: var(--fg); background: var(--bg); border: 1px solid var(--rim); border-radius: 8px; padding: 7px 10px; width: 100%; font: inherit; }
@media (max-width: 560px) { .pl-box { grid-template-columns: 18px 1fr; } .pl-box input:last-child { grid-column: 2; } }
.menu-label { padding: 8px 10px 2px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; border-top: 1px solid var(--rim); margin-top: 4px; }
/* text-style button (Sync now in the sync line) */
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link:disabled { color: var(--muted); cursor: default; }
/* show/hide passwords, in the Password column header */
.eye { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 4px; margin-left: 4px; color: var(--muted); cursor: pointer; vertical-align: middle; line-height: 0; }
.eye svg { width: 15px; height: 15px; }
.eye:hover, .eye[aria-pressed="true"] { color: var(--accent); border-color: var(--rim); }
/* customer view: server details folded away, and the remove confirmation */
.more-creds summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: 6px 0 2px; }
.more-creds[open] summary { margin-bottom: 4px; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: .9rem;
  background: color-mix(in srgb, var(--bad) 12%, transparent); }.conn-on { color: var(--good); }
.conn-full { color: var(--warn); }
.conn-idle { color: var(--muted); }
.banner { border-radius: 10px; padding: 10px 14px; font-size: .9rem; font-weight: 600; }
.banner.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.banner.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
:root {
  --bg: #060910;
  --surface: #0d1422;
  --surface-2: #121c2e;
  --rim: #1e3a5f;
  --fg: #eef2f7;
  --muted: #8d9bb0;
  --accent: #03a9f4;
  --good: #3ccf8e;
  --warn: #f5b142;
  --bad: #f2626b;
  --font-display: "Archivo", "Bahnschrift", "Arial Narrow", Arial, sans-serif;
  --font-body: "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
#l-result { display: grid; gap: 16px; }
#l-result:empty { display: none; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: .95rem; line-height: 1.5; padding-inline: 16px; padding-block: 0 48px; }
.wrap { max-width: 1240px; margin: 0 auto; display: grid; gap: 20px; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: .85em; }

header.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin: 0; line-height: 1.1; }
.brand p { margin: 0; color: var(--muted); font-size: .85rem; }
.conn { display: flex; flex-wrap: wrap; gap: 8px; }
.conn > span { font-size: .78rem; font-weight: 600; border-radius: 999px; padding: 4px 12px; border: 1px solid var(--rim); }
.conn .on { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.conn .off { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.conn .bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); cursor: help; }
.conn .wait { color: var(--muted); }
.conn .mock { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--rim); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.stat span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat small { color: var(--muted); font-size: .8rem; }
.stat.good b { color: var(--good); } .stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); } .stat.trial b { color: var(--accent); }

.balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .balances { grid-template-columns: 1fr; } }
.balance { background: var(--surface); border: 1px solid var(--rim); border-radius: 12px; padding: 16px; display: grid; gap: 8px; min-width: 0; }
.balance-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.balance h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.balance .left { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.balance .left small { font-family: var(--font-body); font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: 4px; }
.balance .left.low { color: var(--warn); }
.balance-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.balance .err { color: var(--warn); font-size: .88rem; }

.btn { border: 1px solid var(--rim); background: var(--surface-2); color: var(--fg); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: var(--bg); }
.btn.ghost { background: transparent; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tools-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--rim); background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--surface-2); color: var(--fg); border-color: var(--accent); }
.chip em { font-style: normal; margin-left: 4px; font-variant-numeric: tabular-nums; }
.search { color: var(--fg); background: var(--surface); border: 1px solid var(--rim); border-radius: 8px; padding: 7px 12px; width: 260px; max-width: 100%; }

.table-scroll { overflow-x: auto; border: 1px solid var(--rim); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 960px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rim); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover td { background: var(--surface); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface); }
td small { display: block; color: var(--muted); font-size: .8rem; }
.num { text-align: right; }
.mono { font-family: var(--font-mono); font-size: .86rem; }
.masked { letter-spacing: .1em; color: var(--muted); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.tag { display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rim); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.tag.converted { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.active { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.pill.due { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.expired { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill.trial { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill.trial-ended, .pill.disabled { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.foot { color: var(--muted); font-size: .85rem; margin: 0; }
.sync-line { color: var(--muted); font-size: .85rem; margin: -8px 0 0; }
.sync-line.bad { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* profile menu */
.profile { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rim); background: var(--surface-2); color: var(--accent);
  font-family: var(--font-display); font-weight: 800; font-size: 1rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.avatar:hover, .avatar[aria-expanded="true"] { border-color: var(--accent); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface-2); border: 1px solid var(--rim); border-radius: 12px;
  padding: 6px; display: grid; gap: 2px; z-index: 5; box-shadow: 0 12px 30px rgb(0 0 0 / .45); }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--rim); margin-bottom: 4px; }
.menu .who span { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.menu .who b { font-size: .95rem; }
.menu button { text-align: left; background: transparent; border: 0; color: var(--fg); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.menu button:hover { background: var(--surface); }
.menu button.out { color: var(--bad); }
.conn { align-items: center; }

dialog { background: var(--surface-2); color: var(--fg); border: 1px solid var(--rim); border-radius: 14px; padding: 0; width: min(720px, calc(100% - 32px)); max-height: calc(100% - 48px); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
.dlg { display: grid; gap: 16px; padding: 22px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.dlg-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.x { background: transparent; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select, .field textarea { color: var(--fg); background: var(--bg); border: 1px solid var(--rim); border-radius: 8px; padding: 8px 10px; width: 100%; }
.field textarea { resize: vertical; min-height: 60px; }
.hint { color: var(--muted); font-size: .8rem; }
.seg { display: inline-flex; gap: 4px; padding: 3px; background: var(--bg); border: 1px solid var(--rim); border-radius: 999px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.summary { background: var(--bg); border-radius: 10px; padding: 12px 14px; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.summary b { color: var(--fg); }
.error { color: var(--bad); margin: 0; font-size: .9rem; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.creds { display: grid; gap: 8px; background: var(--bg); border: 1px solid var(--rim); border-radius: 10px; padding: 14px; }
.cred { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cred > span:first-child { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.cred .val { font-family: var(--font-mono); overflow-wrap: anywhere; }
.cred .btns { display: flex; gap: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.facts div { display: grid; gap: 1px; }
.facts span { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.check { border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.check.ok { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.check.fail { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.actions > div { display: flex; flex-wrap: wrap; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--accent); color: var(--fg); padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); z-index: 10; }
.toast.bad { border-color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .btn, .chip { transition: border-color .15s, background-color .15s; } }
