:root {
  color-scheme: light;
  --navy: #111873;
  --gold: #f6c528;
  --bg: #f3f5fb;
  --paper: #fff;
  --ink: #172049;
  --muted: #535d78;
  --line: #dce2f1;
  --primary: #2635a3;
  --primary-strong: #182580;
  --primary-soft: #eef1ff;
  --new-ink: #215785;
  --new-bg: #eaf3ff;
  --progress-ink: #75480d;
  --progress-bg: #fff2d8;
  --resolved-ink: #12664b;
  --resolved-bg: #e8f6ed;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid #5464d7; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
p { overflow-wrap: anywhere; }
svg { width: 1.125rem; height: 1.125rem; flex: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; overflow: hidden; clip-path: inset(50%); width: 1px; height: 1px; white-space: nowrap; }
.skip-link:focus { position: absolute; top: 1rem; left: 1rem; z-index: 2; padding: .75rem; background: var(--paper); }

.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.header-inner {
  position: relative;
  width: min(100% - 2rem, 73rem);
  min-height: 5rem;
  margin: 0 auto;
  padding: .75rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
}
[data-page="report"] .header-inner {
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: .75rem; min-width: 0; color: #fff; text-decoration: none; }
.brand img { flex: none; padding: .15rem; border-radius: 50%; background: #fff; object-fit: contain; }
.brand strong { display: block; font-size: 1.4rem; letter-spacing: -.04em; line-height: 1.12; }
.brand small { display: block; color: #e3e7ff; font-size: .8rem; line-height: 1.3; margin-top: .25rem; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.site-header nav a, .header-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .4rem .7rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: #f0f2ff;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.site-header nav a[aria-current] { background: #292f8f; border-color: #424ba9; color: #fff; }
.site-header nav a:hover, .header-action:hover { background: #292f8f; }
.site-header :focus-visible { outline-color: var(--gold); }
.header-action:disabled { cursor: wait; opacity: .7; }

.notification-bell { position: relative; justify-content: center; width: 2.75rem; }
.notification-bell[aria-expanded="true"] { background: #292f8f; border-color: #424ba9; }
.notification-badge {
  position: absolute;
  inset: -.1rem -.1rem auto auto;
  min-width: 1.1rem;
  padding: .02rem .25rem;
  border: 1px solid var(--navy);
  border-radius: 1rem;
  background: var(--gold);
  color: var(--navy);
  font-size: .72rem;
  line-height: 1.25;
  font-weight: 750;
  text-align: center;
}
.notification-panel {
  position: absolute;
  z-index: 3;
  inset: calc(100% - .35rem) 0 auto auto;
  width: min(22rem, 100%);
  padding: .85rem;
  color: var(--ink);
  box-shadow: 0 12px 28px #18258029;
}
.notification-panel :focus-visible { outline-color: #5464d7; }
.notification-heading { display: flex; justify-content: space-between; align-items: center; gap: .4rem; flex-wrap: wrap; }
.notification-heading h2 { font-size: 1.15rem; }
.notification-message { padding: .7rem 0 .25rem; color: var(--muted); font-size: .9rem; }
.notification-list { list-style: none; margin: .35rem 0 0; padding: 0 .2rem; max-height: min(25rem, 55dvh); overflow: auto; }
.notification-list li + li { margin-top: .25rem; }
.notification-item {
  display: grid;
  gap: .1rem;
  padding: .5rem .6rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.notification-item[data-unread="true"] { background: var(--primary-soft); }
.notification-item:hover { border-color: var(--line); }
.notification-item > span:not(.sr-only), .notification-item time { color: var(--muted); font-size: .83rem; }

.page-content { margin: 0 auto; padding: clamp(2rem, 5vw, 4.25rem) 0 4rem; }
.wide { width: min(100% - 2rem, 73rem); }
.narrow { width: min(100% - 2rem, 39rem); }
.page-heading { margin-bottom: 1.5rem; }
[data-page="report"] .page-heading { text-align: center; }
.page-heading h1 { font-size: clamp(1.85rem, 5vw, 3.15rem); font-weight: 750; }
.page-heading p { margin-top: .55rem; color: var(--muted); }
.feature-icon, .stat-icon {
  display: inline-grid;
  width: 2.9rem;
  height: 2.9rem;
  place-items: center;
  flex: none;
  border-radius: .8rem;
  background: var(--primary-soft);
  color: var(--primary);
}
.feature-icon { margin-bottom: .75rem; }
.feature-icon svg, .stat-icon svg { width: 1.4rem; height: 1.4rem; }
.feature-icon.success { background: var(--resolved-bg); color: var(--resolved-ink); }
.card { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 4px 12px #26346108; }
.form-card { padding: clamp(1rem, 4vw, 2rem); }
.login-page { max-width: 30rem; }
.login-seal { display: block; margin-bottom: .75rem; }
.login-page h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
.confirmation { margin-bottom: 1rem; padding: .65rem .75rem; border-radius: .5rem; background: var(--resolved-bg); color: var(--resolved-ink); }
form { display: grid; gap: 1rem; }
form label { display: block; color: var(--ink); font-size: .95rem; font-weight: 650; }
form label :is(input, select, textarea) { display: block; width: 100%; margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
:is(input, select, textarea) {
  min-width: 0;
  min-height: 2.75rem;
  padding: .55rem .7rem;
  border: 1px solid #c1c9df;
  border-radius: .5rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #626d88; }
select {
  appearance: none;
  padding-right: 2.1rem;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23535d78' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3C/svg%3E") right .65rem center / 1rem no-repeat;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: .4rem;
  min-height: 2.75rem;
  padding: .55rem .95rem;
  border: 1px solid #cbd3e9;
  border-radius: .5rem;
  background: var(--paper);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.button:hover { background: var(--primary-soft); }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.button.danger { color: #a22338; border-color: #e4b6bf; }
.button.danger:not(:disabled):hover { background: #fff0f3; }
.button:disabled { background: var(--bg); border-color: var(--line); color: var(--muted); cursor: default; }
.button.full-width { width: 100%; }
.form-message { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message[role="alert"] { color: #a22338; }
.global-message { width: min(100% - 2rem, 73rem); margin: 0 auto 1.5rem; color: #a22338; }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.receipt h2, .form-card h2 { font-size: 1.55rem; }
.receipt p { margin-top: .55rem; }
.receipt .actions { margin-top: 1rem; }

.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.dashboard-heading h1 { font-size: clamp(1.85rem, 5vw, 2.9rem); }
.period-panel { padding: clamp(.85rem, 2vw, 1.2rem); margin-bottom: 1.1rem; }
.period-heading { display: flex; align-items: baseline; gap: .35rem 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.period-heading h2 { font-size: 1.15rem; }
.period-heading p { color: var(--muted); font-size: .9rem; }
.period-panel form { gap: .6rem; }
.period-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.period-controls > label { flex: 0 1 10rem; }
.period-controls .actions { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.stat { display: flex; align-items: center; gap: .75rem; padding: clamp(.75rem, 2vw, 1.15rem); }
.stat span:not(.stat-icon) { display: block; color: var(--muted); font-size: .92rem; }
.stat strong { display: block; margin-top: .05rem; font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-icon.new, .status[data-status="new"] { background: var(--new-bg); color: var(--new-ink); }
.stat-icon.in_progress, .status[data-status="in_progress"] { background: var(--progress-bg); color: var(--progress-ink); }
.stat-icon.resolved, .status[data-status="resolved"] { background: var(--resolved-bg); color: var(--resolved-ink); }
.status[data-status="dismissed"] { background: #eeeff3; color: #525b70; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.queue, .detail { min-width: 0; padding: clamp(.75rem, 2vw, 1.25rem); }
.queue-heading { display: flex; align-items: center; gap: .55rem; margin-bottom: .65rem; }
.queue h2, .detail h2 { font-size: 1.3rem; }
.queue-count { padding: .13rem .5rem; border-radius: 1rem; background: var(--bg); color: var(--muted); font-size: .85rem; font-weight: 650; }
.search-field { display: block; position: relative; }
.search-field svg { position: absolute; inset: .8rem auto auto .75rem; color: var(--muted); pointer-events: none; }
.search-field input { width: 100%; padding-left: 2.2rem; }
.filters { display: flex; flex-wrap: wrap; gap: .25rem; margin: .65rem 0; }
.filters button { min-height: 2.45rem; padding: .25rem .65rem; border: 1px solid transparent; border-radius: .45rem; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 600; }
.filters button:hover { border-color: var(--line); }
.filters button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.report-list { margin: 0; padding: 0; list-style: none; }
.report-list li + li { margin-top: .25rem; }
.report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 3.75rem;
  padding: .45rem .65rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: transparent;
  color: var(--ink);
  text-align: start;
}
.report-row:hover { background: var(--bg); }
.report-row[aria-pressed="true"] { background: var(--primary-soft); border-color: #cdd5fb; }
.row-details { overflow-wrap: anywhere; }
.row-details strong, .row-details > span { display: block; }
.row-details strong { font-size: .98rem; }
.row-details > span { color: var(--muted); font-size: .82rem; }
.status {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 1rem;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}
.status::before { content: ""; width: .36rem; height: .36rem; flex: none; border-radius: 50%; background: currentColor; }
.empty { margin: .5rem 0; color: var(--muted); }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.reference { color: var(--muted); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-description, .track-location { margin-top: .55rem; color: var(--muted); }
.detail-description { white-space: pre-wrap; }
.duplicate-note { margin-top: .7rem; padding: .5rem .7rem; border-radius: .5rem; background: var(--progress-bg); color: var(--progress-ink); font-size: .9rem; }
.duplicate-note a { color: inherit; font-weight: 650; }
.detail h2, [data-track-title] { overflow-wrap: anywhere; }
.report-facts { display: grid; gap: .45rem; margin: 1rem 0; padding: .8rem 0; border-block: 1px solid var(--line); }
.report-facts div { display: grid; grid-template-columns: minmax(5rem, .6fr) minmax(0, 1fr); gap: .5rem; font-size: .9rem; }
.report-facts dt { color: var(--muted); }
.report-facts dd { overflow-wrap: anywhere; }
.dismiss-controls { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.dismiss-controls summary { color: #a22338; cursor: pointer; font-weight: 600; font-size: .9rem; }
.dismiss-controls form { margin-top: .65rem; }
#status-form { gap: .3rem; }
.status-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.detail .form-message, [data-track-feedback] { margin-top: .5rem; }

.tracking-subheading { margin-top: 1.3rem; font-size: 1.05rem; }
.timeline { list-style: none; padding: 0; margin: .35rem 0 1.1rem; }
.timeline li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; border-bottom: 1px solid var(--line); padding: .6rem 0; }
.timeline time { color: var(--muted); font-size: .9rem; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); gap: 1rem; }
.qr-card { display: grid; justify-items: start; gap: .8rem; padding: 1.1rem; }
.qr-card h2 { font-size: 1.15rem; }
.qr-card img { max-width: 100%; border: 1px solid var(--line); border-radius: .45rem; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: .4rem 1rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .period-controls .actions { margin-left: 0; }
}
@media (max-width: 480px) {
  .header-inner { align-items: start; flex-direction: column; }
  .site-header nav { margin-left: -.45rem; }
  .site-header nav a, .header-action { padding-inline: .45rem; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .stats { gap: .4rem; }
  .stat { padding: .6rem; }
  .stat-icon { display: none; }
  .stat span:not(.stat-icon) { font-size: .85rem; }
  .form-grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: .1rem; }
}
@media (pointer: coarse) {
  .filters button { min-height: 2.75rem; }
}
