/* ═══════════════════════════════════════════════════════════
   TITAN PAYMENT MANAGER — Banking App Style
   Blue/White/Gray, Large Fonts, High Contrast, Card Layouts
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --blue-900: #0d2444;
  --blue-800: #1e3a5f;
  --blue-700: #2e5282;
  --blue-600: #2e6da4;
  --blue-500: #3b82c4;
  --blue-400: #5b9bd5;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --green-600: #16a34a;
  --green-100: #dcfce7;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --yellow-600: #ca8a04;
  --yellow-100: #fef9c3;
  --orange-600: #ea580c;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  --white: #ffffff;
  --sidebar-w: 220px;
  --topbar-h: 64px;
  --border-radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-main);
  font-size: 16px;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
}

/* ── Layout ────────────────────────────────────────────────── */
body {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  background: var(--blue-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,0.25);
}

#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.logo-icon { font-size: 28px; }
.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--white);
}

.nav-menu {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}
.nav-menu li { margin: 2px 10px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: rgba(255,255,255,0.10);
  color: var(--white);
}
.nav-link.active {
  background: var(--blue-600);
  color: var(--white);
  font-weight: 700;
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.10);
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* ── Topbar ────────────────────────────────────────────────── */
#topbar {
  position: relative;
  background: var(--white);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 60px 0 28px;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
#page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -0.3px;
}
#topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ── Views ─────────────────────────────────────────────────── */
.view {
  padding: 24px 28px;
  flex: 1;
}
.hidden { display: none !important; }

/* ── Alert Banner ──────────────────────────────────────────── */
#alert-banner {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
#alert-banner.success { background: var(--green-100); color: var(--green-600); border-bottom: 2px solid var(--green-600); }
#alert-banner.error   { background: var(--red-100);   color: var(--red-600);   border-bottom: 2px solid var(--red-600); }
#alert-banner.info    { background: var(--blue-100);  color: var(--blue-700);  border-bottom: 2px solid var(--blue-600); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-800);
}
.card-body { padding: 20px 22px; }

/* ── Stat Cards (Dashboard) ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--blue-800);
  line-height: 1;
}
.stat-value.green { color: var(--green-600); }
.stat-value.blue  { color: var(--blue-600); }
.stat-sub {
  font-size: 13px;
  color: var(--gray-500);
}
.stat-card.accent {
  background: var(--blue-800);
  border-color: var(--blue-800);
}
.stat-card.accent .stat-label { color: rgba(255,255,255,0.7); }
.stat-card.accent .stat-value { color: var(--white); }
.stat-card.accent .stat-sub   { color: rgba(255,255,255,0.55); }

/* ── Buttons ─────────────────────────────────────────────────*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(46,109,164,0.35);
}
.btn-primary:hover { background: var(--blue-700); box-shadow: 0 3px 10px rgba(46,109,164,0.45); }
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-success {
  background: var(--green-600);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(22,163,74,0.3);
}
.btn-success:hover { background: #15803d; }
.btn-danger {
  background: var(--red-600);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(220,38,38,0.3);
}
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-xl { padding: 16px 36px; font-size: 18px; font-weight: 700; }

/* ── Table ───────────────────────────────────────────────────*/
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  background: var(--blue-800);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
thead th:first-child { border-radius: 9px 0 0 0; }
thead th:last-child  { border-radius: 0 9px 0 0; }
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background 0.1s; }
tbody tr:hover { background: var(--blue-50); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 11px 16px; color: var(--gray-700); }
tbody td.money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--blue-800); }
tbody td.status-paid   { color: var(--green-600); font-weight: 700; }
tbody td.status-pending { color: var(--yellow-600); font-weight: 600; }
tbody td.status-skipped { color: var(--gray-500); font-weight: 600; }
.table-empty { text-align: center; color: var(--gray-500); padding: 40px 20px; font-size: 15px; }

/* ── Forms ───────────────────────────────────────────────────*/
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
input, select, textarea {
  padding: 10px 13px;
  border: 2px solid var(--gray-200);
  border-radius: 7px;
  font-size: 15px;
  font-family: var(--font-main);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,196,0.15);
}
textarea { min-height: 80px; resize: vertical; }
input.error, select.error { border-color: var(--red-600); }
.field-hint { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ── Modal ───────────────────────────────────────────────────*/
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#modal {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
}
#modal-title { font-size: 20px; font-weight: 700; color: var(--blue-800); }
#modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px 8px;
  border-radius: 5px;
  line-height: 1;
}
#modal-close:hover { background: var(--gray-100); color: var(--gray-900); }
#modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
#modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Loading ─────────────────────────────────────────────────*/
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-overlay p { font-size: 16px; color: var(--blue-700); font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────────*/
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-paid    { background: var(--green-100); color: var(--green-600); }
.badge-pending { background: var(--yellow-100); color: var(--yellow-600); }
.badge-skipped { background: var(--gray-100); color: var(--gray-500); }
.badge-draft   { background: var(--blue-100); color: var(--blue-700); }
.badge-sent    { background: var(--yellow-100); color: var(--yellow-600); }
.badge-complete { background: var(--green-100); color: var(--green-600); }
.badge-ira     { background: #ede9fe; color: #7c3aed; }
.badge-individual { background: var(--blue-50); color: var(--blue-600); }
.badge-trust   { background: #fce7f3; color: #be185d; }
.badge-paid-noconfirm { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.badge-info    { background: #e0f2fe; color: #0369a1; font-size: 11px; }
.badge-custom  { background: #fef3c7; color: #92400e; font-size: 11px; }

/* ── Section Headers ─────────────────────────────────────────*/
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-800);
}

/* ── Filter Bar ──────────────────────────────────────────────*/
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--white);
  padding: 14px 18px;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.filter-bar label { white-space: nowrap; }
.filter-bar input,
.filter-bar select { min-width: 140px; flex: 1; max-width: 220px; font-size: 14px; padding: 8px 11px; }

/* ── Progress Bar ────────────────────────────────────────────*/
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.progress-fill.green { background: linear-gradient(90deg, var(--green-600), #4ade80); }

/* ── Month Grid (Annual Tracker) ─────────────────────────────*/
.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.month-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.month-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-400); }
.month-card.has-data { border-left: 4px solid var(--blue-600); }
.month-card.all-paid { border-left: 4px solid var(--green-600); }
.month-name { font-size: 16px; font-weight: 700; color: var(--blue-800); margin-bottom: 8px; }
.month-amount { font-size: 22px; font-weight: 800; color: var(--blue-700); }
.month-details { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* ── Batch Builder ───────────────────────────────────────────*/
.batch-summary {
  background: var(--blue-800);
  color: var(--white);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.batch-total-label { font-size: 14px; opacity: 0.75; font-weight: 600; }
.batch-total-value { font-size: 36px; font-weight: 900; letter-spacing: -1px; }
.batch-meta { font-size: 14px; opacity: 0.7; margin-top: 4px; }

/* ── Import Drop Zone ────────────────────────────────────────*/
.drop-zone {
  border: 3px dashed var(--blue-400);
  border-radius: 12px;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--blue-50);
}
.drop-zone:hover, .drop-zone.dragover {
  background: var(--blue-100);
  border-color: var(--blue-600);
}
.drop-zone-icon { font-size: 52px; margin-bottom: 12px; }
.drop-zone-text { font-size: 18px; font-weight: 600; color: var(--blue-700); }
.drop-zone-sub  { font-size: 14px; color: var(--gray-500); margin-top: 6px; }

/* ── Import Result ───────────────────────────────────────────*/
.import-result {
  background: var(--green-100);
  border: 2px solid var(--green-600);
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 20px;
}
.import-result h3 { color: var(--green-600); font-size: 18px; margin-bottom: 10px; }
.import-result.has-errors { background: var(--red-100); border-color: var(--red-600); }
.import-result.has-errors h3 { color: var(--red-600); }

/* ── Action Bar ──────────────────────────────────────────────*/
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Confirm Dialog ──────────────────────────────────────────*/
.confirm-dialog p { font-size: 16px; line-height: 1.6; color: var(--gray-700); }
.confirm-dialog .confirm-amount {
  font-size: 32px;
  font-weight: 900;
  color: var(--blue-800);
  margin: 14px 0;
  text-align: center;
}

/* ── Pay Modal ───────────────────────────────────────────────*/
.pay-modal-info {
  background: var(--blue-50);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.pay-modal-client { font-size: 18px; font-weight: 700; color: var(--blue-800); }
.pay-modal-amount { font-size: 28px; font-weight: 900; color: var(--green-600); }
.pay-modal-label  { font-size: 13px; color: var(--gray-500); margin-bottom: 3px; }

/* ── Responsive ──────────────────────────────────────────────*/
@media (max-width: 900px) {
  #sidebar { width: 60px; }
  .logo-text, .nav-link span:not(.nav-icon), .sidebar-footer { display: none; }
  #main-content { margin-left: 60px; }
  .nav-link { justify-content: center; padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Utilities ───────────────────────────────────────────────*/
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }
.gap-10 { gap: 10px; }
.flex   { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.empty-state {
  text-align: center;
  padding: 60px 30px;
  color: var(--gray-500);
}
.empty-state-icon { font-size: 56px; margin-bottom: 14px; }
.empty-state h3 { font-size: 20px; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p  { font-size: 15px; }

/* ── Dashboard quick actions ─────────────────────────────────*/
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.quick-action-btn {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: var(--font-main);
}
.quick-action-btn:hover {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-md);
  background: var(--blue-50);
}
.quick-action-icon { font-size: 26px; margin-bottom: 8px; display: block; }
.quick-action-label { font-size: 15px; font-weight: 700; color: var(--blue-800); display: block; }
.quick-action-sub   { font-size: 13px; color: var(--gray-500); margin-top: 3px; display: block; }

/* ── Payment details inline view ─────────────────────────────*/
.payment-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.payment-list-item:last-child { border-bottom: none; }
.payment-list-item:hover { background: var(--blue-50); }
.payment-client { font-weight: 600; font-size: 15px; }
.payment-account { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.payment-amount { font-size: 18px; font-weight: 800; color: var(--blue-700); white-space: nowrap; }

/* ── Contact Cards (Accordion) ──────────────────────────────*/
.contact-card {
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.contact-card:hover { box-shadow: var(--shadow-md); }

.contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  cursor: pointer;
  gap: 16px;
  transition: background 0.1s;
}
.contact-header:hover { background: var(--blue-50); }

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 17px; font-weight: 700; color: var(--blue-800); }
.contact-meta { font-size: 13px; color: var(--gray-500); margin-top: 3px; display: flex; gap: 14px; flex-wrap: wrap; }

.contact-stats {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-shrink: 0;
}
.contact-stat {
  text-align: right;
}
.contact-stat-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.3px; }
.contact-stat-value { font-size: 18px; font-weight: 800; color: var(--blue-800); }
.contact-stat-value.green { color: var(--green-600); }

.contact-badge-count {
  background: var(--blue-100);
  color: var(--blue-700);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.contact-expand-icon {
  font-size: 18px;
  color: var(--gray-400);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.contact-card.expanded .contact-expand-icon { transform: rotate(180deg); }

/* ── Account Rolldown ───────────────────────────────────────*/
.contact-accounts {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 0 solid var(--gray-200);
}
.contact-card.expanded .contact-accounts {
  max-height: 2000px;
  border-top-width: 1px;
}

.account-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 22px 14px 36px;
  border-bottom: 1px solid var(--gray-100);
  gap: 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.account-row:last-child { border-bottom: none; }
.account-row:hover { background: var(--gray-50); }

.account-info { flex: 1; min-width: 0; }
.account-type-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.account-detail-line {
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.account-financials {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-shrink: 0;
}
.account-principal { font-size: 16px; font-weight: 700; color: var(--blue-800); }
.account-monthly { font-size: 14px; font-weight: 600; color: var(--green-600); }
.account-rate { font-size: 13px; color: var(--gray-500); }

/* ── Account Details Panel ──────────────────────────────────*/
.account-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--gray-50);
  padding: 0 22px 0 36px;
}
.account-row.expanded + .account-details,
.account-details.expanded {
  max-height: 600px;
  padding: 14px 22px 14px 36px;
}
.account-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.account-detail-item { }
.account-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.account-detail-value {
  font-size: 14px;
  color: var(--gray-700);
  margin-top: 2px;
}

/* ── Dashboard Client Grid ──────────────────────────────────*/
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.client-summary-card {
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.client-summary-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-400);
}
.client-summary-name { font-size: 15px; font-weight: 700; color: var(--blue-800); margin-bottom: 6px; }
.client-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 3px;
}
.client-summary-value { font-weight: 700; color: var(--blue-700); }
.client-summary-value.green { color: var(--green-600); }

.client-summary-accounts {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 0;
}
.client-summary-card.expanded .client-summary-accounts {
  max-height: 600px;
  margin-top: 10px;
  border-top: 1px solid var(--gray-200);
  padding-top: 10px;
}
.client-acct-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  color: var(--gray-600);
}
.client-acct-type { font-weight: 600; }
.client-acct-detail { text-align: right; }

/* ── Year Selector ──────────────────────────────────────────*/
.year-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}
.year-selector select {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--blue-800);
  cursor: pointer;
}
.year-selector label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
}

/* ── Badge variants for account types ───────────────────────*/
.badge-entity { background: #fef3c7; color: #92400e; }
.badge-roth   { background: #ede9fe; color: #7c3aed; }
.badge-sep    { background: #e0e7ff; color: #3730a3; }
.badge-corporate { background: #f0fdf4; color: #166534; }

/* ── Auth Screen ────────────────────────────────────────────*/
#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  z-index: 200;
}
.auth-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 {
  font-size: 22px;
  margin-top: 12px;
  color: var(--blue-900);
}
.auth-error {
  background: var(--red-100);
  color: var(--red-600);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Help Button & Panel ───────────────────────────────────*/
#help-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--blue-600);
  background: var(--white);
  color: var(--blue-600);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
#help-btn:hover {
  background: var(--blue-600);
  color: var(--white);
}
#help-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#help-panel.hidden { display: none; }
#help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--blue-900);
  color: var(--white);
}
#help-panel-header h2 { font-size: 18px; margin: 0; }
#help-panel-header button {
  background: none;
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
}
#help-panel-header button:hover { opacity: 1; }
#help-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
}
#help-panel-body h3 {
  font-size: 16px;
  color: var(--blue-900);
  margin: 20px 0 8px;
}
#help-panel-body h3:first-child { margin-top: 0; }
#help-panel-body p { margin: 8px 0; }
#help-panel-body ol, #help-panel-body ul { margin: 8px 0; padding-left: 20px; }
#help-panel-body li { margin: 4px 0; }
#help-panel-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
#help-panel-body th, #help-panel-body td { padding: 6px 10px; border: 1px solid var(--gray-200); text-align: left; }
#help-panel-body th { background: var(--gray-100); font-weight: 600; }
#help-panel-body strong { color: var(--gray-900); }
#help-panel-body code { background: var(--gray-100); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
