/* ==========================================================================
   PBISB Membership — design system
   Matches pbisb.com: dark blaugrana, gold accent, Teko display type.
   Framework-free. Respects prefers-reduced-motion.
   ========================================================================== */

/* ---------- Teko (self-hosted, OFL) — one variable file, weights 300–700 ---- */
@font-face {
  font-family: "Teko";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../vendor/teko/teko-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Teko";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../vendor/teko/teko-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  /* base — pbisb.com palette */
  --bg: #04060f;
  --bg-grid: rgba(120, 140, 180, 0.05);
  --surface: #0c1220;
  --surface-2: #111a2c;
  --surface-3: #16223a;
  --border: #223250;
  --border-strong: #33456a;

  /* text */
  --ink: #eef1f8;
  --ink-soft: #aab6cc;
  --ink-faint: #7c8aa6;

  /* brand */
  --blue: #0a4ea2;          /* FCB blue */
  --blue-600: #0c5cbd;
  --garnet: #a50044;        /* FCB garnet — primary buttons */
  --garnet-600: #c31356;
  --gold: #edbb00;          /* accent — headings, rules, bullets */
  --gold-600: #ffcf1f;

  --brand-grad: linear-gradient(120deg, var(--blue) 0%, #123a6b 45%, var(--garnet) 115%);
  --gold-rule: linear-gradient(90deg, var(--gold), rgba(237, 187, 0, 0));

  /* semantic */
  --ok: #35c98b;
  --ok-bg: #0e2a20;
  --danger: #ff6b6b;
  --danger-bg: #2c1518;
  --warn: #ffc857;
  --warn-bg: #2a2113;

  --ring: 0 0 0 3px rgba(237, 187, 0, 0.4);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 28px 70px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 130ms var(--ease);
  --med: 240ms var(--ease);

  --maxw: 1180px;
  --font: "Teko", "Arial Narrow", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Teko is a condensed face — scale the whole UI up ~15% so it reads at a
   comfortable size. Everything else is in rem, so this "zooms" uniformly. */
html { -webkit-text-size-adjust: 100%; font-size: 115%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--ink);
  /* base wash — the animated tile grid (#bg canvas) sits on top of this */
  background-color: #060a16;
  background-image:
    radial-gradient(75% 50% at 12% -8%, rgba(10, 78, 162, 0.42), transparent 60%),
    radial-gradient(65% 45% at 100% -5%, rgba(165, 0, 68, 0.34), transparent 58%),
    radial-gradient(45% 40% at 88% 108%, rgba(237, 187, 0, 0.12), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--gold);
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(237, 187, 0, 0.3); color: #04060f; }
strong, b { font-weight: 600; }

/* ---------- app shell ---------- */
html, body { overflow-x: hidden; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 12px clamp(14px, 4vw, 32px);
  background: rgba(4, 6, 15, 0.82);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  .site-header { justify-content: flex-start; }
  .brand { font-size: 1.05rem; gap: 8px; }
  .site-nav { gap: 10px; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .site-nav .user-chip { margin-left: auto; }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--gold); }
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--brand-grad);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 0 2px rgba(237, 187, 0, 0.25);
  flex: none;
}
.site-nav { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.user-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--garnet); color: #fff;
  font-size: 0.85rem; font-weight: 700;
}
.link-btn {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.link-btn:hover { border-color: var(--gold); color: var(--gold); }
.inline { display: inline; margin: 0; }

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 32px);
}
.site-footer {
  padding: 18px clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--border);
  color: var(--ink-faint);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ---------- panels ---------- */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--gold-rule);
}
.panel-pad { padding: clamp(20px, 3.5vw, 32px); }
.panel-head { margin-bottom: 20px; }
.panel-head h1 { margin-bottom: 2px; }
.panel-head .sub { color: var(--ink-soft); font-size: 1.05rem; margin-top: 6px; }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 6px;
}

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; margin-bottom: 16px; }
.field > label {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.field .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }
.input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.input::placeholder { color: var(--ink-faint); }
.input:hover { border-color: var(--ink-faint); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring); background: var(--surface-3); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.field.has-error .input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

/* native date/select controls readable on dark */
input[type="date"].input { min-height: 42px; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.6); cursor: pointer; }
select.input { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
  linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 58px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-faint); padding: 6px 8px; border-radius: 6px;
  font: inherit; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.pw-toggle:hover { color: var(--gold); }

.field-error { color: var(--danger); font-size: 0.9rem; margin: 2px 0 0; }
.field-aside { margin: 6px 0 0; font-size: 0.95rem; text-align: right; }
.field-aside a { color: var(--ink-soft); }
.field-aside a:hover { color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--fast), box-shadow var(--fast), filter var(--fast),
    background var(--fast), border-color var(--fast), color var(--fast);
  user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-loading { opacity: 0.65; pointer-events: none; }

.btn.primary {
  --btn-bg: var(--garnet);
  --btn-fg: #fff;
  --btn-bd: var(--garnet);
  box-shadow: 0 6px 18px rgba(165, 0, 68, 0.35);
}
.btn.primary:hover { --btn-bg: var(--garnet-600); --btn-bd: var(--garnet-600); box-shadow: 0 8px 22px rgba(165, 0, 68, 0.45); }

.btn.gold { --btn-bg: var(--gold); --btn-fg: #04060f; --btn-bd: var(--gold); box-shadow: 0 6px 18px rgba(237, 187, 0, 0.25); }
.btn.gold:hover { --btn-bg: var(--gold-600); --btn-bd: var(--gold-600); }

.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn.block { width: 100%; }
.btn.btn-sm { padding: 5px 12px; font-size: 0.82rem; letter-spacing: 0.04em; }
.btn.danger { color: var(--danger); }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- global top progress bar (ui.js) ---------- */
.top-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--garnet-600));
  box-shadow: 0 0 10px rgba(237, 187, 0, 0.55), 0 0 4px rgba(237, 187, 0, 0.8);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: width 0.25s ease, opacity 0.3s ease;
}
.top-progress.active { opacity: 1; }
.top-progress.done { transition: width 0.2s ease, opacity 0.4s ease 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .top-progress { transition: opacity 0.15s ease; }
}

/* ---------- flash / alerts ---------- */
.flash {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  margin-bottom: 14px;
  font-size: 1rem;
  animation: pop var(--med) both;
}
.flash-danger { border-left-color: var(--danger); background: var(--danger-bg); color: #ffd7d7; }
.flash-success { border-left-color: var(--ok); background: var(--ok-bg); color: #c8f5e2; }
.flash-warning { border-left-color: var(--warn); background: var(--warn-bg); color: #ffe6b3; }

/* ---------- login ---------- */
.auth-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 6vh 20px;
}
.auth-card {
  width: 100%;
  max-width: 560px;
  padding: clamp(32px, 5vw, 52px);
  animation: rise var(--med) both;
  /* let the animated grid glow through */
  background: rgba(12, 18, 32, 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  border-color: rgba(120, 140, 180, 0.18);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.auth-brand b { font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.02em; }

/* larger, clearer controls on the login screen */
.auth-card h1 { font-size: clamp(2rem, 5vw, 2.6rem); }
.auth-card .sub { font-size: 1.15rem; margin-bottom: 28px; }
.auth-card .field { margin-bottom: 22px; }
.auth-card .field > label { font-size: 1rem; margin-bottom: 2px; }
.auth-card .input { font-size: 1.2rem; padding: 14px 16px; min-height: 56px; border-radius: 8px; }
.auth-card .pw-wrap .input { padding-right: 68px; }
.auth-card .pw-toggle { font-size: 0.95rem; padding: 8px 12px; }
.auth-card .btn.primary { font-size: 1.15rem; padding: 15px 22px; min-height: 56px; margin-top: 4px; }
.auth-card .field-error { font-size: 1rem; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .sub { color: var(--ink-soft); }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 940px) {
  .dash-grid { grid-template-columns: minmax(0, 470px) minmax(0, 1fr); align-items: start; }
  .preview-col { position: sticky; top: 90px; }
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.preview-col .panel { overflow: hidden; }
.preview-empty {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 340px;
  padding: 32px;
  color: var(--ink-faint);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.preview-empty .ico {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--brand-grad); opacity: 0.4; margin-bottom: 12px;
}
.preview-stage { padding: 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.preview-frame {
  width: 100%;
  aspect-ratio: 1013 / 715;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  display: block;
}
.preview-body { padding: 16px 18px 18px; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}
.pill b { color: var(--gold); font-weight: 600; }
.status-line {
  min-height: 1.2em; margin-top: 12px; font-size: 0.95rem; color: var(--ink-faint);
}

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(237, 187, 0, 0.09), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- public card view ---------- */
.card-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 6vw, 60px) 20px;
}
.card-view .eyebrow { letter-spacing: 0.22em; }
.card-view h1 { margin-bottom: 22px; }
.scene { width: min(560px, 100%); perspective: 1400px; }
.flip-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1013 / 638;
  transform-style: preserve-3d;
  transition: transform 0.75s var(--ease);
  cursor: pointer;
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-card:focus-visible { outline: none; border-radius: 20px; box-shadow: 0 0 0 4px rgba(237, 187, 0, 0.45); }
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: clamp(12px, 3.5vw, 20px);
  overflow: hidden;
  box-shadow: var(--shadow-3);
}
.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face.back { transform: rotateY(180deg); }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 24px 0 10px; }
.hint {
  color: var(--ink-faint);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hint .flip-ico {
  width: 15px; height: 15px;
  border: 1.6px solid currentColor;
  border-radius: 4px;
  animation: nudge 2.6s var(--ease) infinite;
}
@keyframes nudge { 0%, 60%, 100% { transform: rotateY(0); } 78% { transform: rotateY(180deg); } }
.card-view .btn { margin-top: 22px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.card-actions .btn { margin-top: 22px; }

/* ---------- embed (iframe preview) ---------- */
body.embed {
  background: transparent;
  background-image: none;
  padding: 10px;
  align-items: center;
  justify-content: center;
}
body.embed .scene { width: min(520px, 100%); }
body.embed .hint { margin-top: 12px; }

/* ---------- error pages ---------- */
.err-wrap { flex: 1; display: grid; place-items: center; padding: 8vh 20px; text-align: center; }
.err-wrap .code {
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.04em;
  line-height: 1;
}
.err-wrap h1 { margin: 4px 0 10px; }
.err-wrap p { color: var(--ink-soft); max-width: 46ch; font-size: 1.05rem; }
.err-wrap .btn { margin-top: 18px; }

/* ---------- animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
.reveal { animation: rise var(--med) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- header nav links ---------- */
.nav-link {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--gold); text-decoration: none; }
.nav-link.active { color: var(--ink); border-bottom-color: var(--gold); }

/* ---------- admin ---------- */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.subnav a {
  padding: 9px 14px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--gold); border-bottom-color: var(--gold); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 18px; }
.filters .input { max-width: 320px; }
.filters select.input { max-width: 200px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: var(--surface-2);
}
.table tbody tr:hover { background: var(--surface-2); }
.table td a { color: var(--gold); }
.table code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; color: var(--ink-soft); }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
}
.badge-ok { color: #c8f5e2; border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); background: var(--ok-bg); }
.badge-danger { color: #ffd7d7; border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); background: var(--danger-bg); }
.badge-muted { opacity: 0.7; }
.badge-role { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; font-size: 0.95rem; }
.pagination a { color: var(--gold); }
.pagination .disabled { color: var(--ink-faint); }
.pagination .page-of { color: var(--ink-soft); }

.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 22px; }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  color: var(--ink);
}
.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi-num { font-size: 2.2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.kpi-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }
.kpi-sub { color: var(--ink-faint); font-size: 0.85rem; }

.col-2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .col-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .input { flex: 1; }
.input-row .btn { white-space: nowrap; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-faint); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.kv dd { margin: 0; word-break: break-word; }

.checkline { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
textarea.input { resize: vertical; min-height: 70px; }

/* ---------- utilities ---------- */
@media (max-width: 560px) { .hide-sm { display: none; } }
.muted { color: var(--ink-soft); }

/* ---------- SweetAlert2 — dark blaugrana theme ---------- */
.swal2-popup {
  border-radius: var(--r-lg) !important;
  font-family: var(--font) !important;
  font-size: 1rem !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-3) !important;
}
.swal2-title {
  color: var(--gold) !important;
  text-transform: uppercase !important;
  letter-spacing: -0.02em !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
}
.swal2-html-container, .swal2-input-label { color: var(--ink-soft) !important; }
.swal2-input, .swal2-textarea, .swal2-select {
  border-radius: var(--r-sm) !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface-2) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  font-family: var(--font) !important;
  font-size: 1.05rem !important;
}
.swal2-input:focus { border-color: var(--gold) !important; box-shadow: var(--ring) !important; }
.swal2-validation-message {
  background: var(--danger-bg) !important;
  color: #ffd7d7 !important;
  border-radius: var(--r-sm) !important;
}
.swal2-styled.swal2-confirm {
  background: var(--garnet) !important;
  color: #fff !important;
  border-radius: var(--r-sm) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  font-weight: 600 !important;
  box-shadow: 0 6px 18px rgba(165, 0, 68, 0.4) !important;
}
.swal2-styled.swal2-cancel {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--r-sm) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}
.swal2-styled:focus { box-shadow: var(--ring) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(53, 201, 139, 0.4) !important; }
.swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--ok) !important; }
.swal2-icon.swal2-error { border-color: var(--danger) !important; color: var(--danger) !important; }
.swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--danger) !important; }
.swal2-toast {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--shadow-3) !important;
}
.swal2-toast .swal2-title { font-size: 1.05rem !important; }
.swal2-timer-progress-bar { background: rgba(237, 187, 0, 0.4) !important; }

/* ---------- verification preview (experimental) ---------- */
.verify-wrap {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 56px) 20px;
  text-align: center;
}
.verify-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  padding: 12px 28px;
  border-radius: 999px;
  border: 2px solid;
  margin: 6px 0 20px;
}
.verify-banner .v-dot { width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.v-active { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.v-expired { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.v-revoked, .v-unknown { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

.verify-card { display: flex; gap: 20px; align-items: center; text-align: left; margin-top: 8px; }
@media (max-width: 520px) { .verify-card { flex-direction: column; text-align: center; } }
.verify-photo {
  width: 132px; height: 132px; object-fit: cover; flex: none;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2);
}
.verify-photo--none {
  display: grid; place-items: center; color: var(--ink-faint);
  font-size: 0.8rem; text-align: center; padding: 8px;
}
.verify-live { color: var(--ink-faint); font-size: 0.95rem; margin-top: 18px; }

.lab-list { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.lab-list li { margin-bottom: 8px; }

.rot-code { margin: 8px 0 4px; }
.rot-digits {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2.6rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--gold);
}
.rot-digits.flash { animation: rot-flash 0.5s var(--ease); }
@keyframes rot-flash { from { opacity: 0.2; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.rot-meter {
  display: block; height: 4px; width: 220px; max-width: 100%; margin: 6px auto;
  background: var(--surface-3); border-radius: 999px; overflow: hidden;
}
.rot-meter i { display: block; height: 100%; background: var(--gold); transition: width 1s linear; }
.rot-hint { display: block; color: var(--ink-faint); font-size: 0.9rem; }

.lab-tab { color: var(--gold-600) !important; }
.lab-tab.active { border-bottom-color: var(--gold-600) !important; }

/* ---------- a11y ---------- */
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 10000;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  background: var(--gold);
  color: #04060f;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; text-decoration: none; outline: none; }
