/* Requestry: professional skin for a government compliance tool (Justin's mockup,
   2026-11-22). Navy and gold, light surfaces, system fonts (no font downloads from a
   sensitive app). Every status and deadline carries a text label, not color alone. */

:root {
  --navy: #10213F;
  --navy-hover: #1B3360;
  --gold: #C99A2E;
  --gold-bright: #D9B04A;
  --page: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --border: #E3E8EF;
  --border-strong: #D4DBE4;
  --text: #1A2433;
  --text-muted: #5A6676;
  --text-faint: #6F7A8A;
  --link: #1E4FA3;
  --focus: #2F6FDB;
  --blue-bg: #E8F0FB;   --blue-fg: #1E4FA3;
  --amber-bg: #FBF0D5;  --amber-fg: #8A5A06;  --amber-line: #E7CE92;
  --violet-bg: #F0E9FB; --violet-fg: #6B35C0;
  --slate-bg: #EDF1F6;  --slate-fg: #465568;  --slate-line: #CBD4DF;
  --green-bg: #E6F4EA;  --green-fg: #1C7A3D;  --green-line: #B5DDC0;
  --red-bg: #FBE9E7;    --red-fg: #B42318;    --red-line: #F2C2BC;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 33, 63, .06), 0 4px 16px rgba(16, 33, 63, .06);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  padding: 0;
  display: flex; flex-direction: column;
  font-variant-numeric: tabular-nums;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }

/* ===== Top bar ===== */
.topbar { background: var(--navy); color: #fff; padding: 0 max(16px, env(safe-area-inset-left, 0px)); }
.topbar-inner { max-width: 1240px; margin: 0 auto; min-height: 58px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 4px 26px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px;
  letter-spacing: .2px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 16px; height: 16px; border-radius: 4px; background: var(--gold-bright); }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; font-size: 13.5px; }
.nav-links a { color: rgba(255, 255, 255, .82); text-decoration: none; padding: 19px 0 17px;
  border-bottom: 2px solid transparent; }
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; border-bottom-color: var(--gold-bright); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13.5px; }
.nav-right a, .nav-right .linkbutton { color: rgba(255, 255, 255, .82); text-decoration: none; }
.nav-right a:hover, .nav-right .linkbutton:hover { color: #fff; }
.nav-right form { margin: 0; }
.body-pick { display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18); padding: 6px 11px; border-radius: 7px; color: #fff;
  font-weight: 600; font-size: 13px; }
.nav-right a.body-pick { color: #fff; }
.body-pick .chev { opacity: .7; font-size: 11px; }

main, .messages { max-width: 1240px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)); }
.messages { padding-top: 16px; }
main { padding-top: 18px; flex: 1 0 auto; width: 100%; }
.messages { width: 100%; }

/* ===== Panels (template name "window" kept) ===== */
.window { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); margin: 0 auto 22px; overflow: hidden; }
.window.narrow { max-width: 460px; margin-top: 32px; }
.titlebar { padding: 16px 22px; border-bottom: 1px solid var(--border); }
.titlebar h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .1px; }
.window-body { padding: 18px 22px 22px; }
.window-body > :first-child { margin-top: 0; }
.window-body > .table-wrap:last-child { margin-bottom: -22px; }

.pixel-label { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-faint); }
.data { font-size: 1rem; font-weight: 600; color: var(--text); }

/* ===== Forms ===== */
label { display: block; margin: 12px 0 4px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; padding: 8px 11px; background: var(--surface); color: var(--text);
  font: 14px/1.4 var(--font-ui); border: 1px solid var(--border-strong); border-radius: 8px;
}
input[type=date], input[type=datetime-local], input[type=time] { width: auto; }
textarea { min-height: 6em; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.topbar a:focus-visible, .topbar button:focus-visible { outline-color: var(--gold-bright); }
button, .button {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; padding: 9px 16px;
  background: var(--navy); color: #fff; font: 600 13.5px/1.2 var(--font-ui);
  border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--navy-hover); color: #fff; }
.linkbutton { background: none; border: 0; color: var(--link); padding: 0; margin: 0; font: inherit;
  cursor: pointer; text-decoration: underline; border-radius: 0; }
.linkbutton:hover { background: none; color: var(--navy); }

.errorlist { color: var(--red-fg); list-style: none; padding: 0; margin: 4px 0; font-size: 13px; }

/* ===== Status pills ===== */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--slate-bg); color: var(--slate-fg); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.cyan { background: var(--blue-bg); color: var(--blue-fg); }
.pill.lime { background: var(--green-bg); color: var(--green-fg); }
.pill.amber { background: var(--amber-bg); color: var(--amber-fg); }
.pill.status-received, .pill.status-under_review { background: var(--blue-bg); color: var(--blue-fg); }
.pill.status-cost_estimate, .pill.status-awaiting_requestor { background: var(--violet-bg); color: var(--violet-fg); }
.pill.status-ten_day_sent, .pill.status-release_due { background: var(--amber-bg); color: var(--amber-fg); }
.pill.status-ag_referral, .pill.status-referred { background: var(--slate-bg); color: var(--slate-fg); }
.pill.status-released, .pill.status-released_in_part, .pill.status-redacted_release { background: var(--green-bg); color: var(--green-fg); }
.pill.status-withheld { background: var(--red-bg); color: var(--red-fg); }
.pill.status-closed { background: var(--slate-bg); color: var(--slate-fg); }
/* Flags beside a reference: small uppercase outlined chips */
.pill.pill-dup, .pill.pill-spam, .pill.pill-suspect, .pill.pill-check { font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 5px; border: 1px solid; margin-top: 6px; }
.pill.pill-dup::before, .pill.pill-spam::before, .pill.pill-suspect::before, .pill.pill-check::before { width: 6px; height: 6px; }
.pill.pill-dup { color: var(--slate-fg); border-color: var(--slate-line); background: #F1F4F8; }
.pill.pill-check { color: var(--amber-fg); border-color: var(--amber-line); background: #FCF6E7; }
.pill.pill-spam { color: var(--amber-fg); border-color: var(--amber-line); background: #FCF6E7; }
.pill.pill-suspect { color: var(--red-fg); border-color: var(--red-line); background: var(--red-bg); }

/* ===== Alerts ===== */
.alert { display: block; padding: 12px 15px; margin: 0 0 14px; border: 1px solid var(--border);
  border-left: 4px solid var(--slate-fg); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; }
.alert p { margin: 0 0 8px; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: 6px 0 8px; padding-left: 20px; }
.alert strong { color: inherit; }
.alert.critical { border-color: var(--red-line); border-left-color: var(--red-fg); background: var(--red-bg); color: #6E1A12; }
.alert.success { border-color: var(--green-line); border-left-color: var(--green-fg); background: var(--green-bg); color: #14532B; }
.alert.info { border-color: #C9D9F2; border-left-color: var(--blue-fg); background: #F2F6FC; color: #1F3558; }
.alert.warn, .alert.due-today, .alert.spam-review, .alert.dup-review { border-color: #F0DFB6; border-left-color: var(--gold);
  background: #FFF9EC; color: #5C4A1E; }
.alert.error { border-color: var(--red-line); border-left-color: var(--red-fg); background: var(--red-bg); color: #6E1A12; }
.alert.spam-review.suspect { border-left-color: var(--red-fg); }
.alert a { color: var(--navy); font-weight: 600; }
.alert button, .alert .button { margin-top: 6px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin: 0 -22px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-faint);
  background: var(--surface-2); padding-top: 10px; padding-bottom: 10px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.ref a { font-weight: 700; color: var(--navy); text-decoration: none; }
td.ref a:hover { text-decoration: underline; }
td.ref .pia { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
td.ref .pill { display: inline-flex; }
td.req-summary { max-width: 34ch; }
td.recd { white-space: nowrap; color: var(--text-muted); }
td.recd .time { display: block; font-size: 12px; color: var(--text-faint); }

dl.settings { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 8px 18px; margin: 0; }
dl.settings dt { color: var(--text-muted); font-size: 13px; }
dl.settings dd { margin: 0; font-weight: 500; }

.qr { background: #fff; padding: 8px; width: 216px; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.secret { font: 13px var(--font-mono); color: var(--text); background: var(--page); padding: 4px 6px; border-radius: 4px; word-break: break-all; }

.statusbar { margin-top: 32px; display: flex; justify-content: space-between; gap: 12px;
  padding: 6px max(16px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12px; }

/* ===== Request workflow ===== */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .button, .toolbar button { margin-top: 0; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline label { margin: 0; }
form.inline select, form.inline input { width: auto; }
form.inline button { margin-top: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 16px; padding: 10px 16px 16px; }
legend { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--navy); padding: 0 6px; }
ul#id_receipt_type, ul#id_receipt_type li { list-style: none; padding: 0; margin: 4px 0; }
ul#id_receipt_type label { display: inline; font-weight: 400; color: var(--text); }
.help { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }
.field.checkbox { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; }
.field.checkbox label { margin: 0; font-weight: 400; color: var(--text); }
.request-text { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; white-space: normal; }
.note { color: var(--text-muted); font-size: 13px; }
details summary { cursor: pointer; color: var(--navy); margin-top: 12px; font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Next-deadline box (class names kept from the old LED display) ===== */
.led-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin-bottom: 14px; padding: 14px 18px;
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--navy); border-radius: var(--radius); }
.led-caption { width: 100%; text-transform: none; letter-spacing: .2px; font-size: 12px; }
.led { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--navy); }
.led.led-today { color: var(--amber-fg); }
.led.led-error { color: var(--red-fg); font-size: 1.5rem; }
.led.led-idle { color: var(--text-faint); font-size: 1.5rem; }
.led-sub { display: flex; flex-direction: column; gap: 2px; }
.led-count { font-weight: 700; color: var(--text); }
.led-mini { font-weight: 700; color: var(--text); }
.led-mini.led-today { color: var(--amber-fg); }
.crit-text { color: var(--red-fg); font-weight: 700; }
.cite { color: var(--text-muted); font-size: 12.5px; }
.reminder-line { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
table.deadlines tr.dl-passed td { color: var(--text-muted); }
table.deadlines tr.dl-error td { background: var(--red-bg); }
table.deadlines tr.dl-today td { background: #FFF9EC; }
tr.row-closed td { opacity: .55; }
tr.row-closed:hover td, tr.row-closed:focus-within td { opacity: .9; }
.requestor-link { color: var(--text); font-weight: 600; text-decoration: none; }
.requestor-link:hover { color: var(--link); text-decoration: underline; }
.filter-chip { margin: 0; }
.dup-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dup-actions form { margin: 0; }
.dup-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.dup-compare section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.deadline-alert { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.deadline-alert .ack { margin-left: auto; }

/* Next-deadlines strip on the request log (static) */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.strip-label { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-faint); }
.dchip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; box-shadow: var(--shadow); }
.dchip .ref { font-weight: 700; color: var(--navy); }
.dchip .when { color: var(--text-muted); }
.dchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-fg); }
.dchip .dot-soon { background: var(--amber-fg); }

@media (max-width: 600px) {
  dl.settings { grid-template-columns: 1fr; gap: 2px 0; }
  dl.settings dd { margin-bottom: 8px; }
  .nav-links a { padding: 10px 0 8px; }
  .nav-right { margin-left: 0; padding-bottom: 10px; }
  .window-body { padding: 16px; }
  .table-wrap { margin: 0 -16px; }
  .titlebar { padding: 14px 16px; }
  .strip .dchip:nth-of-type(n+4) { display: none; }
}

/* ===== Letters ===== */
.letter-text { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px;
  white-space: pre-wrap; font: 14px/1.6 Georgia, "Times New Roman", serif; color: var(--text); margin: 0 0 12px; }

/* ===== AI drafting ===== */
.ai-links { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; list-style: none; }
.checklist ul { list-style: none; padding: 0; margin: 0; columns: 2 22em; }
.checklist li { break-inside: avoid; margin: 3px 0; }
.checklist label { display: inline; margin: 0; color: var(--text); font-weight: 400; }
ol.suggestions li { margin-bottom: 8px; }

/* ===== Operational views ===== */
.day-head { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--navy); margin: 18px 0 6px; }
.day-head.today { color: var(--amber-fg); }
.counts { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.count { text-decoration: none; color: var(--text); }
.count:hover .led-mini { color: var(--link); }
form.range input[type=date] { width: auto; }

/* ===== Tags, weekly report ===== */
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tag-list > li { background: var(--page); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.tag-list form, .tag-list button { margin: 0; }
.tag-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: var(--text-faint); text-transform: uppercase; }
.weekly-text { width: 100%; font: 13px/1.5 var(--font-mono); background: var(--surface-2); color: var(--text); }
