/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  /* Primary — steel blue (#527e99) */
  --primary:       oklch(54% 0.071 219);
  --primary-dark:  oklch(44% 0.071 219);
  --primary-light: oklch(95% 0.025 219);
  --primary-fg:    var(--primary-dark);
  --on-primary:    oklch(98% 0.006 219);

  /* Neutrals — steel-blue tinted */
  --bg:          oklch(98.5% 0.007 219);
  --surface:     oklch(99.2%  0.004 219);
  --surface-alt: oklch(96.5% 0.009 219);
  --border:      oklch(91%   0.013 219);
  --text:        oklch(16%   0.022 219);
  --text-muted:  oklch(54%   0.022 219);

  /* Status */
  --success:    oklch(72%   0.165 145);
  --success-bg: oklch(98%   0.036 145);
  --success-fg: oklch(46%   0.14  145);
  --warning:    oklch(74%   0.148  72);
  --warning-bg: oklch(98.5% 0.038  72);
  --warning-fg: oklch(54%   0.14   72);
  --danger:     oklch(63%   0.2    24);
  --danger-bg:  oklch(98.5% 0.025  24);
  --danger-fg:  oklch(52%   0.18   24);

  /* Shape */
  --radius:    10px;
  --radius-sm:  7px;

  /* Elevation */
  --shadow:    0 1px 3px oklch(18% 0.018 219 / .07), 0 1px 2px oklch(18% 0.018 219 / .04);
  --shadow-md: 0 4px 12px oklch(18% 0.018 219 / .08), 0 2px 4px oklch(18% 0.018 219 / .04);

  /* Motion */
  --t-fast: 130ms;
  --t-base: 200ms;
  --ease:   cubic-bezier(0.25, 0, 0.1, 1);

  color-scheme: light;
}

/* ── Dark mode ──────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:       oklch(72% 0.072 219);
  --primary-dark:  oklch(66% 0.070 219);
  --primary-light: oklch(35% 0.036 219);
  --primary-fg:    oklch(80% 0.060 219);
  --on-primary:    oklch(16% 0.020 219);

  --bg:          oklch(21% 0.016 219);
  --surface:     oklch(25% 0.018 219);
  --surface-alt: oklch(30% 0.020 219);
  --border:      oklch(39% 0.023 219);
  --text:        oklch(90% 0.010 219);
  --text-muted:  oklch(70% 0.018 219);

  --success-bg: oklch(32% 0.050 145);
  --success-fg: oklch(82% 0.105 145);
  --warning-bg: oklch(34% 0.048  72);
  --warning-fg: oklch(84% 0.112  72);
  --danger-bg:  oklch(33% 0.054  24);
  --danger-fg:  oklch(80% 0.125  24);

  --shadow:    inset 0 1px 0 oklch(92% 0.010 219 / .035), 0 1px 2px oklch(12% 0.018 219 / .18);
  --shadow-md: inset 0 1px 0 oklch(92% 0.010 219 / .04), 0 8px 22px oklch(12% 0.018 219 / .24);

  color-scheme: dark;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Nav ────────────────────────────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}

.nav-brand-logo {
  height: 48px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-logo--dark { display: none; }
[data-theme="dark"] .nav-logo--light { display: none; }
[data-theme="dark"] .nav-logo--dark  { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link {
  padding: .35rem .75rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.nav-link:hover { background: var(--surface-alt); color: var(--text); }

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Theme toggle ───────────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.theme-toggle:hover { background: var(--surface-alt); color: var(--text); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.theme-icon { width: 17px; height: 17px; }
.theme-icon--moon { display: none; }

[data-theme="dark"] .theme-icon--sun  { display: none; }
[data-theme="dark"] .theme-icon--moon { display: block; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              transform  var(--t-fast) var(--ease),
              color      var(--t-fast) var(--ease);
  letter-spacing: -.005em;
}

.btn:active { transform: scale(0.975); }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-ghost,
.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover,
.btn-secondary:hover { background: var(--surface-alt); color: var(--text); }

.btn-danger { background: var(--danger); color: var(--on-primary); }
.btn-danger:hover { background: oklch(58% 0.2 24); }
.btn-danger:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.page { max-width: 1900px; margin: 0 auto; padding: 2rem; }

.page-header { margin-bottom: 2rem; }

.page-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.page-header p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .3rem;
}

/* ── Stat cards ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: .5rem;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 99px;
}

.badge-success { background: var(--success-bg); color: var(--success-fg); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.badge-info    { background: var(--primary-light); color: var(--primary-fg); }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.card-body { padding: 1.75rem; }

/* ── Table ──────────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  background: var(--surface-alt);
  padding: .625rem 1.5rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: .9375rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.pill-paid    { background: var(--success-bg); color: var(--success-fg); }
.pill-done    { background: var(--success-bg); color: var(--success-fg); }
.pill-pending { background: var(--warning-bg); color: var(--warning-fg); }
.pill-overdue { background: var(--danger-bg);  color: var(--danger-fg); }

.amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ── Auth layout ─────────────────────────────────────────────────────────────── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--bg);
}

.auth-wrap { width: 100%; max-width: 420px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.25rem 2.5rem;
}

.auth-logo {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 2rem;
}

.auth-logo-img {
  height: 52px;
  width: auto;
  max-width: 100%;
}

.auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
  letter-spacing: -.025em;
}

.auth-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text-muted);
  font-size: .8125rem;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 2;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

/* ── Form elements ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
  letter-spacing: -.005em;
}

.form-input {
  width: 100%;
  padding: .625rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease),
              box-shadow   var(--t-fast) var(--ease);
  outline: none;
}

.form-input:focus-visible,
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(69% 0.148 221 / .18);
}

.form-input--error {
  border-color: var(--danger);
}
.form-input--error:focus-visible,
.form-input--error:focus {
  box-shadow: 0 0 0 3px oklch(63% 0.2 24 / .18);
}

.form-input::placeholder { color: var(--text-muted); opacity: .7; }

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .4rem;
}

.form-label-row .form-label { margin-bottom: 0; }

.form-hint {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: .4rem;
}

.form-error {
  font-size: .8125rem;
  color: var(--danger);
  margin-top: .35rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: .7rem 1rem;
  font-size: .9375rem;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.alert-error   { background: var(--danger-bg);  color: var(--danger-fg);  border-color: color-mix(in oklch, var(--danger-fg) 38%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: color-mix(in oklch, var(--success-fg) 38%, transparent); }
.alert-info    { background: var(--primary-light); color: var(--primary-fg); border-color: color-mix(in oklch, var(--primary-fg) 34%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg);  border-color: color-mix(in oklch, var(--warning-fg) 38%, transparent); }

/* ── OTP digit boxes ──────────────────────────────────────────────────────── */
.otp-group {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.otp-digit {
  width: 50px;
  height: 58px;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  caret-color: var(--primary);
  transition: border-color var(--t-fast) var(--ease),
              box-shadow   var(--t-fast) var(--ease),
              background   var(--t-fast) var(--ease);
  -moz-appearance: textfield;
}

.otp-digit::-webkit-outer-spin-button,
.otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; }

.otp-digit:focus-visible,
.otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(69% 0.148 221 / .18);
}

.otp-digit.filled {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ── Expiry bar ───────────────────────────────────────────────────────────── */
.expiry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.expiry-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.expiry-countdown.urgent { color: var(--danger); }

/* ── Nav dropdown ─────────────────────────────────────────────────────────── */
.nav-dropdown-wrap { position: relative; }

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease),
              color    var(--t-fast) var(--ease);
  font-family: inherit;
}

.nav-user-btn:hover { background: var(--surface-alt); color: var(--text); }
.nav-user-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.nav-chevron {
  width: 13px;
  height: 13px;
  transition: transform var(--t-base) var(--ease);
  opacity: .5;
}

.nav-user-btn[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 195px;
  z-index: 200;
  overflow: hidden;
  /* Animated open/close via .is-open */
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  visibility: hidden;
  pointer-events: none;
  transition: opacity    var(--t-fast) var(--ease),
              transform  var(--t-fast) var(--ease),
              visibility 0s var(--t-fast);
}

.nav-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition: opacity   var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: .625rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t-fast) var(--ease);
}

.nav-dropdown-item:hover { background: var(--surface-alt); }
.nav-dropdown-item:focus-visible {
  outline: none;
  background: var(--surface-alt);
}
.nav-dropdown-item--danger { color: oklch(52% 0.18 24); }
.nav-dropdown-item--danger:hover { background: var(--danger-bg); }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: .25rem 0; }
.nav-dropdown-label {
  display: block;
  padding: .35rem 1rem .15rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}
.nav-version {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  user-select: none;
  cursor: default;
  transition: opacity 0.2s, max-height 0.2s, padding 0.2s;
}
.nav-dropdown:hover .nav-version {
  opacity: 1;
  max-height: 2rem;
  padding: 0.2rem 0 0.1rem;
}

/* ── Security page ────────────────────────────────────────────────────────── */
.security-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 580px;
}

.security-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.security-row--top { align-items: flex-start; }

.security-method-name {
  font-weight: 600;
  font-size: .9375rem;
  margin-bottom: .25rem;
  letter-spacing: -.01em;
}

.security-method-desc {
  font-size: .875rem;
  color: var(--text-muted);
}

.security-method-actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.security-method-actions a {
  font-size: .875rem;
  text-decoration: none;
  font-weight: 500;
}

.security-method-actions a:hover { text-decoration: underline; }

.security-method-actions .link-danger { color: oklch(52% 0.18 24); }
.security-method-actions .link-muted  { color: var(--text-muted); }
.security-method-actions .link-separator {
  color: var(--border);
  font-size: .9rem;
  user-select: none;
}

.api-key-reveal {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.api-key-code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: .8125rem;
  background: var(--surface-alt, oklch(96% 0 0));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .45rem .75rem;
  word-break: break-all;
  flex: 1;
}

[data-theme="dark"] .api-key-code {
  background: var(--surface-alt);
}

.api-code-block {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: .8125rem;
  background: var(--surface-alt, oklch(96% 0 0));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin: 0;
  overflow-x: auto;
  color: var(--text);
}

[data-theme="dark"] .api-code-block {
  background: var(--surface-alt);
}

.radio-list {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  margin-bottom: 1.25rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  font-size: .9rem;
}

.radio-input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── TOTP setup page ──────────────────────────────────────────────────────── */
.step-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.step-block { margin-bottom: 2rem; }

.step-desc {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.qr-container {
  display: inline-block;
  padding: .75rem;
  background: oklch(99.2% 0.004 219);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.key-details { margin-bottom: 2rem; }

.key-details summary {
  font-size: .875rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

.key-details summary::-webkit-details-marker { display: none; }
.key-details summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

.key-display {
  margin-top: .75rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: .9375rem;
  letter-spacing: .1em;
  color: var(--text);
  word-break: break-all;
}

.key-hint {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

.otp-group--left { justify-content: flex-start; }

.btn-row {
  display: flex;
  gap: .75rem;
  align-items: center;
}

/* ── Narrow card pages (password change, email change, totp disable) ──────── */
.narrow-card { max-width: 480px; }
.narrow-card-md { max-width: 560px; }

.card-intro {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.card-intro strong { color: var(--text); }

.card-hint {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.forgot-link {
  font-size: .8125rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover { text-decoration: underline; }

/* ── Inline field error (below input, no box) ─────────────────────────────── */
.field-error {
  font-size: .8125rem;
  color: oklch(52% 0.18 24);
  margin-top: .35rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Scrollable table wrapper */
.table-scroll {
  overflow: auto;
  max-height: 420px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

/* Tablet (≤ 768px) */
@media (max-width: 768px) {
  .nav { padding: 0 1.25rem; }
  .nav-brand-logo { height: 38px; }
  .page { padding: 1.5rem 1.25rem; }
  .stats-grid { gap: 1rem; }
}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {
  /* Nav */
  .nav { padding: 0 1rem; }
  .nav-brand-logo { height: 28px; }
  .nav-user-btn span { display: none; }

  /* Page */
  .page { padding: 1rem; }
  .page-header { margin-bottom: 1.25rem; }
  .page-header h1 { font-size: 1.25rem; }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
    margin-bottom: 1.25rem;
  }
  .stat-card { padding: 1rem .875rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-badge { font-size: .7rem; }

  /* Card header stacks */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .625rem;
    padding: .875rem 1rem;
  }

  /* Auth */
  .auth-body { padding: 1rem; }
  .auth-card { padding: 1.5rem 1.125rem; }
  .auth-logo-img { height: 40px; }

  /* OTP */
  .otp-group { gap: .375rem; }
  .otp-digit {
    width: 42px;
    height: 50px;
    font-size: 1.25rem;
  }

  /* Security rows stack */
  .security-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .625rem;
  }

  /* Btn row wraps */
  .btn-row { flex-wrap: wrap; }

  /* Narrow card full-width */
  .narrow-card,
  .narrow-card-md { max-width: 100%; }
}

/* Very small phones (≤ 380px) */
@media (max-width: 380px) {
  .nav-brand-logo { height: 22px; }
  .nav-link { padding: .3rem .5rem; font-size: .8rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .otp-digit { width: 36px; height: 44px; font-size: 1.1rem; }
  .otp-group { gap: .25rem; }
}

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