:root {
  --paper: #f3eee6;
  --card: #fffdf9;
  --ink: #1c1814;
  --muted: #6f675e;
  --line: #e4dcd0;
  --accent: #0e5c4c;
  --accent-hover: #0a463a;
  --accent-soft: #e7f3ef;
  --warn: #8a5a10;
  --warn-soft: #f8efd8;
  --danger: #9b2c2c;
  --danger-soft: #f8e8e6;
  --ok: #1f6b3a;
  --ok-soft: #e5f4ea;
  --waiting: #3b5bdb;
  --waiting-soft: #e7ecff;
  --shadow: 0 1px 2px rgba(28, 24, 20, 0.06);
  --radius: 14px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
}

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

img { max-width: 100%; }

.skip {
  position: absolute;
  left: -999px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--ink); }

.brand svg { display: block; }

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover,
.nav a.is-active {
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.trust-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
}
.trust-chip img,
.trust-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.trust-mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.menu { position: relative; }
.menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 240px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.menu:focus-within .menu-panel,
.menu.open .menu-panel { display: block; }
.menu-panel button,
.menu-panel a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.menu-panel button:hover,
.menu-panel a:hover { background: var(--paper); text-decoration: none; }
.menu-label {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 8px 12px 4px;
}

.notif-link {
  position: relative;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--muted);
}
.notif-link:hover { color: var(--ink); text-decoration: none; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.notif-unread { background: var(--accent-soft); }

.user-link {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

main.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.lede {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 1.05rem;
  max-width: 42rem;
}

.hero-search {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 28px;
}
.hero-search label { flex: 1; }
.hero-search-btn { align-self: flex-end; }
.hero-search .hint { margin-top: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label,
label.field-label {
  font-weight: 600;
  font-size: 0.95rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  margin: -12px 12px -12px -14px;
  padding: 12px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
input[type="file"]::-webkit-file-upload-button {
  font: inherit;
  font-weight: 600;
  margin: -12px 12px -12px -14px;
  padding: 12px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.hint { color: var(--muted); font-size: 0.88rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 550;
  line-height: 1;
}
.stat span { color: var(--muted); font-size: 0.9rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h2 {
  font-size: 1rem;
  margin: 0 0 12px;
  font-weight: 650;
}
.empty {
  color: var(--muted);
  margin: 0;
  padding: 8px 0;
}

.person-row-wrap {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  width: 100%;
}
.person-row-wrap:first-child { border-top: 0; }
.person-row-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.person-row-lead:hover { text-decoration: none; }
.person-row-lead:hover .person-name { text-decoration: underline; }
.person-row-lead .person-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-nic-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.person-row-status { flex: 0 0 auto; text-decoration: none; margin-left: auto; }
.person-row-status:hover { text-decoration: none; }
.nic-copy-btn {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  min-height: 28px;
  line-height: 1.2;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.nic-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.nic-copy-btn.is-copied {
  color: var(--ok);
  border-color: var(--ok);
}

/* Legacy class kept for any stray markup */
.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.avatar, .avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}
.person-name { font-weight: 600; color: var(--ink); }
.person-meta { color: var(--muted); font-size: 0.88rem; }
.grow { flex: 1; min-width: 0; }

tr.is-past td { color: var(--muted); }
.record-box summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.record-box summary::-webkit-details-marker { display: none; }
.record-box h2 { font-size: 1rem; margin: 0 0 10px; }
.action-form { max-width: 32rem; margin-top: 12px; }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline strong { display: block; font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.pill-draft { background: var(--paper); color: var(--muted); }
.pill-waiting { background: var(--waiting-soft); color: var(--waiting); }
.pill-needs-info { background: #f5e6d3; color: #8a5a20; }
.pill-approved { background: var(--ok-soft); color: var(--ok); }
.pill-rejected { background: var(--danger-soft); color: var(--danger); }

.tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.tabs a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.tabs a.is-active,
.tabs a:hover {
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}

.list-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 12px 0 0;
}
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
}
table.data th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:hover td { background: #faf7f2; }

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-info { background: var(--waiting-soft); color: var(--waiting); }
.flash-warning { background: var(--warn-soft); color: var(--warn); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

.callout {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
}
.callout-warn { background: var(--warn-soft); color: var(--ink); }
.callout-info { background: var(--accent-soft); color: var(--ink); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px 28px;
}
.auth-card h1 {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 12px 0 4px;
}
.auth-card .lede { margin-bottom: 24px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.demo-box {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}
.demo-box code {
  font-family: ui-monospace, monospace;
  font-size: 0.84rem;
  color: var(--ink);
}

.trust-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.trust-pick button {
  font: inherit;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  color: inherit;
}
.trust-pick button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.trust-pick h2 {
  margin: 10px 0 2px;
  font-size: 1.05rem;
}
.trust-pick p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.file-head {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}
.file-photo-link {
  display: block;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  text-decoration: none;
}
.file-photo-link:hover { text-decoration: none; opacity: 0.92; }
.file-photo {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--accent-soft);
}
.file-photo.avatar {
  font-size: 1.6rem;
  color: var(--accent);
}
.family-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}
.photo-person {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.photo-person:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.photo-card {
  margin: 0;
  width: 120px;
  position: relative;
}
.photo-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: var(--paper);
}
.photo-card.is-primary img { outline: 3px solid var(--accent); }
.photo-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.photo-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.55);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}
.camera-modal[hidden] { display: none; }
.camera-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  max-width: 520px;
  width: 100%;
}
.camera-panel video {
  width: 100%;
  max-height: 360px;
  background: #111;
  border-radius: 10px;
}
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 24px 0 8px;
  font-weight: 700;
}

.help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  margin-left: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: 1px;
}
.help-link:hover,
.help-link:focus {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
h1 .help-link,
h2 .help-link {
  vertical-align: middle;
}
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 28px;
  padding: 16px 20px;
}
.help-toc a { font-size: 0.95rem; }
.help-article {
  scroll-margin-top: 80px;
  margin: 0 0 28px;
  max-width: 42rem;
}
.help-article h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 550;
  margin: 0 0 8px;
}
.help-article p,
.help-article ul { margin: 0 0 10px; }
.help-article ul { padding-left: 1.2rem; }
.help-article code {
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
}

.file-note {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.file-note:last-of-type { border-bottom: 0; }
.file-note-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 4px;
}
.file-note-body { margin: 0; white-space: pre-wrap; }
.pill-file_note { background: var(--accent-soft); color: var(--accent); }

main.page-wide { max-width: 1200px; }
.pay-desk-page { padding-bottom: 88px; }

.pay-desk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 20px;
  align-items: start;
}
.pay-desk-side-title {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 12px;
}
.pay-desk-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pay-desk-stats .stat-highlight b { color: var(--accent); }
.pay-desk-quick-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.pay-desk-field-amount input { font-size: 1.25rem; font-weight: 600; }
.hint-inline { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.pay-desk-more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.pay-desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.pay-desk-file-banner { margin-bottom: 16px; }
.pay-desk-recent-row {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.pay-desk-recent-row:last-child { margin-bottom: 0; }
.pay-desk-kbd-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 20px;
  background: var(--card);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}
.pay-desk-kbd-label {
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}
.pay-desk-kbd-bar kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  font: inherit;
  font-size: 0.78rem;
  color: var(--text);
}

/* —— Reports —— */
.reports-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 36px;
}
.reports-export { padding: 16px 18px; margin: 0; }
.reports-export-title {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 12px;
}
.reports-export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.reports-export-row .btn { grid-column: 1 / -1; }
.reports-section { margin-bottom: 40px; }
.reports-section-title {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 550;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.reports-section-lede {
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 40rem;
}
.reports-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.reports-kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.reports-kpi-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-1px);
}
.reports-kpi-card b {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.reports-kpi-card span {
  font-size: 0.85rem;
  color: var(--muted);
}
.reports-kpi-card.is-warn b { color: var(--warn); }
.reports-kpi-card.is-wait b { color: var(--waiting); }
.reports-kpi-card.is-ok b { color: var(--ok); }
.reports-kpi-card.is-accent b { color: var(--accent); }
.reports-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.reports-card-title {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0 0 4px;
}
.reports-chart-wrap {
  position: relative;
  height: 240px;
  margin-top: 8px;
}
.reports-chart-doughnut { height: 260px; }
.reports-chart-wide { height: 280px; }
.reports-queue-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.reports-queue-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.reports-list-row {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.reports-list-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.reports-table-wrap { overflow-x: auto; margin-top: 8px; }
.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.reports-table th,
.reports-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.reports-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.reports-table .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 800px) {
  .stats, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; align-items: stretch; }
  .header-inner { padding: 10px 16px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; }
  .file-head { flex-wrap: wrap; }
  .file-actions { margin-left: 0; }
  .pay-desk-layout { grid-template-columns: 1fr; }
  .pay-desk-quick-row { grid-template-columns: 1fr; }
  .pay-desk-kbd-bar { display: none; }
  .reports-hero,
  .reports-grid-2,
  .reports-queue-tabs { grid-template-columns: 1fr; }
  .reports-kpi { grid-template-columns: 1fr 1fr; }
  .reports-export-row { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .file-actions, .no-print { display: none !important; }
  body, main.page { background: #fff; padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  .print-toolbar { display: none !important; }
  .print-sheet { border: 0; padding: 0; max-width: none; box-shadow: none; }
  @page { size: A4; margin: 12mm; }
}

.print-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 20px 18px;
  max-width: 210mm;
  font-size: 13px;
  line-height: 1.28;
}
.print-letterhead {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.print-letterhead-banner {
  display: block;
  position: relative;
  align-items: stretch;
}
.print-letterhead-banner .letterhead-banner {
  width: 100%;
  max-height: 96px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.print-letterhead-banner .print-photo {
  position: absolute;
  right: 0;
  top: 4px;
}
.print-letterhead img:not(.print-photo):not(.letterhead-banner) {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.trust-mark-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--paper);
}
.trust-mark-img-print {
  width: 48px;
  height: 48px;
}
.trust-mark-img-pick {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.trust-mark-print {
  width: 48px;
  height: 48px;
  font-size: 0.8rem;
}
.trust-mark-pick {
  width: 40px;
  height: 40px;
  font-size: 0.75rem;
}
.branding-preview-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}
.menu-panel a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font: inherit;
}
.menu-panel a:hover {
  background: var(--paper);
}
.print-letterhead h1 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}
.print-photo {
  width: 56px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.print-doc-title {
  font-weight: 700;
  margin: 0 0 2px;
  font-size: 0.95rem;
}
.print-meta { color: var(--muted); font-size: 0.8rem; }
.print-h {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 10px 0 4px;
  font-weight: 700;
  color: var(--muted);
}
.print-kv { width: 100%; border-collapse: collapse; }
.print-kv th {
  width: 18%;
  text-align: left;
  font-weight: 600;
  padding: 1px 8px 1px 0;
  color: var(--muted);
  font-size: 0.78rem;
  vertical-align: top;
}
.print-kv td { padding: 1px 0; vertical-align: top; }
.print-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.print-table th, .print-table td {
  border: 1px solid var(--line);
  padding: 2px 6px;
  text-align: left;
}
.print-table th { background: var(--paper); font-size: 0.72rem; color: var(--muted); }
.print-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.print-line { margin: 0 0 2px; font-size: 0.82rem; }
.print-decl { font-size: 0.82rem; margin: 0; }
.print-signs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.print-sign-box {
  border: 1px solid var(--ink);
  padding: 6px 8px 8px;
  min-height: 78px;
}
.print-sign-box .label { font-size: 0.72rem; font-weight: 700; }
.print-sign-space { height: 42px; }
.print-thumb-space { height: 52px; }
.print-sign-cap { font-size: 0.7rem; color: var(--muted); }
.print-foot {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 800px) {
  .print-cols, .print-signs { grid-template-columns: 1fr; }
}

/* Payment voucher — two A5 landscape halves on one A4 */
.voucher-sheet {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  max-width: 210mm;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10mm;
  box-shadow: var(--shadow);
}
.voucher-half {
  border: 1px dashed var(--line);
  padding: 8mm 10mm;
  min-height: 130mm;
  display: flex;
  flex-direction: column;
}
.voucher-half .voucher-copy-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.voucher-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.voucher-head img:not(.print-photo) {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.voucher-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.2;
}
.voucher-no-box {
  text-align: right;
  font-size: 0.75rem;
}
.voucher-no-box .label { display: block; color: var(--muted); }
.voucher-no-box strong { font-size: 0.85rem; }
.voucher-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.82rem;
}
.voucher-kv th { width: 28%; }
.voucher-cancelled {
  margin: 0 0 8px;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.85rem;
}
.voucher-signs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.voucher-sign .label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.voucher-sign .sign-space { height: 28px; border-bottom: 1px solid var(--ink); }
.voucher-sign .thumb-space { height: 32px; border: 1px dashed var(--muted); margin-top: 4px; }
.voucher-sign .cap { font-size: 0.62rem; color: var(--muted); }
.voucher-foot {
  margin: 8px 0 0;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
}
.voucher-sheet.is-void .voucher-half { opacity: 0.85; }

.voucher-half .print-letterhead {
  border-bottom-width: 1px;
  margin-bottom: 6px;
  padding-bottom: 6px;
}
.voucher-half .print-letterhead h1 { font-size: 0.9rem; }
.voucher-half .letterhead-banner { max-height: 48px; }
.voucher-half .print-foot {
  margin-top: auto;
  border-top: 0;
  padding-top: 6px;
}

@media print {
  .voucher-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 0;
    max-width: none;
    height: 297mm;
    page-break-after: avoid;
  }
  .voucher-half {
    border: 1px solid #999;
    min-height: 0;
    height: 50%;
    page-break-inside: avoid;
  }
  .voucher-half + .voucher-half {
    border-top: 1px dashed #666;
  }
}
