/* --- Design Tokens ------------------------------------------- */
:root {
  --blue-50:  #f0f7ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --green-50:  #f0fdf4;
  --green-200: #bbf7d0;
  --green-600: #16a34a;
  --red-50:    #fef2f2;
  --red-200:   #fecaca;
  --red-600:   #dc2626;
  --amber-50:  #fffbeb;
  --amber-400: #fbbf24;

  --accent:        #2563eb;
  --accent-dark:   #1d4ed8;
  --accent-soft:   #dbeafe;
  --accent-softer: #f0f7ff;

  --border:       #e2e8f0;
  --border-focus: #3b82f6;
  --surface:      #ffffff;
  --bg:           #f8fafc;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-subtle:  #94a3b8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 32px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-xl: 0 24px 56px rgba(0,0,0,.10), 0 8px 20px rgba(0,0,0,.06);

  --font-sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;
}

/* --- Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* --- Auth Pages Background ------------------------------------ */
body.auth-body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 10%, rgba(59,130,246,.08) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(37,99,235,.06) 0%, transparent 50%);
}

/* --- Auth Shell ----------------------------------------------- */
.auth-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

/* --- Topbar --------------------------------------------------- */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
  flex-shrink: 0;
}

.auth-brand strong { font-size: .95rem; font-weight: 700; color: var(--text); }
.auth-brand-word { display: flex !important; flex-direction: column; line-height: 1; gap: 1px; font-weight: 900; }
.ab-top { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: #EF9F27; }
.ab-bot { font-size: 15px; font-weight: 900; letter-spacing: -0.5px; color: #185FA5; }
.auth-brand div:last-child { font-size: .78rem; color: var(--text-muted); margin-top: 1px; }

.auth-nav { display: flex; gap: 8px; align-items: center; }

.auth-nav a {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  transition: color .15s, background .15s;
}
.auth-nav a:hover { color: var(--accent); background: var(--accent-softer); }

/* --- Auth Grid ------------------------------------------------ */
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 28px;
  align-items: start;
}

/* --- Auth Panel (left copy block) ----------------------------- */
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 36px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--blue-200);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--slate-900);
}

.auth-copy {
  margin: 0 0 24px;
  color: var(--text-muted);
  line-height: 1.75;
  font-size: .95rem;
}

.auth-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.auth-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  color: var(--slate-700);
  line-height: 1.55;
}

.auth-list li::before {
  content: "v";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--green-600);
  font-size: .72rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Auth Card (form) ----------------------------------------- */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 32px;
  position: sticky;
  top: 24px;
}

.auth-card-title {
  margin: 0 0 24px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

/* --- Form ----------------------------------------------------- */
.auth-form { display: grid; gap: 18px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field { display: grid; gap: 6px; }

.field label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-600);
}

.field input,
.field select {
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.field input::placeholder { color: var(--text-subtle); }

.field input.is-error { border-color: var(--red-600); }
.field input.is-error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

/* --- Password Strength ---------------------------------------- */
.password-strength {
  height: 3px;
  border-radius: 999px;
  background: var(--slate-200);
  margin-top: 6px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease, background .3s ease;
  width: 0;
}

.password-strength-bar.weak   { width: 33%; background: var(--red-600); }
.password-strength-bar.medium { width: 66%; background: var(--amber-400); }
.password-strength-bar.strong { width: 100%; background: var(--green-600); }

.password-hint {
  margin: 6px 0 0;
  font-size: .78rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

/* --- Buttons -------------------------------------------------- */
.auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  position: relative;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,.4);
}

.auth-button:active:not(:disabled) { transform: translateY(0); }
.auth-button:disabled { opacity: .6; cursor: not-allowed; }

.auth-button.is-loading {
  color: transparent;
  pointer-events: none;
}

.auth-button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .55s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border: 1.5px solid var(--blue-200);
  border-radius: var(--radius-md);
  background: var(--accent-softer);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .12s;
  white-space: nowrap;
}

.secondary-button:hover:not(:disabled) { background: var(--accent-soft); transform: translateY(-1px); }
.secondary-button:disabled { opacity: .55; cursor: not-allowed; }

/* --- Status --------------------------------------------------- */
.auth-status {
  min-height: 20px;
  margin: 0;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  transition: color .2s;
}

.auth-status.is-error   { color: var(--red-600); }
.auth-status.is-success { color: var(--green-600); }

.auth-footer {
  margin: 4px 0 0;
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-link-inline {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-link-inline:hover { text-decoration: underline; }

/* --- Divider -------------------------------------------------- */
.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-subtle);
  font-size: .8rem;
}
.form-divider::before, .form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ================================================================
   Dashboard
================================================================ */

.dashboard-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

/* --- Dashboard Topbar ----------------------------------------- */
.auth-topbar .dashboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--slate-50);
  font-size: .83rem;
  font-weight: 600;
  color: var(--slate-700);
}

.dashboard-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* --- Dashboard Main ------------------------------------------- */
.dashboard-main {
  display: grid;
  gap: 20px;
}

/* --- Dashboard Card ------------------------------------------- */
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 26px 28px;
}

.card-label {
  margin: 0 0 4px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.card-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.card-subtitle {
  margin: 4px 0 0;
  font-size: .85rem;
  color: var(--text-muted);
}

/* --- Org Header Card ------------------------------------------ */
.org-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.org-meta { display: flex; align-items: center; gap: 14px; }

.org-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.org-info h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.org-info p {
  margin: 4px 0 0;
  font-size: .85rem;
  color: var(--text-muted);
}

.org-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid;
}

.badge-blue   { background: var(--accent-soft);  border-color: var(--blue-200);  color: var(--accent); }
.badge-green  { background: var(--green-50);      border-color: var(--green-200); color: var(--green-600); }
.badge-dot::before { content: "o"; font-size: .5rem; }

/* --- Dashboard Grid ------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* --- Stats Grid ----------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat-tile {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--slate-50);
  transition: border-color .15s, box-shadow .15s;
}

.stat-tile:hover { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }

.stat-value {
  margin: 0 0 4px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.1;
}

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

/* --- API Keys ------------------------------------------------- */
.inline-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.inline-form input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .88rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.inline-form input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.inline-form input::placeholder { color: var(--text-subtle); }

.key-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.key-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--slate-50);
  transition: border-color .15s;
}

.key-item:hover { border-color: var(--slate-300); }

.key-name {
  margin: 0;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}

.key-meta {
  margin: 0;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.key-prefix {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  border: 1px solid var(--border);
  font-family: var(--font-mono, monospace);
  font-size: .78rem;
  color: var(--slate-700);
  font-weight: 500;
}

.key-status-active  { color: var(--green-600); font-weight: 600; }
.key-status-revoked { color: var(--red-600);   font-weight: 600; }

/* --- Key Reveal ----------------------------------------------- */
.reveal-key:not(:empty) {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--green-50);
  border: 1.5px solid var(--green-200);
  color: #065f46;
  font-family: var(--font-mono, monospace);
  font-size: .82rem;
  word-break: break-all;
  line-height: 1.6;
}

.reveal-key:not(:empty)::before {
  content: "Copy this key now - it will not be shown again.";
  display: block;
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-bottom: 8px;
}

/* --- Dashboard Status ----------------------------------------- */
.dashboard-status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s;
}

.dashboard-status.is-success { color: var(--green-600); }
.dashboard-status.is-error   { color: var(--red-600); }

/* --- Credit Packs --------------------------------------------- */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.credit-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  cursor: default;
}

.credit-tile:hover { border-color: var(--blue-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.credit-tile-name {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.credit-tile-credits {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.1;
}

.credit-tile-price {
  margin: 0;
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ================================================================
   Payment Modal
================================================================ */

.pay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.pay-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pay-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 32px;
  width: min(440px, 100%);
  display: grid;
  gap: 20px;
  transform: translateY(16px) scale(.97);
  transition: transform .25s ease;
}

.pay-overlay.is-open .pay-modal {
  transform: translateY(0) scale(1);
}

.pay-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  width: fit-content;
  transition: color .15s;
}
.pay-back:hover { color: var(--accent); }

.pay-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pay-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.pay-sub {
  margin: 2px 0 0;
  font-size: .78rem;
  color: var(--text-muted);
}

.pay-summary {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}

.pay-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
}

.pay-plan-label {
  font-weight: 700;
  color: var(--text);
}

.pay-plan-credits {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--blue-200);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
}

.pay-summary-divider {
  height: 1px;
  background: var(--border);
}

.pay-summary-total {
  font-weight: 700;
  font-size: .95rem;
}

.pay-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
}

.pay-methods {
  display: grid;
  gap: 8px;
}

.pay-methods-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.pay-methods-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pay-chip {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  border: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 600;
  color: var(--slate-600);
}

.pay-now-btn {
  margin-top: 4px;
}

.pay-secure {
  margin: 0;
  font-size: .75rem;
  color: var(--text-subtle);
  text-align: center;
}

/* --- Responsive ----------------------------------------------- */
@media (max-width: 900px) {
  .auth-grid        { grid-template-columns: 1fr; }
  .dashboard-grid   { grid-template-columns: 1fr; }
  .credits-grid     { grid-template-columns: 1fr 1fr; }
  .field-row        { grid-template-columns: 1fr; }
  .auth-panel       { display: none; }
}

@media (max-width: 600px) {
  .auth-shell, .dashboard-shell { width: calc(100% - 24px); padding-top: 16px; }
  .auth-topbar  { margin-bottom: 20px; }
  .auth-card    { padding: 24px 20px; }
  .credits-grid { grid-template-columns: 1fr; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .org-card     { flex-direction: column; align-items: flex-start; }
  .inline-form  { flex-direction: column; }
}

/* ── Credit Hero (dashboard) ─────────────────────────────────── */
.credit-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  color: #fff;
  flex-wrap: wrap;
}
.credit-hero-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.credit-hero-left .card-label {
  color: rgba(255,255,255,.7);
}
.credit-hero-balance {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0;
}
.credit-hero-num {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.credit-hero-unit {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: .8;
}
.credit-hero-inr {
  font-size: 1.05rem;
  font-weight: 600;
  opacity: .85;
  margin: 0;
}
.credit-hero-sub {
  font-size: .78rem;
  opacity: .65;
  margin: 2px 0 0;
}
.credit-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
.credit-add-btn {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.credit-add-btn:hover {
  background: rgba(255,255,255,.9);
  color: var(--accent);
}
.credit-hero-org {
  display: flex;
  align-items: center;
  gap: 10px;
}
.credit-hero-org .org-avatar {
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.35);
  color: #fff;
}
.credit-hero-orgname {
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.credit-hero-email {
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  margin: 2px 0 0;
}

/* ── Card header row (title + action) ────────────────────────── */
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-header-row h2.card-title {
  margin-bottom: 0;
}

/* ── Transaction list ────────────────────────────────────────── */
.txn-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.txn-empty {
  font-size: .85rem;
  color: var(--text-subtle);
  margin: 8px 0 0;
}
.txn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background .1s;
}
.txn-row:hover {
  background: var(--slate-100);
}
.txn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.txn-icon--topup {
  background: #dcfce7;
  color: #16a34a;
}
.txn-icon--usage {
  background: #fee2e2;
  color: #dc2626;
}
.txn-desc {
  flex: 1;
  min-width: 0;
}
.txn-desc-main {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-desc-sub {
  font-size: .75rem;
  color: var(--text-subtle);
  margin: 2px 0 0;
}
.txn-amount {
  font-size: .9rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.txn-amount--topup { color: #16a34a; }
.txn-amount--usage { color: #dc2626; }
.txn-inr {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-subtle);
}

/* ── Auth status variants ────────────────────────────────────── */
.auth-status--error   { color: #dc2626; }
.auth-status--success { color: #16a34a; }

/* ── Subscription plan badge ──────────────────────────────────── */
.plan-badge {
  display: inline-block;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; padding: 3px 10px; border-radius: 20px;
  background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe;
  white-space: nowrap;
}
.plan-badge--pro        { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.plan-badge--team       { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.plan-badge--publisher  { background: #fdf4ff; color: #7e22ce; border-color: #e9d5ff; }
.plan-badge--free       { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.plan-badge--payg       { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.plan-badge--researcher { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }

/* ── Monthly quota progress bar ───────────────────────────────── */
.quota-bar-bg   {
  height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden;
  margin-top: 4px;
}
.quota-bar-fill {
  height: 100%; background: #4f46e5; border-radius: 99px;
  transition: width .4s ease;
}
.quota-bar-fill.warn { background: #d97706; }
.quota-bar-fill.over { background: #dc2626; }
