/* Bynix Chat operator console */
[hidden] { display: none !important; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ops-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.ops-nav { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.ops-main { max-width: 1180px; margin: 0 auto; padding: 24px; display: grid; gap: 20px; }
#opsBody { display: grid; gap: 20px; }
.ops-gate { max-width: 520px; margin: 40px auto; display: grid; gap: 10px; justify-items: start; }
h2 { font-size: 18px; }
h3 { font-size: 14px; margin: 18px 0 6px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--bx-r-lg); padding: 16px; display: grid; gap: 4px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
#kMrr { font-size: 18px; }
.kpi-val { font-size: 26px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-sub { font-size: 12px; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; margin-top: 14px; border-bottom: 1px solid var(--line); position: relative; }
.bars .bar { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bars .bar i { display: block; width: 100%; background: var(--bx-red-ink); border-radius: 4px 4px 0 0; min-height: 0; }
.bars .bar:hover i { background: var(--bx-red); }
.bars .tip { position: absolute; bottom: calc(100% + 4px); transform: translateX(-50%); background: var(--bx-charcoal); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; }
.bars-table { margin-top: 8px; font-size: 13px; }
.bars-table summary { cursor: pointer; color: var(--muted); }

.ws-filters { display: grid; grid-template-columns: 1fr 200px; gap: 8px; margin-top: 12px; }
.tbl-wrap { overflow-x: auto; }
.ws-tbl { min-width: 720px; }
.ws-tbl td { text-align: left; font-family: inherit; }
.ws-tbl td.num { text-align: right; }
.ws-tbl tbody tr { cursor: pointer; }
.ws-tbl tbody tr:hover, .ws-tbl tbody tr:focus-visible { background: var(--surface-2); outline: none; }
.ws-tbl .nm { font-weight: 700; }
.ws-tbl .sub { font-size: 12px; color: var(--muted); }
.state { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--surface-2); color: var(--fg); white-space: nowrap; }
.state.paying { background: rgba(14, 124, 77, .12); color: var(--ok-ink); }
.state.trial { background: var(--glow-soft); color: var(--warn-ink); }
.state.suspended { background: var(--accent-soft); color: var(--red-text); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }

.ops-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.ops-log li { display: flex; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ops-log time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 120px; }
.ops-log .empty { color: var(--muted); border: 0; }

.ws-dlg { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: var(--bx-r-lg); padding: 0; background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.ws-dlg::backdrop, .reauth-dlg::backdrop { background: rgba(17, 17, 19, .55); }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { font-size: 20px; overflow-wrap: anywhere; }
.dlg-body { padding: 4px 20px 20px; }
.ws-paused { margin-top: 14px; padding: 10px 12px; border-radius: var(--bx-r); background: var(--accent-soft); color: var(--red-text); font-weight: 600; font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ws-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.act { display: grid; gap: 6px; align-content: start; border: 1px solid var(--line); border-radius: var(--bx-r); padding: 12px; }
#noteForm { margin-top: 12px; }
.act label { font-weight: 700; font-size: 14px; }
.act .hint { font-size: 12px; margin: 0; }
.act > .bx-btn { justify-self: start; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline.end { justify-content: flex-end; }
.inline .bx-select { width: auto; }
.reauth-dlg { width: min(380px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: var(--bx-r-lg); padding: 20px; background: var(--surface); color: var(--fg); }
.reauth-dlg form { display: grid; gap: 10px; }
.err { color: var(--red-text); font-size: 13px; margin: 0; }

@media (max-width: 640px) {
  .ops-top { padding: 12px 16px; }
  .ops-main { padding: 16px; }
  .ws-filters, .ws-actions { grid-template-columns: 1fr; }
}
/* the wide workspaces table scrolls inside its card instead of widening the page */
.ops-main, #opsBody { grid-template-columns: minmax(0, 1fr); }
.ops-main .bx-card { min-width: 0; }
@media (max-width: 400px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi-val { font-size: 22px; } }
