/* VIA PSA stylesheet.

   The palette above is the family's, kept byte-for-byte so PSA looks like
   Scout, Racked and Tickets. Everything BELOW it is PSA's own.

   This file deliberately does NOT carry Racked's component CSS. It did at
   first -- the whole stylesheet was copied for the palette -- and the generic
   names collided: Racked defines `.grid { display: grid }` for a photo grid,
   which turned every table on this page into a grid container and flattened
   the rows, and `.status { display: inline-flex }` fought the run status line.
   Copying a stylesheet for four colour variables is how you inherit a hundred
   rules you never look at. Take the palette; write the components.
*/
:root {
  /* VIA family palette — navy / signal blue / amber on light (matches VIA Scout) */
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel2: #f7fafc;
  --line: #e2e8f0;
  --text: #1a202c;
  --navy: #14304a;
  --muted: #718096;
  --accent: #2b6cb0;
  --accent2: #2b6cb0;
  --amber: #f5a623;
  --ok: #2f855a;
  --warn: #c05621;
  --err: #c53030;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
input, select, button { font-family: inherit; }
input[type=text], input[type=email], input[type=password], select {
  border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
  color: var(--text);
}
a { color: var(--accent); }

/* ---- VIA PSA app shell ------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: 10px 16px;
}
.topbar .brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.topbar .brand-via { color: var(--amber); }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .muted { color: #cbd5e0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; margin: 16px 0;
}
.panel h3 { margin: 0 0 6px; font-size: 15px; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 8px 14px; font-size: 14px; cursor: pointer;
}
.btn-sm {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 5px; padding: 3px 8px; font-size: 12px; cursor: pointer;
  text-decoration: none;
}
.btn-link { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 14px; }
.topbar .btn-link { color: #fff; text-decoration: underline; }
.cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; min-width: 120px;
}
/* The phantom-bill count is the commercial answer the audit exists to produce,
   so it is the one number given emphasis. */
.card-accent { border-color: var(--amber); border-width: 2px; }
.card-n { font-size: 24px; font-weight: 700; color: var(--navy); }
.card-l { font-size: 12px; color: var(--muted); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 7px 9px; text-align: left; }
table.grid th { background: var(--panel2); font-weight: 600; color: var(--navy); }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid td.ok { color: var(--ok); font-weight: 700; }
table.grid td.bad { color: var(--err); font-weight: 700; }
.status { font-size: 13px; color: var(--muted); min-height: 18px; margin-top: 6px; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.bad { color: var(--err); }
label.inline { font-size: 13px; margin: 0 10px; }
#new-audit-dialog { border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
#new-audit-dialog label { display: block; margin: 8px 0; font-size: 13px; }
#new-audit-dialog input { display: block; width: 320px; padding: 6px; margin-top: 3px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---- run controls ------------------------------------------------------ */
.run-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 10px 0; }
.run-controls label { font-size: 12px; color: var(--muted); display: block; }
.run-controls select { display: block; margin-top: 3px; padding: 6px; font-size: 13px; }
.progress {
  height: 10px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 5px; overflow: hidden; margin: 10px 0 6px;
}
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
#run-history { font-size: 12px; margin-top: 8px; }
#run-estimate { font-size: 13px; margin-top: 4px; }
