/* Management console — its own visual language, distinct from the player.
   Dense, scannable, keyboard-first: this is operated, not watched. */
:root {
  --bg: #0b0d12; --bg-1: #12151c; --bg-2: #1a1f29; --line: #262c38;
  --fg: #eef2f8; --fg-2: #9aa6b8; --fg-3: #6b7688;
  --accent: #3ddc97; --accent-ink: #06140d;
  --warn: #ffb84d; --bad: #ff6b6b;
  --r: 10px; --r-sm: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 15px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.loading { color: var(--fg-3); padding: 40px; text-align: center; }
a { color: var(--accent); }

/* ---- login ---- */
.login { max-width: 380px; margin: 12vh auto; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 1.3rem; }
.login p.sub { margin: 0 0 20px; color: var(--fg-2); font-size: .9rem; }
label { display: block; font-size: .82rem; color: var(--fg-2); margin: 14px 0 6px; }
input {
  width: 100%; padding: 11px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg);
  font: inherit;
}
input:focus { outline: none; border-color: var(--accent); }
.btn {
  appearance: none; border: 0; border-radius: var(--r-sm); padding: 11px 18px;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { color: var(--fg); }
.btn[disabled] { opacity: .5; cursor: default; }
.err { color: var(--bad); font-size: .85rem; margin-top: 12px; min-height: 1.1em; }

/* ---- header ---- */
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.top h1 { font-size: 1.25rem; margin: 0; flex: 1; }
.who { color: var(--fg-2); font-size: .85rem; }
.pill { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--fg-2); }
.pill.admin { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }

/* ---- your config card ---- */
.card { background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px; margin-bottom: 24px; }
.card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.card .hint { color: var(--fg-3); font-size: .84rem; margin: 0 0 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }
.saverow { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.saved { color: var(--accent); font-size: .85rem; }

/* ---- admin table ---- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.toolbar input { flex: 1; }
.count { color: var(--fg-3); font-size: .82rem; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th { text-align: left; color: var(--fg-3); font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; }
thead th:hover { color: var(--fg); }
tbody td { padding: 10px; border-bottom: 1px solid var(--bg-2); vertical-align: middle; }
tbody tr:hover { background: var(--bg-1); }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.tag { font-size: .7rem; padding: 2px 7px; border-radius: 999px; }
.tag.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.tag.off { background: var(--bg-2); color: var(--fg-3); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; color: var(--fg-2); }
.empty { color: var(--fg-3); text-align: center; padding: 30px; }

/* ---- two panels, side by side ------------------------------------------
   ⭐ The console now shows BOTH services from one sign-in. The two customer
   lists sit next to each other and are deliberately NOT merged -- see the note
   in manage.js: joining two customers by name alone can hand one of them the
   other's credentials. */
.card h3 { margin: 22px 0 4px; font-size: .95rem; color: var(--fg); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 10px; }
@media (max-width: 860px) { .sides { grid-template-columns: 1fr; } }
.side table { table-layout: fixed; }
.side td:first-child { width: 42%; }
input.mini { padding: 7px 9px; font-size: .84rem; }
.btn.tiny { padding: 6px 10px; font-size: .78rem; }
.dim { color: var(--fg-3); }

/* Suggested customer matches -- a proposal, never applied on its own. */
.suggest { margin: 6px 0 4px; }
.suggrows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.suggrow {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 6px 5px 12px;
}

/* Admin linking dialog */
.modal {
  position: fixed; inset: 0; background: rgba(4, 6, 10, .66);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modalbox {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; width: min(460px, 100%);
}
.modalbox h2 { margin: 0 0 4px; font-size: 1.05rem; }

/* ⚠️ A service the reseller does not sell is GREYED, not hidden and not labelled
   as an error. Same layout for everyone -- the owner's call: "just have it gray
   out the one they don't sell." */
.greyed { opacity: .45; }
.greyed input { cursor: not-allowed; }

/* Two declared addresses, one choice. Not a free-text box: a mistyped URL here
   means that customer sees nothing, on a field nobody thinks to check. */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.segbtn {
  appearance: none; border: 0; background: transparent; color: var(--fg-2);
  font: inherit; font-size: .78rem; padding: 5px 12px; cursor: pointer;
}
.segbtn[data-on='1'] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.segbtn:disabled { cursor: not-allowed; }
.svc { white-space: nowrap; }
.svc .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.svc .dot.ok { background: var(--accent); }
.svc .dot.off { background: var(--bad); }
.svc.none { color: var(--fg-3); }
.small { font-size: .78rem; }

/* ---- 571 accounts, readable -------------------------------------------
   ⛔ Every row the same height. Wrapping cells ("Sub Reseller", the service
   pills, a three-line "App set up" header) made the grid look broken. */
.tablewrap { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.accttable { table-layout: fixed; font-size: .86rem; }
.accttable thead th { position: sticky; top: 0; background: var(--bg-1); z-index: 2; white-space: nowrap; }
.accttable th.sortable { cursor: pointer; }
.accttable td { height: 46px; padding: 6px 10px; white-space: nowrap; overflow: hidden; }
.accttable td.acct { width: 26%; }
.accttable td.svcs { width: 116px; }
.accttable td.num  { width: 84px; }
.accttable td.act  { width: 78px; text-align: right; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fixed-width service chips: present is lit, absent is dim, neither wraps. */
.chip {
  display: inline-block; width: 44px; text-align: center;
  font-size: .68rem; padding: 2px 0; margin-right: 4px; border-radius: 4px;
  background: var(--bg-2); color: var(--fg-3);
}
.chip.on { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 14px; }
.filter { display: flex; align-items: center; gap: 6px; }
.flabel { color: var(--fg-3); font-size: .78rem; margin-right: 2px; }
.setchip {
  appearance: none; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--fg-2); font: inherit; font-size: .78rem;
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
}
.setchip[data-on='1'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
