/* PropTax — Main Stylesheet */

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

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-pro: #7c3aed;
  --color-pro-bg: #f5f3ff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { color: var(--color-muted); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 680px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }

.btn-pro {
  background: var(--color-pro);
  color: #fff;
}
.btn-pro:hover { background: #6d28d9; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { background: var(--color-bg); text-decoration: none; }

.btn-lg { padding: .875rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .375rem .875rem; font-size: .875rem; }

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

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-pro {
  border: 2px solid var(--color-pro);
  background: linear-gradient(135deg, #fff 0%, #f5f3ff 100%);
}

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-label { font-size: .875rem; font-weight: 500; color: var(--color-text); }
.form-input {
  padding: .625rem .875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .9375rem;
  font-family: var(--font);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .15s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--color-primary); }
.form-input::placeholder { color: var(--color-muted); opacity: .7; }

.form-hint { font-size: .8125rem; color: var(--color-muted); }
.form-error { font-size: .8125rem; color: var(--color-danger); font-weight: 500; }

.form-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--color-danger);
  margin-bottom: 1rem;
}

/* ─── Navigation ───────────────────────────────────────────────────────────── */
.nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-logo span { color: var(--color-primary); }

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

.nav-links a {
  color: var(--color-muted);
  font-size: .9375rem;
  font-weight: 500;
  padding: .375rem .75rem;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  text-decoration: none;
}

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

.nav-cta { margin-left: .5rem; }

.badge {
  display: inline-block;
  padding: .125rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-free { background: #f1f5f9; color: var(--color-muted); }
.badge-pro { background: var(--color-pro-bg); color: var(--color-pro); }

/* ─── Alert / Toast ─────────────────────────────────────────────────────────── */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  margin-bottom: 1.5rem;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ─── Dashboard Layout ───────────────────────────────────────────────────────── */
.app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 220px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.sidebar-section { margin-bottom: 1rem; }
.sidebar-label {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
  padding: 0 1.25rem;
  margin-bottom: .25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1.25rem;
  color: var(--color-muted);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  transition: color .15s, background .15s;
  width: 100%;
}
.sidebar-link:hover { color: var(--color-text); background: var(--color-bg); text-decoration: none; }
.sidebar-link.active { color: var(--color-primary); background: #eff6ff; }

.sidebar-link .icon { font-size: 1.125rem; width: 20px; text-align: center; }

.sidebar-divider { height: 1px; background: var(--color-border); margin: .75rem 1.25rem; }

.sidebar-upgrade {
  margin: auto 1rem 1rem;
  padding: .875rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  text-align: center;
}

.sidebar-upgrade h4 { font-size: .875rem; color: var(--color-pro); margin-bottom: .25rem; }
.sidebar-upgrade p { font-size: .75rem; color: var(--color-muted); margin-bottom: .75rem; }

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: calc(100% - 220px);
  overflow: auto;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.module-title { font-size: 1.25rem; font-weight: 600; color: var(--color-text); }
.module-subtitle { font-size: .875rem; color: var(--color-muted); margin-top: .25rem; }

/* ─── Pricing Table ────────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
}

.pricing-card.popular {
  border-color: var(--color-pro);
  box-shadow: 0 0 0 4px rgba(124,58,237,.1);
}

.pricing-popular-label {
  display: inline-block;
  background: var(--color-pro);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .25rem .625rem;
  border-radius: 999px;
  margin-bottom: .75rem;
}

.pricing-price { font-size: 2.5rem; font-weight: 700; color: var(--color-text); }
.pricing-price sup { font-size: 1.25rem; vertical-align: super; font-weight: 500; }
.pricing-period { font-size: .9375rem; color: var(--color-muted); margin-top: .25rem; }
.pricing-savings { font-size: .8125rem; color: var(--color-success); font-weight: 600; margin-top: .25rem; }

.pricing-features {
  list-style: none;
  text-align: left;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.pricing-features li {
  font-size: .9rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.pricing-features li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-features li.disabled {
  color: var(--color-muted);
}
.pricing-features li.disabled::before { content: '—'; color: var(--color-muted); }

/* ─── Tax Tracker Table ─────────────────────────────────────────────────────── */
.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
.tax-table th {
  text-align: left;
  padding: .625rem .875rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-muted);
  border-bottom: 2px solid var(--color-border);
}
.tax-table td {
  padding: .875rem .875rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.tax-table tr:hover td { background: var(--color-bg); }

.tax-quarter { font-weight: 600; }
.tax-amount { font-weight: 600; }
.tax-amount.positive { color: var(--color-success); }
.tax-amount.negative { color: var(--color-danger); }
.tax-status { display: inline-block; padding: .2rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.tax-status.paid { background: #f0fdf4; color: #166534; }
.tax-status.pending { background: #fffbeb; color: #92400e; }
.tax-status.overdue { background: #fef2f2; color: #991b1b; }

/* ─── Calendar ─────────────────────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
  margin-top: 1rem;
}
.calendar-day { text-align: center; font-size: .8125rem; }
.calendar-day-name { font-weight: 600; color: var(--color-muted); padding: .25rem 0; font-size: .75rem; text-transform: uppercase; }
.calendar-date { padding: .375rem; border-radius: 6px; }
.calendar-event {
  font-size: .6875rem;
  padding: .1rem .25rem;
  border-radius: 3px;
  margin-top: .1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-estimated { background: #fef9c3; color: #713f12; }
.event-actual { background: #dbeafe; color: #1e40af; }
.event-filing { background: #dcfce7; color: #166534; }

/* ─── Locked / Pro Feature ─────────────────────────────────────────────────── */
.pro-lock {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--color-muted);
}
.pro-lock .icon { font-size: 2rem; margin-bottom: .5rem; }
.pro-lock h3 { font-size: 1rem; margin-bottom: .375rem; color: var(--color-text); }
.pro-lock p { font-size: .875rem; margin-bottom: 1rem; }

/* ─── Auth Pages ───────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--color-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}
.auth-logo span { color: var(--color-primary); }

/* ─── Account Page ─────────────────────────────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.account-section-title {
  font-size: .875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: .9375rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--color-muted); }
.info-value { font-weight: 500; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
  color: var(--color-muted);
  font-size: .875rem;
  margin-top: auto;
}

/* ─── Hamburger / Mobile Nav ────────────────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-text);
  padding: 0;
  transition: border-color .15s, background .15s;
  flex-shrink: 0;
}
.mobile-nav-toggle:hover { border-color: var(--color-primary); background: var(--color-bg); }

.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.mobile-sidebar-overlay.open { display: block; }

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--color-surface);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.mobile-sidebar.open { transform: translateX(0); }

.mobile-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.mobile-sidebar-logo { font-size: 1.125rem; font-weight: 700; color: var(--color-text); }
.mobile-sidebar-logo span { color: var(--color-primary); }
.mobile-sidebar-close {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.mobile-sidebar-close:hover { background: var(--color-bg); color: var(--color-text); }

.mobile-sidebar-section { padding: .75rem 0; }
.mobile-sidebar-label {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
  padding: .25rem 1.25rem;
  margin-bottom: .25rem;
}
.mobile-sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  color: var(--color-muted);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.mobile-sidebar-link:hover { color: var(--color-text); background: var(--color-bg); }
.mobile-sidebar-link.active { color: var(--color-primary); background: #eff6ff; }
.mobile-sidebar-link .icon { font-size: 1.125rem; width: 20px; text-align: center; }

.mobile-sidebar-divider { height: 1px; background: var(--color-border); margin: .5rem 1.25rem; }

.mobile-sidebar-upgrade {
  margin: auto 1rem 1rem;
  padding: .875rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  text-align: center;
}
.mobile-sidebar-upgrade h4 { font-size: .875rem; color: var(--color-pro); margin-bottom: .25rem; }
.mobile-sidebar-upgrade p { font-size: .75rem; color: var(--color-muted); margin-bottom: .75rem; }

.mobile-sidebar-nav-links {
  display: flex;
  gap: .25rem;
  align-items: center;
  padding: 0 .5rem;
}
.mobile-sidebar-nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .375rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.mobile-sidebar-nav-links a:hover { color: var(--color-text); background: var(--color-bg); }

/* ─── Mobile (768px and below) ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav */
  .nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .mobile-nav-toggle { display: flex; }
  .nav-inner { justify-content: space-between; }

  /* Dashboard layout */
  .sidebar { display: none !important; }
  .main-content { max-width: 100% !important; padding: 1rem !important; }
  .app-body { flex-direction: column; }

  /* Stat grids — 2 columns on tablet, 1 on phone */
  .summary-stats { grid-template-columns: 1fr 1fr !important; }
  .tax-estimator-grid { grid-template-columns: 1fr 1fr !important; }

  /* Pro quarter grid — 2x2 */
  #tracker-quarters-grid { grid-template-columns: 1fr 1fr !important; }

  /* Pricing & account grids */
  .pricing-grid { grid-template-columns: 1fr !important; }
  .account-grid { grid-template-columns: 1fr !important; }

  /* Typography */
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.25rem; }

  /* Module header — stack on mobile */
  .module-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .module-header > div:last-child { width: 100%; display: flex; gap: .5rem; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  /* Even smaller — single column grids */
  .summary-stats { grid-template-columns: 1fr !important; }
  .tax-estimator-grid { grid-template-columns: 1fr 1fr !important; }
  #tracker-quarters-grid { grid-template-columns: 1fr 1fr !important; }

  /* Landing page hero */
  .hero-cta-wrap { flex-direction: column !important; }
  .hero-cta-wrap .btn { width: 100%; justify-content: center; }

  /* Account page feature & pricing grids */
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Tax reminder — compact */
  .tax-reminder { padding: .75rem 1rem; }
  .tax-reminder-countdown { font-size: 1.25rem; }

  /* Net income card — stack vertically */
  .net-income-card { flex-direction: column; align-items: flex-start; }
  .net-income-right { align-items: flex-start !important; flex-direction: row !important; flex-wrap: wrap; gap: .375rem !important; }

  /* Pro lock / upgrade cards */
  .pro-lock { padding: 1.5rem 1rem; }

  /* Auth pages */
  .auth-card { padding: 1.75rem 1.25rem; }

  /* Calendar event cards */
  .cal-event-card { flex-wrap: wrap; gap: .375rem; }
  .cal-event-right { width: 100%; flex-direction: row; align-items: center; justify-content: flex-end; }

  /* Quarter nav — full width */
  .quarter-nav { width: 100%; justify-content: space-between; }

  /* Form grid — single column */
  form [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Modal — full width on small screens */
  #modal-backdrop { padding: .5rem; align-items: flex-end; }
  #modal-backdrop > div { max-width: 100%; border-radius: 12px 12px 0 0; }
}

/* ─── Utility ───────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--color-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-pro { color: var(--color-pro); }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ─── Onboarding Walkthrough ─────────────────────────────────────────────────── */
.walkthrough-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .875rem 1.25rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 12px;
  color: #fff;
  margin-bottom: 1.5rem;
}

.walkthrough-bar-text {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
}

.walkthrough-bar-text strong { font-weight: 600; }

.walkthrough-steps {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  opacity: .85;
}

.walkthrough-step {
  display: flex;
  align-items: center;
  gap: .375rem;
}

.walkthrough-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
}

.walkthrough-step.done .walkthrough-step-dot {
  background: #86efac;
}

.walkthrough-step.done .walkthrough-step-text { text-decoration: line-through; }

.walkthrough-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.btn-walkthrough {
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  padding: .375rem .75rem;
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.btn-walkthrough:hover { background: rgba(255,255,255,.25); text-decoration: none; }

.btn-walkthrough-done {
  background: #86efac;
  border-color: #86efac;
  color: #166534;
  padding: .375rem .75rem;
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-walkthrough-done:hover { background: #4ade80; }

/* ─── Empty States ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.empty-state-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .5rem;
}

.empty-state-body {
  font-size: .875rem;
  color: var(--color-muted);
  max-width: 360px;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* ─── Firm Selector ──────────────────────────────────────────────────────────── */
.firm-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.firm-selector-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
}

.firm-selector-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .5rem;
}

.firm-selector-sub {
  font-size: .875rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

.firm-selector-list {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: .5rem;
}

.firm-selector-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem .875rem;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  transition: border-color .15s, background .15s;
  user-select: none;
}

.firm-selector-item:hover {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.firm-selector-item.selected {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.firm-selector-item input { width: 16px; height: 16px; cursor: pointer; }

.firm-selector-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
}

/* ─── Quarterly Tax Reminder ─────────────────────────────────────────────────── */
.tax-reminder {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%);
  border: 1px solid #fde68a;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: box-shadow .15s;
}

.tax-reminder:hover {
  box-shadow: 0 2px 8px rgba(245,158,11,.15);
}

.tax-reminder-icon { font-size: 1.75rem; flex-shrink: 0; }

.tax-reminder-content { flex: 1; }

.tax-reminder-title {
  font-size: .9rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: .125rem;
}

.tax-reminder-sub {
  font-size: .8rem;
  color: #b45309;
}

.tax-reminder-countdown {
  font-size: 1.5rem;
  font-weight: 800;
  color: #d97706;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1;
}

.tax-reminder-countdown span {
  font-size: .7rem;
  font-weight: 500;
  color: #b45309;
  display: block;
  margin-top: .125rem;
  text-align: right;
}

/* ─── Countdown Timer Banner ─────────────────────────────────────────────────── */
.countdown-banner {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  min-height: 72px;
}

.countdown-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.countdown-banner-content {
  flex: 1;
}

.countdown-banner-event {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-pro);
}

.countdown-banner-firm {
  font-size: .75rem;
  color: #7c3aed;
  margin-top: .125rem;
}

.countdown-display {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  flex-shrink: 0;
}

.countdown-unit {
  font-size: 1.25rem;
  font-weight: 800;
  color: #7c3aed;
  font-family: 'SF Mono', 'Fira Code', monospace;
  min-width: 1.75rem;
  text-align: center;
}

.countdown-label {
  font-size: .625rem;
  font-weight: 600;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: .25rem;
}

.countdown-banner-window {
  font-size: .7rem;
  color: #7c3aed;
  background: #ede9fe;
  padding: .2rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Firm Chip (selector) ──────────────────────────────────────────────────── */
.firm-chip {
  display: inline-flex;
  padding: .3rem .65rem;
  border-radius: 6px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.firm-chip:hover {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.firm-chip.selected {
  border-color: var(--color-primary);
  background: #eff6ff;
  color: var(--color-primary);
  font-weight: 600;
}

/* ─── Calendar Events ─────────────────────────────────────────────────────────── */
.cal-event-row {
  transition: box-shadow .15s;
}

.cal-event-row:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ─── Traffic Light ──────────────────────────────────────────────────────────── */
.traffic-light {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: .9375rem;
  font-weight: 500;
}

.traffic-light.green {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #166534;
}

.traffic-light.amber {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #92400e;
}

.traffic-light.red {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #991b1b;
}

.traffic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

.traffic-dot.green { background: #22c55e; }
.traffic-dot.amber { background: #f59e0b; animation: pulse-amber 1.5s ease-in-out infinite; }
.traffic-dot.red { background: #ef4444; animation: pulse-red 1s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
@keyframes pulse-amber {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245,158,11,.4); }
  50% { opacity: .8; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50% { opacity: .85; box-shadow: 0 0 0 6px rgba(239,68,68,.2); }
}

.traffic-next {
  font-size: .75rem;
  opacity: .85;
  margin-left: auto;
}

/* ─── Impact Filter ─────────────────────────────────────────────────────────── */
.impact-filter {
  display: flex;
  gap: .375rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.impact-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  transition: all .15s;
  user-select: none;
}

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

.impact-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.impact-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ─── Calendar Event Rows ────────────────────────────────────────────────────── */
.cal-date-group {
  margin-bottom: 1.25rem;
}

.cal-date-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .375rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: .5rem;
}

.cal-event-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .875rem;
  border-radius: 8px;
  margin-bottom: .375rem;
  border: 1px solid;
  transition: transform .1s;
  cursor: default;
}

.cal-event-card:hover {
  transform: translateX(2px);
}

.cal-event-card.very_high { background: #fef2f2; border-color: #fecaca; }
.cal-event-card.high { background: #fff7ed; border-color: #fed7aa; }
.cal-event-card.medium { background: #fefce8; border-color: #fef08a; }
.cal-event-card.low { background: #f0fdf4; border-color: #bbf7d0; }
.cal-event-card.filing { background: #f0fdf4; border-color: #bbf7d0; }

.cal-event-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.cal-event-body { flex: 1; min-width: 0; }

.cal-event-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-meta {
  font-size: .75rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .125rem;
}

.cal-event-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
  flex-shrink: 0;
}

.impact-badge {
  display: inline-block;
  padding: .125rem .5rem;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}

.impact-badge.very_high { background: #fee2e2; color: #dc2626; }
.impact-badge.high { background: #ffedd5; color: #ea580c; }
.impact-badge.medium { background: #fef9c3; color: #ca8a04; }
.impact-badge.low { background: #dcfce7; color: #16a34a; }

.firm-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .125rem .5rem;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #c4b5fd;
}

.window-badge {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .625rem;
  font-weight: 600;
  background: #ede9fe;
  color: #6d28d9;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.cal-countdown-banner {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.cal-countdown-left { flex: 1; }

.cal-countdown-event { font-size: .875rem; font-weight: 600; color: #7c3aed; }
.cal-countdown-firm { font-size: .75rem; color: #6d28d9; margin-top: .125rem; }

.cal-countdown-display {
  display: flex;
  align-items: baseline;
  gap: .25rem;
}

.cal-countdown-unit {
  font-size: 1.125rem;
  font-weight: 800;
  color: #7c3aed;
  font-family: 'SF Mono', 'Fira Code', monospace;
  min-width: 1.5rem;
  text-align: center;
}

.cal-countdown-label {
  font-size: .5625rem;
  font-weight: 600;
  color: #6d28d9;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: .125rem;
}

.cal-countdown-sep { color: #c4b5fd; font-size: .75rem; }

.cal-countdown-window {
  font-size: .7rem;
  color: #6d28d9;
  background: #ede9fe;
  padding: .2rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Mobile Calendar ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .traffic-light { padding: .75rem 1rem; font-size: .875rem; }

  .cal-event-card {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .cal-event-right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
  }

  .impact-filter { gap: .25rem; }

  .impact-filter-btn { font-size: .7rem; padding: .2rem .5rem; }

  .cal-countdown-display { flex-wrap: wrap; gap: .25rem; }

  .sidebar { display: none !important; }
  .main-content { max-width: 100% !important; padding: 1rem !important; }
  .app-body { flex-direction: column; }
}

/* ─── Tax Tracker ─────────────────────────────────────────────────────────── */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.stat-card-label {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
}

.stat-card-value {
  font-size: 1.375rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.1;
}

.stat-card-value.positive { color: var(--color-success); }
.stat-card-value.negative { color: var(--color-danger); }
.stat-card-value.muted { color: var(--color-muted); font-weight: 600; }

.stat-card-sub {
  font-size: .6875rem;
  color: var(--color-muted);
  margin-top: .125rem;
}

/* Net Income Card */
.net-income-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.net-income-left { flex: 1; }
.net-income-label { font-size: .8125rem; font-weight: 600; color: #166534; margin-bottom: .25rem; }
.net-income-value { font-size: 2rem; font-weight: 800; color: #166534; font-family: 'SF Mono', 'Fira Code', monospace; line-height: 1; }
.net-income-sub { font-size: .75rem; color: #16a34a; margin-top: .25rem; }

.net-income-right { display: flex; flex-direction: column; gap: .375rem; align-items: flex-end; }
.tax-estimate-chip {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.tax-estimate-chip.se { background: #fff7ed; color: #92400e; border: 1px solid #fed7aa; }
.tax-estimate-chip.income { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.tax-estimate-chip.total { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Quarterly Tax Estimator */
.tax-estimator-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.tax-estimator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.tax-estimator-title { font-size: 1rem; font-weight: 600; color: var(--color-text); }
.tax-estimator-sub { font-size: .75rem; color: var(--color-muted); margin-top: .125rem; }

.tax-estimator-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .625rem;
  margin-bottom: 1rem;
}

.tax-estimator-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.tax-estimator-item-label {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted);
}

.tax-estimator-item-value {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.tax-estimator-item-value.highlight { color: var(--color-danger); }

.tax-deadline-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin-top: .75rem;
}

.tax-deadline-icon { font-size: 1.25rem; flex-shrink: 0; }
.tax-deadline-info { flex: 1; }
.tax-deadline-label { font-size: .875rem; font-weight: 600; color: #92400e; }
.tax-deadline-sub { font-size: .75rem; color: #b45309; }
.tax-deadline-countdown {
  font-size: 1.25rem;
  font-weight: 800;
  color: #d97706;
  font-family: 'SF Mono', 'Fira Code', monospace;
  text-align: right;
}
.tax-deadline-countdown span { font-size: .625rem; font-weight: 500; color: #b45309; display: block; }
.tax-deadline-countdown.urgent { color: var(--color-danger); }

/* Disclaimer Banner */
.tax-disclaimer {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: .625rem 1rem;
  font-size: .75rem;
  color: var(--color-muted);
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-top: 1rem;
}
.tax-disclaimer-icon { font-size: .875rem; flex-shrink: 0; margin-top: 1px; }
.tax-disclaimer strong { color: var(--color-text); }

/* Quarter tabs */
.quarter-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}
.quarter-tab {
  padding: .5rem 1rem;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  border-radius: 4px 4px 0 0;
}
.quarter-tab:hover { color: var(--color-text); }
.quarter-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.quarter-tab.has-data::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  margin-left: .375rem;
  vertical-align: middle;
}

/* Payout type badge */
.payout-type-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
}
.payout-type-badge.profit_split { background: #f0fdf4; color: #166534; }
.payout-type-badge.challenge_fee_refund { background: #eff6ff; color: #1e40af; }
.payout-type-badge.performance_bonus { background: #f5f3ff; color: #7c3aed; }
.payout-type-badge.other { background: #f1f5f9; color: var(--color-muted); }

/* Income summary row in quarter */
.quarter-income-summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: .625rem;
  font-size: .8125rem;
}
.qis-label { font-weight: 600; color: var(--color-text); flex: 1; }
.qis-metric { display: flex; flex-direction: column; align-items: flex-end; }
.qis-metric-label { font-size: .625rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.qis-metric-value { font-weight: 700; font-family: 'SF Mono', 'Fira Code', monospace; }
.qis-metric-value.negative { color: var(--color-danger); }
.qis-sep { width: 1px; height: 28px; background: var(--color-border); }

/* Tax estimate per quarter row */
.tax-estimate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 1rem;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 6px;
  margin-top: .375rem;
  font-size: .8125rem;
}
.tax-estimate-row-label { font-weight: 600; color: #92400e; }
.tax-estimate-row-value {
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #92400e;
}

/* Entry delete button */
.entry-row { display: flex; align-items: center; gap: .5rem; }
.entry-row-text { flex: 1; }
.entry-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: .875rem;
  padding: .25rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.entry-row:hover .entry-delete-btn { opacity: 1; }
.entry-delete-btn:hover { color: var(--color-danger); background: #fef2f2; }

/* Quarter nav arrows */
.quarter-nav { display: flex; align-items: center; gap: .5rem; }
.quarter-nav-btn {
  background: none;
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 6px;
  font-size: .875rem;
  color: var(--color-muted);
  transition: all .15s;
}
.quarter-nav-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.quarter-year-label { font-size: .875rem; font-weight: 600; color: var(--color-text); padding: 0 .25rem; }

/* Form Elements (modals) ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .25rem; }
.form-label { font-size: .8125rem; font-weight: 500; color: var(--color-text); }
.form-input {
  padding: .5rem .75rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-size: .875rem;
  font-family: var(--font);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--color-primary); }
.form-input::placeholder { color: var(--color-muted); }
select.form-input { cursor: pointer; }