/* HudHud Cloud console — white, simple design system shared by the customer portal and admin.
   One accent (HudHud orange), hairline borders, no gradients, no dark blocks. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Ethiopic:wght@400;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  color-scheme: light;
  --surface: #ffffff;
  --subtle: #f8f8f9;
  --hover: #f4f4f5;
  --line: #e7e7ea;
  --line-2: #f0f0f2;
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;
  --accent: #e8590c;          /* marks, active states */
  --accent-strong: #c2410c;   /* buttons with white text, links (≥ 4.5:1 on white) */
  --accent-wash: #fff4ec;
  --good: #15803d; --good-wash: #ecfdf3;
  --warn: #b45309; --warn-wash: #fffbeb;
  --bad: #b91c1c;  --bad-wash: #fef2f2;
  --chart-1: #e8590c; --chart-2: #2a78d6; --chart-3: #1baf7a; --chart-4: #6250d6; --chart-bad: #dc2626;
  --radius: 12px; --radius-sm: 8px;
  --font: 'Inter', 'Noto Sans Ethiopic', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 248px; --top-h: 60px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.console { margin: 0; background: var(--surface); color: var(--ink); font: 14px/1.5 var(--font); letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
body.console::before, body.console::after { display: none !important; }
.console h1, .console h2, .console h3, .console h4 { color: var(--ink); margin: 0; letter-spacing: -0.02em; }
.console h1 { font-size: 24px; font-weight: 650; line-height: 1.25; }
.console h2 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.console h3 { font-size: 14px; font-weight: 600; }
.console p { margin: 0; }
.console a { color: var(--accent-strong); text-decoration: none; }
.console a:hover { text-decoration: underline; }
.console code, .console pre { font-family: var(--mono); font-size: 12.5px; }
.console code { background: var(--subtle); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.console .ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.console :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.console .subtle, .console .muted, .console .comfort-note span { color: var(--ink-3); font-size: 13px; }
.console [hidden], .console .hidden { display: none !important; }
.console .tabular, .console .kpi strong, .console td.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons & inputs ---------- */
.console button { font: inherit; color: inherit; }
.console .action, .console .primary, .console .secondary, .console .kpi-action, .console .user-menu {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; border: 1px solid transparent; transition: background .12s, border-color .12s, color .12s; text-decoration: none; transform: none !important; box-shadow: none !important;
}
.console .action, .console .primary { background: var(--accent-strong); color: #fff; }
.console .action:hover, .console .primary:hover { background: #9a3412; text-decoration: none; }
.console .action.secondary, .console .secondary, .console .kpi-action, .console .user-menu { background: var(--surface); color: var(--ink); border-color: var(--line); }
.console .action.secondary:hover, .console .secondary:hover, .console .kpi-action:hover, .console .user-menu:hover { background: var(--hover); }
.console button:disabled { opacity: .55; cursor: not-allowed; }
.console .link { color: var(--accent-strong); font-weight: 500; font-size: 13px; }
.console input:not([type=checkbox]):not([type=radio]):not([type=range]), .console select, .console textarea, .console .input {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 36px; padding: 7px 11px; width: auto; max-width: 100%; transition: border-color .12s, box-shadow .12s;
}
.console textarea { min-height: 88px; width: 100%; resize: vertical; }
.console input:focus, .console select:focus, .console textarea:focus, .console .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 89, 12, .14); }
.console input::placeholder, .console textarea::placeholder { color: var(--ink-4); }
.console label { color: var(--ink-2); font-size: 13px; }
.console .form-row, .console .toolbar, .console .reports-toolbar, .console .sender-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.console .form-row input, .console .sender-form input { flex: 1 1 220px; }

/* ---------- badges ---------- */
.console .badge, .console .pill, .console .sender-status-pill, .console .side-count {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; font-style: normal;
  background: var(--hover); color: var(--ink-2); border: 0; text-transform: none; letter-spacing: 0; white-space: nowrap;
}
.console .badge.good, .console .badge.paid, .console .badge.active, .console .pill.good, .console .sender-status-pill.approved { background: var(--good-wash); color: var(--good); }
.console .badge.warn, .console .badge.pending, .console .badge.unpaid, .console .pill.warn, .console .side-count.warn { background: var(--warn-wash); color: var(--warn); }
.console .badge.danger, .console .badge.bad, .console .badge.failed, .console .pill.bad, .console .sender-status-pill.rejected { background: var(--bad-wash); color: var(--bad); }
.console .badge.neutral { background: var(--hover); color: var(--ink-2); }

/* ---------- cards ---------- */
.console .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; box-shadow: none; backdrop-filter: none; }
.console .panel-head, .console .panel > .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.console .panel-head p, .console .panel > .head p { margin-top: 2px; }
.console .panel h2 + p.muted, .console .panel h2 + .muted { margin: 2px 0 12px; }
.console .empty, .console .report-empty, .console .onboarding-empty, .console .hh-none { color: var(--ink-3); font-size: 13px; padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--subtle); display: block; }
.console .onboarding-empty { text-align: left; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.console .onboarding-empty strong { color: var(--ink); font-size: 14px; }
.console .notice, .console .portal-note { background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--ink-2); font-size: 13px; display: block; }
.console .portal-note strong { display: block; color: var(--ink); margin-bottom: 2px; }

/* ---------- tables ---------- */
.console .table-wrap, .console .report-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.console table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.console th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); text-transform: none; letter-spacing: 0; background: var(--subtle); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.console td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
.console tbody tr:last-child td { border-bottom: 0; }
.console tbody tr:hover td { background: #fcfcfd; }
.console td strong { color: var(--ink); font-weight: 600; }
.console .panel > table, .console .panel > div > table { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }

/* ---------- KPI tiles ---------- */
.console .kpis, .console .metrics, .console .usage-kpis, .console .report-summary, .console .report-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.console .kpi, .console .usage-kpis .k, .console .report-stat, .console .report-metric, .console .metric {
  all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink);
}
.console .kpi header, .console .kpi > span:not(.ic), .console .usage-kpis .k span, .console .report-stat span, .console .report-metric span, .console .metric span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.console .kpi header em { font-style: normal; }
.console .kpi header em:empty { display: none; }
.console .kpi strong, .console .usage-kpis .k strong, .console .report-stat strong, .console .report-metric strong, .console .metric strong { display: block; font-size: 24px; font-weight: 650; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.console .kpi p, .console .usage-kpis .k small { color: var(--ink-3); font-size: 12.5px; }
.console .kpi .kpi-action { align-self: flex-start; margin-top: 8px; height: 30px; padding: 0 10px; font-size: 12.5px; }
.console .usage-kpis .k.warn { border-color: #fcd9a8; background: var(--warn-wash); }
.console button.kpi { cursor: pointer; transition: border-color .12s, background .12s; }
.console button.kpi:hover { border-color: #f7c9a9; background: #fffaf6; }
.console .kpi .ic { display: none; }
.console .delta { font-size: 12px; font-weight: 600; }
.console .delta.up { color: var(--good); } .console .delta.down { color: var(--bad); } .console .delta.flat { color: var(--ink-3); }

/* ---------- charts (charts.js) ---------- */
.hh-chart { position: relative; width: 100%; }
.hh-chart svg { display: block; overflow: visible; max-width: 100%; }
.hh-grid { stroke: var(--line-2); stroke-width: 1; }
.hh-base { stroke: var(--line); stroke-width: 1; }
.hh-axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.hh-empty { fill: var(--ink-4); font-size: 13px; font-family: var(--font); }
.hh-cross { stroke: var(--ink-4); stroke-width: 1; }
.hh-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(17, 24, 39, .08); padding: 8px 10px; font-size: 12px; color: var(--ink-2); display: grid; gap: 3px; }
.hh-tip b { color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.hh-tip span { display: flex; align-items: center; gap: 6px; }
.hh-tip em { margin-left: auto; font-style: normal; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; padding-left: 12px; }
.hh-tip i, .hh-legend i, .hh-keys i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.hh-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.hh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hh-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hh-donut-value { fill: var(--ink); font-size: 20px; font-weight: 650; font-family: var(--font); }
.hh-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1 1 160px; min-width: 0; font-size: 13px; }
.hh-keys li { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.hh-keys b { margin-left: auto; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hh-keys em { font-style: normal; color: var(--ink-3); width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.hh-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hh-hb-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.hh-hb-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-hb-top b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hh-hb-track { height: 6px; background: var(--line-2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.hh-hb-track i { display: block; height: 100%; border-radius: 3px; }
.hh-hbars small { color: var(--ink-3); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; gap: 2px; background: var(--surface); }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--ink); font-weight: 600; }

/* ---------- dashboard grid ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash > * { min-width: 0; }
.dash .panel { margin: 0; }
.dash-col { display: grid; gap: 16px; min-width: 0; }
.dash-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.dash-3 .panel { margin: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-head .big { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.chart-head .big small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.meter { height: 8px; border-radius: 4px; background: var(--accent-wash); overflow: hidden; margin: 10px 0 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.warn { background: var(--warn-wash); } .meter.warn i { background: #d97706; }
.stat-list { display: grid; gap: 0; margin: 0; }
.stat-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stat-list > div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--ink-3); } .stat-list dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.list-rows { display: grid; }
.list-rows > * { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-rows > *:last-child { border-bottom: 0; }

@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr); } .dash-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 900px) { .console .kpis, .console .metrics, .console .usage-kpis, .console .report-summary, .console .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-3 { grid-template-columns: minmax(0, 1fr); } .console .kpi strong { font-size: 20px; } .console .panel { padding: 16px; } }

/* =====================================================================================
   CUSTOMER PORTAL (body.console.portal)
   ===================================================================================== */
.portal .topstrip { display: none; }
.portal .header { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.portal .header .brand img { height: 26px; width: auto; display: block; }
.portal .header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.portal .notification { font-size: 13px; color: var(--ink-3); }
.portal .user-menu { background: var(--surface) !important; color: var(--ink) !important; }
.portal .menu-btn, .portal .side-close { display: none; border: 0; background: transparent; width: 36px; height: 36px; border-radius: var(--radius-sm); align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.portal .menu-btn:hover, .portal .side-close:hover { background: var(--hover); }
.portal .layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.portal .sidebar { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 14px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.portal .side-head { display: none; }
.portal .side-account { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border: 0; background: none; margin: 0; }
.portal .side-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-wash); color: var(--accent-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.portal .side-who { display: grid; min-width: 0; line-height: 1.3; }
.portal .side-who strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal .side-who small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal .side-order { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 0 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; box-shadow: none; }
.portal .side-order:hover { background: var(--hover); }
.portal .side-order .ico { width: 16px; height: 16px; }
.portal .side-nav { display: flex; flex-direction: column; gap: 1px; }
.portal .sidebar-title { font-size: 11.5px; font-weight: 500; color: var(--ink-4); padding: 14px 10px 4px; text-transform: none; letter-spacing: 0; }
.portal .side-link { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; text-decoration: none !important; }
.portal .side-link:hover { background: var(--hover); color: var(--ink); }
.portal .side-link.active { background: var(--accent-wash); color: var(--accent-strong); font-weight: 600; }
.portal .side-link.active::before { display: none; }
.portal .side-link .ico { width: 17px; height: 17px; color: var(--ink-3); }
.portal .side-link.active .ico { color: var(--accent); }
.portal .side-count { margin-left: auto; height: 20px; min-width: 20px; justify-content: center; padding: 0 6px; font-size: 11.5px; }
.portal .side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.portal .side-scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .32); z-index: 45; }
.portal .main { padding: 28px 32px 64px; max-width: 1320px; width: 100%; }
.portal .crumb { font-size: 12.5px; color: var(--ink-3); margin: 0 0 4px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.portal .welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.portal .welcome p { color: var(--ink-3); margin-top: 4px; }
.portal .view { display: none; }
.portal .view.active { display: block; animation: hh-in .18s ease-out; }
@keyframes hh-in { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.portal .view > h1, .portal .view > .crumb + h1 { margin-bottom: 4px; }
.portal .view > h1 + p, .portal .view > h1 + .subtle { color: var(--ink-3); margin: 0 0 20px; }
.portal .grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.portal .grid > * { min-width: 0; }
.portal .spark { height: 36px; margin-top: 8px; display: block; }

/* attention */
.portal .attention-panel { background: var(--surface); color: var(--ink); }
.portal .attention-grid { display: grid; gap: 0; }
.portal .attention-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); background: none; border-radius: 0; color: var(--ink-2); }
.portal .attention-item:last-child { border-bottom: 0; padding-bottom: 0; }
.portal .attention-item:first-child { padding-top: 0; }
.portal .attention-item > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.portal .attention-item strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.portal .attention-item span { color: var(--ink-3); font-size: 13px; }
.portal .attention-item button { justify-self: start; margin-top: 6px; height: 30px; padding: 0 10px; font-size: 12.5px; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.portal .attention-item button:hover { background: var(--hover); }
.portal .attention-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-top: 6px; flex: none; box-shadow: none; }
.portal .attention-dot.danger { background: var(--bad); } .portal .attention-dot.warn, .portal .attention-dot.warning { background: #d97706; } .portal .attention-dot.info { background: var(--chart-2); }

/* services, progress, invoices */
.portal .service, .portal .progress-row, .portal .sender-status-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: none; box-shadow: none; }
.portal .service:last-child, .portal .progress-row:last-child, .portal .sender-status-row:last-child { border-bottom: 0; }
.portal .service-main, .portal .progress-row-main { display: flex; gap: 12px; min-width: 0; }
.portal .service-main > div, .portal .progress-row-main > div { display: grid; gap: 2px; min-width: 0; }
.portal .service strong, .portal .progress-row strong, .portal .sender-status-row strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.portal .service small, .portal .progress-row p, .portal .sender-status-row span { color: var(--ink-3); font-size: 12.5px; display: block; }
.portal .service > div:last-child { display: grid; gap: 4px; justify-items: end; flex: none; }
.portal .service-icon, .portal .progress-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--subtle); border: 1px solid var(--line); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.portal .service-comfort { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; display: block; }
.portal .service-actions { margin-top: 8px; display: flex; gap: 6px; }
.portal .service-actions .action { height: 30px; font-size: 12.5px; padding: 0 10px; }
.portal .progress-list { margin-top: 8px; }
.portal .payment-state { margin-top: 8px; padding: 10px 12px; background: var(--subtle); border-radius: var(--radius-sm); display: grid; gap: 2px; font-size: 13px; }
.portal .payment-state strong { color: var(--ink); font-weight: 600; }
.portal .billing-trust { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: baseline; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--subtle); margin: 0 0 16px; font-size: 13px; color: var(--ink-3); }
.portal .billing-trust strong { color: var(--ink); font-weight: 600; }
.portal .billing-guidance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.portal .billing-state { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); display: grid; gap: 4px; font-size: 13px; color: var(--ink-3); position: relative; padding-left: 28px; }
.portal .billing-state::before { content: ''; position: absolute; left: 14px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.portal .billing-state.good::before { background: var(--good); } .portal .billing-state.warn::before { background: #d97706; } .portal .billing-state.danger::before { background: var(--bad); }
.portal .billing-state strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.portal .sender-panel { margin-top: 0; }
.portal .sender-status-list { margin-top: 10px; }

/* quick actions */
.portal .quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.portal .quick button, .portal .quick-link { display: grid; gap: 2px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none !important; transition: border-color .12s, background .12s; }
.portal .quick button:hover, .portal .quick-link:hover { border-color: #f7c9a9; background: #fffaf6; }
.portal .quick b { color: var(--accent); font-weight: 600; font-size: 15px; line-height: 1; margin-bottom: 4px; }
.portal .quick .subtle { font-weight: 400; font-size: 12px; }

/* health */
.portal .metric-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal .metric-row strong { font-size: 26px; font-weight: 650; color: var(--ink); margin-right: 2px; }
.portal .metric-row > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }

/* domains */
.portal .domain-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.portal .domain-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.portal .domain-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; }
.portal .domain-tabs button { border: 0; background: none; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.portal .domain-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.portal .domain-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.portal .domain-stat, .portal .domain-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 2px; background: var(--surface); }
.portal .domain-stat span { color: var(--ink-3); font-size: 12px; }
.portal .domain-stat strong { color: var(--ink); font-size: 14px; font-weight: 600; text-transform: capitalize; }
.portal .domain-table { min-width: 720px; }
.portal .domain-name { font-weight: 600; color: var(--ink); }
.portal .domain-meta { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.portal .domain-ns-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.portal .domain-select { width: 16px; height: 16px; accent-color: var(--accent); }

/* developer, reports, usage, support */
.portal .api-guidance, .portal .support-guidance { background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.portal .api-key-result { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--subtle); }
.portal .api-key-result code { word-break: break-all; }
.portal .report-section { margin-top: 16px; }
.portal .report-section h3 { margin-bottom: 8px; }
.portal .report-table { min-width: 640px; }
.portal .alert-grid { display: grid; gap: 12px; }
.portal .alert-grid label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.portal .alert-grid input[type=number] { width: 120px; }
.portal .alert-channels { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.portal .support-chat-panel { display: grid; gap: 10px; }
.portal .mfa-msg { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.portal .sms-handoff { display: none; }

/* toast + QPay dialog */
.portal .toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; background: var(--ink); color: #fff; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; display: none; box-shadow: 0 10px 30px rgba(17, 24, 39, .18); max-width: 380px; }
.portal .toast.show { display: block; }
.portal .qpay-dialog { position: fixed; inset: 0; z-index: 80; background: rgba(17, 24, 39, .4); display: flex; align-items: center; justify-content: center; padding: 20px; }
.portal .qpay-dialog[hidden] { display: none; }
.portal .qpay-sheet { width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); padding: 22px; box-shadow: 0 24px 60px rgba(17, 24, 39, .2); }
.portal .qpay-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.portal .qpay-close { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1; }
.portal .qpay-qr-wrap { display: grid; place-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; background: #fff; }
.portal .qpay-status { font-size: 13px; color: var(--ink-2); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--subtle); }
.portal .qpay-instructions { font-size: 13px; color: var(--ink-3); }
.portal .qpay-raw { font-family: var(--mono); font-size: 11px; word-break: break-all; color: var(--ink-3); }

@media (max-width: 1000px) {
  .portal .layout { grid-template-columns: minmax(0, 1fr); }
  .portal .menu-btn, .portal .side-close { display: inline-flex; }
  .portal .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(288px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(17, 24, 39, .14); }
  body.nav-open .portal .sidebar, .portal.nav-open .sidebar, body.portal.nav-open .sidebar { transform: none; }
  .portal .side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
  .portal .side-head .side-brand img { height: 24px; width: auto; }
  .portal .main { padding: 20px 16px 56px; }
  .portal .grid, .portal .domain-grid, .portal .billing-guidance { grid-template-columns: minmax(0, 1fr); }
  .portal .domain-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .portal .notification { display: none; } .portal .quick { grid-template-columns: 1fr; } .portal .welcome h1 { font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .portal .sidebar, .portal .view.active { transition: none; animation: none; } }

/* =====================================================================================
   ADMIN (body.console.admin)
   ===================================================================================== */
.admin .top { display: none; }
.admin .shell { max-width: none; margin: 0; padding: 0; }
.admin .shell > .head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 40px 24px 0; max-width: 520px; margin: 0 auto; }
.admin .head .brand { font-weight: 700; font-size: 15px; color: var(--ink); }
.admin .head .brand span { color: var(--accent); }
.admin .head h1 { font-size: 22px; margin-top: 10px; }
.admin .head p { color: var(--ink-3); margin-top: 4px; }
.admin .auth { display: flex; gap: 8px; align-items: center; }
.admin #notice { max-width: 520px; margin: 16px auto; }
.admin .login-card { max-width: 520px; margin: 16px auto 60px; padding: 24px; }
.admin .login-card form { display: grid; gap: 10px; margin-top: 14px; }
.admin .login-card .input { width: 100%; }
.admin .adm-bar, .admin .adm-menu, .admin .adm-side-head, .admin .adm-scrim { display: none; }
body.admin.adm-in .shell > .head { display: none; }
body.admin.adm-in .shell { padding-left: var(--side-w); }
body.admin.adm-in .adm-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; height: var(--top-h); padding: 0 32px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.admin .adm-bar .grow { flex: 1; min-width: 0; }
.admin .adm-bar h1 { font-size: 16px; font-weight: 600; }
.admin .adm-bar .sub { display: none; }
.admin .adm-bar .live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--good); background: var(--good-wash); border-radius: 999px; height: 24px; padding: 0 10px; }
.admin .adm-bar .live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.admin .session-user { font-size: 13px; color: var(--ink-3); }
body.admin.adm-in #notice { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 360px; margin: 0; background: var(--ink); color: #fff; border: 0; box-shadow: 0 10px 30px rgba(17, 24, 39, .18); transition: opacity .3s; }
.admin #notice.fade { opacity: 0; pointer-events: none; }
body.admin.adm-in #nav { position: fixed !important; top: 0; left: 0; bottom: 0; width: var(--side-w); margin: 0 !important; display: flex !important; flex-direction: column; gap: 1px; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 12px; z-index: 40; }
body.admin.adm-in #nav.hidden { display: none !important; }
body.admin.adm-in .adm-side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 12px; }
.admin .adm-side-head img { height: 24px; width: auto; }
.admin .adm-side-head small { font-size: 10.5px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--subtle); }
.admin #nav .grp { font-size: 11.5px; font-weight: 500; color: var(--ink-4); padding: 14px 10px 4px; text-transform: none; letter-spacing: 0; }
.admin #nav button[data-tab] { display: flex !important; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; text-align: left; background: transparent !important; border: 0 !important; border-radius: var(--radius-sm); color: var(--ink-2) !important; font-size: 13.5px; font-weight: 500; cursor: pointer; box-shadow: none !important; }
.admin #nav button[data-tab]:hover { background: var(--hover) !important; color: var(--ink) !important; }
.admin #nav button[data-tab].active { background: var(--accent-wash) !important; color: var(--accent-strong) !important; font-weight: 600; }
.admin #nav button[data-tab] .ico { width: 17px; height: 17px; color: var(--ink-3); }
.admin #nav button[data-tab].active .ico { color: var(--accent); }
.admin #nav .badge { margin-left: auto; height: 20px; min-width: 20px; justify-content: center; padding: 0 6px; background: var(--accent-wash); color: var(--accent-strong); font-size: 11.5px; }
.admin #nav .badge[data-zero] { display: none; }
.admin #nav .adm-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.admin #nav .adm-foot a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 13.5px; }
.admin #nav .adm-foot a:hover { background: var(--hover); }
.admin #app { padding: 24px 32px 64px; max-width: 1400px; }
.admin .section { display: none; }
.admin .section.active { display: block; animation: hh-in .18s ease-out; }
.admin .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.admin .layout > .panel { margin: 0; min-width: 0; }
.admin .layout > .wide { grid-column: 1 / -1; }
.admin .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin .kpi { cursor: pointer; }
.admin .kpi > span:not(.ic) { order: 0; }
.admin .kpi strong { order: 1; }
.admin .report-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 14px 0; }
.admin .report-filters label { display: grid; gap: 4px; color: var(--ink-3); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.admin .security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.admin .security-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.admin .security-note { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.admin .security-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; font-size: 13px; color: var(--ink-3); }
.admin .security-status strong { color: var(--ink); }
.admin .security-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.admin .security-secret { font-family: var(--mono); font-size: 12px; word-break: break-all; background: var(--subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.admin .security-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.admin .chart:not(.hh-chart) { display: none; }
.admin .labels { display: none; }
.admin [class^="commercial-"] { font-size: 12.5px; }

@media (max-width: 1000px) {
  body.admin.adm-in .shell { padding-left: 0; }
  body.admin.adm-in .adm-bar { padding: 0 16px; }
  body.admin.adm-in .adm-menu { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); }
  body.admin.adm-in #nav { transform: translateX(-102%); transition: transform .2s ease; width: min(288px, 86vw); box-shadow: 0 10px 40px rgba(17, 24, 39, .14); z-index: 50; }
  body.admin.adm-nav-open #nav { transform: none; }
  .admin .adm-scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .32); z-index: 45; }
  body.admin.adm-nav-open .adm-scrim { display: block; }
  .admin #app { padding: 20px 16px 56px; }
  .admin .layout, .admin .security-grid { grid-template-columns: minmax(0, 1fr); }
  .admin .session-user { display: none; }
}

/* portal KPI extras */
.portal .kpi header em { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--hover); color: var(--ink-2); }
.portal .kpi header em.good { background: var(--good-wash); color: var(--good); }
.portal .kpi header em.warn { background: var(--warn-wash); color: var(--warn); }
.portal .kpi header em.danger, .portal .kpi header em.bad { background: var(--bad-wash); color: var(--bad); }
.portal .kpi-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 6px 0 0; }
.portal .kpi-stats div { display: grid; gap: 0; }
.portal .kpi-stats dt { font-size: 12px; color: var(--ink-3); }
.portal .kpi-stats dd { margin: 0; font-size: 18px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.portal .sidebar > *, .portal .side-nav > * { flex: none; }
.dash-col .panel { height: auto; }
.dash-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.dash-2 .panel { margin: 0; }
@media (max-width: 900px) { .dash-2 { grid-template-columns: minmax(0, 1fr); } }
.portal .kpi header em { white-space: nowrap; flex: none; }
.admin #pulseSignals { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.admin #pulseSignals .report-metric strong { font-size: 13.5px; font-weight: 500; line-height: 1.45; letter-spacing: 0; color: var(--ink-2); }
.admin #pulseSignals .report-metric span { text-transform: capitalize; }
.admin #pulseSignals .report-metric button { align-self: flex-start; margin-top: 8px; height: 30px; font-size: 12.5px; }
.admin #pulse { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.admin #attention p { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); }
.admin #attention p strong { color: var(--ink); font-weight: 600; }
.console .panel > h2, .console .panel > h3 { margin-bottom: 12px; }
@media (max-width: 900px) { .admin .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* filter bar + SMS log */
.console .filter-bar { display: grid; gap: 12px; }
.console .filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.console .filter-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-3); min-width: 0; }
.console .filter-grid input, .console .filter-grid select { width: 100%; }
.console .filter-actions { display: flex; gap: 8px; }
.console .filter-bar .seg { justify-self: start; }
.console .pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.console .nowrap { white-space: nowrap; }
.console .mono { font-family: var(--mono); font-size: 12.5px; }
.console th.num, .console td.num { text-align: right; font-variant-numeric: tabular-nums; }
.console table.sms-log td.msg { max-width: 340px; }
.console table.sms-log td.msg span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.console table.sms-log tr { cursor: pointer; }
.console table.sms-log tr.open td.msg span { white-space: normal; color: var(--ink); }
.console table.sms-log .badge { text-transform: capitalize; }
@media (max-width: 1100px) { .console .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .console .filter-actions { grid-column: 1 / -1; } }
@media (max-width: 640px) { .console .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.console .filter-grid input, .console .filter-grid select { min-width: 0; }
@media (max-width: 640px) {
  .console table.sms-log thead { display: none; }
  .console table.sms-log, .console table.sms-log tbody { display: block; }
  .console table.sms-log tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px; border-bottom: 1px solid var(--line-2); }
  .console table.sms-log td { display: block; padding: 0; border: 0; max-width: none; }
  .console table.sms-log td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 12px; color: var(--ink-3); }
  .console table.sms-log td:nth-child(7) { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .console table.sms-log td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--ink); font-weight: 500; }
  .console table.sms-log td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 12px; color: var(--ink-3); }
  .console table.sms-log td:nth-child(4) { grid-column: 1 / -1; grid-row: 4; margin-top: 4px; }
  .console table.sms-log td:nth-child(5) { display: none; }
  .console table.sms-log td:nth-child(6) { grid-column: 2; grid-row: 3; text-align: right; font-size: 12.5px; }
  .console .table-wrap:has(table.sms-log) { border-radius: var(--radius-sm); }
}

/* =====================================================================================
   SMS WORKSPACE (body.console.portal.sms-page) — reuses the portal shell
   ===================================================================================== */
.sms-page .layout.hidden { display: none !important; }
.sms-page .login-required { max-width: 480px; margin: 80px auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.sms-page .welcome .dashboard-period { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.sms-page .welcome .dashboard-period label { font-size: 12px; font-weight: 500; }
.sms-page .panel label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin: 12px 0 4px; }
.sms-page .panel label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.sms-page .panel input:not([type=checkbox]):not([type=radio]), .sms-page .panel select, .sms-page .panel textarea { width: 100%; }
.sms-page .panel form > .action, .sms-page .panel > .action, .sms-page #sendForm .action, .sms-page #campaignForm .action { margin-top: 14px; }
.sms-page .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; margin: 10px 0; }
.sms-page .row > .action { align-self: end; }
.sms-page .panel hr { border: 0; border-top: 1px solid var(--line-2); margin: 20px 0; }
.sms-page .panel h3 { margin-bottom: 4px; }
.sms-page .panel > p.muted, .sms-page .panel form p.muted { margin: 6px 0; }
.sms-page .metric { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: none; border-left: 0; border-right: 0; border-top: 0; }
.sms-page .metric span { color: var(--ink-3); font-size: 13px; }
.sms-page .metric strong { font-size: 18px; font-weight: 650; }
.sms-page #walletBalance { font-size: 28px; }
.sms-page .notice { margin: 12px 0; }
.sms-page .quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sms-page .quick-amounts .action { height: 30px; padding: 0 10px; font-size: 12.5px; }
.sms-page .key { font-family: var(--mono); font-size: 12.5px; word-break: break-all; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--subtle); margin: 10px 0; }
.sms-page .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 12px; }
.sms-page .tabs .action { height: 36px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--ink-3); font-weight: 500; margin-bottom: -1px; }
.sms-page .tabs .action.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.sms-page .table-scroll, .sms-page #historyTab, .sms-page #campaignsTab { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sms-page #campaignsTab.hidden { display: none; }
.sms-page .data-table { min-width: 680px; }
.sms-page .data-table td:nth-child(3) { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-page .invoice-list { display: grid; gap: 8px; margin: 4px 0 8px; }
.sms-page .invoice-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); flex-wrap: wrap; }
.sms-page .report-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sms-page .report-metric.success strong { color: var(--good); }
.sms-page .report-metric.danger strong { color: var(--bad); }
.sms-page .report-metric small { color: var(--ink-3); font-size: 12.5px; }
.sms-page .status:not(.badge) { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--hover); color: var(--ink-2); }
.sms-page #quote { font-weight: 500; color: var(--ink-2); }
.sms-page .header-right .action { height: 34px; }
.sms-page .toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; background: var(--ink); color: #fff; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; display: none; }
@media (max-width: 640px) { .sms-page .header-right .action.secondary { display: none; } }
.sms-page .view { scroll-margin-top: calc(var(--top-h) + 8px); }
.sms-page .dash { margin-bottom: 16px; }

/* Domains (registrar) + bank transfer */
.console .msg-good { color: var(--good, #1baf7a); }
.console .msg-bad { color: var(--bad, #c92a2a); }
.console .bank-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.console .bank-account { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 2px; }
.console .bank-account code { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: .02em; user-select: all; }
.console .bank-account small { color: var(--ink-3, #6b7788); }
.console .payment-state.warn strong { color: var(--warn); }
.console #dnsRows .input { width: 100%; min-width: 0; padding: 7px 9px; }
.console #dnsRows td { vertical-align: middle; }
.console .domain-actions select.input { width: auto; }

/* Invoice document (portal) */
.console .invoice-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 18px; }
.console .inv-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.console .inv-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.console .inv-head h3 { font-size: 20px; margin: 2px 0 2px; }
.console .inv-status { display: grid; justify-items: end; gap: 4px; text-align: right; }
.console .inv-status strong { font-size: 22px; letter-spacing: -.01em; }
.console .inv-status small { color: var(--ink-3); font-size: 12px; }
.console .inv-paid .inv-status strong { color: var(--good); }
.console .inv-overdue .inv-status strong { color: var(--bad); }
.console .inv-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.console .inv-parties > div { display: grid; gap: 2px; font-size: 13px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.console .inv-parties b { color: var(--ink); font-size: 14px; }
.console .inv-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.console .inv-parties dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.console .inv-parties dt { color: var(--ink-3); }
.console .inv-parties dd { margin: 0; text-align: right; color: var(--ink); overflow-wrap: anywhere; }
.console .inv-lines .num { text-align: right; white-space: nowrap; }
.console .inv-lines tfoot td { border-top: 1px solid var(--line); font-size: 15px; padding-top: 12px; }
.console .inv-payments summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.console .inv-payments ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.console .inv-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .console .inv-parties { grid-template-columns: 1fr; }
  .console .inv-status { justify-items: start; text-align: left; }
  .console .invoice-doc { padding: 16px; }
}
@media print {
  body.printing-invoice * { visibility: hidden !important; }
  body.printing-invoice #invoiceDetail, body.printing-invoice #invoiceDetail .invoice-doc, body.printing-invoice #invoiceDetail .invoice-doc * { visibility: visible !important; }
  body.printing-invoice #invoiceDetail { position: absolute; left: 0; top: 0; width: 100%; margin: 0 !important; }
  body.printing-invoice .inv-actions, body.printing-invoice .bank-transfer form { display: none !important; }
  body.printing-invoice .invoice-doc { border: 0; padding: 0; }
}
.console #bankForm { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.console #bankForm label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.console #bankForm input { width: 100%; }
.console #bankForm button, .console #bankForm #bankMsg { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 560px) {
  .console .inv-lines th:nth-child(2), .console .inv-lines td:nth-child(2), .console .inv-lines th:nth-child(3), .console .inv-lines td:nth-child(3) { display: none; }
  .console .inv-lines tfoot td[colspan] { display: table-cell !important; }
}
.console .inv-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 24px; margin-top: -6px; padding: 0 14px; font-size: 15px; color: var(--ink-2); }
.console .inv-total b { font-size: 17px; color: var(--ink); }
