:root {
  --navy: #0d1f2d;
  --ink: #344454;
  --muted: #71808d;
  --orange: #ee7c01;
  --teal: #3abfa7;
  --paper: #fbfaf7;
  --line: #e6edf0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(58,191,167,.14), transparent 30%), var(--paper);
  color: var(--navy);
}
a { color: var(--orange); text-decoration: none; font-weight: 700; }
button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--navy);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  background: white;
}
code {
  border-radius: 10px;
  background: #f2f5f6;
  padding: 4px 7px;
  color: var(--ink);
}
.verify-shell, .admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 40px auto;
}
.narrow { width: min(520px, calc(100% - 32px)); }
.hero-card, .result-card, .panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px;
  box-shadow: 0 20px 60px rgba(13,31,45,.08);
}
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--orange);
  font-weight: 900;
  font-size: 12px;
}
h1 { margin: 0 0 14px; font-size: clamp(34px, 6vw, 72px); letter-spacing: -.05em; }
h2 { margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.6; }
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.quick-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 16px;
  color: white;
  border-radius: 14px;
  background: var(--navy);
}
.quick-links a:first-child {
  background: var(--orange);
}
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 28px; }
.brand-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 48px;
  border-radius: 16px;
  background: var(--orange);
  color: white;
  font-weight: 1000;
  letter-spacing: .02em;
}
.result-card.ok { border-top: 8px solid var(--teal); }
.result-card.bad { border-top: 8px solid #d94b4b; }
.verify-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.verify-title h1 {
  margin-bottom: 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  color: white;
  font-weight: 900;
  white-space: nowrap;
}
.status-pill.valid { background: var(--teal); }
.status-pill.revoked { background: #d94b4b; }
.verify-note {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
dt { color: var(--muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 4px 0 0; font-size: 20px; font-weight: 800; }
.admin-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.dashboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.dashboard article, .report-grid article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(13,31,45,.06);
}
.dashboard span, .report-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard strong, .report-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.manual-form {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(170px, .8fr) minmax(240px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}
.filter-panel .wide-action {
  grid-column: auto;
}
.filter-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filter-panel a {
  align-self: center;
  padding: 12px 0;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px !important;
  border-radius: 14px;
  background: var(--orange);
  color: white;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.button-link.secondary {
  background: var(--navy);
}
.danger-button {
  background: #b42318;
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.result-note {
  margin: -6px 0 18px;
  font-weight: 700;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}
.records { display: grid; gap: 12px; }
.record {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto auto 86px auto auto;
  gap: 14px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}
.record div { display: grid; gap: 4px; }
.record-main {
  min-width: 0;
}
.record-main strong, .record-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record span { color: var(--muted); }
.record img { width: 86px; height: 86px; }
.muted-action { font-weight: 800; color: var(--muted); white-space: nowrap; }
pre { white-space: pre-wrap; background: #f7f9fa; padding: 16px; border-radius: 16px; color: #9d2727; }
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}
.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.detail-heading h2 {
  margin-top: 16px;
  font-size: 34px;
}
.detail-qr {
  width: 180px;
  height: 180px;
}
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}
.detail-actions form button {
  width: 100%;
}
.short-link {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.short-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.short-link code {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
  .record { grid-template-columns: minmax(220px, 1fr) auto auto auto auto auto auto; }
}

@media (max-width: 780px) {
  .search-form, .grid, .form-grid, .filter-panel, dl, .record, .dashboard, .report-grid, .detail-layout { grid-template-columns: 1fr; }
  .filter-actions { align-items: stretch; flex-direction: column; }
  .record-main strong, .record-main span { white-space: normal; }
  .admin-head { align-items: flex-start; flex-direction: column; }
  .verify-title, .detail-heading { flex-direction: column; }
  .verify-shell, .admin-shell { width: min(100% - 24px, 1120px); margin: 24px auto; }
  .hero-card, .result-card, .panel { border-radius: 24px; padding: 24px; }
  h1 { font-size: clamp(34px, 11vw, 54px); }
  .brand-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .detail-qr { width: 150px; height: 150px; }
  .record img { width: 72px; height: 72px; }
  .button-link, button { width: 100%; }
  .quick-links a { width: 100%; justify-content: center; }
}

@media (max-width: 430px) {
  .hero-card, .result-card, .panel { padding: 20px; }
  dd { font-size: 18px; overflow-wrap: anywhere; }
  code { overflow-wrap: anywhere; }
  .dashboard strong, .report-grid strong { font-size: 24px; }
}
