:root {
  color-scheme: light;
  --navy: #133b5c;
  --blue: #1e6091;
  --ink: #172b3a;
  --muted: #667786;
  --line: #dbe3e9;
  --surface: #fff;
  --background: #f3f6f8;
  --green: #16834b;
  --red: #b42318;
  --yellow: #8a5a00;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
a { color: var(--blue); }
button, input, select { font: inherit; }
.site-header { min-height: 68px; display: flex; align-items: center; gap: 32px; padding: 12px max(22px, calc((100% - 1200px) / 2)); background: var(--navy); color: white; }
.brand { color: white; font-size: 1.08rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand span { color: #a9d6f2; }
.main-nav, .account { display: flex; align-items: center; gap: 20px; }
.main-nav { flex: 1; }
.main-nav a { color: #e5f0f7; text-decoration: none; font-size: .94rem; }
.account { gap: 12px; font-size: .9rem; }
.account form { margin: 0; }
.page { width: min(1200px, calc(100% - 36px)); margin: 34px auto 64px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.7rem, 4vw, 2.35rem); letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.eyebrow { margin-bottom: 7px; color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p:last-child { margin-bottom: 0; }
.heading-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-weight: 700; cursor: pointer; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: #174d75; }
.button-secondary { color: var(--navy); background: white; border-color: var(--line); }
.button-quiet { min-height: 34px; padding: 6px 10px; color: inherit; background: transparent; border-color: #ffffff50; }
.button-wide { width: 100%; }
.panel, .metric-card, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px #18334a0a; }
.panel { padding: 20px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.scanner-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 20px; align-items: start; }
.qr-reader { max-width: 620px; margin: 0 auto; overflow: hidden; border-radius: 8px; }
#reader video { border-radius: 8px; }
#reader__dashboard_section_csr button { margin: 5px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
#reader__dashboard_section_csr select { padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.scan-feedback { display: flex; flex-direction: column; gap: 4px; margin-top: 15px; padding: 14px 16px; border: 1px solid #cbd6df; border-radius: 9px; background: #f6f8fa; }
.scan-feedback strong { font-size: 1.05rem; }
.scan-feedback.is-success { color: #075c35; background: #e7f6ed; border-color: #91d5ac; }
.scan-feedback.is-warning { color: #765000; background: #fff5d6; border-color: #f0d37e; }
.scan-feedback.is-error { color: #8f1b13; background: #fff0ee; border-color: #f2b0aa; }
.stack-form { display: flex; flex-direction: column; gap: 9px; }
.stack-form label, .field label { font-weight: 700; font-size: .92rem; }
.stack-form input, .field input, .field select, .filter-bar input, .filter-bar select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #bdcbd5; border-radius: 7px; background: white; color: var(--ink); }
.stack-form input:focus, .field input:focus, .filter-bar input:focus, .filter-bar select:focus { outline: 3px solid #1e609126; border-color: var(--blue); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 99px; font-size: .88rem; font-weight: 700; white-space: nowrap; }
.status-pill span { width: 9px; height: 9px; border-radius: 100%; background: currentColor; }
.status-open { color: #08623b; background: #e5f5ec; }
.status-closed { color: #7a5200; background: #fff4d2; }
.notice { margin-bottom: 18px; padding: 12px 15px; border-radius: 8px; }
.notice-warning { color: #765000; background: #fff5d6; border: 1px solid #f0d37e; }
code { font-size: .9em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-card { display: flex; flex-direction: column; gap: 6px; padding: 19px; }
.metric-card > span { color: var(--muted); font-size: .92rem; font-weight: 650; }
.metric-card strong { font-size: 2.1rem; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); }
.metric-present strong { color: var(--green); }
.metric-pending strong { color: var(--yellow); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e7edf1; vertical-align: middle; }
th { color: var(--muted); font-size: .77rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .table-scroll { padding: 0 16px; }
.table-actions { display: flex; gap: 9px; white-space: nowrap; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tag-green { color: #08623b; background: #e5f5ec; }
.tag-muted { color: #5a6974; background: #eef1f3; }
.empty-state { padding: 25px; color: var(--muted); text-align: center; }
.progress { display: inline-block; width: 65px; height: 7px; margin-right: 6px; overflow: hidden; vertical-align: middle; border-radius: 99px; background: #e8edf1; }
.progress span { display: block; height: 100%; background: var(--green); }
.refresh-status { margin: 12px 0 0; text-align: right; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .5fr) auto auto; gap: 9px; margin-bottom: 14px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 15px; border-top: 1px solid var(--line); font-size: .9rem; }
.form-panel { max-width: 680px; }
.form-panel .stack-form { gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-error { color: var(--red); }
.identity-box { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; padding: 13px; border-radius: 8px; background: #eff5f9; overflow-wrap: anywhere; }
.identity-box strong { color: var(--navy); }
.qr-print-card { width: min(440px, 100%); margin: 0 auto; padding: 30px; text-align: center; }
.qr-print-card .eyebrow { margin-bottom: 15px; }
.qr-large { display: block; width: min(280px, 100%); height: auto; margin: 0 auto 15px; image-rendering: pixelated; }
.qr-employee { margin-bottom: 5px; font-size: 1.2rem; font-weight: 750; }
.qr-print-card code { overflow-wrap: anywhere; }
.login-card { width: min(420px, 100%); margin: 8vh auto; padding: 30px; }
.login-card h1 { font-size: 1.9rem; }
.login-card .stack-form { margin-top: 24px; gap: 11px; }
.messages { margin-bottom: 18px; }
.message { padding: 11px 14px; border-radius: 8px; }
.message.success { color: #075c35; background: #e7f6ed; }
.message.error { color: #8f1b13; background: #fff0ee; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .site-header { flex-wrap: wrap; gap: 12px 20px; padding-inline: 18px; }
  .main-nav { order: 3; flex-basis: 100%; gap: 18px; }
  .account { margin-left: auto; }
  .page { width: min(100% - 28px, 680px); margin-top: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .scanner-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .site-header { padding-inline: 14px; }
  .page { width: calc(100% - 24px); margin-top: 19px; }
  .panel { padding: 15px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 1.75rem; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1 / -1; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .table-panel .table-scroll { padding-inline: 10px; }
  .table-actions { flex-wrap: wrap; }
  .account { font-size: .82rem; }
  .login-card { padding: 24px; }
}
@media print {
  body { background: white; }
  .site-header, .no-print { display: none !important; }
  .page { width: 100%; margin: 0; }
  .qr-print-card { border: 0; box-shadow: none; }
}
