/* Beep Wi-Fi venue panel. Beep design tokens (beep-whmcs-theme/src/css/01-tokens.css, --b-*): Inter for
   the interface with tabular numbers, Outfit for titles, 4 px grid, light and dark from the same roles
   (follows the system; the bar's theme button forces light or dark, html[data-theme]). Opaque bars. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/outfit.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --b-bg: #F4F8FB; --b-surface: #FFFFFF; --b-surface-2: #F8FAFC; --b-surface-3: #EEF2F6;
  --b-inverse: #0B1B3F; --b-inverse-fg: #FFFFFF;
  --b-fg: #0B1B3F; --b-fg-2: #4B5A70; --b-fg-3: #5F6E84; --b-fg-on-accent: #FFFFFF;
  --b-line: #E3EAF0; --b-line-2: #D3DCE6; --b-control: #8291A6;
  --b-accent: #1565FF; --b-accent-hover: #0E4FD8; --b-accent-text: #1258E0; --b-accent-tint: #EAF1FF;
  --b-focus: #1565FF; --b-focus-halo: rgba(21, 101, 255, 0.18);
  --b-success: #16C47F; --b-success-text: #087443; --b-success-tint: #E8F7F0; --b-success-line: #B9E8D3;
  --b-warning: #F59E0B; --b-warning-text: #B54708; --b-warning-tint: #FEF6E7; --b-warning-line: #F8DDA9;
  --b-danger: #F04438; --b-danger-text: #B42318; --b-danger-tint: #FDECEA; --b-danger-line: #F6C3BE;
  --b-info-text: #1252CC; --b-info-tint: #EAF1FF; --b-info-line: #C5D8FF;
  --b-pay: #0A7A4C; --b-pay-hover: #08653F;
  --b-wifi: #0B7A73; --b-wifi-tint: #E3F4F2; /* the hub's Wi-Fi teal, for the brand mark only */
  --b-font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --b-font-display: "Outfit", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --b-font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --b-radius-sm: 4px; --b-radius: 6px; --b-radius-lg: 8px; --b-radius-xl: 12px;
  --b-shadow-pop: 0 1px 2px rgba(11, 27, 63, 0.06), 0 8px 24px rgba(11, 27, 63, 0.12);
  --b-shadow-sheet: 0 16px 48px rgba(11, 27, 63, 0.18);
  --b-dur-1: 120ms; --b-dur-2: 200ms; --b-ease: cubic-bezier(0.2, 0, 0, 1);
  --b-control-h: 44px;
}
@media (min-width: 992px) { :root { --b-control-h: 38px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --b-bg: #0B1220; --b-surface: #111B2E; --b-surface-2: #16223A; --b-surface-3: #1C2A45;
    --b-inverse: #E6ECF5; --b-inverse-fg: #0B1220;
    --b-fg: #E6ECF5; --b-fg-2: #A3B1C6; --b-fg-3: #8696AD; --b-line: #22304A; --b-line-2: #2D3D5C; --b-control: #5A6A85;
    --b-accent-text: #5B93FF; --b-accent-tint: #15284D; --b-focus: #5B93FF; --b-focus-halo: rgba(91, 147, 255, 0.25);
    --b-success-text: #3DD598; --b-success-tint: #0F2B24; --b-success-line: #1A4A3B;
    --b-warning-text: #F5B547; --b-warning-tint: #2D2414; --b-warning-line: #4D3B17;
    --b-danger-text: #FF7A6E; --b-danger-tint: #33191B; --b-danger-line: #5C2A2A;
    --b-info-text: #7EAAFF; --b-info-tint: #15284D; --b-info-line: #24427A;
    --b-wifi: #3CC9BE; --b-wifi-tint: #0E2D2B;
    --b-shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.45); --b-shadow-sheet: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --b-bg: #0B1220; --b-surface: #111B2E; --b-surface-2: #16223A; --b-surface-3: #1C2A45;
  --b-inverse: #E6ECF5; --b-inverse-fg: #0B1220;
  --b-fg: #E6ECF5; --b-fg-2: #A3B1C6; --b-fg-3: #8696AD; --b-line: #22304A; --b-line-2: #2D3D5C; --b-control: #5A6A85;
  --b-accent-text: #5B93FF; --b-accent-tint: #15284D; --b-focus: #5B93FF; --b-focus-halo: rgba(91, 147, 255, 0.25);
  --b-success-text: #3DD598; --b-success-tint: #0F2B24; --b-success-line: #1A4A3B;
  --b-warning-text: #F5B547; --b-warning-tint: #2D2414; --b-warning-line: #4D3B17;
  --b-danger-text: #FF7A6E; --b-danger-tint: #33191B; --b-danger-line: #5C2A2A;
  --b-info-text: #7EAAFF; --b-info-tint: #15284D; --b-info-line: #24427A;
  --b-wifi: #3CC9BE; --b-wifi-tint: #0E2D2B;
  --b-shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.45); --b-shadow-sheet: 0 16px 48px rgba(0, 0, 0, 0.5);
}
@media (prefers-reduced-motion: reduce) { :root { --b-dur-1: 0ms; --b-dur-2: 0ms; } }

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--b-font-ui); background: var(--b-bg); color: var(--b-fg); font-feature-settings: "cv11" 1; }
.hidden { display: none !important; }
a { color: var(--b-accent-text); }
:focus-visible { outline: 2px solid var(--b-focus); outline-offset: 2px; }

/* bar and navigation: solid surfaces, no see-through */
.bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; background: var(--b-surface); color: var(--b-fg); border-bottom: 1px solid var(--b-line); }
.bar .brand { display: inline-flex; align-items: center; gap: 8px; font: 600 1.125rem/1 var(--b-font-display); letter-spacing: -0.02em; }
.bar .brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--b-wifi); box-shadow: 0 0 0 4px var(--b-wifi-tint); }
.bar .logo { height: 32px; max-width: 120px; object-fit: contain; border-radius: var(--b-radius); }
.bar select { width: auto; max-width: 16rem; }
.bar .icon-btn { min-height: 36px; padding: 6px 10px; background: var(--b-surface); color: var(--b-fg); border: 1px solid var(--b-line-2); }
.spacer { flex: 1; }
#who { color: var(--b-fg-2); font-size: .875rem; }
nav#nav { position: relative; z-index: 30; background: var(--b-surface); border-bottom: 1px solid var(--b-line); }
nav .groups, nav .subs { display: flex; gap: 4px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
nav .groups button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 12px 10px; min-height: 48px; color: var(--b-fg-2); font-weight: 600; white-space: nowrap; }
nav .groups button.on { color: var(--b-fg); border-bottom-color: var(--b-accent); }
nav .subs { padding-top: 8px; padding-bottom: 8px; background: var(--b-surface-2); border-top: 1px solid var(--b-line); }
nav .subs button { background: none; border: 1px solid transparent; padding: 6px 12px; min-height: 36px; border-radius: 999px; color: var(--b-fg-2); white-space: nowrap; }
nav .subs button.on { background: var(--b-accent-tint); color: var(--b-accent-text); border-color: var(--b-info-line); font-weight: 600; }
#banner:empty { display: none; }
.banner { max-width: 1100px; margin: 12px auto 0; padding: 12px 16px; border-radius: var(--b-radius-lg); border: 1px solid var(--b-danger-line); background: var(--b-danger-tint); color: var(--b-fg); }
.banner b { color: var(--b-danger-text); }
.banner ol { margin: 6px 0 8px 20px; padding: 0; }
.banner .row { margin-top: 4px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 96px; }

/* type */
h1 { font: 600 1.625rem/1.25 var(--b-font-display); letter-spacing: -0.02em; margin: 4px 0 16px; }
@media (min-width: 992px) { h1 { font-size: 2rem; } }
h2 { font: 600 1.25rem/1.3 var(--b-font-display); letter-spacing: -0.01em; margin: 20px 0 8px; }
.card h2:first-child { margin-top: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 12px; }
.page-head h1 { margin: 4px 0; }
.page-head .lead { color: var(--b-fg-2); flex-basis: 100%; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.muted { color: var(--b-fg-2); }
.small { font-size: .8125rem; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--b-danger-text); }

/* surfaces */
.card { background: var(--b-surface); color: var(--b-fg); border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); padding: 16px; margin-bottom: 16px; }
.card.warn { border-color: var(--b-warning-line); background: var(--b-warning-tint); }
.card.bad { border-color: var(--b-danger-line); background: var(--b-danger-tint); }
.card.good { border-color: var(--b-success-line); background: var(--b-success-tint); }
.narrow { max-width: 440px; margin: 48px auto; }

/* forms */
label { display: block; margin: 8px 0; font-weight: 500; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; font-weight: 400; }
input, select, textarea { font: inherit; min-height: var(--b-control-h); padding: 6px 10px; border: 1px solid var(--b-control); border-radius: var(--b-radius); background: var(--b-surface); color: var(--b-fg); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; accent-color: var(--b-accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--b-focus); box-shadow: 0 0 0 3px var(--b-focus-halo); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], input[type=password], input[type=search], select, textarea { display: block; width: 100%; max-width: 32rem; margin-top: 4px; }
input[type=color] { padding: 0; width: 3rem; height: 2.25rem; }
textarea { min-height: 5rem; }
button { font: 600 .9375rem/1.2 var(--b-font-ui); cursor: pointer; min-height: var(--b-control-h); padding: 8px 16px; border-radius: var(--b-radius); border: 1px solid var(--b-accent); background: var(--b-accent); color: var(--b-fg-on-accent); }
button:hover { background: var(--b-accent-hover); border-color: var(--b-accent-hover); }
button.secondary { background: var(--b-surface); color: var(--b-accent-text); border-color: var(--b-line-2); }
button.secondary:hover { background: var(--b-surface-2); }
button.danger { background: var(--b-surface); color: var(--b-danger-text); border-color: var(--b-danger-line); }
button.danger:hover { background: var(--b-danger-tint); }
button.danger.solid { background: #B42318; border-color: #B42318; color: #fff; }
button.pay { background: var(--b-pay); border-color: var(--b-pay); }
button.link { background: none; border: 0; color: var(--b-accent-text); text-decoration: underline; padding: 0; min-height: 0; font-weight: 500; }
button:disabled { background: var(--b-surface-3); border-color: var(--b-line-2); color: var(--b-fg-2); cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }

/* tables: sticky header, tabular numbers; cards under 640 px (labels from the header, data-l) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--b-line); vertical-align: top; }
thead th { position: sticky; top: 56px; background: var(--b-surface-2); font-size: .75rem; color: var(--b-fg-3); font-weight: 600; z-index: 1; }
tbody tr:hover { background: var(--b-surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt thead { display: none; }
  table.rt { border: 0; background: none; }
  table.rt tr { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); margin-bottom: 8px; padding: 4px 0; }
  table.rt td { border: 0; padding: 6px 12px; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  table.rt td[data-l]::before { content: attr(data-l); color: var(--b-fg-3); font-size: .75rem; text-align: left; flex: 0 0 auto; }
  table.rt td:first-child { font-weight: 600; }
}

/* status: dot + word, never colour alone */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; border: 1px solid var(--b-line-2); background: var(--b-surface-3); color: var(--b-fg-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.online, .pill.ok, .pill.active, .pill.paid, .pill.in { color: var(--b-success-text); background: var(--b-success-tint); border-color: var(--b-success-line); }
.pill.offline, .pill.bad, .pill.failed, .pill.overdue, .pill.suspended { color: var(--b-danger-text); background: var(--b-danger-tint); border-color: var(--b-danger-line); }
.pill.pending, .pill.waiting, .pill.due, .pill.unused { color: var(--b-warning-text); background: var(--b-warning-tint); border-color: var(--b-warning-line); }
.pill.info { color: var(--b-info-text); background: var(--b-info-tint); border-color: var(--b-info-line); }
pre.script { max-height: 18rem; overflow: auto; background: #0B1220; color: #D6E4FF; padding: 12px; border-radius: var(--b-radius-lg); font: .78rem/1.5 var(--b-font-mono); white-space: pre; }
code { font-family: var(--b-font-mono); font-size: .875em; background: var(--b-surface-3); padding: 1px 5px; border-radius: var(--b-radius-sm); }
.error { color: var(--b-danger-text); }
p.card.error { background: var(--b-danger-tint); border-color: var(--b-danger-line); }

/* stat tiles: label, value, change vs comparison, foot */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-radius-lg); padding: 14px 16px; }
.tile.hero { border-color: var(--b-info-line); background: var(--b-accent-tint); }
.tile .k { color: var(--b-fg-2); font-size: .8125rem; font-weight: 500; }
.tile .v { font: 600 1.5rem/1.3 var(--b-font-ui); font-variant-numeric: tabular-nums; margin: 2px 0; }
.tile .d { font-size: .8125rem; color: var(--b-fg-2); font-variant-numeric: tabular-nums; }
.tile .up { color: var(--b-success-text); font-weight: 600; }
.tile .down { color: var(--b-danger-text); font-weight: 600; }

/* action cards (Today): what needs me now, with the action inline */
.actions-list { display: grid; gap: 8px; margin-bottom: 16px; }
.action { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: var(--b-surface); border: 1px solid var(--b-line); border-left: 4px solid var(--b-warning); border-radius: var(--b-radius-lg); padding: 12px 16px; }
.action.bad { border-left-color: var(--b-danger); }
.action.info { border-left-color: var(--b-accent); }
.action .t { flex: 1 1 260px; }
.action .t b { display: block; }
.empty { text-align: center; padding: 24px 16px; color: var(--b-fg-2); }
.empty .ico { font-size: 1.75rem; display: block; margin-bottom: 4px; }
.caught { display: flex; align-items: center; gap: 8px; color: var(--b-success-text); font-weight: 600; background: var(--b-success-tint); border: 1px solid var(--b-success-line); border-radius: var(--b-radius-lg); padding: 12px 16px; margin-bottom: 16px; }

/* list tools: search + saved filter chips */
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.tools input[type=search] { max-width: 20rem; margin: 0; }
.chip { background: var(--b-surface); color: var(--b-fg-2); border: 1px solid var(--b-line-2); border-radius: 999px; min-height: 36px; padding: 4px 12px; font-weight: 500; }
.chip:hover { background: var(--b-surface-2); border-color: var(--b-line-2); }
.chip.on { background: var(--b-accent-tint); color: var(--b-accent-text); border-color: var(--b-info-line); font-weight: 600; }
.count { color: var(--b-fg-3); font-size: .8125rem; }

/* toast (5 s, with Undo) */
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(8px); z-index: 1100; display: flex; align-items: center; gap: 12px; background: var(--b-inverse); color: var(--b-inverse-fg); padding: 10px 16px; border-radius: var(--b-radius-lg); box-shadow: var(--b-shadow-pop); opacity: 0; transition: opacity var(--b-dur-2) var(--b-ease), transform var(--b-dur-2) var(--b-ease); pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
#toast button { min-height: 32px; padding: 4px 10px; background: transparent; color: var(--b-inverse-fg); border: 1px solid currentColor; }

/* sheet (ConfirmSheet, forms in a sheet, the date picker) */
.backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(11, 27, 63, 0.45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .backdrop { align-items: center; } }
.sheet { background: var(--b-surface); color: var(--b-fg); width: 100%; max-width: 480px; border-radius: var(--b-radius-xl) var(--b-radius-xl) 0 0; padding: 20px; box-shadow: var(--b-shadow-sheet); max-height: 90vh; overflow: auto; }
@media (min-width: 640px) { .sheet { border-radius: var(--b-radius-xl); } }
.sheet h2 { margin-top: 0; }
.sheet .consequence { color: var(--b-fg-2); }
.sheet .buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: .75rem; color: var(--b-fg-3); padding: 4px 0; }
.cal button { min-height: 40px; padding: 0; background: var(--b-surface); color: var(--b-fg); border: 1px solid var(--b-line); font-weight: 500; }
.cal button.today { border-color: var(--b-accent); }
.cal button.sel { background: var(--b-accent); color: #fff; border-color: var(--b-accent); }
.cal button:disabled { color: var(--b-fg-3); background: var(--b-surface-2); }

.designer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .designer { grid-template-columns: 1fr; } }
.phone { width: 340px; height: 680px; border: 12px solid #0B1B3F; border-radius: 36px; overflow: hidden; background: #fff; position: sticky; top: 120px; }
.phone iframe { width: 100%; height: 100%; border: 0; }

/* charts: bars for time series, the previous period as a faint ghost; values on hover/focus and in a table */
.chart { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--b-line-2); padding-top: 20px; }
.chart .slot { flex: 1 1 0; height: 100%; position: relative; display: flex; align-items: flex-end; }
.chart .g { position: absolute; left: 0; right: 0; bottom: 0; background: var(--b-line-2); opacity: .7; border-radius: 3px 3px 0 0; }
.chart .b { position: relative; width: 100%; background: var(--b-accent); border-radius: 3px 3px 0 0; min-height: 1px; }
.chart .slot:hover .b, .chart .slot:focus .b { background: var(--b-accent-hover); }
.chart .slot:focus { outline: none; }
.chart .tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; background: var(--b-inverse); color: var(--b-inverse-fg); font-size: .75rem; padding: 2px 6px; border-radius: var(--b-radius-sm); white-space: nowrap; z-index: 2; }
.chart .slot:hover .tip, .chart .slot:focus .tip { display: block; }
.axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--b-fg-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; font-size: .8125rem; color: var(--b-fg-2); margin: 4px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.codes > div { border: 1px dashed var(--b-control); border-radius: var(--b-radius-lg); padding: 10px; text-align: center; font: 600 1.1rem var(--b-font-mono); }
.codes .row { justify-content: center; margin-top: 6px; font: 500 .8125rem var(--b-font-ui); }
.codes .row button { min-height: 32px; padding: 2px 8px; }
.demo-badge { background: var(--b-warning-tint); color: var(--b-warning-text); border: 1px solid var(--b-warning-line); font: 600 .75rem var(--b-font-ui); padding: 2px 8px; border-radius: 999px; }
.slip { border: 1px solid var(--b-line-2); border-radius: var(--b-radius-lg); padding: 16px; }
.slip .big { font: 600 1.5rem var(--b-font-display); }
@media print { header, nav, #banner, .noprint, #toast, .backdrop { display: none !important; } main { padding: 0; } .card { border: 0; } body { background: #fff; color: #000; } }
.legend .lg-now { background: var(--b-accent); }
.legend .lg-prev { background: var(--b-line-2); }
.bar .brand { white-space: nowrap; }
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  #who { display: none; }
  .bar select { max-width: 11rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px; }
  .tile .v { font-size: 1.25rem; }
  .page-head .actions { margin-left: 0; }
  nav#nav { top: 0; position: relative; }
  thead th { top: 0; }
}
.site-sel { margin-bottom: 12px; }
.tools select { width: auto; max-width: 16rem; margin: 0; }
