/* NEW SYSTEM preview desk. The environment colour is a burnt orange
   (#A33A00, white text): a different hue from the live desk's navy ink
   (#1F2A44), not a shade of it (test plan C1). */
:root {
  --env: #A33A00;
  --env-soft: #FFF1E6;
  --ink: #222;
  --muted: #5c5c5c;
  --rule: #e2d6cc;
  --neg: #9b1c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fffaf6;
  padding-top: 40px; /* the fixed banner */
}

#env-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  min-height: 40px; padding: 9px 16px;
  background: var(--env); color: #fff;
  font-size: 14px; letter-spacing: .01em;
  border-bottom: 3px solid #fff;
  box-shadow: 0 1px 0 var(--env);
}
#env-banner strong { font-weight: 700; }
#env-banner span:not(:empty)::before { content: " · "; }

#topbar {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--env-soft);
}
#topbar .brand { font-weight: 700; color: var(--env); }
#topnav { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; }
#topnav a { color: var(--env); text-decoration: none; }
#topnav a:hover, #topnav a:focus { text-decoration: underline; }
#whoami { color: var(--muted); }
button {
  font: inherit; padding: 6px 12px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--env); background: #fff; color: var(--env);
}
button.primary { background: var(--env); color: #fff; }
button:disabled { opacity: .6; cursor: progress; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
h1, h2, h3 { line-height: 1.2; }
h2 { margin: 6px 0 12px; }
h3 { margin: 22px 0 8px; }
a { color: #8a3000; }
.muted { color: var(--muted); }
.refusal { font-size: 16px; padding: 18px 0; }
.error { color: var(--neg); }

button.google { display: block; margin-top: 12px; padding: 8px 16px; border: 1px solid #747775; color: #1f1f1f; background: #fff; font-weight: 600; }
button.google:hover, button.google:focus { background: #f2f2f2; }
.signin-or { margin: 16px 0 0; }
form#signin-form { max-width: 360px; display: grid; gap: 10px; margin-top: 12px; }
form#signin-form label { display: grid; gap: 4px; }
form#signin-form input { font: inherit; padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; }

.door-card { border: 1px solid var(--rule); border-left: 5px solid var(--env); background: #fff; padding: 14px 16px; max-width: 640px; }
.door-card a { font-size: 17px; font-weight: 600; }

table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--env-soft); font-weight: 600; }
td.amt, th.amt, .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--neg); }

.flag { display: inline-block; font-size: 12px; padding: 1px 6px; margin: 0 4px 2px 0; border-radius: 3px; border: 1px solid #bbb; color: #444; background: #f6f6f6; }
.flag.no-email { border-color: #b98a00; background: #fff6d6; color: #5c4400; }
.badge-net-negative { display: inline-block; padding: 3px 9px; border-radius: 3px; background: var(--neg); color: #fff; font-weight: 600; font-size: 13px; }

.output-stamp { display: inline-block; margin: 4px 0 10px; padding: 2px 8px; border: 2px solid var(--env); color: var(--env); font-weight: 700; letter-spacing: .02em; }
#pay-card { max-width: 720px; }
#pay-card table { margin-top: 8px; }
#pay-card tr.group-total th, #pay-card tr.group-total td { background: var(--env-soft); font-weight: 600; }
#pay-card tr.component td:first-child { padding-left: 22px; }
#pay-card tr.subtotal th, #pay-card tr.subtotal td { border-top: 2px solid #999; font-weight: 700; font-size: 15px; }
.combined-line { font-weight: 600; }
#allocations { max-width: 720px; }
.allocation { border: 1px solid var(--rule); background: #fff; padding: 8px 10px; margin: 6px 0; display: flex; justify-content: space-between; gap: 12px; }
.couple { border: 1px solid var(--rule); background: #fff; padding: 10px 14px; margin: 10px 0; max-width: 820px; }
.actions { margin: 14px 0; display: flex; gap: 10px; flex-wrap: wrap; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid var(--rule); }

@media print {
  body { padding-top: 0; background: #fff; }
  #env-banner { position: static; display: block; border: 2px solid var(--env); color: var(--env); background: #fff; }
  #topbar, #topnav, .actions, button { display: none !important; }
  main { padding: 8px 0; max-width: none; }
}
