@font-face {
  font-family: Jost;
  src: url('/fonts/Jost.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #211619;
  --soft: #624d50;
  --red: #8a181a;
  --deep: #5b0c0e;
  --paper: #f4edec;
  --white: #fffaf7;
  --rose: #f0d9d7;
  --rule: #d8bdb8;
  --shadow: 4px 4px 0 var(--deep);
  font-family: Jost, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-size: 1.0625rem; line-height: 1.5; }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
header { background: var(--white); border-bottom: 2px solid var(--deep); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 86px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--deep); font-size: 1.69rem; font-weight: 800; line-height: .95; letter-spacing: -.055em; }
.brand-copy { border-left: 1px solid var(--rule); padding-left: 14px; }
.brand small { display: block; color: var(--soft); font-size: .85rem; font-weight: 500; letter-spacing: 0; margin-top: 7px; }
.brand-logo {
  flex: 0 0 146px; height: 40px; position: relative; overflow: hidden; mix-blend-mode: multiply;
}
.brand-logo img { position: absolute; left: 0; top: 50%; width: 100%; height: auto; transform: translateY(-50%); }
.nav-shell { background: var(--paper); border-bottom: 1px solid var(--rule); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-block: 12px; }
nav button {
  min-height: 42px; background: none; border: 1px solid transparent; border-radius: 99px;
  padding: .42rem .85rem; color: var(--deep); font-size: .96rem;
}
nav button:hover { border-color: var(--rule); background: var(--white); }
nav button[aria-current="page"] { background: var(--rose); border-color: var(--deep); }
#logout { margin-left: auto; }
main { padding-block: 28px 64px; }
.intro {
  margin-bottom: 28px; padding: clamp(20px, 4vw, 39px) clamp(18px, 4vw, 42px);
  background: var(--red); color: white; border: 2px solid var(--deep); border-radius: 15px;
  box-shadow: var(--shadow);
  background-image: radial-gradient(ellipse at right top, #a83032, transparent 63%);
}
.intro p { margin: 6px 0 0; color: #ffefed; font-size: 1.06rem; }
.intro .primary { background: var(--white); color: var(--deep); }
.intro .primary:hover { background: var(--rose); }
h1,h2,p { overflow-wrap: anywhere; }
h1 {
  font-size: clamp(2.4rem, 6vw, 4.05rem); line-height: 1; font-weight: 850;
  letter-spacing: -.055em; margin: 0;
}
h2 { color: var(--deep); font-size: 1.4rem; font-weight: 750; margin: 0 0 .78rem; line-height: 1.17; letter-spacing: -.025em; }
.panel { background: var(--white); border: 2px solid var(--deep); border-radius: 14px; padding: 23px; min-width: 0; }
.narrow { max-width: 570px; }
#login { margin: 28px auto; box-shadow: var(--shadow); }
#login h1 { color: var(--deep); font-size: clamp(2.2rem, 5vw, 3.1rem); }
.bar-grid, .metrics { display: grid; gap: 16px; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
.bar-grid > :first-child { box-shadow: var(--shadow); }
.bar-grid > :nth-child(2) { background: #fff5ee; }
.metrics { grid-template-columns: 1.35fr repeat(3,minmax(0,1fr)); margin-bottom: 30px; }
.metrics .panel { min-height: 100%; padding: 17px; }
.metrics .panel:first-child { background: var(--rose); box-shadow: 3px 3px 0 var(--deep); }
.metrics span { display: block; color: var(--soft); font-size: .95rem; }
.metrics strong {
  display: block; margin-top: 5px; font-size: clamp(1.4rem, 3vw, 2.05rem); line-height: 1.15;
  color: var(--deep); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -.035em;
}
.split, .actions, .customer, .amount, .pages { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.split, .customer, .amount, .pages { justify-content: space-between; }
.actions { justify-content: flex-end; }
.amount { padding: 12px 0; border-block: 1px dashed var(--red); margin: 16px 0; }
.amount strong { color: var(--deep); font-size: 1.65rem; }
.customer { padding: .35rem 0 .65rem; }
button, a.primary { cursor: pointer; font: 650 1rem/1.25 Jost, system-ui, sans-serif; }
.primary, .secondary {
  display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
  border-radius: 99px; border: 2px solid var(--deep); padding: .49rem .95rem; text-decoration: none;
}
.primary { background: var(--red); color: #fff; box-shadow: 2px 2px 0 var(--deep); }
.primary:hover { background: var(--deep); }
.secondary { background: var(--white); color: var(--deep); }
.secondary:hover { background: var(--rose); }
:disabled { opacity: .55; cursor: default; box-shadow: none; }
:focus-visible { outline: 3px solid #8a4f00; outline-offset: 3px; }
.intro :focus-visible { outline-color: white; }
label { display: grid; gap: 5px; color: var(--soft); font-size: .96rem; font-weight: 600; min-width: 0; }
input {
  color: var(--ink); background: #fffefd; border: 1px solid #a77070; border-radius: 8px;
  width: 100%; min-height: 44px; padding: .5rem .7rem; font: 400 1.0625rem Jost, system-ui, sans-serif;
}
input::placeholder { color: #755f62; }
form > label { margin-bottom: 13px; }
.inline-form, .filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline-form label { flex: 1 1 215px; }
.inline-form label, .filters label { margin: 0; }
#lookup, #login-form { margin-top: 15px; }
.badge { display: inline-block; border: 1px solid #c28883; border-radius: 80px; background: var(--rose); padding: .19rem .63rem; font-size: .92rem; color: var(--deep); font-weight: 650; }
.badge.inactive { background: #eee5e2; border-color: #c5b3ad; color: var(--soft); }
.muted, .feedback { color: var(--soft); }
.feedback { margin: 10px 0 0; }
.feedback:empty { display: none; }
.feedback.error { color: var(--red); font-weight: 600; }
.feedback.success { color: #23583b; font-weight: 600; }
#bill-empty { border: 1px dashed var(--rule); border-radius: 9px; padding: 15px; }
.table-panel { padding: 0; overflow-x: auto; margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { background: var(--rose); color: var(--deep); font-size: .95rem; white-space: nowrap; }
tbody tr:nth-child(even) { background: #faf1ec; }
tbody tr:last-child td { border-bottom: none; }
td:last-child .secondary { margin: 2px; }
.empty { padding: 15px 16px; margin: 0; color: var(--soft); }
#video { display: block; background: var(--ink); border-radius: 10px; width: 100%; max-height: 280px; margin-top: 12px; }
#report-results { margin-top: 20px; }
dialog {
  border: 2px solid var(--deep); border-radius: 15px; padding: 25px; width: min(460px, calc(100% - 28px));
  color: var(--ink); background: var(--white); box-shadow: var(--shadow);
}
dialog::backdrop { background: #290b10a8; }
dialog .actions { margin-top: 16px; }
#qr-dialog { text-align: center; }
#qr-dialog .actions { justify-content: center; }
#qr-image { border: 1px solid var(--rule); border-radius: 8px; max-width: 100%; object-fit: contain; }
.card-code { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.check { display: flex; align-items: center; }
.check input { width: 18px; min-height: 18px; accent-color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 730px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bar-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .wrap { width: calc(100% - 28px); }
  .top { min-height: 70px; gap: 8px; }
  .brand { gap: 7px; font-size: 1.28rem; }
  .brand small { font-size: .75rem; margin-top: 5px; }
  .brand-copy { padding-left: 7px; }
  .brand-logo { flex-basis: 94px; height: 29px; }
  #role { font-size: .8rem; }
  .panel:not(.table-panel) { padding: 16px; }
  main { padding-top: 19px; }
  nav { padding-block: 8px; gap: 4px; }
  nav button { padding-inline: .56rem; }
  th,td { padding: 10px; }
}
