/* Business dashboard (admin only). Uses the site's colours from style.css. */
.adm-top, .adm-main { max-width: 1240px; }
.adm-top-right { display: flex; align-items: center; gap: 16px; }
.adm-badge { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid; }
.adm-badge.live { color: var(--good); border-color: var(--good); }
.adm-badge.test { color: var(--warn); border-color: var(--warn); }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 6px 0 18px; }
.adm-head h1 { margin: 0; font-size: 30px; letter-spacing: -.5px; }
.adm-head p { margin: 4px 0 0; }

/* headline numbers */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: rgba(11, 29, 74, .85); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .k-value { font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi.warn .k-value { color: var(--warn); }

.adm-grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.adm-sub { margin-top: 22px !important; }

/* sign-ups chart */
.chart { position: relative; margin-top: 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hover { fill: #5cc0ff; }
.chart .grid { stroke: rgba(255,255,255,.08); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.adm-table-toggle { margin-top: 8px; }
.adm-table-toggle table { margin-top: 8px; font-size: 13px; border-collapse: collapse; }
.adm-table-toggle td, .adm-table-toggle th { padding: 2px 14px 2px 0; text-align: left; }

/* labelled horizontal bars (one series, so one colour; the label carries identity) */
.hbars { display: grid; gap: 9px; margin-top: 12px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.hbar .h-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbar .h-track { display: block; height: 12px; background: rgba(255,255,255,.06); border-radius: 0 6px 6px 0; }
.hbar .h-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .h-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* accounts */
.adm-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 8px; }
.adm-filters input[type=search] { flex: 1 1 220px; max-width: 320px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; color: var(--muted); background: rgba(2,10,34,.6); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.chip.on { color: var(--ink); background: var(--panel-hi); border-color: var(--accent); }
.chip span { color: var(--dim); margin-left: 4px; }
.table-wrap { overflow-x: auto; border-radius: 10px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.adm-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.adm-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.adm-table tr:hover td { background: rgba(255,255,255,.03); }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table .email { font-weight: 600; word-break: break-all; }
.adm-table .when { color: var(--muted); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status.active::before { background: var(--good); }
.status.trial::before { background: var(--accent); }
.status.lifetime::before { background: #8b3dff; }
.status.expired::before { background: var(--dim); }
.status.blocked::before, .status.cancelling::before { background: var(--bad); }
.status small { color: var(--muted); font-weight: 500; }
.adm-more { text-align: center; margin-top: 10px; }

/* money */
.money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 12px 0; }
.money div { background: rgba(2,10,34,.5); border-radius: 10px; padding: 12px 14px; }
.money b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.money span { color: var(--muted); font-size: 13px; }

/* manage dialog */
.adm-dialog { width: min(560px, calc(100vw - 32px)); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: #0b1d4a; color: var(--ink); padding: 24px; }
.adm-dialog::backdrop { background: rgba(2,10,34,.7); }
.adm-dialog h3 { margin: 0 32px 4px 0; word-break: break-all; }
.adm-dialog-close { position: absolute; top: 14px; right: 16px; }
.adm-dialog-close .link { text-decoration: none; font-size: 18px; }
.adm-actions { display: grid; gap: 14px; margin-top: 16px; }
.adm-actions .group { display: grid; gap: 8px; }
.adm-actions .group > b { font-size: 13px; color: var(--muted); font-weight: 600; }
.adm-actions .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.danger { border-color: var(--bad); color: #ffd1e3; }

/* tooltip */
.adm-tip { position: fixed; pointer-events: none; z-index: 20; background: #020a22; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .adm-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpi .k-value { font-size: 26px; }
  .adm-head h1 { font-size: 24px; }
  .money { grid-template-columns: 1fr; }
}

/* ---------- CRM layout: side menu + tabs ---------- */
.adm-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.adm-nav { position: sticky; top: 16px; display: grid; gap: 4px; background: rgba(11, 29, 74, .6); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 10px; }
.adm-nav button { position: relative; display: flex; align-items: center; gap: 10px; font: inherit; font-size: 15px; color: var(--muted); background: none; border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; }
.adm-nav button:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.adm-nav button.on { background: var(--panel-hi); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.adm-dot { position: absolute; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.adm-content { min-width: 0; }
.adm-alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; border: 1px solid var(--bad); background: rgba(255, 70, 120, .12); font-size: 14px; }
.adm-alert.warn { border-color: var(--warn); background: rgba(255, 190, 70, .1); }
.adm-alert button { margin-left: auto; }

/* activity feed */
.adm-feed { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.adm-feed li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.adm-feed li .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.adm-feed li .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* slim tables */
.adm-table.slim { min-width: 0; }
.adm-table.slim td, .adm-table.slim th { padding: 8px 10px; }
.adm-table .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-table .tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); white-space: nowrap; }

/* services */
.svc-list { display: grid; gap: 10px; margin-top: 10px; }
.svc { display: grid; grid-template-columns: 16px 1fr auto; gap: 14px; align-items: center; background: rgba(11, 29, 74, .85); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 14px 18px; }
.svc .light { width: 14px; height: 14px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.svc.warn .light { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.svc.bad .light { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.svc b { font-size: 16px; }
.svc .what { color: var(--muted); font-size: 13px; margin-left: 6px; }
.svc .detail { color: var(--muted); font-size: 14px; margin-top: 3px; }
.svc.bad .detail { color: #ffd1e3; }

/* costs editor */
.adm-table.costs { min-width: 860px; }
.adm-table.costs input, .adm-table.costs select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; width: 100%; box-sizing: border-box; }
.adm-table.costs td.num input { width: 80px; text-align: right; }
.adm-table.costs tr.stopped td { opacity: .55; }
.adm-cost-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.money .neg b { color: var(--bad); }
.money .pos b { color: var(--good); }

@media (max-width: 900px) {
  .adm-layout { grid-template-columns: 1fr; }
  .adm-nav { position: static; display: flex; overflow-x: auto; padding: 6px; }
  .adm-nav button { flex: none; padding: 8px 12px; }
  .adm-nav button.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .adm-dot { position: static; }
}
.adm-table.costs { min-width: 1040px; table-layout: fixed; }
.adm-table.costs th:nth-child(1) { width: 18%; } .adm-table.costs th:nth-child(2) { width: 22%; }
.adm-table.costs th:nth-child(3) { width: 90px; } .adm-table.costs th:nth-child(4) { width: 64px; }
.adm-table.costs th:nth-child(5) { width: 104px; } .adm-table.costs th:nth-child(6) { width: 150px; }
.adm-table.costs th:nth-child(7) { width: 104px; } .adm-table.costs th:nth-child(8) { width: 120px; }
.adm-table.costs select { padding: 6px 4px; min-width: 0; background-image: none; appearance: auto; }
.adm-cost-actions label { display: inline-flex; align-items: center; gap: 6px; }
.adm-cost-actions label input { width: 70px; }
