/* CertVerify design system — unified direction: one ink/accent/type system across the admin
   screens and the public verify page. A serif carries the credential title only, because that's
   the one place formality is content-driven, not decorative; everything else — admin and
   recipient-facing alike — is the same workhorse sans. */

/* Palette values below are copied directly (same oklch() coordinates, not a hex
   approximation) from the ats app's design system (app/assets/css/main.css's @theme block) —
   its brand/surface/success/danger/warning ramps, at the ramp steps that read correctly for
   CertVerify's own token roles (button fills need more contrast than inline text, etc.). */
:root {
  --color-bg: oklch(98.5% 0.002 264); /* ats surface-50 */
  --color-surface: #ffffff;
  --color-surface-alt: oklch(96.5% 0.004 264); /* ats surface-100 */
  --color-border: oklch(93.0% 0.006 264); /* ats surface-200 */
  --color-text: oklch(21.0% 0.003 264); /* ats surface-900 */
  --color-text-muted: oklch(40.0% 0.005 264); /* ats surface-600 */
  --color-text-faint: oklch(53.0% 0.006 264); /* ats surface-500 */

  --color-primary: oklch(54.0% 0.200 264); /* ats brand-600 */
  --color-primary-hover: oklch(46.0% 0.180 264); /* ats brand-700 */
  --color-primary-bg: oklch(93.5% 0.030 264); /* ats brand-100 */

  --color-success: oklch(50.8% 0.118 166); /* ats success-700 */
  --color-success-bg: oklch(97.9% 0.021 166); /* ats success-50 */
  --color-success-border: oklch(50.8% 0.118 166);

  --color-danger: oklch(51.4% 0.222 17); /* ats danger-700 */
  --color-danger-bg: oklch(96.9% 0.015 12); /* ats danger-50 */
  --color-danger-border: oklch(51.4% 0.222 17);

  --color-warning: oklch(55.5% 0.163 49); /* ats warning-700 */
  --color-warning-bg: oklch(98.7% 0.022 95); /* ats warning-50 */
  --color-warning-border: oklch(55.5% 0.163 49);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --border-width: 1px;
  --shadow-sm: 0 1px 2px rgba(31, 36, 48, 0.06);
  --shadow-md: 0 12px 32px -18px rgba(31, 36, 48, 0.28);
  --shadow-lg: 0 20px 45px -18px rgba(31, 36, 48, 0.32);

  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --max-width: 1280px;
}

/* Theme is a deliberate choice (a durable cookie, see Theming/ThemeCookie.cs and
   _ThemeToggleScript.cshtml) — never inferred from prefers-color-scheme. The server always
   renders an explicit data-theme attribute, defaulting to light. */
:root[data-theme="dark"] {
  --color-bg: oklch(17.0% 0.003 264); /* ats surface-950 */
  --color-surface: oklch(21.0% 0.003 264); /* ats surface-900 */
  --color-surface-alt: oklch(25.0% 0.004 264); /* ats surface-800 */
  --color-border: oklch(28.0% 0.005 264); /* ats surface-700 */
  --color-text: oklch(96.5% 0.004 264); /* ats surface-100 */
  --color-text-muted: oklch(65.0% 0.006 264); /* ats surface-400 */
  --color-text-faint: oklch(53.0% 0.006 264); /* ats surface-500 */

  --color-primary: oklch(72.0% 0.150 264); /* ats brand-400 */
  --color-primary-hover: oklch(79.0% 0.115 264); /* ats brand-300 */
  --color-primary-bg: oklch(18.0% 0.050 264); /* ats brand-950 */

  --color-success: oklch(76.5% 0.177 163); /* ats success-400 */
  --color-success-bg: oklch(18.0% 0.030 173); /* ats success-950 */
  --color-success-border: oklch(76.5% 0.177 163);

  --color-danger: oklch(71.2% 0.194 13); /* ats danger-400 */
  --color-danger-bg: oklch(18.0% 0.050 12); /* ats danger-950 */
  --color-danger-border: oklch(71.2% 0.194 13);

  --color-warning: oklch(82.8% 0.189 84); /* ats warning-400 */
  --color-warning-bg: oklch(18.0% 0.040 46); /* ats warning-950 */
  --color-warning-border: oklch(82.8% 0.189 84);

  --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 45px -18px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  transition: background-color 0.15s ease, color 0.15s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1rem; max-width: 68ch; }

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

small, .text-muted { color: var(--color-text-muted); }

/* ---------- Layout shell ---------- */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
  background: var(--color-surface);
  border-bottom: var(--border-width) solid var(--color-border);
}

.app-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex: 1;
}

.main-nav a {
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.main-nav a:hover {
  color: var(--color-text);
  background: var(--color-surface-alt);
  text-decoration: none;
}

.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.app-footer {
  border-top: var(--border-width) solid var(--color-border);
  padding: 1.25rem 1.5rem;
  color: var(--color-text-faint);
  font-size: 0.8rem;
}

.app-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: var(--border-width) solid var(--color-border);
  padding-bottom: 1.1rem;
}

.page-header p { margin: 0.25rem 0 0; color: var(--color-text-muted); }

/* ---------- Cards ---------- */

.card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  overflow-x: auto;
}

.card + .card { margin-top: 1.25rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ---------- Buttons ----------
   Shape lives entirely on .btn (padding, radius, weight, shadow) — matched to the ats app's own
   button treatment; a variant only ever changes fill/border/text color, never shape — so a row of
   mixed primary/secondary/danger buttons always lines up. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  border: var(--border-width) solid var(--color-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover { background: var(--color-surface-alt); }

.btn-danger {
  background: var(--color-surface);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}

.btn-danger:hover { background: var(--color-danger); color: #ffffff; }

.btn-block { width: 100%; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; line-height: 1.1rem; }

/* Icon-only buttons for dense table rows — a hover title attribute carries the label instead of
   visible text, so a row of several actions doesn't force the credential ID/date columns to wrap. */
.btn-icon {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  flex: 0 0 auto;
}

.btn-icon svg { width: 16px; height: 16px; }

.nowrap { white-space: nowrap; }

.table-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Filter bars & pagination ---------- */

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-bar .form-group { margin-bottom: 0; min-width: 160px; flex: 1 1 160px; }
.filter-bar-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; min-width: 0; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: var(--border-width) solid var(--color-border);
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.pagination-size select { width: auto; }

.pagination-controls { display: flex; align-items: center; gap: 1rem; margin-left: auto; }

.pagination-status { font-size: 0.85rem; color: var(--color-text-muted); }

.btn-disabled { opacity: 0.45; pointer-events: none; }

/* ---------- Forms ---------- */

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="color"],
input[type="file"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}

input[type="color"] { padding: 0.25rem; height: 2.6rem; cursor: pointer; }

textarea { resize: vertical; min-height: 5rem; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

form .btn { margin-top: 0.25rem; }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem 1.25rem; }

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  border-bottom: var(--border-width) solid var(--color-border);
}

tbody td {
  padding: 0.75rem 0.75rem;
  border-bottom: var(--border-width) solid var(--color-border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-alt); }

.table-empty {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---------- Badges / pills / alerts ----------
   Pill radius is reserved for state indicators (badges); every other interactive shape uses the
   moderate --radius-sm/--radius scale — a small, consistent vocabulary rather than one radius for
   everything. */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success-border); }
.badge-danger { color: var(--color-danger); background: var(--color-danger-bg); border-color: var(--color-danger-border); }
.badge-warning { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.badge-neutral { color: var(--color-text-muted); background: var(--color-surface-alt); border-color: var(--color-border); }
.badge-neutral::before { display: none; }

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid transparent;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.alert-success { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success-border); }
.alert-danger { color: var(--color-danger); background: var(--color-danger-bg); border-color: var(--color-danger-border); }
.alert-warning { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.alert-neutral { color: var(--color-text-muted); background: var(--color-surface-alt); border-color: var(--color-border); }
.alert a { color: inherit; text-decoration: underline; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover { background: var(--color-surface-alt); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.theme-toggle-corner {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
}

/* ---------- Auth shell (DevLogin) ---------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.25rem;
}

.auth-card .brand { justify-content: center; margin-bottom: 1.5rem; font-size: 1.15rem; }
.auth-card h1 { text-align: center; font-size: 1.2rem; }
.auth-card > p.text-muted { text-align: center; font-size: 0.85rem; margin-bottom: 1.5rem; }

/* ---------- Sign-in landing page ----------
   Card-less by design — the same restraint as the rest of the admin UI, with one deliberate
   departure: the heading borrows the serif already reserved for certificate titles, so the one
   moment a person actually reads before entering the system carries a touch of the same
   formality as the credentials it goes on to issue. A quiet radial wash replaces a flat
   background for depth without ornament. */

.signin-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 900px 560px at 50% -8%, var(--color-primary-bg), transparent 65%),
    var(--color-bg);
}

.signin-content { width: 100%; max-width: 400px; text-align: center; }

.signin-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  box-shadow: var(--shadow-sm);
  animation: signin-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.signin-brand-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 2.25rem;
  animation: signin-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.signin-heading {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  animation: signin-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.signin-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0 0 2.25rem;
  animation: signin-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.signin-provider-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  height: 3rem;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  animation: signin-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.signin-provider-btn:hover {
  border-color: var(--color-text-faint);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.signin-provider-btn:active { transform: translateY(0); }

.signin-footer {
  margin-top: 2.5rem;
  font-size: 0.82rem;
  color: var(--color-text-faint);
  animation: signin-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
}

.signin-footer a { color: var(--color-primary); text-decoration: none; }
.signin-footer a:hover { text-decoration: underline; }

@keyframes signin-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .signin-mark, .signin-brand-name, .signin-heading, .signin-subtitle,
  .signin-provider-btn, .signin-footer {
    animation: none;
  }
}

.theme-toggle-corner-left {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
}

/* ---------- Public verification page ----------
   The one page a recipient actually shows someone else. A band in the issuing org's own brand
   color (real per-org data), a neutral mark (a real logo when the org has uploaded one, else an
   initial), and a serif credential title as the one deliberately bold element on the page — the
   only card on the whole site that gets a lifted shadow. */

.verify-shell {
  min-height: 100vh;
  background: var(--color-bg);
}

.verify-band {
  background: var(--org-color, var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.75rem 1.25rem 4.5rem;
}

.verify-mark {
  width: 76px;
  height: 76px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  flex-shrink: 0;
  overflow: hidden;
}

.verify-mark img { width: 100%; height: 100%; object-fit: cover; }

.verify-card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 640px;
  margin: -3rem auto 2.5rem;
  padding: 2.25rem 2.5rem 2.5rem;
  position: relative;
}

.verify-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.verify-org-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.verify-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
}

.verify-recipient {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.verify-recipient strong { color: var(--color-text); font-weight: 700; }

.verify-description {
  color: var(--color-text-muted);
  white-space: pre-line;
  margin-bottom: 1.5rem;
}

.verify-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: var(--border-width) solid var(--color-border);
  border-bottom: var(--border-width) solid var(--color-border);
  margin-bottom: 1.5rem;
}

.verify-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  margin-bottom: 0.3rem;
}

.verify-meta dd { margin: 0; font-weight: 600; font-size: 0.95rem; }

.verify-signature {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.verify-signature-rule { border: none; border-top: var(--border-width) solid var(--color-border); width: 180px; }

.verify-signature-name { font-family: var(--font-serif); font-style: italic; font-weight: 600; font-size: 1.1rem; margin: 0; }
.verify-signature-title { font-size: 0.8rem; color: var(--color-text-faint); margin: 0.15rem 0 0; }

.verify-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.verify-footer {
  text-align: center;
  padding: 0 1.5rem 2.5rem;
}

.verify-footer p {
  margin: 0 auto 0.3rem;
  font-size: 0.78rem;
  color: var(--color-text-faint);
}

.verify-footer p:last-child { margin-bottom: 0; }

.verify-not-found {
  text-align: center;
  padding: 4rem 2rem;
}

/* ---------- Dashboard stat tiles (Home) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  display: block;
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.stat-tile:hover, a.stat-tile:focus-visible {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.stat-tile .stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.1; }
.stat-tile .stat-label { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.3rem; }

.stat-tile.tone-success .stat-value { color: var(--color-success); }
.stat-tile.tone-warning .stat-value { color: var(--color-warning); }
.stat-tile.tone-danger .stat-value { color: var(--color-danger); }
.stat-tile.tone-accent .stat-value { color: var(--color-primary); }

/* ---------- Settings shell (sidebar + boxed content, no full page nav between sections) ---------- */

.settings-shell {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.settings-sidebar {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-sidebar a {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}

.settings-sidebar a:hover {
  background: var(--color-surface-alt);
  text-decoration: none;
}

.settings-sidebar a.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-content.is-loading { opacity: 0.5; pointer-events: none; }

.org-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.org-tile .org-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--org-color, var(--color-primary));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.org-tile .org-mark img { width: 100%; height: 100%; object-fit: cover; }

.org-tile .org-stats { display: flex; gap: 1.25rem; margin-left: auto; text-align: right; }
.org-tile .org-stats div { font-size: 0.78rem; color: var(--color-text-faint); }
.org-tile .org-stats b { display: block; font-size: 1.05rem; color: var(--color-text); font-weight: 700; }

/* ---------- Utilities ---------- */

.stack-sm > * + * { margin-top: 0.75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }

/* ---------- Small viewports ---------- */

@media (max-width: 640px) {
  .app-main { padding: 1.5rem 1rem 2rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .card { padding: 1.1rem; }
  .verify-card { margin-left: 1rem; margin-right: 1rem; padding: 1.75rem; }
  .org-tile { flex-wrap: wrap; }
  .org-tile .org-stats { margin-left: 0; }
}
