@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  /* Background layers */
  --bg:           #0f1117;
  --bg2:          #151820;
  --surface:      rgba(255,255,255,0.04);
  --surface2:     rgba(255,255,255,0.07);
  --surface3:     rgba(255,255,255,0.11);
  --surface-solid: #171a24;

  /* Borders */
  --border:       rgba(255,255,255,0.08);
  --border2:      rgba(255,255,255,0.15);

  /* Text */
  --text:         #e8eaf0;
  --text-muted:   #7c8494;
  --text-subtle:  #4e5568;

  /* Brand — clean professional blue */
  --accent:       #3b82f6;
  --accent2:      #60a5fa;
  --accent-glow:  rgba(59,130,246,0.2);
  --grad:         linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --grad-hover:   linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);

  /* Semantic */
  --green:        #22c55e;
  --green-bg:     rgba(34,197,94,0.10);
  --yellow:       #f59e0b;
  --yellow-bg:    rgba(245,158,11,0.10);
  --red:          #ef4444;
  --red-bg:       rgba(239,68,68,0.10);
  --orange:       #f97316;

  /* Networks */
  --visa:         #1a3a8f;
  --mastercard:   #b91c1c;
  --amex:         #0057a8;
  --rupay:        #0a6b3c;
  --diners:       #374151;

  /* Score */
  --score-keep:   #22c55e;
  --score-review: #f59e0b;
  --score-close:  #ef4444;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ── Light theme overrides ── */
[data-theme="light"] {
  --bg:           #f3f4f8;
  --bg2:          #ebedf2;
  --surface:      rgba(0,0,0,0.04);
  --surface2:     rgba(0,0,0,0.07);
  --surface3:     rgba(0,0,0,0.11);
  --surface-solid: #ffffff;

  --border:       rgba(0,0,0,0.09);
  --border2:      rgba(0,0,0,0.18);

  --text:         #111827;
  --text-muted:   #6b7280;
  --text-subtle:  #9ca3af;

  --accent:       #2563eb;
  --accent2:      #3b82f6;
  --accent-glow:  rgba(37,99,235,0.12);
  --grad:         linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  --grad-hover:   linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);

  --green-bg:     rgba(34,197,94,0.10);
  --yellow-bg:    rgba(245,158,11,0.10);
  --red-bg:       rgba(239,68,68,0.10);
}

[data-theme="light"] body::before { background: radial-gradient(ellipse, rgba(37,99,235,0.04), transparent 70%); }
[data-theme="light"] header { background: rgba(243,244,248,0.92); }
[data-theme="light"] #login-overlay { background: var(--bg); }

html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Subtle top-left blue accent — much less aggressive than before */
body::before {
  content: '';
  position: fixed;
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.06), transparent 70%);
  top: 0; left: 0;
  pointer-events: none;
  z-index: 0;
}

/* ─────────────────────────────
   LOGIN
───────────────────────────── */
#auth-loading {
  position: fixed; inset: 0;
  z-index: 1001;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
#auth-loading.hidden { display: none; }
.auth-loading-card {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

#login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  overflow-y: auto;
}
#login-overlay.hidden { display: none; }

/* Two-column layout */
.login-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  max-width: 980px; width: 100%;
  min-height: 560px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

/* Left: features panel */
.login-features {
  background: linear-gradient(145deg, #0f1623 0%, #131825 60%, #0d1520 100%);
  border: 1px solid rgba(79,142,247,0.15);
  border-right: none;
  padding: 44px 48px;
  display: flex; flex-direction: column; gap: 0;
}

.login-brand {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 28px;
}
.login-brand-icon { font-size: 22px; }
.login-brand-name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.login-brand-tag {
  font-size: 10px; font-weight: 600; color: var(--accent);
  background: rgba(79,142,247,0.12); border-radius: 4px;
  padding: 2px 7px; margin-left: 4px;
}

.login-headline {
  font-size: 26px; font-weight: 800; color: var(--text);
  line-height: 1.25; letter-spacing: -0.6px; margin: 0 0 12px;
}
.login-subhead {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  margin: 0 0 28px;
}

.login-feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  flex: 1;
}
.lf-item {
  display: flex; gap: 10px; align-items: flex-start;
}
.lf-svg {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
  color: var(--accent); opacity: 0.85;
}
.lf-title {
  font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px;
}
.lf-desc {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
}

.login-footer-note {
  margin-top: 28px;
  font-size: 10px; color: var(--text-faint, rgba(255,255,255,0.3));
  letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 6px;
}

/* Right: sign-in card */
.login-card {
  background: #161920;
  border: 1px solid var(--border2);
  border-radius: 0;
  padding: 44px 40px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.login-logo-wrap {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(79,142,247,0.1); border: 1px solid rgba(79,142,247,0.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.login-card h1 {
  font-size: 22px; font-weight: 800;
  color: var(--text); margin-bottom: 8px; letter-spacing: -0.5px;
}
.login-card p { color: var(--text-muted); font-size: 12px; line-height: 1.6; margin-bottom: 24px; max-width: 260px; }

.login-trust-list { width: 100%; margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.login-trust-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted); text-align: left;
}

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 20px;
  background: #fff; color: #1f2937;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.btn-google:active { transform: translateY(0); }
.google-icon { width: 18px; height: 18px; flex-shrink: 0; }

.login-divider {
  width: 100%; height: 1px; background: var(--border);
  margin: 28px 0;
}
.login-stats {
  display: flex; gap: 20px; justify-content: center;
}
.login-stat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.ls-val { font-size: 16px; font-weight: 800; color: var(--accent); }
.ls-lbl { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ─────────────────────────────
   HEADER
───────────────────────────── */
header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  height: 52px;
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.app-title {
  font-size: 14px; font-weight: 800; letter-spacing: -0.3px; color: var(--text);
}
.app-subtitle {
  font-size: 10px; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.2px;
}

/* ── Tabs ── */
.tab-nav { display: flex; gap: 1px; margin: 0 16px; }
.tab-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 6px 16px; font-size: 13px; font-weight: 500;
  border-radius: 8px; cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font); white-space: nowrap;
}
.tab-btn.active {
  background: var(--surface3); color: var(--text);
}
.tab-btn:hover:not(.active) { background: var(--surface); color: var(--text); }

.header-right { display: flex; gap: 8px; margin-left: auto; align-items: center; }

/* User dropdown trigger */
.user-chip {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500; color: var(--text);
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: none; background: none;
  transition: background .15s;
  user-select: none;
}
.user-chip:hover { background: var(--surface2); }
.user-chip.open  { background: var(--surface2); }
.user-chip-caret {
  font-size: 8px; opacity: 0.4; margin-left: 1px;
  transition: transform .2s; color: var(--text-muted);
}
.user-chip.open .user-chip-caret { transform: rotate(180deg); opacity: 0.7; }

.user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border2); }
.user-avatar-placeholder {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}

/* Dropdown menu */
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px;
  background: var(--surface-solid); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 500;
  display: none; flex-direction: column; gap: 2px;
}
.user-dropdown.open { display: flex; }

.ud-header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.ud-name { font-size: 13px; font-weight: 600; color: var(--text); }
.ud-email { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ud-plan {
  display: inline-flex; align-items: center;
  margin-top: 8px; height: 20px; padding: 0 9px;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.ud-plan--free {
  color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border);
}
.ud-plan--premium {
  color: var(--yellow); background: var(--yellow-bg); border: 1px solid rgba(245,158,11,.22);
}

.ud-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
  transition: background .12s, color .12s;
}
.ud-item:hover { background: var(--surface2); color: var(--text); }
.ud-item-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.ud-item.ud-danger:hover { background: var(--red-bg); color: var(--red); }
.ud-separator { height: 1px; background: var(--border); margin: 4px 0; }

/* Theme toggle row */
.ud-theme-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12px; color: var(--text-muted);
}
.ud-theme-switch {
  display: flex; align-items: center; gap: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px; gap: 2px;
}
.ud-theme-btn {
  padding: 3px 9px; border-radius: 16px; font-size: 10px; font-weight: 600;
  border: none; background: none; cursor: pointer; color: var(--text-muted);
  font-family: var(--font); transition: background .15s, color .15s;
}
.ud-theme-btn.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.ud-theme-btn--soon { opacity: 0.45; cursor: not-allowed; position: relative; }
.ud-theme-btn--soon::after {
  content: "soon"; font-size: 7px; font-weight: 700; letter-spacing: .03em;
  background: var(--accent); color: #fff; border-radius: 4px;
  padding: 0px 3px; margin-left: 3px; vertical-align: middle; opacity: 0.8;
}

/* Profile */
.profile-page {
  overflow-y: auto; padding: 28px 32px;
}
.profile-shell {
  max-width: 820px; display: flex; flex-direction: column; gap: 18px;
}
.profile-header {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
}
.profile-header h2 {
  margin: 0; font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px;
}
.profile-header p {
  margin-top: 4px; color: var(--text-muted); font-size: 13px;
}
.profile-plan-card {
  min-width: 130px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.profile-plan-label {
  display: block; color: var(--text-muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px;
}
.profile-plan-card strong,
.profile-plan-row strong {
  color: var(--text); font-size: 16px;
}
.profile-plan-premium { color: var(--yellow) !important; }
.profile-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 20px;
}
.profile-section {
  display: flex; flex-direction: column; gap: 12px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.profile-section-title {
  color: var(--text-muted); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
}
.profile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.profile-grid label:nth-child(3) { grid-column: 1 / -1; }
.profile-readonly-field {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.profile-readonly-value {
  min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.profile-readonly-value strong {
  color: var(--text); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
}
.profile-readonly-value em,
.profile-phone-actions span {
  flex-shrink: 0; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px;
}
.profile-verified { color: var(--green); background: var(--green-bg); }
.profile-unverified { color: var(--yellow); background: var(--yellow-bg); }
.profile-phone-row {
  display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px;
}
.profile-phone-row .profile-phone-code {
  text-align: center; font-weight: 700;
}
.profile-phone-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 2px;
}
.profile-otp-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 2px;
}
.profile-address-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.profile-span-2 { grid-column: 1 / -1; }
.profile-form label {
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%; background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px 12px;
  font-size: 13px; font-family: var(--font);
}
.profile-form textarea { resize: vertical; min-height: 84px; }
.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.profile-help {
  color: var(--text-subtle); font-size: 11px; font-weight: 500;
}
.profile-subscription-card {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  min-height: 72px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.profile-subscription-copy {
  display: flex; flex-direction: column; gap: 8px;
}
.profile-subscription-copy span {
  color: var(--text-muted); font-size: 13px;
}
.profile-subscription-card strong {
  font-size: 18px; white-space: nowrap;
}
.profile-actions {
  display: flex; align-items: center; gap: 12px;
  padding-top: 2px;
}
.profile-error {
  color: var(--red); font-size: 12px;
}

@media (max-width: 720px) {
  .profile-page { padding: 20px; }
  .profile-header { align-items: stretch; flex-direction: column; }
  .profile-grid,
  .profile-address-grid { grid-template-columns: 1fr; }
  .profile-span-2 { grid-column: auto; }
  .profile-phone-row { grid-template-columns: 76px minmax(0, 1fr); }
  .profile-phone-actions { align-items: flex-start; flex-direction: column; }
  .profile-otp-row { grid-template-columns: 1fr; }
  .profile-subscription-card { align-items: flex-start; flex-direction: column; }
}

/* ─────────────────────────────
   TABS
───────────────────────────── */
.tab-content { display: none; flex: 1; flex-direction: column; overflow: hidden; position: relative; z-index: 1; }
.tab-content.active { display: flex; }

/* ─────────────────────────────
   BUTTONS
───────────────────────────── */
button, .btn {
  font-family: var(--font); font-size: 12px; cursor: pointer;
  border: none; border-radius: 8px; padding: 7px 14px;
  transition: all .15s; font-weight: 500;
}

.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { background: var(--grad-hover); transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-success  { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-danger   { background: #1e1e22; color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.12); }
.btn-delete-hard { color: var(--text-muted); font-size: 14px; opacity: 0.5; transition: opacity .15s, color .15s; }
.btn-delete-hard:hover { opacity: 1; color: #ef4444; }

/* ── YTD spend modal ── */
.ytd-period-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
}
.ytd-period-badge strong { color: var(--text); }
.ytd-current-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.ytd-stat {
  flex: 1; min-width: 120px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.ytd-stat-total {
  border-color: var(--accent); background: rgba(59,130,246,0.06);
}
.ytd-stat-label { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.ytd-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }

/* ── Delete confirmation overlay ── */
.delete-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 600; padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.delete-dialog {
  background: #13151c;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 420px; width: 100%;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.08), 0 40px 80px rgba(0,0,0,0.7);
  animation: modalIn .2s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column; gap: 16px;
}
.delete-dialog-icon {
  font-size: 32px; text-align: center;
  background: rgba(239,68,68,0.1); border-radius: 50%;
  width: 60px; height: 60px; line-height: 60px;
  margin: 0 auto;
}
.delete-dialog-title {
  font-size: 17px; font-weight: 700;
  text-align: center; color: #ef4444;
  letter-spacing: -0.3px; margin: 0;
}
.delete-dialog-desc {
  font-size: 13px; color: var(--text-muted); text-align: center;
  line-height: 1.6; margin: 0;
}
.delete-dialog-desc strong { color: var(--text); }
.delete-dialog-desc em { color: #ef4444; font-style: normal; font-weight: 600; }
.delete-confirm-input-wrap {
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 10px; padding: 14px;
}
.delete-confirm-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.delete-confirm-label strong { color: var(--text); letter-spacing: 2px; }
.delete-confirm-input {
  background: var(--bg) !important;
  border: 1px solid rgba(239,68,68,0.3) !important;
  border-radius: 8px; padding: 10px 12px;
  font-size: 18px; font-weight: 700;
  letter-spacing: 6px; text-align: center;
  color: #ef4444 !important; width: 100%;
}
.delete-confirm-input:focus { outline: none; border-color: #ef4444 !important; }
.delete-dialog-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.btn-delete-confirm {
  background: #ef4444; color: #fff;
  border: none; border-radius: 10px;
  padding: 10px 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s, transform .1s;
}
.btn-delete-confirm:hover:not(:disabled) { background: #dc2626; transform: translateY(-1px); }
.btn-delete-confirm:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.close-dialog {
  border-color: rgba(245,158,11,0.28);
  box-shadow: 0 0 0 1px rgba(245,158,11,0.08), 0 40px 80px rgba(0,0,0,0.7);
}
.close-dialog-icon {
  background: rgba(245,158,11,0.1);
}
.close-dialog-title {
  color: var(--yellow);
}
.close-dialog-note {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.16);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.btn-close-confirm {
  background: var(--yellow); color: #16181f;
  border: none; border-radius: 10px;
  padding: 10px 20px; font-size: 13px; font-weight: 800;
  cursor: pointer; transition: background .15s, transform .1s;
}
.btn-close-confirm:hover:not(:disabled) { background: #fbbf24; transform: translateY(-1px); }
.btn-close-confirm:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface3); border-color: var(--border2); }

.btn-icon { background: none; color: var(--text-muted); padding: 5px 7px; border-radius: 6px; }
.btn-icon:hover { background: var(--surface2); color: var(--text); }

/* ─────────────────────────────
   FORMS
───────────────────────────── */
input, select, textarea {
  background: #1a1d24;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font); font-size: 12px; outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text-subtle); }
select option { background: #1a1d24; color: var(--text); }

label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.2px;
}
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field-error { font-size: 11px; color: var(--red); margin-top: 2px; }

/* ─────────────────────────────
   MODAL
───────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: #13151c;
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 28px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  animation: modalIn .2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalIn {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-wide { max-width: 720px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-header h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.modal-body { max-height: calc(90vh - 140px); overflow-y: auto; padding-right: 4px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.modal form { display: flex; flex-direction: column; gap: 16px; }

/* ─────────────────────────────
   TOAST
───────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 900;
}
.toast {
  padding: 11px 16px; border-radius: 10px; font-size: 12px; font-weight: 500;
  max-width: 300px;
  border: 1px solid; animation: toastIn .2s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.toast-success { background: rgba(34,197,94,0.10);  color: var(--green); border-color: rgba(34,197,94,0.25); }
.toast-error   { background: rgba(239,68,68,0.10);  color: var(--red);   border-color: rgba(239,68,68,0.25); }
.toast-info    { background: rgba(59,130,246,0.10);  color: var(--accent2); border-color: rgba(59,130,246,0.25); }

/* ─────────────────────────────
   DASHBOARD
───────────────────────────── */
#tab-dashboard { padding: 24px; overflow-y: auto; }

.alert-banner {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px;
}
.alert-banner h4 { color: var(--yellow); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.alert-item { font-size: 12px; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.alert-item span { color: var(--text-muted); }
.fee-strike { color: var(--text-muted); opacity: 0.6; }
.ltf-tag {
  display: inline-block;
  background: rgba(34,197,94,0.12); color: #22c55e;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 100px; padding: 1px 8px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.2px;
  vertical-align: middle; margin-left: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.stat-card {
  background: #161920;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s, transform .2s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad);
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stat-card-savings { border-color: rgba(34,197,94,0.2); cursor: default; }
.stat-card-savings::before { background: var(--green); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.stat-sub { font-size: 10px; color: var(--text-muted); margin-top: 5px; }
.stat-sub-stack { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.stat-sub-stack span { font-size: 10px; color: var(--text-muted); line-height: 1.4; }

/* ── Locked stat card ── */
.stat-card--locked { position: relative; }
.stat-value--locked { color: var(--text-subtle) !important; letter-spacing: 3px; }
.stat-lock-chip {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--yellow); background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.25); border-radius: 4px; padding: 2px 7px;
}

/* ── Locked portfolio panel ── */
.portfolio-panel--locked { position: relative; overflow: hidden; }
/* header row: title + premium chip */
.plo-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.plo-header .section-title { margin-bottom: 0; }
.plo-premium-chip {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--yellow); background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.28); border-radius: 20px;
  padding: 3px 10px 3px 8px;
}
/* short feature description */
.plo-desc {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.65;
  margin: 0 0 16px; max-width: 480px;
}
/* blurred fake bars to hint at content */
.plo-blur-body {
  filter: blur(3px); opacity: .25; pointer-events: none;
  padding: 4px 0 2px;
}
.plo-fake-bars { display: flex; flex-direction: column; gap: 12px; }
.plo-fake-bar {
  height: 10px; border-radius: 6px;
  background: var(--border2);
}
/* keep old overlay selectors harmless */
.panel-lock-overlay { display: none; }
.plo-icon, .plo-label, .plo-sub { display: none; }

/* ── Locked limits panel ── */
.limits-panel--locked { position: relative; overflow: hidden; }

/* ── Full-tab premium lock ── */
.premium-tab-lock {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 24px 48px;
}
.ptl-card {
  background: var(--surface); border: 1px solid var(--border2); border-radius: 20px;
  padding: 36px 40px 32px; max-width: 680px; width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.ptl-top {
  display: flex; align-items: flex-start; gap: 24px;
}
.ptl-icon-wrap {
  flex-shrink: 0; width: 68px; height: 68px; border-radius: 16px;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); opacity: .85;
}
.ptl-text { flex: 1; min-width: 0; }
.ptl-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--yellow); background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.28); border-radius: 20px; padding: 3px 10px 3px 8px;
}
.ptl-name {
  font-size: 22px; font-weight: 800; color: var(--text);
  margin: 0 0 10px; letter-spacing: -.3px; line-height: 1.2;
}
.ptl-desc {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.7; margin: 0;
}
.ptl-divider {
  border: none; border-top: 1px solid var(--border); margin: 28px 0 20px;
}
.ptl-bullets-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-subtle); margin-bottom: 14px;
}
.ptl-bullets {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.ptl-bullet {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; color: var(--text-muted); line-height: 1.55;
}
.ptl-bullet::before {
  content: ""; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .6; margin-top: 6px;
  align-self: flex-start;
}

/* ── Header premium badge ── */
.header-premium-badge {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--yellow); background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.3); border-radius: 4px; padding: 1px 6px;
  vertical-align: middle; margin-left: 6px;
}

/* ── Waitlist overlay ── */
#waitlist-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
#waitlist-overlay.hidden { display: none; }
.waitlist-card {
  background: #161920; border: 1px solid var(--border2); border-radius: 24px;
  padding: 48px 52px 44px; max-width: 440px; width: calc(100% - 32px); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  box-shadow: 0 32px 96px rgba(0,0,0,.55);
}
.waitlist-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.3px;
  margin-bottom: 32px;
}
.waitlist-heading {
  font-size: 24px; font-weight: 800; color: var(--text);
  margin: 0 0 10px; letter-spacing: -.3px; line-height: 1.2;
}
.waitlist-sub {
  font-size: 14px; color: var(--text-muted); line-height: 1.65;
  margin: 0 0 28px;
}
.waitlist-token-wrap {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 24px 28px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 20px;
}
.waitlist-token-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; color: var(--text-muted);
}
.waitlist-token-number {
  font-size: 56px; font-weight: 900; letter-spacing: -4px;
  color: var(--accent); line-height: 1;
}
.waitlist-note {
  font-size: 12.5px; color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 18px; line-height: 1.65; width: 100%;
  margin-bottom: 28px;
}
.waitlist-icon { font-size: 44px; line-height: 1; margin-bottom: 20px; }
.waitlist-icon--denied { color: var(--red); }
.waitlist-logout-btn {
  font-size: 12px; opacity: .45; padding: 6px 16px;
  border: 1px solid transparent; border-radius: 8px; transition: opacity .15s, border-color .15s;
}
.waitlist-logout-btn:hover { opacity: .85; border-color: var(--border); }

/* ── Admin waitlist token badge ── */
.waitlist-token-badge-sm {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.25);
  border-radius: 6px; padding: 2px 8px;
}

/* ── Admin membership chip ── */
.admin-chip--premium {
  background: rgba(245,158,11,.15); color: var(--yellow); border-color: rgba(245,158,11,.3);
}
.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }
.stat-value.neutral  { color: var(--yellow); }

.section-title {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 12px; margin-top: 24px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Dashboard portfolio panels ── */
.portfolio-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.portfolio-panel { display: flex; flex-direction: column; gap: 12px; }
.panel-empty { font-size: 12px; color: var(--text-muted); padding: 16px 0; }

/* ── Utilization / waiver bar rows ── */
.util-bar-list { display: flex; flex-direction: column; gap: 8px; }
.util-bar-row {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
}
.util-bar-top  { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.util-bar-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.util-bar-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.util-bar-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.util-bar-bank { font-size: 10px; color: var(--text-muted); }
.util-bar-sub  { font-size: 10px; color: var(--text-muted); }
.util-bar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.util-bar-pct { font-size: 14px; font-weight: 700; }
.util-bar-track {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 100px; overflow: hidden;
}
.util-bar-fill {
  height: 100%; border-radius: 100px;
  transition: width .6s cubic-bezier(0.16,1,0.3,1);
}
.util-bar-amounts { font-size: 10px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }

/* track badges */
.track-badge {
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; letter-spacing: 0.3px; text-transform: uppercase;
}
.track-badge.on-track { background: rgba(34,197,94,0.15); color: #22c55e; }
.track-badge.behind   { background: rgba(234,179,8,0.15);  color: #eab308; }

@media (max-width: 900px) {
  .portfolio-panels { grid-template-columns: 1fr; }
}

/* ─────────────────────────────
   CARDS TAB
───────────────────────────── */
#tab-cards { flex-direction: column; overflow: hidden; }

.cards-toolbar {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 20px;
  background: #0f1117;
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap; overflow-x: auto;
}
/* In toolbar, selects and inputs must NOT take 100% width */
.cards-toolbar input[type="text"] { width: 200px; flex-shrink: 0; }
.cards-toolbar select             { width: auto; min-width: 120px; flex-shrink: 0; }
.cards-toolbar .btn               { flex-shrink: 0; white-space: nowrap; }
.cards-toolbar a.btn              { text-decoration: none; flex-shrink: 0; white-space: nowrap; }

.cards-body { flex: 1; overflow-y: auto; padding: 20px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ── View toggle ── */
.view-toggle { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; flex-shrink: 0; }
.view-toggle-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 5px 8px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active { background: var(--surface3); color: var(--text); }

/* ── Card Table view ── */
.card-table-wrap { overflow-x: auto; }
.cards-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cards-table thead tr { border-bottom: 1px solid var(--border2); }
.cards-table th { padding: 8px 12px; color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; text-align: left; }
.cards-table th.ta-r { text-align: right; }
.cards-table tbody tr.cards-table-row { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.cards-table tbody tr.cards-table-row:hover { background: var(--surface); }
.cards-table td { padding: 11px 12px; vertical-align: middle; white-space: nowrap; }
.cards-table td.ta-r { text-align: right; }
.cards-table td.text-muted { color: var(--text-muted); }
.ct-name-cell { display: flex; align-items: center; gap: 10px; }
.ct-accent { width: 4px; height: 36px; border-radius: 3px; flex-shrink: 0; }
.ct-name { font-weight: 600; font-size: 13px; color: var(--text); }
.ct-bank { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ct-network { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--surface2); padding: 2px 8px; border-radius: 20px; }
.ct-waiver-cell { min-width: 140px; }
.ct-waiver-bar-wrap { display: flex; flex-direction: column; gap: 4px; }
.ct-waiver-bar-track { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.ct-waiver-bar-fill { height: 100%; border-radius: 2px; transition: width .4s; }
.ct-waiver-bar-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }
.ct-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── Closed card badge & states ── */
.closed-chip {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); background: var(--surface3);
  border: 1px solid var(--border2); border-radius: 4px; padding: 1px 5px;
  vertical-align: middle; margin-left: 6px;
}
.card-tile--closed { opacity: 0.55; filter: grayscale(40%); }
.card-tile--closed:hover { opacity: 0.75; filter: grayscale(20%); }
.closed-notice { font-size: 11px; color: var(--text-muted); font-style: italic; }
.ct-row--closed { opacity: 0.55; }
.ct-row--closed:hover { opacity: 0.75; background: var(--surface) !important; }

/* ── Card Tile ── */
.card-tile {
  background: #161920;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.card-tile:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.card-tile:active { transform: translateY(0); }
.card-tile-accent {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-tile-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.card-tile-name { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 3px; }
.card-tile-bank { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.network-badge {
  font-size: 9px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; color: #fff; text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap; flex-shrink: 0;
}
.network-Visa         { background: var(--visa); }
.network-Mastercard   { background: var(--mastercard); }
.network-Amex         { background: var(--amex); }
.network-RuPay        { background: var(--rupay); }
.network-Diners-Club  { background: var(--diners); }

.network-logo-badge {
  flex-shrink: 0;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.network-logo-badge svg { display: block; width: 100%; height: 100%; }

.card-tile-meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; flex: 1; }
.card-meta-row  { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.card-meta-row .label { color: var(--text-muted); }
.card-meta-row .value { font-weight: 600; }
.card-meta-row .value.muted { color: var(--text-muted); font-weight: 400; }

.waiver-bar-wrap { margin-top: 10px; height: 36px; display: flex; flex-direction: column; justify-content: center; }
/* ── Fee type badges ── */
.fee-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: 0.3px; text-transform: uppercase;
  border: 1px solid;
}
.fee-badge.ltf         { background: rgba(34,197,94,0.12);  color: var(--green);  border-color: rgba(34,197,94,0.3); }
.fee-badge.fyf         { background: rgba(59,130,246,0.12); color: var(--accent2); border-color: rgba(59,130,246,0.3); }
.fee-badge.fee-applies { background: var(--surface2); color: var(--text-muted); border-color: var(--border); }

/* ── Card name autocomplete ── */
.cf-card-name-wrap { position: relative; }
.cf-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #1a1d27;
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 999;
  max-height: 240px; overflow-y: auto;
  padding: 4px;
}
.cf-suggestions.hidden { display: none; }
.cf-suggestion-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 7px; cursor: pointer;
  font-size: 12px; gap: 8px;
  transition: background .1s;
}
.cf-suggestion-item:hover { background: rgba(59,130,246,0.12); }
.cf-sug-main {
  min-width: 0; display: flex; flex-direction: column; gap: 4px; flex: 1;
}
.cf-sug-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-sug-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cf-sug-tag {
  font-size: 9px; line-height: 1; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 2px 5px; border-radius: 999px;
}
.cf-sug-meta {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.cf-sug-fee {
  font-size: 10px; font-weight: 700; color: var(--text-muted); white-space: nowrap;
}
.cf-sug-network {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  background: var(--surface2); padding: 2px 7px; border-radius: 20px;
  white-space: nowrap;
}
.cf-sug-add {
  color: var(--accent); font-weight: 500; font-size: 11px;
  border-top: 1px solid var(--border); margin-top: 2px; padding-top: 10px;
  justify-content: center;
}
.cf-sug-add:hover { background: rgba(59,130,246,0.08); color: var(--accent2); }

/* ── Card form sections ── */
.cf-section {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.cf-section-last { border-bottom: none; padding-bottom: 0; }
.cf-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--accent); margin-bottom: 2px;
}
.cf-required { color: var(--red); font-size: 10px; vertical-align: super; margin-left: 1px; }
.cf-gst-label {
  display: block; font-size: 10px; color: var(--text-muted);
  margin-top: 4px; line-height: 1.5;
}
.cf-gst-label strong { color: var(--text); font-weight: 600; }
.cf-gst-tag {
  font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 10px; background: rgba(34,197,94,0.12);
  color: #22c55e; letter-spacing: 0.3px; margin-left: 4px;
}
.cf-help {
  font-size: 10px; color: var(--text-muted); font-weight: 400;
  line-height: 1.4; letter-spacing: 0;
}
.cf-color-row { display: flex; align-items: center; gap: 10px; }
.cf-color-input {
  width: 40px !important; height: 36px !important; padding: 2px !important;
  border-radius: 6px !important; cursor: pointer; flex-shrink: 0;
}
.cf-errors { color: var(--red); font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.modal form { gap: 0; }

/* ── Fee type radio group in card form ── */
.fee-type-group {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px;
}
.fee-type-option {
  display: flex; align-items: center; cursor: pointer;
  flex-direction: row; gap: 0;   /* override label flex-direction:column */
}
.fee-type-option input[type="radio"] { display: none; }
.fee-type-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; padding: 6px 14px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text-muted);
  cursor: pointer; transition: all .15s;
  letter-spacing: 0.2px;
}
.fee-type-option input[type="radio"]:checked + .fee-type-pill.fee-applies {
  background: rgba(255,255,255,0.08); color: var(--text); border-color: var(--border2);
}
.fee-type-option input[type="radio"]:checked + .fee-type-pill.fyf {
  background: rgba(59,130,246,0.15); color: var(--accent2); border-color: rgba(59,130,246,0.4);
}
.fee-type-option input[type="radio"]:checked + .fee-type-pill.ltf {
  background: rgba(34,197,94,0.15); color: var(--green); border-color: rgba(34,197,94,0.4);
}
.fee-type-pill:hover { border-color: var(--border2); color: var(--text); }

.no-waiver-pill {
  display: inline-flex; align-items: center;
  font-size: 10px; color: var(--text-subtle); font-weight: 500;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
}
.waiver-bar-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
.waiver-bar-bg { background: rgba(255,255,255,0.05); border-radius: 100px; height: 4px; overflow: hidden; }
.waiver-bar-fill { height: 100%; border-radius: 100px; transition: width .5s cubic-bezier(0.16,1,0.3,1); background: var(--grad); }
.waiver-bar-fill.achieved { background: linear-gradient(90deg, #22c55e, #16a34a); }

.card-tile-actions {
  display: flex; gap: 6px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  align-items: center; flex-shrink: 0;
}
.tile-spend-btn { flex: 1; }

/* ⋯ dropdown menu */
.tile-menu-wrap { position: relative; }
.tile-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0;
  background: #1a1d27; border: 1px solid var(--border2);
  border-radius: 10px; min-width: 190px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  z-index: 300; display: none; flex-direction: column; padding: 4px;
}
.tile-menu.open { display: flex; }
.tile-menu-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text);
  font-size: .85rem; padding: 8px 12px; border-radius: 7px;
  cursor: pointer; text-align: left; width: 100%;
  transition: background .15s;
}
.tile-menu-item:hover { background: rgba(255,255,255,0.07); }
.tile-menu-icon { font-size: 1rem; line-height: 1; width: 18px; text-align: center; }
.tile-menu-divider { height: 1px; background: var(--border); margin: 3px 8px; }
.tile-menu-danger { color: var(--red) !important; }
.tile-menu-danger:hover { background: rgba(239,68,68,0.1) !important; }

/* ─────────────────────────────
   CARD DETAIL PANEL
───────────────────────────── */
#card-detail-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 500px; max-width: 95vw;
  background: #111318;
  border-left: 1px solid var(--border2);
  display: flex; flex-direction: column; z-index: 200;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: -24px 0 60px rgba(0,0,0,0.5);
}
#card-detail-panel.open { transform: none; }

.detail-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #13151d;
}
.detail-header h3 { font-size: 14px; font-weight: 700; flex: 1; letter-spacing: -0.2px; }
.detail-body { flex: 1; overflow-y: auto; padding: 0; display: flex; flex-direction: column; }

/* Detail section wrapper */
.detail-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.detail-section:last-child { border-bottom: none; }

.detail-section h4 {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Info grid — cleaner 2-column layout */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.info-item {
  background: #161920;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.info-item .lbl {
  font-size: 10px; color: var(--text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.info-item .val { font-size: 13px; font-weight: 600; }

/* Waiver bar in detail panel */
.waiver-bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }

/* ─────────────────────────────
   TABLES
───────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }
.data-table .actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ── Benefit usage controls ── */
.ben-toggle {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; cursor: pointer; user-select: none;
  border: 1px solid var(--border2); color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.ben-toggle:hover { border-color: var(--accent); color: var(--accent); }
.ben-toggle-on { background: rgba(34,197,94,0.12); border-color: #22c55e; color: #22c55e; }
.ben-toggle-on:hover { background: rgba(34,197,94,0.06); border-color: var(--border2); color: var(--text-muted); }

.ben-counter { display: inline-flex; align-items: center; gap: 6px; }
.ben-counter-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border2); background: none;
  color: var(--text); font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.ben-counter-btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.ben-counter-btn:disabled { opacity: 0.3; cursor: default; }
.ben-counter-val { font-size: 12px; font-weight: 600; min-width: 28px; text-align: center; }
.ben-counter-cap { font-weight: 400; color: var(--text-muted); }
.ben-counter-full { color: #22c55e; }

.empty-state {
  text-align: center; color: var(--text-muted); padding: 36px 20px;
  font-size: 12px; line-height: 1.7;
}
.empty-state::before {
  content: ''; display: block; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); margin: 0 auto 12px;
}

/* ─────────────────────────────
   REVIEW TAB
───────────────────────────── */
#tab-review { overflow-y: auto; padding: 24px; }

.review-grid { display: flex; flex-direction: column; gap: 12px; }

.review-card {
  background: #161920;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color .2s;
}
.review-card:hover { border-color: var(--border2); }

.review-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.review-card-header .name { font-size: 14px; font-weight: 700; flex: 1; letter-spacing: -0.2px; }

.score-badge {
  font-size: 20px; font-weight: 800;
  padding: 6px 14px; border-radius: 10px;
  min-width: 58px; text-align: center;
  letter-spacing: -0.5px;
}
.score-keep   { background: var(--green-bg);  color: var(--score-keep);   border: 1px solid rgba(34,197,94,0.2); }
.score-review { background: var(--yellow-bg); color: var(--score-review); border: 1px solid rgba(245,158,11,0.2); }
.score-close  { background: var(--red-bg);    color: var(--score-close);  border: 1px solid rgba(239,68,68,0.2); }

.reco-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.reco-keep   { color: var(--score-keep); }
.reco-review { color: var(--score-review); }
.reco-close  { color: var(--score-close); }

.review-stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px;
}
.review-stat {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; text-align: center;
}
.review-stat .lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.review-stat .val { font-size: 13px; font-weight: 700; margin-top: 3px; letter-spacing: -0.2px; }

.review-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.flag-chip {
  font-size: 10px; padding: 3px 9px; border-radius: 20px;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
  font-weight: 500;
}
.flag-chip.flag-good { background: var(--green-bg);  color: var(--green); border-color: rgba(34,197,94,0.2); }
.flag-chip.flag-warn { background: var(--red-bg);    color: var(--red);   border-color: rgba(239,68,68,0.2); }

.breakdown-toggle { font-size: 11px; color: var(--accent2); cursor: pointer; margin-bottom: 8px; font-weight: 500; }
.breakdown-toggle:hover { color: var(--accent); }
.breakdown-details {
  display: none; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 12px; font-size: 11px;
}
.breakdown-details.open { display: block; }
.bd-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--text-muted); }
.bd-row .bd-val { font-weight: 600; color: var(--text); }

.decision-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.decision-row select { flex: 0 0 140px; }
.decision-row input[type=text] { flex: 1; min-width: 160px; }

/* ─────────────────────────────
   LIMITS TAB
───────────────────────────── */
#tab-limits { overflow-y: auto; }

.limits-page { display: flex; flex-direction: column; min-height: 100%; }

/* Summary strip */
.limits-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lstat-card {
  background: #0f1117;
  padding: 20px 28px;
  display: flex; flex-direction: column; gap: 4px;
}
.lstat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.lstat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.lstat-sub   { font-size: 11px; color: var(--text-muted); }
.lstat-score-tag { font-size: 13px; font-weight: 500; opacity: .45; margin-left: 1px; }

/* Two-column body */
.limits-body {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 0;
  flex: 1;
  min-width: 0;
}
.limits-col { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.limits-col:first-child { border-right: 1px solid var(--border); }

.limits-panel {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.limits-panel:last-child { border-bottom: none; }
.limits-panel-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.limits-panel-hint {
  font-size: 10px; color: var(--text-muted); font-weight: 400;
}

/* Per-card list */
.limit-cards-list { display: flex; flex-direction: column; gap: 0; }

.limit-card-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  position: relative; padding-left: 12px;
}
.limit-card-row:last-child { border-bottom: none; }

.limit-card-accent {
  position: absolute; left: 0; top: 16px; bottom: 16px;
  width: 3px; border-radius: 2px;
}
.limit-card-info { display: flex; flex-direction: column; gap: 3px; }
.limit-card-name {
  font-size: 13px; font-weight: 700; letter-spacing: -0.2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.limit-card-bank { font-size: 11px; color: var(--text-muted); }

.limit-card-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
.limit-stat-block { display: flex; flex-direction: column; gap: 2px; }
.limit-stat-lbl { font-size: 9px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.limit-stat-val { font-size: 13px; font-weight: 700; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.limit-stat-locked {
  font-size: 11px; font-weight: 600; color: var(--yellow);
  opacity: .7; align-items: center; gap: 5px;
}

.reporters-chip {
  font-size: 9px; color: var(--text-subtle); font-weight: 400;
  background: var(--surface2); padding: 1px 5px; border-radius: 20px;
  border: 1px solid var(--border);
}

.limit-util-row, .limit-bench-row { display: flex; flex-direction: column; gap: 4px; }
.limit-util-label {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted); font-weight: 500;
}

/* Utilization bar color overrides */
.waiver-bar-fill.util-warn { background: var(--red); }
.waiver-bar-fill.util-mid  { background: var(--yellow); }

/* ─────────────────────────────
   HISTORY TAB
───────────────────────────── */
#tab-history { overflow-y: auto; padding: 24px; }

/* ─────────────────────────────
   CHARTS
───────────────────────────── */
canvas.chart { display: block; width: 100%; border-radius: var(--radius-sm); }

/* ─────────────────────────────
   UTILITY
───────────────────────────── */
.hidden { display: none !important; }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag-chip {
  font-size: 10px; padding: 3px 8px; border-radius: 20px;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); font-weight: 500;
}

.inr { font-variant-numeric: tabular-nums; }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-muted  { color: var(--text-muted); }

hr.divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─────────────────────────────
   RESPONSIVE
───────────────────────────── */
@media (max-width: 900px) {
  .limits-body { grid-template-columns: 1fr; }
  .limits-col:first-child { border-right: none; }
  .limit-card-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ─────────────────────────────
   BILLING CYCLE TAB
───────────────────────────── */
#tab-billing { overflow-y: auto; }
.billing-wrap { display: flex; flex-direction: column; gap: 24px; padding: 24px; }

/* Header */
.billing-top  { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.billing-month { font-size: 20px; font-weight: 700; }
.billing-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Legend */
.bc-legend      { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.bc-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.sl-leg-dot   { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.sl-leg-ring  { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-muted);
                background: transparent; flex-shrink: 0; }
.sl-leg-today { width: 2px; height: 14px; background: var(--accent); border-radius: 1px; flex-shrink: 0; }

/* ── Swimlane scroll shell ── */
.sl-scroll    { overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
                border-radius: var(--radius-lg); }
.sl-container { min-width: 820px; display: flex; flex-direction: column; }

/* Header row: label space + axis */
.sl-header-row  { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.sl-label-space { flex: 0 0 220px; min-width: 220px; padding: 8px 12px;
                  font-size: 10px; font-weight: 600; color: var(--text-muted);
                  text-transform: uppercase; letter-spacing: 0.5px;
                  display: flex; align-items: flex-end; border-right: 1px solid var(--border); }

/* Axis */
.sl-axis      { flex: 1; position: relative; height: 48px; overflow: hidden; }
.sl-axis-day  { position: absolute; top: 0; display: flex; flex-direction: column;
                align-items: center; transform: translateX(-50%); user-select: none; }
.sl-ax-num    { font-size: 10px; font-weight: 600; color: var(--text-muted); line-height: 2; }
.sl-ax-dow    { font-size: 9px; color: var(--text-muted); opacity: 0.6; line-height: 1; }
.sl-axis-day.sl-we .sl-ax-num { color: var(--accent); opacity: 0.7; }
.sl-axis-day.sl-ax-nm { opacity: 0.35; }
.sl-axis-today-col .sl-ax-num { color: white; font-weight: 700; }

/* Month boundary on axis */
.sl-ax-boundary { position: absolute; top: 0; bottom: 0; width: 1px;
                  background: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 4px, transparent 4px, transparent 8px);
                  pointer-events: none; }
.sl-ax-boundary-label { position: absolute; top: 4px; left: 4px;
                         font-size: 9px; font-weight: 600; color: var(--text-muted);
                         white-space: nowrap; opacity: 0.7; }
.sl-ax-today-tick { position: absolute; top: 0; bottom: 0; width: 2px;
                    background: var(--accent); border-radius: 1px;
                    transform: translateX(-50%); pointer-events: none; opacity: 0.7; }

/* ── Lanes ── */
.sl-lanes    { display: flex; flex-direction: column; }
.sl-lane     { display: flex; align-items: stretch; min-height: 64px; }
.sl-lane-alt { background: rgba(255,255,255,0.018); }
.sl-lane + .sl-lane { border-top: 1px solid var(--border); }

/* Label column */
.sl-label      { flex: 0 0 220px; min-width: 220px; display: flex; align-items: center;
                 gap: 0; padding: 10px 12px 10px 0;
                 border-right: 1px solid var(--border); overflow: hidden; }
.sl-label-bar  { width: 3px; min-height: 36px; border-radius: 2px;
                 align-self: stretch; flex-shrink: 0; margin-right: 10px; }
.sl-label-body { flex: 1; overflow: hidden; }
.sl-label-name { font-size: 12px; font-weight: 600; white-space: nowrap;
                 overflow: hidden; text-overflow: ellipsis; }
.sl-label-bank { font-size: 10px; color: var(--text-muted); margin-top: 2px;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-label-grace { flex-shrink: 0; margin-left: 8px; padding: 2px 6px;
                  border-radius: 100px; font-size: 9px; font-weight: 600;
                  background: rgba(255,255,255,0.07); color: var(--text-muted); }

/* Track area */
.sl-track          { flex: 1; position: relative; overflow: hidden; }
.sl-track-base     { position: absolute; left: 0; right: 0; top: 42%; height: 1px;
                     background: var(--border); }
.sl-track-boundary { position: absolute; top: 0; bottom: 0; width: 1px;
                     background: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 4px, transparent 4px, transparent 8px);
                     pointer-events: none; }
.sl-track-today    { position: absolute; top: 0; bottom: 0; width: 2px;
                     background: var(--accent); transform: translateX(-50%);
                     pointer-events: none; opacity: 0.55; }

/* Grace bar (fills bill→due) */
.sl-grace-bar { position: absolute; top: calc(42% - 1px); height: 3px;
                border-radius: 2px; opacity: 0.28; pointer-events: none; }

/* Billing dot (filled) */
.sl-bill-dot { position: absolute; top: 42%; width: 11px; height: 11px;
               border-radius: 50%; transform: translate(-50%, -50%);
               cursor: default; z-index: 2; }

/* Due ring (outlined) */
.sl-due-ring { position: absolute; top: 42%; width: 11px; height: 11px;
               border-radius: 50%; border: 2px solid; background: transparent;
               transform: translate(-50%, -50%); cursor: default; z-index: 2; }

/* Date labels below dots */
.sl-bill-lbl { position: absolute; top: 58%; font-size: 9px; font-weight: 600;
               transform: translateX(-50%); white-space: nowrap; }
.sl-due-lbl  { position: absolute; top: 58%; font-size: 9px; font-weight: 600;
               transform: translateX(-50%); white-space: nowrap; }
.sl-due-lbl-spill { opacity: 0.55; }

/* Missing billing date row */
.sl-lane-missing .sl-label-name,
.sl-lane-missing .sl-label-bank { opacity: 0.4; }
.sl-missing-msg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
                  font-size: 11px; color: var(--text-muted); opacity: 0.5;
                  white-space: nowrap; font-style: italic; }

/* Insights */
.billing-insights  { display: flex; flex-direction: column; gap: 16px; }
.bi-grid           { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bi-panel          { background: var(--surface); border: 1px solid var(--border);
                     border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.bi-panel-title    { font-size: 10px; font-weight: 700; color: var(--text-muted);
                     text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.bi-item   { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px;
             border-radius: 8px; font-size: 12px; line-height: 1.55; }
.bi-icon   { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center;
             justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.bi-text   { flex: 1; }
.bi-good    { background: rgba(34,197,94,0.06); }
.bi-good .bi-icon   { background: rgba(34,197,94,0.2);  color: #22c55e; }
.bi-warn    { background: rgba(245,158,11,0.07); }
.bi-warn .bi-icon   { background: rgba(245,158,11,0.2); color: #f59e0b; }
.bi-neutral { background: rgba(255,255,255,0.03); }
.bi-neutral .bi-icon { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.bi-action  { background: rgba(99,102,241,0.06); }
.bi-action .bi-icon { background: rgba(99,102,241,0.2); color: #818cf8; }

@media (max-width: 900px) {
  .bi-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────
   CREDIT SCORE TAB
───────────────────────────── */
#tab-credit { overflow-y: auto; }
.credit-wrap { display: flex; flex-direction: column; gap: 20px; padding: 24px; }

/* Top section: 50/50 gauge + KPI grid */
.credit-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.credit-gauge-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 24px 24px;
}
.credit-gauge { width: 100%; max-width: 300px; height: auto; overflow: visible; }
.gauge-needle { stroke: white; stroke-width: 2.5; stroke-linecap: round; }
.credit-score-num { font-size: 52px; font-weight: 800; letter-spacing: -2px; margin-top: 6px; line-height: 1; }
.credit-rating-label { font-size: 15px; font-weight: 700; margin-top: 4px; }
.credit-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.credit-trend { font-size: 12px; margin-top: 4px; }

/* KPI grid (right side of top section) */
.credit-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.credit-kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 16px; display: flex; flex-direction: column; gap: 4px;
}
.kpi-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.kpi-bar-track { height: 4px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; margin: 4px 0 2px; }
.kpi-bar-fill { height: 100%; border-radius: 100px; transition: width .6s cubic-bezier(0.16,1,0.3,1); }
.kpi-status { font-size: 11px; font-weight: 600; }
.kpi-detail { font-size: 10px; color: var(--text-muted); line-height: 1.4; }

/* Mid section: per-card util + best practices side by side */
.credit-mid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.credit-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px;
}
.credit-panel-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 14px; }
.credit-panel-empty { font-size: 12px; color: var(--text-muted); }

/* Best practices */
.credit-practices { display: flex; flex-direction: column; gap: 8px; }
.credit-practice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
}
.credit-practice.pass { border-color: rgba(34,197,94,0.25); background: rgba(34,197,94,0.04); }
.credit-practice.fail { border-color: rgba(239,68,68,0.25);  background: rgba(239,68,68,0.04);  }
.cp-icon { font-size: 14px; font-weight: 700; min-width: 16px; margin-top: 1px; }
.credit-practice.pass .cp-icon { color: #22c55e; }
.credit-practice.fail .cp-icon { color: #ef4444; }
.credit-practice.neutral .cp-icon { color: var(--text-muted); }
.cp-body { display: flex; flex-direction: column; gap: 2px; }
.cp-title { font-size: 12px; font-weight: 600; }
.cp-detail { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Score history */
.credit-history { display: flex; flex-direction: column; gap: 6px; }
.ch-row {
  display: grid; grid-template-columns: 120px 80px 1fr auto 32px;
  align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: 12px;
}
.ch-date { color: var(--text-muted); }
.ch-bureau { color: var(--text-muted); font-size: 11px; }
.ch-score { font-weight: 700; font-size: 15px; }
.ch-label { font-size: 10px; font-weight: 500; margin-left: 4px; }
.ch-trend { font-size: 11px; }
.ch-del { opacity: 0; transition: opacity .15s; }
.ch-row:hover .ch-del { opacity: 1; }

/* Modal score preview */
.cs-preview-bar { margin-top: 4px; }
.cs-preview-label { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.cs-preview-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.cs-preview-fill { height: 100%; border-radius: 100px; transition: width .3s; }

@media (max-width: 900px) {
  .credit-top { grid-template-columns: 1fr; }
  .credit-kpi-grid { grid-template-columns: 1fr 1fr; }
  .credit-mid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .credit-kpi-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .review-stats { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  #card-detail-panel { width: 100%; }
  .modal { padding: 20px; }
  header { flex-wrap: wrap; gap: 8px; padding: 10px 14px; height: auto; }
  .tab-nav { order: 3; width: 100%; overflow-x: auto; }
  .login-layout { grid-template-columns: 1fr; }
  .login-features { display: none; }
  .login-card { border-radius: var(--radius-xl); padding: 44px 32px; }
  .login-feature-grid { grid-template-columns: 1fr 1fr; }
  .cards-toolbar { flex-wrap: wrap; }
  .cards-toolbar input[type="text"] { width: 100%; }
  .cards-toolbar select { width: 100%; }
  .limits-summary { grid-template-columns: 1fr 1fr; }
  .limit-card-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════
   LIGHT THEME — override hardcoded dark values
   ═══════════════════════════════════════════ */
[data-theme="light"] {
  /* Scrollbar */
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ── Login ── */
[data-theme="light"] .login-card { background: #ffffff; box-shadow: 0 20px 60px rgba(0,0,0,0.12); }

/* ── Header ── */
[data-theme="light"] header { background: rgba(243,244,248,0.95); }

/* ── Inputs / selects ── */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea { background: #ffffff; color: var(--text); border-color: var(--border); }
[data-theme="light"] input::placeholder { color: var(--text-subtle); }
[data-theme="light"] select option { background: #ffffff; color: var(--text); }

/* ── Modal ── */
[data-theme="light"] .modal { background: #ffffff; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
[data-theme="light"] .delete-dialog { background: #ffffff; box-shadow: 0 20px 60px rgba(0,0,0,0.12); }
[data-theme="light"] .delete-confirm-input { background: #f8f8fa !important; }

/* ── Cards toolbar ── */
[data-theme="light"] .cards-toolbar { background: var(--bg2); }

/* ── Card tiles ── */
[data-theme="light"] .card-tile { background: #ffffff; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
[data-theme="light"] .card-tile:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

/* ── Dashboard stat cards ── */
[data-theme="light"] .stat-card { background: #ffffff; }

/* ── Buttons ── */
[data-theme="light"] .btn-danger { background: var(--red-bg); border-color: rgba(239,68,68,0.25); }

/* ── Card detail panel ── */
[data-theme="light"] #card-detail-panel { background: #f8f9fc; box-shadow: -8px 0 32px rgba(0,0,0,0.1); }
[data-theme="light"] .detail-header { background: #ffffff; }
[data-theme="light"] .info-item { background: #ffffff; }

/* ── Tile menus / autocomplete ── */
[data-theme="light"] .tile-menu { background: #ffffff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
[data-theme="light"] .tile-menu-item:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .cf-suggestions { background: #ffffff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* ── Review tab ── */
[data-theme="light"] .review-card { background: #ffffff; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

/* ── Limits summary strip ── */
[data-theme="light"] .lstat-card { background: #ffffff; }

/* ── Progress / waiver bars ── */
[data-theme="light"] .util-bar-track { background: rgba(0,0,0,0.06); }
[data-theme="light"] .waiver-bar-bg  { background: rgba(0,0,0,0.06); }
[data-theme="light"] .cs-preview-track { background: rgba(0,0,0,0.06); }

/* ── Ben counter hover ── */
[data-theme="light"] .ben-counter-btn:hover:not(:disabled) { background: rgba(0,0,0,0.06); }

/* ── Fee type pill checked state ── */
[data-theme="light"] .fee-type-option input[type="radio"]:checked + .fee-type-pill.fee-applies {
  background: rgba(0,0,0,0.07); color: var(--text); border-color: var(--border2);
}

/* ── Swimlane shell ── */
[data-theme="light"] .sl-scroll { background: #ffffff; }
[data-theme="light"] .sl-axis-today-col .sl-ax-num { color: #1d4ed8; }

/* ── Credit score tab ── */
[data-theme="light"] .credit-gauge-panel { background: #ffffff; }
[data-theme="light"] .credit-panel { background: #ffffff; }

/* ── History / data tables ── */
[data-theme="light"] .data-table tr:hover td { background: rgba(0,0,0,0.03); }

/* ─────────────────────────────
   ADMIN PANEL
───────────────────────────── */
.tab-btn--admin { color: var(--accent); }
.tab-btn--admin.active { background: var(--accent); color: #fff; }

/* ── Admin Shell ─────────────────────────────────────────────────────────── */
.adm-shell {
  display: flex; height: 100%; flex: 1; overflow: hidden;
}

/* Sidebar */
.adm-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0;
  padding: 20px 0; overflow-y: auto;
}
.adm-sidebar-group { display: flex; flex-direction: column; padding: 0 10px; margin-bottom: 24px; gap: 2px; }
.adm-sidebar-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-subtle); padding: 0 8px; margin-bottom: 6px;
}
.adm-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.adm-nav-item:hover:not(.adm-nav-item--soon) { background: var(--surface2); color: var(--text); }
.adm-nav-item.active { background: rgba(59,130,246,.12); color: var(--accent); font-weight: 600; }
.adm-nav-item--soon { opacity: .45; cursor: default; }
.adm-nav-icon { flex-shrink: 0; display: flex; align-items: center; }
.adm-nav-label { flex: 1; }
.adm-nav-badge {
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; border-radius: 9px;
  background: var(--surface2); color: var(--text-muted); padding: 0 5px;
}
.adm-nav-badge--warn { background: rgba(245,158,11,.2); color: var(--yellow); }
.adm-nav-soon {
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface2); color: var(--text-subtle); border-radius: 4px;
  padding: 1px 5px;
}

/* Content area */
.adm-content { flex: 1; overflow-y: auto; }
.adm-section-wrap { padding: 28px 32px; max-width: 1100px; display: flex; flex-direction: column; gap: 24px; }
.adm-section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.adm-section-title { font-size: 18px; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -.3px; }
.adm-section-sub   { font-size: 12px; color: var(--text-muted); }

/* Metric grid (overview) */
.adm-metric-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.adm-metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.adm-metric-val { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.adm-metric-lbl { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Overview panels */
.adm-ov-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.adm-ov-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.adm-ov-panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.adm-bar-row { display: flex; align-items: center; gap: 10px; }
.adm-bar-label { font-size: 12px; color: var(--text-muted); width: 72px; flex-shrink: 0; }
.adm-bar-track { flex: 1; height: 6px; background: var(--border2); border-radius: 3px; overflow: hidden; }
.adm-bar-fill  { height: 100%; border-radius: 3px; transition: width .3s; }
.adm-bar-val   { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; min-width: 60px; text-align: right; }
.adm-bar-pct   { color: var(--text-muted); font-weight: 400; }

/* Quick action panel */
.adm-quick-action {
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted);
}
.adm-quick-action--ok { color: var(--text-subtle); }
.adm-qa-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.adm-qa-dot--warn { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.adm-qa-dot--ok   { background: var(--green); }

/* Users toolbar */
.adm-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.adm-search {
  flex: 1; min-width: 200px; height: 34px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 12px; color: var(--text); font-size: 13px;
}
.adm-search:focus { outline: none; border-color: var(--accent); }
.adm-filter-chips { display: flex; gap: 4px; }
.adm-chip {
  height: 30px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .12s;
}
.adm-chip:hover { border-color: var(--accent); color: var(--text); }
.adm-chip.active { background: rgba(59,130,246,.12); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.adm-sort-sel {
  height: 34px; padding: 0 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 12px;
}
.adm-result-count { font-size: 11px; color: var(--text-subtle); white-space: nowrap; }
.adm-empty-row { text-align: center; padding: 32px !important; color: var(--text-muted); font-size: 13px; }

/* Waitlist empty state */
.adm-empty-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 60px 24px; color: var(--text-muted);
}
.adm-empty-icon { opacity: .3; }
.adm-empty-msg  { font-size: 15px; font-weight: 700; color: var(--text); }
.adm-empty-sub  { font-size: 13px; }

/* Coming soon card */
.adm-soon-card {
  display: flex; gap: 28px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 16px;
  padding: 32px 36px; max-width: 720px;
}
.adm-soon-icon {
  flex-shrink: 0; width: 60px; height: 60px; border-radius: 14px;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); opacity: .7;
}
.adm-soon-icon svg { width: 26px; height: 26px; }
.adm-soon-body { flex: 1; }
.adm-soon-eyebrow {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-subtle); margin-bottom: 8px;
}
.adm-soon-title { font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 10px; letter-spacing: -.3px; }
.adm-soon-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.65; margin: 0; }
.adm-soon-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0 14px; }
.adm-soon-bullets-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-subtle); margin-bottom: 10px; }
.adm-soon-bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-soon-bullets li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
}
.adm-soon-bullets li::before {
  content: ""; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .5; margin-top: 6px;
}

/* ── Card Catalog ────────────────────────────────────────────────────────── */
.cat-toolbar {
  flex-wrap: nowrap;
  gap: 8px;
}
.cat-toolbar .adm-search {
  flex: 1 1 420px;
  min-width: 260px;
}
.cat-toolbar .adm-sort-sel {
  flex: 0 0 180px;
}
.cat-toolbar .adm-filter-chips {
  flex: 0 0 auto;
}
.cat-toolbar .adm-result-count {
  margin-left: auto;
}

@media (max-width: 1100px) {
  .cat-toolbar {
    flex-wrap: wrap;
  }
  .cat-toolbar .adm-search {
    flex-basis: 100%;
  }
}

.cat-table .cat-bank { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.cat-table .cat-name {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-row { cursor: default; }
.cat-row--open td { background: rgba(59,130,246,.04); }

/* Pin the expand-btn column so it never scrolls out of view */
.cat-table th:last-child,
.cat-table td:last-child {
  position: sticky; right: 0; z-index: 1;
  background: var(--surface);
  box-shadow: -4px 0 8px rgba(0,0,0,.06);
}
.cat-table thead th:last-child {
  z-index: 25;
  background: var(--bg);
}
.cat-row--open td:last-child { background: rgba(59,130,246,.04); }
[data-theme="light"] .cat-table th:last-child,
[data-theme="light"] .cat-table td:last-child { background: var(--surface); }

.cat-expand-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); font-size: 10px; padding: 3px 8px; cursor: pointer;
  transition: all .12s;
}
.cat-expand-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Network pill */
.cat-network-pill {
  display: inline-block; font-size: 10px; font-weight: 700; color: #fff;
  border-radius: 4px; padding: 2px 7px; letter-spacing: .02em; white-space: nowrap;
}

/* Tag chips */
.cat-tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 180px; }
.cat-tag-chip {
  display: inline-block; font-size: 10px; font-weight: 600;
  border-radius: 20px; padding: 2px 8px;
}

/* GST secondary labels */
.cat-fee-gst {
  display: block; font-size: 10px; font-weight: 500; color: var(--text-muted);
  margin-top: 1px; line-height: 1;
}
.cat-lbl-gst {
  font-size: 10px; font-weight: 500; color: var(--text-subtle);
  background: var(--surface2); border-radius: 4px; padding: 1px 5px;
  margin-left: 4px; vertical-align: middle;
}

/* User count */
.cat-user-count { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.cat-user-count--active { color: var(--accent); }

/* Expand panel */
.cat-expand-row td { padding: 0 !important; border-bottom: 2px solid var(--accent) !important; }
.cat-expand-panel {
  display: grid; grid-template-columns: 1fr 320px; gap: 0;
  background: var(--surface2);
}

/* Edit column */
.cat-edit-col {
  padding: 24px 28px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0;
}
.cat-edit-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); margin-bottom: 16px;
}
.cat-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.cat-field { display: flex; flex-direction: column; gap: 5px; }
.cat-field-lbl {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.cat-input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text); font-size: 13px;
  transition: border-color .12s;
}
.cat-input:focus { outline: none; border-color: var(--accent); }

/* Tag picker */
.cat-tag-picker {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.cat-tag-toggle {
  font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; transition: all .12s;
}
.cat-tag-toggle:hover { border-color: var(--accent); color: var(--text); }
.cat-tag-toggle.on {
  background: rgba(59,130,246,.15); border-color: var(--accent); color: var(--accent); font-weight: 700;
}

/* Backfill checkbox row */
.cat-backfill-row {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
}
.cat-backfill-row input { accent-color: var(--accent); }

.cat-edit-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* Holders column */
.cat-holders-col {
  padding: 24px 20px; display: flex; flex-direction: column; gap: 16px;
}
.cat-holders-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.cat-holders-stat {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; text-align: center;
}
.cat-holders-stat-val { font-size: 16px; font-weight: 800; color: var(--text); }
.cat-holders-stat-lbl { font-size: 10px; color: var(--text-muted); }

.cat-holders-list {
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 240px;
}
.cat-holder-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px;
}
.cat-holder-info { display: flex; flex-direction: column; gap: 1px; }
.cat-holder-name  { font-size: 12px; font-weight: 600; color: var(--text); }
.cat-holder-email { font-size: 10px; color: var(--text-muted); }
.cat-holder-meta  { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cat-holder-limit { font-size: 12px; font-weight: 700; color: var(--accent); }
.cat-no-holders   { font-size: 12px; color: var(--text-muted); text-align: center; padding: 20px 0; }
.cat-holders-loading { font-size: 12px; color: var(--text-subtle); padding: 12px 0; }

/* Add card modal */
.cat-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px); z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.cat-modal-backdrop.hidden { display: none; }
.cat-modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 20px; width: 640px; max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  display: flex; flex-direction: column; max-height: 90vh;
}
.cat-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; flex-shrink: 0;
}
.cat-modal-title { font-size: 17px; font-weight: 800; color: var(--text); margin: 0; }
.cat-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.cat-modal-close:hover { background: var(--surface2); color: var(--text); }
.cat-modal-body   { padding: 20px 24px; overflow-y: auto; }
.cat-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* Keep old admin- prefixed classes for table, chips, buttons */
.admin-page { padding: 24px 32px; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.admin-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent); color: #fff; border-radius: 4px; padding: 2px 8px;
}

/* Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted);
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--surface2); }

.admin-user-name  { font-weight: 600; color: var(--text); }
.admin-user-email { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.ta-r { text-align: right; }

/* Status chips */
.admin-chip {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
}
.admin-chip--ok      { background: var(--green-bg);  color: var(--green);  }
.admin-chip--blocked { background: var(--red-bg);    color: var(--red);    }
.admin-chip--admin   { background: rgba(79,142,247,.15); color: var(--accent); }

/* Action buttons */
.admin-actions { display: flex; gap: 6px; }
.admin-btn {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.admin-btn:hover         { background: var(--surface); }
.admin-btn--danger       { color: var(--red); border-color: var(--red-bg); }
.admin-btn--danger:hover { background: var(--red-bg); }
.admin-btn--ok           { color: var(--green); border-color: var(--green-bg); }
.admin-btn--ok:hover     { background: var(--green-bg); }
.admin-btn:disabled      { opacity: .5; cursor: not-allowed; }
.admin-no-action         { color: var(--text-muted); font-size: 12px; }

[data-theme="light"] .admin-stat-card { background: #ffffff; }
[data-theme="light"] .admin-section   { background: #ffffff; }
[data-theme="light"] .admin-table tbody tr:hover td { background: rgba(0,0,0,0.03); }

/* Admin expandable detail row */
.admin-user-row:hover td { background: var(--surface2); }
.admin-detail-row td { padding: 0; }
.admin-detail-row.hidden { display: none; }
.admin-detail-panel {
  background: var(--surface2); border-top: 1px solid var(--border);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 16px;
}
/* 4-column group grid */
.ad-group-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.ad-group {
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 20px 0 0;
  border-right: 1px solid var(--border);
}
.ad-group:last-child { border-right: none; padding-right: 0; padding-left: 20px; }
.ad-group:first-child { padding-left: 0; }
.ad-group:not(:first-child):not(:last-child) { padding-left: 20px; }
.ad-group-title {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-subtle); margin-bottom: 4px;
}
.ad-row { display: flex; flex-direction: column; gap: 2px; }
.ad-lbl { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ad-val { font-size: 12px; color: var(--text); font-weight: 500; }
.ad-val--mono { font-family: monospace; font-size: 11px; }
.admin-detail-ua {
  font-size: 10px; color: var(--text-muted); font-family: monospace;
  word-break: break-all; opacity: 0.5; padding-top: 4px;
  border-top: 1px solid var(--border);
}
