:root {
  --cvt-deep-blue: #05599E;
  --cvt-bright-blue: #0294D9;
  --cvt-yellow: #FCF002;
  --cvt-gray: #8C969A;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #1b1f24;
  --ink-soft: #41474f;
  --muted: #767d87;
  --line: #e6e2da;
  --line-strong: #d4cfc4;
  --accent: var(--cvt-deep-blue);
  --accent-hover: #034477;
  --accent-soft: #E6F4FC;
  --gold: #B9A900;          /* logo yellow accent */
  --danger: #9b2c2c;
  --danger-soft: #f7ecec;
  --ok: #2f6b4f;
  --ok-soft: #e8f1ec;
  --shadow: 0 1px 2px rgba(27, 31, 36, 0.04), 0 6px 20px rgba(27, 31, 36, 0.06);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .bar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand-app {
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--ink);
}
/* Small secondary company mark, hard-capped so it can never overflow the bar. */
.brand-logo-img {
  display: block; height: 18px; max-height: 18px; width: auto; max-width: 150px;
}
.brand .mark {
  width: 22px; height: 22px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  display: inline-block;
  position: relative;
}
.brand .mark::after {
  content: "";
  position: absolute; left: 3px; right: 3px; top: 7px;
  height: 2px; background: var(--accent);
  box-shadow: 0 4px 0 var(--accent);
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--ink-soft);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
}
.nav a:hover { background: #f1efe9; text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.usermenu { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.usermenu .who { color: var(--muted); }
.usermenu .who strong { color: var(--ink-soft); font-weight: 600; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }

/* ---- Page head ---- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0;
}
.page-head .sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.head-actions { display: flex; gap: 10px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft);
  cursor: pointer; transition: background .12s, border-color .12s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f3f1eb; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: #e3c9c9; background: var(--danger-soft); }
.btn-danger:hover { background: #f1dada; }
.btn-danger-outline { color: var(--danger); border: 1px solid var(--line); background: transparent; }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: #e3c9c9; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.card .card-pad { padding: 22px 24px; }
.card + .card { margin-top: 20px; }

/* ---- Toolbar (search / filters) ---- */
.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .search { flex: 1; min-width: 220px; position: relative; }
.toolbar input[type="search"], .toolbar select { height: 40px; }

/* ---- Forms ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }

/* ZIP field that supports city/state autofill (see zip-autofill.js): pill
   shape + a soft blue glow signal that this field does something extra.
   While a lookup is actually in flight, the glow pulse is replaced by a
   sweep animation instead — the two never animate at the same time. */
input[data-zip-autofill] {
  border-radius: 999px;
  border-color: var(--cvt-bright-blue);
  box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.14);
  animation: zip-glow-pulse 2.4s ease-in-out infinite;
}
input[data-zip-autofill]:focus {
  outline: 2px solid var(--cvt-bright-blue); outline-offset: -1px; border-color: var(--cvt-bright-blue);
}
input[data-zip-autofill][data-zip-loading] {
  animation: zip-loading-sweep 1.1s linear infinite;
  background-image: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  background-size: 200% 100%;
  box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.30);
}
@keyframes zip-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.14); }
  50%      { box-shadow: 0 0 8px 3px rgba(2, 148, 217, 0.38); }
}
@keyframes zip-loading-sweep {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  input[data-zip-autofill] { animation: none; box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.22); }
  input[data-zip-autofill][data-zip-loading] { animation: none; background-image: none; }
}

/* Street address field with Geocodio verification (see address-autofill.js).
   Same glow signal as the ZIP field, but without the pill shape — a wide
   text field looks odd fully rounded the way a short ZIP box doesn't. */
input[data-address-autofill] {
  border-color: var(--cvt-bright-blue);
  box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.14);
  animation: zip-glow-pulse 2.4s ease-in-out infinite;
}
input[data-address-autofill]:focus {
  outline: 2px solid var(--cvt-bright-blue); outline-offset: -1px; border-color: var(--cvt-bright-blue);
}
input[data-address-autofill][data-address-loading] {
  animation: zip-loading-sweep 1.1s linear infinite;
  background-image: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  background-size: 200% 100%;
  box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.30);
}
@media (prefers-reduced-motion: reduce) {
  input[data-address-autofill] { animation: none; box-shadow: 0 0 0 3px rgba(2, 148, 217, 0.22); }
  input[data-address-autofill][data-address-loading] { animation: none; background-image: none; }
}
input[type="text"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; font: inherit; font-size: 15px;
  padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }
.mono-input { font-family: var(--mono); }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #e3c9c9; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #c9e0d3; }

/* ---- Check list ---- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: none; }
.checklist .num {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  width: 64px; flex-shrink: 0;
}
.checklist .body { flex: 1; min-width: 0; }
.checklist .payee { font-weight: 600; color: var(--ink); }
.checklist .payee a { color: var(--ink); }
.checklist .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.checklist .amount {
  font-family: var(--mono); font-weight: 600; font-size: 15px;
  font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}
.checklist .right { display: flex; align-items: center; gap: 14px; }

/* ---- Status pills ---- */
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 4px;
}
.pill-draft { background: #f0ede5; color: #7a6f56; }
.pill-printed { background: var(--accent-soft); color: var(--accent); }
.pill-void { background: var(--danger-soft); color: var(--danger); }

/* ---- Tables (reports) ---- */
table.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ledger th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line-strong);
}
table.ledger td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.ledger td.num, table.ledger td.amt, table.ledger th.amt { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.ledger td.amt, table.ledger th.amt { text-align: right; }
table.ledger tfoot td, table.ledger tr.total td {
  font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: none;
}

/* ---- Pagination ---- */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: var(--muted); font-size: 13px; }
.pager .pages { display: flex; gap: 6px; }

/* ---- Reports controls ---- */
.report-controls { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.report-controls .or { color: var(--muted); font-weight: 600; font-size: 12px; padding: 0 4px 10px; }
.report-controls .field { margin-bottom: 0; }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty h3 { color: var(--ink-soft); margin: 0 0 6px; font-size: 18px; }

/* ---- Login ---- */
.login-page { background: linear-gradient(135deg, var(--cvt-deep-blue), var(--cvt-bright-blue)); }
.login-wrap { min-height: 100vh; display: flex; }

/* Brand panel */
.login-brand {
  flex: 1 1 46%;
  max-width: 560px;
  background: radial-gradient(circle at 85% 12%, rgba(252, 240, 2, 0.32), transparent 26%), linear-gradient(160deg, var(--cvt-bright-blue) 0%, var(--cvt-deep-blue) 58%, #033E70 100%);
  color: #eaf2f4;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 56px 40px;
  position: relative; overflow: hidden;
}
/* faint ledger-line motif along the bottom */
.login-brand::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44%;
  background-image: repeating-linear-gradient(
    to bottom, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 34px);
  pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 1; max-width: 400px; }
.logo-plate {
  background: #fff; border-radius: 18px; padding: 18px 24px; border: 1px solid rgba(140, 150, 154, 0.28);
  display: inline-flex; align-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18); margin-bottom: 38px;
}
.brand-logo { display: block; height: auto; width: min(320px, 100%); max-width: 320px; }
.brand-tagline {
  font-size: 30px; line-height: 1.18; font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 14px; color: #fff;
}
.brand-sub {
  font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, 0.82); margin: 0;
}
.brand-foot {
  position: relative; z-index: 1; margin-top: 48px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62); display: flex; align-items: center; gap: 9px;
}
.brand-foot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cvt-yellow); box-shadow: 0 0 0 3px rgba(252, 240, 2, 0.22);
}

/* Form side */
.login-form-side {
  flex: 1 1 54%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.login-card { width: 100%; max-width: 400px; background: rgba(255, 255, 255, 0.98); border: 1px solid rgba(140, 150, 154, 0.22); border-radius: 18px; padding: 30px; box-shadow: 0 24px 60px rgba(5, 89, 158, 0.18); }
.login-card h1 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--cvt-deep-blue);
}
.login-lede { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.login-form .field { margin-bottom: 18px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login-footnote {
  margin-top: 24px; color: var(--muted); font-size: 13px; text-align: center;
}

/* Password field with show/hide toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--accent);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 9px; border-radius: 5px;
}
.pw-toggle:hover { background: var(--accent-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hidden { display: none; }

@media (max-width: 880px) {
  .login-wrap { flex-direction: column; }
  .login-brand {
    flex: none; max-width: none; padding: 34px 24px 30px;
    align-items: center; text-align: center;
  }
  .login-brand::after { display: none; }
  .login-brand-inner { max-width: none; }
  .logo-plate { margin-bottom: 22px; }
  .brand-tagline { font-size: 22px; }
  .brand-sub, .brand-foot { display: none; }
  .brand-logo { width: min(260px, 100%); }
  .login-form-side { padding: 32px 20px 56px; }
}

/* ---- Utility ---- */
.muted { color: var(--muted); }
.right { text-align: right; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
.inline-form { display: inline; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

@media (max-width: 640px) {
  .site-header .bar { gap: 12px; padding: 0 14px; }
  .nav a { padding: 7px 8px; }
  .usermenu .who { display: none; }
  .brand-app { font-size: 15px; }
  .brand-logo-img { height: 16px; max-height: 16px; }
  .wrap { padding: 22px 14px 60px; }
  .checklist li { flex-wrap: wrap; }
  .checklist .num { width: auto; }
}

/* ---- Modals ---- */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 26, 31, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 80px 16px 32px; overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface); width: 100%; max-width: 560px;
  max-height: calc(100vh - 112px);
  display: flex; flex-direction: column;
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-x {
  background: transparent; border: 0; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal-x:hover { background: #f1efe9; color: var(--ink); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfaf7;
  border-radius: 0 0 12px 12px;
  flex: 0 0 auto;
}
/* When a <form> wraps modal-head/modal-body/modal-foot (needed for a native
   POST with many fields, e.g. the print-settings modal), the form itself
   must join the flex column and be allowed to shrink — otherwise it sits at
   its natural content height with nothing to size .modal-body's
   overflow-y:auto against, so the dialog just grows past the viewport
   instead of scrolling. */
.modal-card > form {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}

/* ---- Vendor autocomplete ---- */
.payee-field { position: relative; }
.vendor-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden; max-height: 280px; overflow-y: auto;
}
.vendor-results[hidden] { display: none; }
.vendor-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 14px; cursor: pointer; font: inherit;
}
.vendor-item:last-child { border-bottom: none; }
.vendor-item:hover { background: var(--accent-soft); }
.vendor-item-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.vendor-item-meta { font-size: 12px; color: var(--muted); }
.vendor-add { color: var(--accent); font-weight: 600; background: #f7fafb; }
.vendor-add:hover { background: var(--accent-soft); }

/* Linked-vendor chip on the check form */
.vendor-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  font-size: 12px; color: var(--ok); background: var(--ok-soft);
  border: 1px solid #c9e0d3; padding: 4px 10px; border-radius: 999px;
}
.vendor-chip[hidden] { display: none; }

/* ---- Audit log ---- */
.audit-action {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px; background: #f0ede5; color: #6a6150;
  white-space: nowrap;
}
.audit-action.is-fail { background: var(--danger-soft); color: var(--danger); }
.audit-action.is-auth { background: var(--accent-soft); color: var(--accent); }
.audit-ts { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filters .field { margin: 0; }
.audit-row { cursor: pointer; }
.audit-row:hover, .audit-row:focus-visible { background: var(--accent-soft); }
.audit-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- Month navigation (checks page) ---- */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
}
.month-arrow {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; color: var(--accent);
  background: var(--accent-soft); text-decoration: none; font-weight: 700;
}
.month-arrow:hover { background: #dceaef; text-decoration: none; }
.month-current { text-align: center; line-height: 1.2; }
.month-label { display: block; font-size: 18px; font-weight: 700; color: var(--ink); }
.month-today { font-size: 12px; color: var(--accent); }

/* ---- Clickable link-style button ---- */
.linklike {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--accent); text-align: left;
}
.linklike:hover { text-decoration: underline; }

/* ---- Vendor detail modal ----
   Layout: modal-head (fixed) -> vendor-detail-info (fixed) ->
   vendor-detail-checks-head (fixed) -> vendor-detail-checks-scroll (scrolls) ->
   modal-foot (fixed). Only the checks table scrolls; everything else stays put. */
.vendor-detail-info {
  padding: 18px 22px 16px; flex: 0 0 auto;
  display: grid; grid-template-columns: 100px 1fr; gap: 12px 16px;
  font-size: 14px;
}
.vd-label { color: var(--muted); padding-top: 1px; }
.vd-value { margin: 0; font-weight: 500; line-height: 1.5; }
.vd-value > span { display: block; }
.vd-empty { padding: 4px 22px 18px; color: var(--muted); font-size: 14px; }

.vendor-detail-checks-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin: 0 22px; padding: 14px 0 10px;
  border-top: 1px solid var(--line); flex: 0 0 auto;
}
.vendor-detail-checks-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.vendor-detail-checks-head .muted { font-size: 13px; }
.vendor-detail-checks-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 0 22px 18px;
}
.vendor-detail-checks-scroll table.ledger { margin: 0; }
.vendor-detail-checks-scroll table.ledger th {
  position: sticky; top: 0; background: var(--surface);
  font-size: 11px; letter-spacing: 0.03em;
}

/* ---- Icon button (e.g. archive trash) ---- */
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  width: 30px; height: 28px; padding: 0; margin-left: 6px; cursor: pointer;
  color: var(--muted); vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

/* ---- Account security / 2FA ---- */
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.empty-mini { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.qr-box { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.qr-box svg { display: block; width: 220px; height: 220px; }
code { font-family: var(--mono); background: #f3f1eb; padding: 2px 4px; border-radius: 4px; }
.hidden { display: none !important; }

.muted { color: var(--muted); font-weight: 500; }

/* ---- CVT branded app shell (post-login UX matches login screen) ---- */
.app-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 8%, rgba(252, 240, 2, 0.20), transparent 28%),
    radial-gradient(circle at 5% 10%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(135deg, var(--cvt-deep-blue) 0%, var(--cvt-bright-blue) 48%, #033E70 100%);
  color: var(--ink);
}
.app-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.055) 0 1px,
    transparent 1px 34px
  );
  opacity: .72;
}
.app-page .site-header {
  background: rgba(3, 62, 112, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 42px rgba(3, 62, 112, 0.26);
}
.app-page .site-header .bar {
  max-width: 1180px;
  min-height: 76px;
  height: auto;
  padding: 12px 24px;
  gap: 22px;
  position: relative;
  z-index: 1;
}
.app-page .app-brand {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 235px;
}
.app-page .brand-logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(140, 150, 154, 0.28);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.app-page .brand-logo-img {
  display: block;
  width: 142px;
  max-width: 142px;
  height: auto;
  max-height: 42px;
}
.app-page .brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.app-page .brand-app {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.app-page .brand-kicker {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1;
}
.app-page .nav {
  gap: 7px;
  align-items: center;
}
.app-page .nav a {
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 13px;
}
.app-page .nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.app-page .nav a.active {
  color: #033E70;
  background: var(--cvt-yellow);
  border-color: rgba(252, 240, 2, 0.5);
  box-shadow: 0 8px 18px rgba(252, 240, 2, 0.18);
}
.app-page .usermenu {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
}
.app-page .usermenu .who,
.app-page .usermenu .who strong,
.app-page .usermenu a {
  color: #fff;
}
.app-page .usermenu .btn {
  border-radius: 999px;
  background: #fff;
  border-color: #fff;
  color: var(--cvt-deep-blue);
}
.app-page .usermenu .btn:hover {
  background: var(--cvt-yellow);
  border-color: var(--cvt-yellow);
}
.app-page .wrap {
  max-width: 1180px;
  padding-top: 34px;
  position: relative;
  z-index: 1;
}
.app-page .page-head {
  align-items: center;
  margin-bottom: 22px;
  padding: 24px 26px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(3, 62, 112, 0.22);
  backdrop-filter: blur(10px);
}
.app-page .page-head h1 {
  color: #fff;
  font-size: 30px;
  font-weight: 850;
}
.app-page .page-head .sub {
  color: rgba(255, 255, 255, 0.78);
}
.app-page .head-actions {
  align-items: center;
}
.app-page .card,
.app-page .modal-card,
.app-page .month-nav,
.app-page .toolbar,
.app-page .filters {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(140, 150, 154, 0.22);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(5, 89, 158, 0.16);
}
.app-page .card .card-pad {
  padding: 24px 26px;
}
.app-page .toolbar,
.app-page .filters {
  padding: 14px;
}
.app-page .btn {
  border-radius: 12px;
}
.app-page .btn-primary {
  background: var(--cvt-deep-blue);
  border-color: var(--cvt-deep-blue);
}
.app-page .btn-primary:hover {
  background: var(--cvt-bright-blue);
  border-color: var(--cvt-bright-blue);
}
.app-page input[type="text"],
.app-page input[type="password"],
.app-page input[type="search"],
.app-page input[type="number"],
.app-page input[type="date"],
.app-page select,
.app-page textarea {
  border-radius: 12px;
  border-color: #d6dee6;
}
.app-page input:focus,
.app-page select:focus,
.app-page textarea:focus {
  outline: none;
  border-color: var(--cvt-bright-blue);
  box-shadow: 0 0 0 4px rgba(2, 148, 217, 0.15);
}
.app-page table.ledger th {
  color: var(--cvt-deep-blue);
}
.app-page table.ledger td {
  border-bottom-color: #edf1f5;
}
.app-page .checklist li {
  border-bottom-color: #edf1f5;
}
.app-page .pill-printed,
.app-page .audit-action.is-auth {
  background: var(--accent-soft);
  color: var(--cvt-deep-blue);
}
.app-page .month-arrow {
  border-radius: 14px;
  background: var(--accent-soft);
}
.app-page .modal-foot {
  background: #f7fbfe;
}
.app-page .alert {
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(3, 62, 112, 0.10);
}

@media (max-width: 920px) {
  .app-page .site-header .bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .app-page .app-brand {
    min-width: 0;
    width: 100%;
  }
  .app-page .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .app-page .usermenu {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .app-page .site-header .bar {
    padding: 12px 14px;
  }
  .app-page .brand-logo-img {
    width: 120px;
    max-width: 120px;
  }
  .app-page .brand-copy {
    display: none;
  }
  .app-page .usermenu {
    width: 100%;
    border-radius: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .app-page .page-head {
    padding: 20px;
    border-radius: 18px;
  }
  .app-page .page-head h1 {
    font-size: 25px;
  }
  .app-page .card .card-pad {
    padding: 20px;
  }
}

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 700;
  line-height: 1.35;
}
.checkline input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  accent-color: var(--primary);
}

/* ---- Check attachments ---- */
.attachment-list { list-style: none; margin: 0 0 16px; padding: 0; }
.attachment-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.attachment-list li:last-child { border-bottom: none; }
.attachment-name { font-weight: 600; color: var(--accent); margin-right: auto; }
.attachment-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.attachment-remove { margin: 0; }
.attachment-upload {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 4px;
}
.attachment-upload input[type="file"] { font-size: 13px; }
