/* ═══════════════════════════════════════════════════════════════════════════
   page.css — the shared kit for standalone report pages (29/10/2026)
   Used by ok-to-pay.html, anpr-daily.html, ledger.html and viqi.html, which each
   carried their own copy of these basics. Link it right BEFORE /css/theme.css
   (theme.css stays last). Colours are theme tokens only — html.vq-tokens and
   theme.css define them for light and dark.

   Not repeated here because theme.css / fonts.css already do it:
     • the font family (IBM Plex Sans) and Plex Mono for td.r/th.r/.num/.money/.ref/.kpi-v
     • td.n / th.n right-aligned in Plex Mono
     • th type (11px, 600, upper case), KPI tile radius/padding and label/figure/sub type
     • .toast look, .intro hero band, :focus-visible ring, dark-theme buttons
   Pages keep only their own layout rules in their <style> block.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
body { color: var(--text); min-height: 100vh; font-size: 14px; }

/* Top bar: Home, page title, spacer, who is signed in, page actions */
.topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 20px; min-height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.topbar-title { font-size: 16px; font-weight: 700; margin: 0; }
.topbar .muted, .topbar-sub { font-size: 12px; color: var(--text-muted); }
.spacer, .sp { flex: 1; }
@media (max-width: 480px) { #who, .topbar-sub { display: none; } .topbar { padding: 8px 12px; } }

/* Content column — .content for reports, .wrap for the wide lists */
.content, .wrap { margin: 0 auto; padding: 20px 16px 60px; max-width: 1200px; }
.wrap { max-width: 1700px; }
.intro { margin-bottom: 16px; }

/* Buttons: one secondary look, one primary (teal) per screen */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; line-height: 1.3;
  text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:not(.btn-primary):not(.primary):hover { background: var(--surface2); }
.btn-primary, .btn.primary { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--on-accent) !important; }
.btn-primary:hover, .btn.primary:hover { background: var(--primary-hover, var(--accent)) !important; border-color: var(--primary-hover, var(--accent)) !important; }
.btn.sm, .btn-sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Fields: zero specificity so a page can still size its own */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 10px; }

/* Tool bar above a table: filters, search, export */
.bar, .filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* KPI tiles (theme.css sets the type, radius and padding) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } }

/* Cards; .tablecard holds a table edge to edge and scrolls sideways on small screens */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.tablecard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: var(--surface2); color: var(--text-muted); white-space: nowrap; position: sticky; top: 0; z-index: 2; }
td.r, th.r { text-align: right; }
table.dense th { padding: 7px 8px; }
table.dense td { padding: 5px 8px; }
.empty { padding: 28px; text-align: center; color: var(--text-muted); }
.muted { color: var(--text-muted); }

/* Toasts (utils.js toast() fills it; theme.css styles each .toast) */
#toast-container { position: fixed; right: 16px; bottom: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 32px)); }
