/* Audit upload screen.
 *
 * Same visual language as the other capture screens: pale ground, white cards,
 * one accent, status carried by a pale ground with saturated ink rather than a
 * colour alone. Read at a desk on a laptop, not on a tablet at a pallet, so
 * the density is closer to the reports than to apps/capture. */

:root {
  --bg: #f9f9f7;
  --surface: #ffffff;
  --sunk: #f2f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --border: rgba(128, 128, 128, .3);
  --border-2: rgba(128, 128, 128, .18);
  --accent: #2a78d6;
  --pass-bg: #e8f4ec;
  --pass-ink: #1c6b3f;
  --fail-bg: #fbeaea;
  --fail-ink: #9b2c2c;
  --warn-bg: #fbf4de;
  --warn-ink: #7a5c00;
  --tap: 40px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --surface: #161616;
    --sunk: #1c1c1a;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --border: rgba(160, 160, 160, .28);
    --border-2: rgba(160, 160, 160, .16);
    --accent: #6aa8ec;
    --pass-bg: #10281a;
    --pass-ink: #6cc48d;
    --fail-bg: #2a1414;
    --fail-ink: #e79a9a;
    --warn-bg: #241f0e;
    --warn-ink: #ddc07a;
  }
}

* { box-sizing: border-box; }

/* `el.hidden = true` is ADVISORY unless this wins.
 *
 * The attribute's default is `display: none` at the lowest possible
 * precedence, so any rule setting `display` on the same element beats it --
 * and half the rules below use flex or grid. Without this the drop zone, the
 * error lines and the whole signed-out view would be set hidden and stay on
 * screen. Every stylesheet under apps/ carries this line and
 * tests/test_audit_screen.py fails on one that does not. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px 80px; }

h1 { font-size: 25px; letter-spacing: -.02em; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.lead { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }

/* ---- chrome ---- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 18px 0 26px; }
.topbar__spacer { flex: 1 1 auto; }
.homelink {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 6px 12px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
}
.homelink:hover { background: var(--sunk); color: var(--ink); }
.head { margin-bottom: 20px; }

footer {
  margin-top: 44px; padding-top: 18px;
  border-top: 1px solid var(--border-2);
  font-size: 13.5px; color: var(--muted);
}
footer b { color: var(--ink-2); }

/* ---- sign in ---- */
.signin { max-width: 380px; margin: 12vh auto; padding: 0 20px; }
.signin label {
  display: block; font-size: 13px; color: var(--ink-2);
  margin: 14px 0 4px; font-weight: 500;
}
.signin input {
  width: 100%; min-height: var(--tap); font: inherit;
  padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.signin .btn { margin-top: 18px; width: 100%; }

/* ---- buttons ---- */
.btn {
  min-height: var(--tap); font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 9px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn--quiet {
  background: var(--surface); color: var(--ink-2); border-color: var(--border);
}
.btn--quiet:hover { background: var(--sunk); color: var(--ink); filter: none; }
.linkbtn {
  background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13.5px;
  color: var(--muted); cursor: pointer; text-decoration: underline;
}
.btnrow { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }

/* ---- status lines ---- */
.flagline {
  background: var(--warn-bg); color: var(--warn-ink);
  border-radius: 9px; padding: 10px 13px; font-size: 14px;
}
.privacy {
  background: var(--sunk); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 11px 14px;
  font-size: 14px; color: var(--ink-2);
}
.privacy b { color: var(--ink); }

/* ---- drop zone ---- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 34px 20px; margin: 6px 0 14px;
  border: 1.5px dashed var(--border); border-radius: 14px;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; text-align: center;
}
.drop:hover, .drop:focus-visible, .drop--over {
  border-color: var(--accent); background: var(--sunk); outline: none;
}
.drop b { color: var(--ink); font-size: 15px; }
.drop span { font-size: 13.5px; }

/* ---- cards ---- */
.cards { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.card {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); overflow: hidden;
}
.card__head {
  padding: 12px 18px; border-bottom: 1px solid var(--border-2);
  background: var(--sunk);
}
.card__name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.card__body { padding: 16px 18px 18px; }
.card__body > p:last-of-type { margin-bottom: 0; }

.card--not-an-audit .card__head,
.card--checklist-changed .card__head,
.card--totals-disagree .card__head,
.card--no-auditor .card__head,
.card--refused .card__head { background: var(--fail-bg); }
.card--duplicate-file .card__head,
.card--duplicate-audit .card__head,
.card--needs-shift .card__head { background: var(--warn-bg); }
.card--captured .card__head { background: var(--pass-bg); }

/* ---- the record ---- */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 20px; margin: 0 0 16px;
}
.facts div { display: flex; flex-direction: column; gap: 1px; }
.facts dt {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.facts dd { margin: 0; font-size: 15px; }

.verdict {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  padding: 12px 15px; border-radius: 11px; margin-bottom: 12px;
}
.verdict--pass { background: var(--pass-bg); color: var(--pass-ink); }
.verdict--fail { background: var(--fail-bg); color: var(--fail-ink); }
.verdict__score { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.verdict__pct { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.verdict__word { font-size: 13.5px; font-weight: 600; margin-left: auto; }

.lost { list-style: none; margin: 4px 0 12px; padding: 0; }
.lost li {
  display: grid; grid-template-columns: 30px 1fr auto;
  gap: 2px 10px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--border-2);
}
.lost__n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.lost__t { font-size: 14.5px; }
.lost__s {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px;
  color: var(--fail-ink);
}
.lost__c {
  grid-column: 2 / -1; font-size: 13.5px; color: var(--ink-2);
  font-style: italic;
}

.copyout {
  margin-top: 12px; padding: 11px 13px; border-radius: 9px;
  background: var(--sunk); border: 1px solid var(--border-2);
  font-size: 12px; overflow-x: auto; white-space: pre; color: var(--ink-2);
}
