/* ==========================================================================
   portal.css — Scrollwell Certificate Portal design system.
   Public help-center + verify pages + admin console + login.

   Design language: Google-product discipline —
   · one type scale (Inter for display, Roboto for body), 8px spacing rhythm
   · layered elevation (hairline border + soft ambient shadow, never heavy)
   · semantic status palette (success/error/warning/info)
   · visible keyboard focus rings, pressed states, reduced-motion support
   · micro-interactions: 160ms ease-out hovers, gentle lifts, no bounce

   NOTE: this stylesheet is NEVER injected into the certificate output —
   the frozen templates carry their own styles (L-30).
   ========================================================================== */

:root {
  /* brand — used sparingly: primary actions, links, focus */
  --brand: #1a6dc4;
  --brand-dark: #155aa6;          /* legacy name — kept for inline uses */
  --brand-deep: #114a8a;
  --brand-light: #eef4fb;         /* legacy name — kept for inline uses */
  --brand-050: #f6f8fc;
  --magenta: #b8466a;             /* muted — required asterisk / cert accent */

  /* ink — warm near-black + warm greys */
  --ink: #20201d;                 /* legacy name — headings */
  --ink-700: #4a473f;
  --muted: #757064;               /* legacy name — secondary text */
  --ink-300: #a8a294;

  /* surfaces — warm paper, crisp white cards */
  --bg: #f5f3ee;
  --surface: #ffffff;
  --line: #e9e4da;                /* legacy name — warm hairlines */
  --line-strong: #ddd6c8;

  /* chrome surfaces that stay dark in BOTH themes (avatars, status headers,
     active chips); + theme-aware hover/active fills */
  --chrome: #20201d;
  --hover: #f3f1ec;
  --active: #ece9e2;

  /* semantic — muted, never candy */
  --success: #2f7d56;  --success-bg: #eef4ef;  --success-line: #d9e6dd;
  --danger:  #b0463d;  --danger-bg:  #f7ece9;  --danger-line:  #eed2cb;
  --warning: #946612;  --warning-bg: #f6efdc;  --warning-line: #ecddb4;
  --info:    #2766b3;  --info-bg:    #eef3fa;  --info-line:    #d9e3f1;

  /* geometry & motion */
  --r-s: 8px;  --r-m: 12px;  --r-l: 14px;  --r-xl: 18px;
  --shadow-1: 0 1px 2px rgba(28, 25, 20, .04);
  --shadow-2: 0 1px 2px rgba(28, 25, 20, .04), 0 6px 18px rgba(28, 25, 20, .05);
  --shadow-3: 0 12px 36px rgba(28, 25, 20, .11);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --fast: 140ms;  --med: 240ms;

  /* legacy aliases still referenced inline in PHP views */
  --card-radius: var(--r-l);
  --gap: 16px;
  --section-padding: 26px;
  --transition: all var(--fast) var(--ease);
  --shadow: var(--shadow-2);

  /* ─────────────────────────────────────────────────────────────────────
     CREDENTIAL IDENTITY TOKENS (design language: official document / seal).
     A five-token vocabulary aliased onto the existing palette so nothing
     changes structurally — only adds named, intentional design moments.
       Ink    — type/structure anchor (warm near-black, not pure #000)
       Vellum — aged-paper surface (not #fff)
       Seal   — the ONE accent (brass/wax). The brand moment, used sparingly.
       Verify — official confirmed state (not playful green)
       Muted  — single low-contrast tone for labels / dividers / ghosts
     ───────────────────────────────────────────────────────────────────── */
  --vellum:     var(--bg);          /* #f5f3ee aged paper */
  --seal:       #9c6b3f;            /* brass/wax — the rare brand moment      */
  --seal-deep:  #7d5430;            /* pressed edge of the seal               */
  --seal-tint:  #f4ecdf;            /* faint impression on vellum             */
  --seal-line:  #e4d4bd;            /* hairline in seal family                */
  --verify:     var(--success);     /* #2f7d56 official confirmed state       */

  /* type roles — Display for credential names, Body for metadata, Mono for IDs */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  accent-color: var(--brand);
}

/* ============================ Base ============================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Roboto', sans-serif;
  font-size: 14.5px;
  background: var(--bg);  /* flat warm paper — calm, fast, no tiled artwork */
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand); color: #fff; }

a { color: var(--brand-dark); transition: color var(--fast) var(--ease); }
a:hover { color: var(--brand-deep); }

h1, h2, h3, h4 { color: var(--ink); }

/* keyboard focus — visible, branded, never on mouse click */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* slim, quiet scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c8d2de; border-radius: 99px; border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #aebccb; border: 2px solid transparent; background-clip: content-box; }

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

/* ============================ Shared layout ============================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  flex: 1;
  align-items: start;
}
@media (min-width: 992px) {
  .container { grid-template-columns: 280px 1fr; }
}

.topbar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.back-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-1);
}
.back-btn:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.back-btn:active { transform: translateY(0); }
.back-btn.ghost { background: rgba(255, 255, 255, .9); color: var(--brand-dark); border: 1px solid var(--line-strong); }
.back-btn.ghost:hover { background: #fff; }

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 20px;
  grid-column: 1 / -1;
}
.logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-2);
  flex-shrink: 0;
}
.logo img { width: 76%; height: 76%; object-fit: contain; }
.header-content h1 {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--brand);
  margin-bottom: 3px;
  line-height: 1.2;
}
.header-content p { color: var(--muted); font-size: 15px; }

/* ============================ Sidebar nav (public) ============================ */
.sidebar { display: flex; flex-direction: column; gap: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 13px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  color: var(--ink-700);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  gap: 12px;
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--brand-dark);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--chrome);
  border-color: var(--chrome);
  color: #fff;
  box-shadow: none;
}
/* Seal moment: the active section's icon is struck in brass — the single,
   sparing use of Seal on the help-center chrome, marking the current action. */
.nav-item.active i { color: #e8c89a; opacity: 1; }
.nav-item i { width: 22px; text-align: center; font-size: 16px; opacity: .9; }
.nav-item .count {
  margin-left: auto;
  background: var(--magenta);
  color: #fff;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
}
.nav-item.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.nav-item.danger:hover { background: var(--danger); color: #fff; }

@media (max-width: 991px) {
  /* Tidy single-row, swipeable tab strip instead of a wrapped block. */
  .sidebar {
    flex-direction: row; flex-wrap: nowrap;
    gap: 8px; overflow-x: auto; padding-bottom: 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 0 0 auto; white-space: nowrap;
    padding: 10px 15px; font-size: 13px; border-radius: 999px;
    scroll-snap-align: start;
  }
  .nav-item:hover { transform: none; }
  .nav-item i { width: auto; font-size: 14px; }
}

/* ============================ Main panel ============================ */
.main-content {
  background: var(--surface);
  border-radius: var(--r-l);
  padding: var(--section-padding);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
  min-height: 500px;
  min-width: 0;
}

.section { display: none; animation: fadeIn var(--med) var(--ease); }
.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
}

/* ============================ Forms ============================ */
.form-group, .field { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: .005em;
}
.field .req { color: var(--magenta); }
.field .hint, .hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.5; }

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-size: 14.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-300); }
input:hover, select:hover, textarea:hover { border-color: #b9c6d4; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(18, 123, 203, .14);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2369788c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
input[type="file"] {
  padding: 9px 12px;
  background: var(--brand-050);
  border-style: dashed;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 6px 12px;
  margin-right: 10px;
  font: 600 12.5px 'Roboto', sans-serif;
  color: var(--ink-700);
  cursor: pointer;
  transition: var(--transition);
}
input[type="file"]::file-selector-button:hover { border-color: var(--brand); color: var(--brand-dark); }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 0;
}
@media (min-width: 768px) { .form-row { grid-template-columns: 1fr 1fr; } }

.label-optional { color: var(--ink-300); font-weight: 400; font-size: 12px; margin-left: 6px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--fast) var(--ease);
}
.input-icon-wrap:focus-within i { color: var(--brand); }
.input-icon-wrap input { padding-left: 38px; }

.search-row { display: flex; gap: 10px; margin-bottom: 20px; }
.search-row input { flex: 1; }

/* ============================ Buttons ============================ */
button, .button-link, .btn {
  background: var(--brand);
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
  text-decoration: none;
  line-height: 1.3;
  font-family: inherit;
  box-shadow: var(--shadow-1);
}
button:hover, .button-link:hover, .btn:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
button:active, .button-link:active, .btn:active { transform: translateY(0) scale(.985); box-shadow: var(--shadow-1); }

button.secondary, .button-link.secondary, .btn.secondary {
  background: var(--info-bg);
  color: var(--brand-dark);
  box-shadow: none;
}
button.secondary:hover, .button-link.secondary:hover, .btn.secondary:hover { background: #d9e8fd; color: var(--brand-deep); }

button.danger, .btn.danger { background: var(--danger); }
button.danger:hover, .btn.danger:hover { background: #a91e1b; }

button.ghost, .btn.ghost {
  background: var(--surface);
  color: var(--ink-700);
  border-color: var(--line-strong);
  box-shadow: none;
}
button.ghost:hover, .btn.ghost:hover { background: var(--brand-050); color: var(--brand-dark); border-color: #b9cfe4; }

button.success, .btn.success { background: var(--success); }
button.success:hover, .btn.success:hover { background: #136c2e; }

.btn.small, button.small { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ============================ Status & feedback ============================ */
.result-box { margin-top: 24px; animation: fadeIn var(--med) var(--ease); }

.status-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.status-verified, .badge.valid { background: var(--success-bg); color: var(--success); }
.status-pending, .badge.superseded { background: var(--warning-bg); color: var(--warning); }
.status-error, .badge.revoked { background: var(--danger-bg); color: var(--danger); }
.badge.notfound { background: #eef1f5; color: var(--muted); }

.pill {
  display: inline-block;
  padding: 3.5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pill.active, .pill.resolved { background: var(--success-bg); color: var(--success); }
.pill.revoked, .pill.dismissed { background: var(--danger-bg); color: var(--danger); }
.pill.superseded, .pill.open { background: var(--warning-bg); color: var(--warning); }

.notice {
  padding: 13px 16px;
  border-radius: var(--r-m);
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.55;
  animation: fadeIn var(--med) var(--ease);
}
.notice.error { background: var(--danger-bg); color: #93211e; border: 1px solid var(--danger-line); }
.notice.ok { background: var(--success-bg); color: #136c2e; border: 1px solid var(--success-line); }
.notice.warn { background: var(--warning-bg); color: #8a4c00; border: 1px solid var(--warning-line); }
.notice.info { background: var(--info-bg); color: #174fa3; border: 1px solid var(--info-line); }

.feedback { color: var(--danger); font-size: 13px; margin-top: 6px; }
.hidden { display: none !important; }

/* ============================ Find & Download ============================ */
.find-summary {
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: var(--r-l);
  background: var(--chrome);   /* calm near-black band — premium, not candy blue */
  box-shadow: none;
}
.find-summary-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 5px;
}
.find-summary-line {
  margin-bottom: 3px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.94);
}
.find-summary-line:last-child { margin-bottom: 0; }

.certificate-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.download-card {
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 18px;
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease), border-color var(--med) var(--ease);
}
.download-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-strong); }
.download-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 13px;
}
.download-card-title { color: var(--ink); font-size: 15.5px; line-height: 1.35; font-weight: 700; }
.download-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.download-card-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34a853;
  box-shadow: 0 0 0 3px rgba(52, 168, 83, .14);
}
.download-card-badge.warn { background: var(--warning-bg); color: var(--warning); }
.download-card-badge.warn::before { background: #f9ab00; box-shadow: 0 0 0 3px rgba(249, 171, 0, .14); }
.download-card-badge.bad { background: var(--danger-bg); color: var(--danger); }
.download-card-badge.bad::before { background: #ea4335; box-shadow: 0 0 0 3px rgba(234, 67, 53, .14); }
.download-card-id {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.download-card-meta { display: grid; gap: 11px; margin-bottom: 16px; }
.download-card-row { display: grid; gap: 3px; }
.download-card-label {
  color: var(--ink-300);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.download-card-value {
  color: var(--ink-700);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 600;
  word-break: break-word;
}
.download-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.download-card-status { color: var(--muted); font-size: 12px; font-weight: 600; }
.download-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow-1);
  transition: var(--transition);
}
.download-card-link:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.download-card-link.is-disabled {
  background: #e6edf6;
  color: var(--ink-300);
  box-shadow: none;
  pointer-events: none;
}

/* ============================ Verify panel + card ============================ */
.verify-shell { max-width: 760px; margin: 0 auto; }
.verify-panel {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.verify-form-card {
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  padding: 18px;
}
.verify-form-card label { font-weight: 700; color: var(--ink); }
.verify-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  margin-bottom: 0;
}
.verify-search-row input {
  width: 100%;
  min-height: 52px;
  border-radius: 13px;
  padding: 0 16px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .02em;
}
.verify-search-row button {
  width: 100%;
  min-height: 52px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 700;
}
.verify-feedback { margin-top: 14px; font-size: 13px; }
.verify-result-card { margin-top: 18px; }

/* Empty-state helper under the search (hidden once a result shows) */
.find-help { margin-top: 22px; animation: fadeIn var(--med) var(--ease); }
.find-help.hidden { display: none; }
.find-help-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.find-step {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 15px 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
}
.find-step-n {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--chrome); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.find-step-t { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.find-step-d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.find-help-tip {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 12px; padding: 11px 15px;
  background: var(--seal-tint, #f4ecdf); border: 1px solid var(--seal-line, #e4d4bd);
  border-radius: var(--r-m); font-size: 13px; color: #7a5c00;
}
.find-help-tip i { color: var(--seal, #9c6b3f); }
.find-eg {
  display: inline; padding: 2px 7px; margin: 0 1px;
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; font-weight: 600;
  color: var(--brand-deep); background: var(--brand-050); border: 1px solid var(--info-line);
  border-radius: 6px; cursor: pointer; transition: background var(--fast) var(--ease);
}
.find-eg:hover { background: #e3eefb; }
@media (max-width: 700px) { .find-help-steps { grid-template-columns: 1fr; } }

.verified-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: fadeIn var(--med) var(--ease);
}
/* Signature motif: a thin brass foil line across the top of every credential
   — the "document lineage" mark that becomes this product's visual memory.
   The gradient is a light-catch on foil (a meaning, not decoration). */
.verified-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--seal-deep), var(--seal) 28%, #d8b27a 50%, var(--seal) 72%, var(--seal-deep));
  z-index: 2;
}
/* The seal is an emblem of validity — so on revoked/superseded/not-found
   states the foil line and hallmark drop to the matching status tone instead. */
.verified-card:has(.verified-card-header.revoked)::before    { background: var(--danger); }
.verified-card:has(.verified-card-header.superseded)::before { background: var(--warning); }
.verified-card:has(.verified-card-header.notfound)::before   { background: var(--ink-300); }
.verified-card:has(.verified-card-header.revoked) .verified-card-icon,
.verified-card:has(.verified-card-header.superseded) .verified-card-icon,
.verified-card:has(.verified-card-header.notfound) .verified-card-icon {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}
.verified-card-header {
  background: var(--chrome);   /* near-black; the green VALID pill carries the status */
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.verified-card-header.revoked { background: #6f2b25; }
.verified-card-header.superseded { background: #6f5316; }
.verified-card-header.notfound { background: #45433d; }
.verified-card-headline { display: flex; align-items: center; gap: 13px; min-width: 0; }
/* Hallmark seal: a struck-brass medallion. The one place Seal appears in the
   header, so it reads as an official impression rather than a UI icon. */
.verified-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--seal);
  box-shadow: inset 0 0 0 4px rgba(156, 107, 63, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 38% 34%, rgba(216, 178, 122, 0.35), rgba(156, 107, 63, 0.12) 60%, transparent 72%),
    rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8c89a;
  font-size: 24px;
  flex-shrink: 0;
}
.verified-card-text h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 4px;
}
.verified-card-text p { color: rgba(255, 255, 255, 0.85); font-size: 13px; }
.verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.verified-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 9px rgba(74, 222, 128, 0.75);
}
.verified-pill-dot.red { background: #f87171; box-shadow: 0 0 9px rgba(248, 113, 113, .75); }
.verified-pill-dot.amber { background: #fbbf24; box-shadow: 0 0 9px rgba(251, 191, 36, .75); }
.verified-pill-dot.grey { background: #d1d5db; box-shadow: 0 0 9px rgba(209, 213, 219, .75); }
.verified-card-body { padding: 22px 28px 20px; }
.verified-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 24px;
}
.verified-card-field.full-width { grid-column: 1 / -1; }
.verified-card-label {
  color: var(--ink-300);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
  margin-bottom: 7px;
}
.verified-card-value {
  color: var(--ink-700);
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 600;
  word-break: break-word;
}
.verified-card-value.name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  line-height: 1.12;
  color: var(--ink);
}
.verified-card-value.cert-id {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 9px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.verified-card-footer {
  border-top: 1px solid var(--line);
  background: #fafcff;
  padding: 13px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.verified-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.verified-card-meta i { color: var(--success); font-size: 15px; }
/* Download is the page's primary action → a solid affordance, not a text link. */
.verified-card-download {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--r-m);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: var(--shadow-1);
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease), gap var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.verified-card-download:hover {
  background: var(--brand-deep);
  gap: 11px;
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.verified-card-download:active { transform: translateY(0); }
.verified-card-download:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ============================ Share / FAQ ============================ */
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  background: var(--brand-050);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--transition);
}
.action-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-2); }
.action-btn:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.certificate-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.certificate-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 18px;
  box-shadow: var(--shadow-1);
}
/* Same brass foil signature as the credential cards — one consistent motif. */
.certificate-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--seal-deep), var(--seal) 28%, #d8b27a 50%, var(--seal) 72%, var(--seal-deep));
}
.certificate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.certificate-title { font-weight: 700; color: var(--ink); font-size: 15.5px; font-family: 'Inter', sans-serif; }

.grid-faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }

.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 16px;
  border-top: 3px solid var(--brand);
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
  box-shadow: var(--shadow-1);
}
.category-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.category-card h3 {
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  margin-bottom: 4px;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

.faq-item { border-top: 1px solid var(--line); padding: 11px 0; }
.faq-item:first-of-type { border-top: none; }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  box-shadow: none;
}
.faq-q:hover { color: var(--brand); transform: none; background: none; box-shadow: none; }
.faq-q i { transition: transform var(--fast) var(--ease); }
.faq-a { display: none; margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.faq-a.show { display: block; animation: fadeIn var(--fast) var(--ease); }

/* ============================ Cards / tables (admin) ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 22px;
  box-shadow: var(--shadow-1);
}

.table-scroll { overflow-x: auto; border-radius: var(--r-s); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td {
  padding: 11px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  background: #f7fafc;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
table.data tbody tr { transition: background var(--fast) var(--ease); }
table.data tr:hover td { background: var(--brand-050); }
table.data tr:last-child td { border-bottom: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 16px 18px;
  border-top: 3px solid var(--brand);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
}
a.stat:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.stat .n {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-dark);
  font-family: 'Inter', sans-serif;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.detail-list { text-align: left; margin: 22px auto 6px; max-width: 560px; }
.detail-list .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list .row:last-child { border-bottom: 0; }
.detail-list .k { flex: 0 0 150px; color: var(--muted); font-size: 13px; }
.detail-list .v { flex: 1; color: var(--ink); font-weight: 600; word-break: break-word; font-size: 13.5px; }

.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar-row select, .toolbar-row input[type="text"] { width: auto; }
.toolbar-row input[type="text"] { flex: 1 1 200px; }
.spacer { flex: 1; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  text-decoration: none;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  transition: var(--transition);
  font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--brand); background: var(--brand-050); }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: .01em; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; }
.wrap.narrow { max-width: 720px; }
.status-card { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } .detail-list .k { flex-basis: 110px; } }

/* ============================ Login page ============================ */
.login-stage {
  width: 100%;
  max-width: 980px;
  margin: 4vh auto 0;
  display: grid;
  grid-template-columns: 1fr;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-3);
  background: var(--surface);
  animation: fadeIn var(--med) var(--ease);
}
@media (min-width: 860px) { .login-stage { grid-template-columns: 1.05fr 1fr; } }

.login-hero {
  background: var(--chrome);   /* calm near-black panel — premium, minimal */
  color: #fff;
  padding: 46px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}
.login-hero .mark {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}
.login-hero .mark img { width: 74%; height: 74%; object-fit: contain; }
.login-hero h1 {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.22;
  margin-bottom: 12px;
  color: #fff;   /* override the base dark h1 colour — this sits on the dark panel */
}
.login-hero p { color: rgba(255, 255, 255, .85); font-size: 14.5px; max-width: 360px; }
.login-hero ul { list-style: none; margin-top: 26px; display: grid; gap: 12px; }
.login-hero li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .92);
}
.login-hero li i {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  flex-shrink: 0;
}
.login-hero .foot { margin-top: 30px; font-size: 12px; color: rgba(255, 255, 255, .6); }

.login-form-side { padding: 46px 42px; display: flex; flex-direction: column; justify-content: center; }
.login-form-side h2 {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 5px;
}
.login-form-side .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-form-side .field-icon { position: relative; }
.login-form-side .field-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  font-size: 14px;
  transition: color var(--fast) var(--ease);
}
.login-form-side .field-icon:focus-within i { color: var(--brand); }
.login-form-side .field-icon input {
  padding-left: 42px;
  padding-right: 40px;            /* room for the browser's autofill/reveal icon */
  min-height: 50px;
  border-radius: 12px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.login-form-side .field-icon input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 109, 196, .15);
  outline: none;
}
/* Keep autofilled fields on-brand (no jarring pale-blue/yellow tint). */
.login-form-side input:-webkit-autofill,
.login-form-side input:-webkit-autofill:hover,
.login-form-side input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}
.login-form-side button[type="submit"] { width: 100%; min-height: 50px; border-radius: 12px; font-size: 15px; margin-top: 4px; }
.login-links { margin-top: 22px; display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 8px; }
.login-links a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.login-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   ADMIN CONSOLE — SaaS-style shell (white sidebar + light workspace).
   ========================================================================== */
body.console-body {
  display: block;
  background: var(--bg);
  background-image: none;
  padding: 0;
}

.console { display: flex; min-height: 100vh; align-items: stretch; }

/* ---- Sidebar ---- */
.c-side {
  width: 256px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.c-brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 16px; }
.c-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--chrome);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow-1);
}
.c-avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.c-brand strong { display: block; font-size: 15px; color: var(--ink); font-family: 'Inter', sans-serif; line-height: 1.2; letter-spacing: -.01em; }
.c-brand small { color: var(--ink-300); font-size: 12px; }

.c-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-300);
  padding: 14px 10px 6px;
}
.c-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  border-radius: 11px;
  color: var(--ink-700);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  position: relative;
  transition: var(--transition);
}
.c-item i {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  background: #f1f5fa;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition);
}
.c-item:hover { background: var(--hover); color: var(--ink); }
.c-item:hover i { color: var(--ink); }
.c-item.active { background: var(--active); color: var(--ink); }
.c-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--chrome);
}
.c-item.active i { background: var(--chrome); color: #fff; box-shadow: none; }
.c-item .count {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  min-width: 21px;
  height: 21px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.c-sync {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  background: #fafcfe;
}
.c-sync small { display: block; font-weight: 400; color: var(--ink-300); margin-top: 2px; font-variant-numeric: tabular-nums; }
.c-side .c-item.logout { margin-top: 8px; color: #b3403d; }
.c-side .c-item.logout i { background: var(--danger-bg); color: #c5524f; }
.c-side .c-item.logout:hover { background: var(--danger-bg); }

/* ---- Main column ---- */
.c-main { flex: 1; min-width: 0; padding: 18px 22px 44px; }
.c-top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 13px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-1);
}
.c-top-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.c-top-title small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-300);
}
.c-top-title h1 {
  font-family: 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
  line-height: 1.25;
}
.c-top-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---- KPI cards ---- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--med) var(--ease);
}
.kpi:hover { box-shadow: var(--shadow-2); }
.kpi .n {
  font-family: 'Inter', sans-serif;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi .t { font-size: 13px; font-weight: 600; color: var(--ink-700); margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--ink-300); margin-top: 5px; line-height: 1.45; }
.kpi.accent .n { color: var(--brand-dark); }
.kpi.warn .n { color: #c2410c; }
.kpi.good .n { color: var(--success); }

/* ---- Request cards (corrections / support) ---- */
.rq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  align-items: start;
}
.rq-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
  animation: fadeIn var(--med) var(--ease);
}
.rq-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.rq-card.resolved { border-color: var(--success-line); }
.rq-card.open { border-color: var(--warning-line); }
.rq-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .01em;
}
.rq-head .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.rq-card.resolved .rq-head { background: var(--success-bg); color: var(--success); }
.rq-card.resolved .rq-head .dot { background: #34a853; box-shadow: 0 0 0 3px rgba(52, 168, 83, .15); }
.rq-card.open .rq-head { background: var(--warning-bg); color: #c2410c; }
.rq-card.open .rq-head .dot { background: #f9ab00; box-shadow: 0 0 0 3px rgba(249, 171, 0, .15); }
.rq-card.dismissed .rq-head { background: #f6f8fa; color: var(--muted); }
.rq-card.dismissed .rq-head .dot { background: var(--ink-300); }
.rq-chip {
  background: var(--surface);
  border: 1px solid currentColor;
  padding: 2.5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.rq-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.rq-who { display: flex; gap: 11px; align-items: flex-start; }
.rq-ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow-1);
}
.rq-name { font-weight: 700; color: var(--ink); font-size: 14px; line-height: 1.3; }
.rq-mail { color: var(--brand); font-size: 12.5px; font-weight: 600; word-break: break-all; }
.rq-idchip {
  display: inline-block;
  background: var(--info-bg);
  color: var(--info);
  font-weight: 700;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 11px;
  margin-top: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.rq-time { margin-left: auto; color: var(--ink-300); font-size: 11px; white-space: nowrap; padding-top: 2px; font-variant-numeric: tabular-nums; }
.rq-box { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fbfdfe; }
.rq-box .l {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-300);
  margin-bottom: 3px;
}
.rq-box .v { font-size: 13.5px; font-weight: 600; color: var(--ink-700); word-break: break-word; line-height: 1.45; }
.rq-box .v.plain { font-weight: 400; }
.rq-box .s { font-size: 11px; color: var(--ink-300); margin-top: 3px; }
.rq-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rq-foot {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  align-items: center;
  background: #fbfdfe;
}
.rq-foot select { flex: 1; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; }
.rq-foot .btn, .rq-foot button { padding: 9px 18px; font-size: 13.5px; border-radius: 9px; }
.rq-links { display: flex; gap: 14px; font-size: 12.5px; flex-wrap: wrap; }
.rq-links a { color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.rq-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Console filter bar ---- */
.c-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.c-filter input[type="text"] { flex: 1 1 220px; min-height: 42px; border-radius: 11px; font-size: 14px; }
.c-filter select { width: auto; min-height: 42px; border-radius: 11px; font-size: 14px; }

/* ---- Responsive console ---- */
@media (max-width: 960px) {
  .console { flex-direction: column; }
  .c-side {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    gap: 6px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .c-brand { padding: 4px 6px; }
  .c-brand div { display: none; }
  .c-label, .c-sync { display: none; }
  .c-item { padding: 7px 9px; font-size: 12.5px; gap: 7px; }
  .c-item.active::before { display: none; }
  .c-item i { width: 26px; height: 26px; font-size: 11.5px; border-radius: 7px; }
  .c-side .c-item.logout { margin-top: 0; }
  .c-main { padding: 14px 12px 32px; }
  .rq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .c-item span { display: none; }
  .c-item .count { margin-left: 2px; }
  .c-top-actions { width: 100%; }
  .rq-2col { grid-template-columns: 1fr; }
}

/* ---- verify / download cards on phones ---- */
@media (max-width: 768px) {
  .verify-panel { padding: 20px 14px; }
  .verify-search-row { grid-template-columns: 1fr; }
  .verified-card-header { flex-direction: column; align-items: flex-start; }
  .verified-pill { align-self: flex-start; }
  .verified-card-grid { grid-template-columns: 1fr; gap: 14px; }
  .download-grid { grid-template-columns: 1fr; }
  .verified-card-header, .verified-card-body, .verified-card-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .verified-card-text h3 { font-size: 20px; }
  .verified-card-value.name { font-size: 20px; }
  .verified-card-value, .verified-card-value.cert-id { font-size: 14.5px; }
}

/* ============================ Footer ============================ */
.footer {
  grid-column: 1 / -1;
  text-align: center;
  padding: 26px 0;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  width: 100%;
}
.footer a { color: var(--brand); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   ACCESSIBILITY · COMMAND PALETTE · TOASTS · DARK MODE  (admin + portal)
   ========================================================================== */

/* Skip link — first tab stop, jumps past the sidebar */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 12px; }

/* Command-palette launcher in the sidebar */
.c-cmdk {
  width: 100%; margin: 2px 0 8px; padding: 9px 12px;
  display: flex; align-items: center; gap: 9px;
  background: var(--brand-050); color: var(--muted);
  border: 1px solid var(--line); border-radius: 11px;
  font: 600 13px 'Roboto', sans-serif; cursor: pointer; box-shadow: none;
}
.c-cmdk:hover { background: #fff; border-color: var(--line-strong); color: var(--ink-700); transform: none; }
.c-cmdk span { flex: 1; text-align: left; }
.c-cmdk kbd, .cmdk-foot kbd {
  font: 600 10.5px ui-monospace, monospace; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 5px; padding: 2px 6px;
}

/* Command palette overlay */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(16, 24, 40, .42); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px; animation: fadeIn var(--fast) var(--ease);
}
.cmdk-overlay[hidden] { display: none; }
.cmdk-box {
  width: 100%; max-width: 560px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-3);
}
.cmdk-input { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input i { color: var(--ink-300); font-size: 15px; }
.cmdk-input input { border: 0; padding: 0; font-size: 16px; box-shadow: none !important; background: transparent; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink-700);
}
.cmdk-item i { width: 18px; text-align: center; color: var(--ink-300); }
.cmdk-item.active, .cmdk-item:hover { background: var(--brand-050); color: var(--brand-dark); }
.cmdk-item.active i, .cmdk-item:hover i { color: var(--brand); }
.cmdk-empty { padding: 20px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.cmdk-foot { padding: 9px 16px; border-top: 1px solid var(--line); color: var(--ink-300); font-size: 11.5px; }

/* Toasts */
#sw-toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.sw-toast {
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-3);
  opacity: 0; transform: translateY(10px); transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  border-left: 4px solid var(--brand);
}
.sw-toast.show { opacity: 1; transform: translateY(0); }
.sw-toast.ok { border-left-color: #34a853; }
.sw-toast.error { border-left-color: #ea4335; }
.sw-toast.warn { border-left-color: #f9ab00; }

/* Inline field validation */
.inline-err { color: var(--danger); font-size: 12px; margin-top: 5px; font-weight: 600; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }

/* High-contrast focus for keyboard users on the empty-state CTAs */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .ico {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-050); color: var(--brand); font-size: 26px;
}
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { color: var(--muted); margin: 0 auto 18px; max-width: 420px; }

/* ---------------- Dark mode (portal chrome only; never the certificate) -- */
[data-theme="dark"] {
  --brand: #4ea3e8;
  --brand-dark: #79bdf0;
  --brand-deep: #9bd0f6;
  --brand-050: #16202b;
  --brand-light: #1b2a3a;
  --ink: #e8edf3;
  --ink-700: #c2cdd9;
  --muted: #93a1b2;
  --ink-300: #6d7d8f;
  --bg: #0e141b;
  --surface: #161e27;
  --line: #263241;
  --line-strong: #33404f;
  --success: #5bb974; --success-bg: #14241a; --success-line: #24432f;
  --danger: #f28b82; --danger-bg: #2a1715; --danger-line: #4a2420;
  --warning: #fdd663; --warning-bg: #2a2113; --warning-line: #4a3a18;
  --info: #8ab4f8; --info-bg: #16202e; --info-line: #28384f;
  --hover: #1c242e;  --active: #232d39;
  /* --chrome intentionally NOT overridden — stays dark in both themes */
}
[data-theme="dark"] body { background-image: none; background-color: var(--bg); }
[data-theme="dark"] body.console-body { background: var(--bg); }
[data-theme="dark"] .c-side,
[data-theme="dark"] .c-top,
[data-theme="dark"] .card,
[data-theme="dark"] .kpi,
[data-theme="dark"] .rq-card,
[data-theme="dark"] .stat,
[data-theme="dark"] .download-card,
[data-theme="dark"] .category-card,
[data-theme="dark"] .cmdk-box,
[data-theme="dark"] table.data th { background: var(--surface); }
[data-theme="dark"] table.data tr:hover td { background: var(--brand-050); }
[data-theme="dark"] .rq-box, [data-theme="dark"] .rq-foot,
[data-theme="dark"] .c-sync { background: #11181f; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #11181f; color: var(--ink); border-color: var(--line-strong);
}
[data-theme="dark"] .c-cmdk { background: #11181f; }
[data-theme="dark"] .sw-toast { background: #0a0f14; }
[data-theme="dark"] .skip-link { color: #08121c; }
[data-theme="dark"] .login-form-side { background: var(--surface); }

/* Honour OS dark preference on first visit (before any manual toggle) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) body.console-body { background: #0e141b; }
}

/* ---- verify-page share row (LinkedIn / WhatsApp / copy) ---- */
.verify-share { border-top: 1px solid var(--line); padding: 16px 22px; }
.verify-share-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-300); margin-bottom: 10px;
}
.verify-share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.share-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  background: var(--brand-050); color: var(--brand-dark);
  border: 1px solid var(--line); transition: var(--transition);
}
.share-chip:hover { background: #fff; border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); color: var(--brand-deep); }
.share-chip.linkedin { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.share-chip.linkedin:hover { background: #08538f; color: #fff; }

/* ---- "Report an error" line under verify cards ---- */
.verify-report-line {
  text-align: center; font-size: 13px; color: var(--muted);
  padding: 14px 22px 4px;
}
.verify-report-line a { font-weight: 600; }

/* Amber "request a correction" banner under a verified card */
.verify-correct {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 16px 22px 4px;
  padding: 13px 18px;
  background: var(--seal-tint, #f4ecdf);
  border: 1px solid var(--seal-line, #e4d4bd);
  border-radius: var(--r-m, 12px);
  text-decoration: none;
  transition: background var(--fast, .14s) var(--ease), border-color var(--fast, .14s) var(--ease);
}
.verify-correct:hover { background: #f8eed8; border-color: #d8c293; }
.verify-correct:focus-visible { outline: 2px solid var(--seal, #9c6b3f); outline-offset: 2px; }
.verify-correct-l {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 500; color: #7a5c00; line-height: 1.4;
}
.verify-correct-l i { color: var(--seal, #9c6b3f); font-size: 15px; flex-shrink: 0; }
.verify-correct-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; color: var(--brand); white-space: nowrap;
  transition: gap var(--fast, .14s) var(--ease);
}
.verify-correct:hover .verify-correct-cta { gap: 9px; }

/* registered-email hint on the report form (masked, read-only) */
.reg-email-hint {
  display: flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 14px;
  background: var(--brand-050); border: 1px solid var(--info-line);
  border-radius: 10px; color: var(--ink); font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em;
}
.reg-email-hint i { color: var(--success); }

/* inline link-styled button (e.g. OTP "resend the code") */
.linklike {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--brand-dark); font-weight: 600; font-size: inherit;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
  display: inline; box-shadow: none;
}
.linklike:hover { background: none; color: var(--brand-deep); transform: none; box-shadow: none; }

/* ---- Email template editor ---- */
.tpl-editor { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1080px) { .tpl-editor { grid-template-columns: 1fr 1fr; } }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag-chip {
  background: var(--brand-050); color: var(--brand-dark);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 9px; font-size: 11.5px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer;
  box-shadow: none; transition: var(--transition);
}
.tag-chip:hover { background: #fff; border-color: var(--brand); color: var(--brand-deep); transform: none; box-shadow: var(--shadow-1); }
.tpl-preview-card { position: sticky; top: 18px; }
.tpl-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }

/* ---- First-run setup checklist ---- */
.setup-card { border-top: 3px solid var(--brand); }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.setup-step {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--brand-050);
}
.setup-step i { color: var(--ink-300); font-size: 16px; }
.setup-step.done { background: var(--success-bg); border-color: var(--success-line); }
.setup-step.done i { color: var(--success); }
.setup-step span { flex: 1; font-weight: 600; color: var(--ink-700); font-size: 14px; }
.setup-step.done span { color: var(--success); }
.setup-ok { font-size: 12px; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: .05em; }
.setup-ring {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--line) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.setup-ring::before { content: ''; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.setup-ring span { position: relative; font-weight: 800; font-size: 13px; color: var(--brand-dark); font-family: 'Inter', sans-serif; }

/* ---- Sidebar nav wrapper (items now live inside <nav>) ---- */
.c-side > nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; }
.c-side > nav .c-sync { margin-top: auto; }
@media (max-width: 960px) {
  .c-side { height: auto; }
  .c-side > nav {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  .c-side > nav .c-brand { width: auto; padding: 4px 8px 4px 2px; }
  .c-side > nav .c-cmdk { display: none; }
  .c-side > nav .c-label, .c-side > nav .c-sync { display: none; }
  .c-side > nav .c-item { padding: 8px 10px; }
  .c-side > nav .c-item.logout { margin-top: 0; margin-left: auto; }
}
