/* ═══════════════════════════════════════════════════════════
   TAYLA — STYLESHEET
   -------------------------------------------------------
   TABLE OF CONTENTS
   
   01. Design System (CSS Variables)
   02. Base & Reset
   03. Typography
   04. Layout & Screens
   05. Navigation (Top Nav)
   06. Buttons
   07. Form Elements
   08. Alerts & Badges
   09. Cards
   10. Modals & Animations
   11. Auth Screen
   12. App Shell (Sidebar + Main)
   13. Tax Calculator
   14. Budget Tracker
   15. Financial Health
   16. Goals
   17. Settings & Privacy
   18. Legal (Terms & Privacy Policy)
   19. Data Rights Modal
   20. Responsive (Mobile)
═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   DESIGN SYSTEM — warm editorial / refined
   ═══════════════════════════════════════════ */
:root {
  --ink:        #111e1e;
  --ink-2:      #1e3535;
  --ink-3:      #4a6868;
  --paper:      #f0f4f3;
  --paper-2:    #e0eae8;
  --paper-3:    #c8d8d5;
  --rule:       rgba(30,80,80,0.18);
  --gold:       #1a7a8c;
  --gold-light: #7cc4d0;
  --gold-dim:   rgba(26,122,140,0.15);
  --green:      #1a7a8c;
  --green-dim:  rgba(26,122,140,0.12);
  --red:        #a83232;
  --red-dim:    rgba(168,50,50,0.12);
  --blue:       #1a6080;
  --blue-dim:   rgba(26,96,128,0.14);
  --shadow-sm:  0 1px 4px rgba(17,30,30,0.10);
  --shadow-md:  0 4px 20px rgba(17,30,30,0.13);
  --shadow-lg:  0 12px 48px rgba(17,30,30,0.16);
  --r:          10px;
  --r-sm:       6px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* Subtle paper texture */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(200,146,42,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(45,122,79,0.03) 0%, transparent 50%);
}

.page { position: relative; z-index: 1; }

/* ══ TYPOGRAPHY ══ */
.serif { font-family: 'Playfair Display', serif; }
.mono  { font-family: 'IBM Plex Mono', monospace; }

h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; }
h2 { font-size: 1.7rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }

/* ══ LAYOUT ══ */
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ══ SCREENS ══ */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ══ NAV ══ */
.nav {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 200;
  padding: 0 28px;
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900; font-size: 1.4rem;
  color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.logo-dot { width: 8px; height: 8px; background: var(--gold-light); border-radius: 50%; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-user-name {
  font-size: 0.82rem; color: rgba(255,255,255,0.6);
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  padding: 4px 12px; border-radius: 20px;
}

/* ══ BUTTONS ══ */
.btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  padding: 10px 22px; border-radius: var(--r-sm);
  border: none; cursor: pointer; transition: all 0.18s;
  letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary {
  background: var(--ink); color: var(--paper);
}
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-gold {
  background: var(--gold); color: #fff;
}
.btn-gold:hover { background: #b8831e; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,146,42,0.35); }
.btn-ghost {
  background: transparent; color: var(--ink-2);
  border: 1.5px solid var(--rule);
}
.btn-ghost:hover { border-color: var(--ink-3); background: var(--paper-2); }
.nav .btn-ghost {
  color: rgba(255,255,255,0.75); border-color: rgba(255,255,255,0.18);
}
.nav .btn-ghost:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { padding: 7px 16px; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ══ FORM ELEMENTS ══ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.form-input {
  width: 100%; background: var(--paper);
  border: 1.5px solid var(--rule); border-radius: var(--r-sm);
  padding: 11px 14px; font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.9rem; color: var(--ink); transition: border-color 0.18s; outline: none;
}
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.form-input::placeholder { color: var(--ink-3); opacity: 0.7; }
.form-helper { font-size: 0.75rem; color: var(--ink-3); margin-top: 5px; }

/* ══ ALERTS ══ */
.alert {
  padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 0.82rem; margin-bottom: 14px; display: none;
  border-left: 3px solid;
}
.alert-error   { background: var(--red-dim);   border-color: var(--red);   color: var(--red); }
.alert-success { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.alert-info    { background: var(--blue-dim);  border-color: var(--blue);  color: var(--blue); }
.alert-warn    { background: var(--gold-dim);  border-color: var(--gold);  color: #8a6010; }

/* ══ CARDS ══ */
.card {
  background: #fff; border: 1px solid var(--rule);
  border-radius: var(--r); padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.card-sub   { font-size: 0.78rem; color: var(--ink-3); margin-bottom: 22px; }

/* ══ DIVIDER ══ */
.divider { border: none; border-top: 1px solid var(--rule); margin: 24px 0; }
.divider-text {
  text-align: center; position: relative; margin: 24px 0;
  font-size: 0.75rem; color: var(--ink-3);
}
.divider-text::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--rule);
}
.divider-text span { background: #fff; padding: 0 12px; position: relative; }

/* ══ BADGE ══ */
.badge {
  display: inline-block; font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; vertical-align: middle;
}
.badge-soon { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(26,82,118,0.2); }
.badge-new  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(45,122,79,0.2); }
.badge-req  { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(200,146,42,0.2); }

/* ══ MODAL ══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,22,18,0.55);
  backdrop-filter: blur(4px); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r); max-width: 680px; width: 100%;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease;
}
.modal-header {
  padding: 22px 28px 18px; border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none; border: none; font-size: 1.5rem; color: var(--ink-3);
  cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 4px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--paper-2); color: var(--ink); }
.modal-body {
  padding: 24px 28px; overflow-y: auto; flex: 1;
  font-size: 0.85rem; color: var(--ink-2); line-height: 1.8;
}
.modal-body h4 {
  font-family: 'Playfair Display', serif; font-size: 0.95rem;
  color: var(--ink); margin: 20px 0 8px; border-bottom: 1px solid var(--rule); padding-bottom: 4px;
}
.modal-body p { margin-bottom: 12px; }
.modal-footer { padding: 18px 28px; border-top: 1px solid var(--rule); display: flex; gap: 10px; justify-content: flex-end; }

/* ══ ANIMATIONS ══ */
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

/* ════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════ */
#auth-screen {
  display: none;
  background: var(--paper);
}
#auth-screen.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-hero {
  background: linear-gradient(145deg, #0d1f1f 0%, #0f2e30 60%, #0c2a38 100%);
  padding: 60px 56px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(26,122,140,0.30) 0%, transparent 70%);
  pointer-events: none;
}
.auth-hero::after {
  content: '';
  position: absolute; bottom: -60px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(26,96,128,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.hero-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.hero-label::before { content: ''; width: 28px; height: 1.5px; background: var(--gold); }
.auth-hero h1 { color: #fff; margin-bottom: 20px; }
.auth-hero h1 em { font-style: normal; color: var(--gold-light); }
.auth-hero p { color: rgba(255,255,255,0.6); max-width: 380px; font-size: 0.88rem; line-height: 1.8; }

.auth-features { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.auth-feature {
  display: flex; align-items: flex-start; gap: 14px;
  animation: fadeIn 0.4s ease both;
}
.auth-feature:nth-child(1) { animation-delay: 0.1s; }
.auth-feature:nth-child(2) { animation-delay: 0.2s; }
.auth-feature:nth-child(3) { animation-delay: 0.3s; }
.auth-feature:nth-child(4) { animation-delay: 0.4s; }
.feature-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(200,146,42,0.15); border: 1px solid rgba(200,146,42,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; flex-shrink: 0; margin-top: 2px;
}
.auth-feature-text h4 { color: rgba(255,255,255,0.9); font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.auth-feature-text p  { color: rgba(255,255,255,0.45); font-size: 0.78rem; line-height: 1.5; }

.auth-panel {
  padding: 60px 56px; display: flex; flex-direction: column;
  justify-content: center; background: var(--paper);
}
.auth-panel-inner { max-width: 400px; width: 100%; }
.auth-tabs {
  display: flex; background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: var(--r-sm); padding: 4px; gap: 4px; margin-bottom: 28px;
}
.auth-tab {
  flex: 1; text-align: center; padding: 9px;
  border-radius: calc(var(--r-sm) - 2px); cursor: pointer;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em;
  transition: all 0.18s; color: var(--ink-3);
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ════════════════════════════════════
   CONSENT PANEL (shown during register)
════════════════════════════════════ */
.consent-box {
  background: var(--paper-2); border: 1.5px solid var(--rule);
  border-radius: var(--r-sm); padding: 16px; margin-bottom: 16px;
}
.consent-box-title {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px;
}
.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--rule);
}
.consent-row:first-of-type { border-top: none; }
.consent-row input[type=checkbox] { accent-color: var(--gold); margin-top: 3px; flex-shrink: 0; width: 15px; height: 15px; }
.consent-row label { font-size: 0.78rem; color: var(--ink-2); line-height: 1.5; }
.consent-row label strong { color: var(--ink); }
.consent-row label a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-light); }
.consent-row label a:hover { border-bottom-color: var(--gold); }
.consent-required { font-size: 0.68rem; color: var(--red); font-weight: 600; margin-left: 4px; }
.consent-optional { font-size: 0.68rem; color: var(--ink-3); margin-left: 4px; }

/* ════════════════════════════════════
   APP SHELL
════════════════════════════════════ */
#app-screen { display: none; }
#app-screen.active { display: block; }

.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 62px);
}

/* ══ SIDEBAR ══ */
.sidebar {
  background: var(--ink-2); border-right: 1px solid rgba(255,255,255,0.06);
  padding: 28px 0; position: sticky;
  top: 62px; height: calc(100vh - 62px); overflow-y: auto;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
  padding: 8px 20px; display: block;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer; font-size: 0.85rem;
  color: rgba(255,255,255,0.65); transition: all 0.15s; border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-item.active {
  background: rgba(26,122,140,0.25); color: #fff;
  border-left-color: var(--gold-light); font-weight: 600;
}
.sidebar-item .icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-item .soon-tag {
  margin-left: auto; font-size: 0.6rem; font-weight: 600;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4);
  padding: 2px 6px; border-radius: 10px; letter-spacing: 0.05em;
}

.sidebar-footer {
  padding: 20px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: auto;
}
.privacy-indicator {
  background: rgba(26,122,140,0.18); border: 1px solid rgba(26,122,140,0.3);
  border-radius: var(--r-sm); padding: 10px 12px;
  font-size: 0.72rem; color: rgba(255,255,255,0.55); line-height: 1.5;
  display: flex; gap: 8px; align-items: flex-start;
}

/* ══ MAIN CONTENT ══ */
.main-content { padding: 36px 40px; }

/* ══ TAB PANELS ══ */
.tab-panel { display: none; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: block; }

.page-header { margin-bottom: 32px; }
.page-header h2 { margin-bottom: 6px; }
.page-header p { color: var(--ink-3); font-size: 0.85rem; }
.page-header-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 20px; flex-wrap: wrap;
}

/* ════════════════════════════════════
   TAX CALCULATOR
════════════════════════════════════ */
.calc-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }

/* Mode switcher */
.mode-switcher {
  display: inline-flex; background: var(--paper-2);
  border: 1.5px solid var(--rule); border-radius: var(--r-sm);
  padding: 3px; gap: 3px; margin-bottom: 20px;
}
.mode-btn {
  padding: 8px 18px; border-radius: calc(var(--r-sm) - 1px);
  border: none; background: transparent; cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 0.8rem;
  font-weight: 600; color: var(--ink-3); transition: all 0.18s;
  letter-spacing: 0.01em;
}
.mode-btn:hover { color: var(--ink); background: var(--paper-3); }
.mode-btn.active {
  background: #fff; color: var(--ink);
  box-shadow: var(--shadow-sm); border: 1px solid var(--rule);
}
.mode-desc {
  font-size: 0.75rem; color: var(--ink-3); margin-bottom: 16px;
  background: var(--gold-dim); border: 1px solid rgba(200,146,42,0.2);
  border-radius: var(--r-sm); padding: 8px 14px; line-height: 1.5;
}

.week-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.week-search {
  background: var(--paper-2); border: 1.5px solid var(--rule);
  border-radius: var(--r-sm); padding: 8px 14px;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 0.82rem;
  color: var(--ink); outline: none; width: 180px; transition: border-color 0.18s;
}
.week-search:focus { border-color: var(--gold); }

/* Annual single-input mode */
.annual-input-wrap {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r);
  padding: 32px; display: none; text-align: center;
}
.annual-input-wrap.visible { display: block; }
.annual-big-input {
  font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 700;
  text-align: center; border: none; border-bottom: 2px solid var(--rule);
  background: transparent; color: var(--ink); outline: none;
  width: 100%; max-width: 320px; padding: 8px 0;
  transition: border-color 0.2s;
}
.annual-big-input:focus { border-bottom-color: var(--gold); }
.annual-input-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; display: block;
}
.annual-result-row {
  display: flex; justify-content: center; gap: 40px; margin-top: 28px;
  flex-wrap: wrap;
}
.annual-result-item { text-align: center; }
.annual-result-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.annual-result-value { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.6rem; }

.weeks-container {
  max-height: 580px; overflow-y: auto;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: #fff;
}
.weeks-container::-webkit-scrollbar { width: 6px; }
.weeks-container::-webkit-scrollbar-track { background: var(--paper-2); }
.weeks-container::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.week-row {
  display: grid; grid-template-columns: 160px 1fr 1fr 1fr;
  align-items: center; gap: 0;
  border-bottom: 1px solid var(--rule); transition: background 0.12s;
}
.week-row:last-child { border-bottom: none; }
.week-row:hover { background: var(--paper-2); }
.week-row.has-value { background: rgba(200,146,42,0.03); }

.week-head {
  background: var(--paper-2); border-bottom: 2px solid var(--rule);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.week-head .wc { padding: 10px 14px; }

.wc { padding: 10px 14px; font-size: 0.82rem; }
.wc-label { color: var(--ink-3); font-size: 0.78rem; font-family: 'IBM Plex Mono', monospace; }
.wc-input {
  width: 100%; background: transparent; border: none;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.88rem;
  color: var(--ink); outline: none; padding: 2px 0;
}
.wc-input:focus { border-bottom: 1.5px solid var(--gold); }
.wc-tax  { color: var(--red);   font-family: 'IBM Plex Mono', monospace; }
.wc-net  { color: var(--green); font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.wc-gross { color: var(--ink-2); font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.wc-empty { color: var(--ink-3); opacity: 0.5; }

/* Summary */
.summary-card { position: sticky; top: 100px; }
.stat-block { margin-bottom: 16px; }
.stat-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.stat-value { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.5rem; }
.stat-value.s-gross  { color: var(--ink); }
.stat-value.s-tax    { color: var(--red); }
.stat-value.s-net    { color: var(--green); }

.rate-bar-wrap { margin-bottom: 20px; }
.rate-bar-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--ink-3); margin-bottom: 6px; }
.rate-bar-track  { background: var(--paper-2); border-radius: 4px; height: 6px; overflow: hidden; }
.rate-bar-fill   { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

.bracket-table { width: 100%; font-size: 0.78rem; border-collapse: collapse; }
.bracket-table td { padding: 7px 10px; border-bottom: 1px solid var(--rule); }
.bracket-table tr:last-child td { border-bottom: none; }
.bracket-table .b-range { color: var(--ink-2); }
.bracket-table .b-rate  { color: var(--ink-3); text-align: right; font-family: 'IBM Plex Mono', monospace; }
.bracket-table .b-active .b-range,
.bracket-table .b-active .b-rate { color: var(--gold); font-weight: 600; }
.bracket-note { font-size: 0.7rem; color: var(--ink-3); line-height: 1.6; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }

/* ════════════════════════════════════
   BUDGET TRACKER
════════════════════════════════════ */
.budget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.budget-summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.metric-card {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.metric-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.metric-value { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.6rem; }
.metric-sub   { font-size: 0.72rem; color: var(--ink-3); }

.entry-list { display: flex; flex-direction: column; gap: 0; }
.entry-item {
  display: grid; grid-template-columns: 28px 1fr auto auto;
  align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
  font-size: 0.84rem; transition: background 0.12s;
}
.entry-item:hover { background: var(--paper-2); }
.entry-item:last-child { border-bottom: none; }
.entry-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.entry-desc { color: var(--ink); }
.entry-cat-label { font-size: 0.72rem; color: var(--ink-3); display: block; margin-top: 1px; }
.entry-amount { font-family: 'IBM Plex Mono', monospace; font-weight: 500; color: var(--red); }
.entry-amount.income { color: var(--green); }
.entry-amount.savings { color: var(--ink-2); }
.entry-del {
  background: none; border: none; color: var(--ink-3); cursor: pointer;
  font-size: 1rem; padding: 4px; border-radius: 4px; transition: all 0.15s; opacity: 0;
}
.entry-item:hover .entry-del { opacity: 1; }
.entry-del:hover { background: var(--red-dim); color: var(--red); }

.add-entry-form {
  background: var(--paper-2); border: 1.5px solid var(--rule);
  border-radius: var(--r); padding: 20px; margin-bottom: 20px;
}
.add-entry-grid { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: end; }

.cat-select {
  appearance: none; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7068' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid var(--rule); border-radius: var(--r-sm);
  padding: 11px 36px 11px 14px;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 0.88rem;
  color: var(--ink); outline: none; cursor: pointer; transition: border-color 0.18s; width: 100%;
}
.cat-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

.spending-bars { margin-top: 8px; }
/* Pie chart */
.pie-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pie-svg-wrap { flex-shrink: 0; }
.pie-svg-wrap svg { display: block; }
.pie-slice { transition: opacity 0.15s, transform 0.15s; transform-box: fill-box; }
.pie-legend { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.pie-legend-row {
  display: grid; grid-template-columns: 12px 1fr auto auto;
  align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  transition: background 0.12s;
}
.pie-legend-row:hover { background: var(--paper-2); }
.pie-leg-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.pie-leg-name { font-size: 0.82rem; color: var(--ink-2); }
.pie-leg-pct { font-size: 0.78rem; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; min-width: 40px; text-align: right; }
.pie-leg-amt { font-size: 0.82rem; color: var(--ink); font-family: 'IBM Plex Mono', monospace; min-width: 80px; text-align: right; font-weight: 500; }

@media (min-width: 480px) {
  .pie-wrap { flex-direction: row; align-items: flex-start; }
  .pie-legend { max-width: calc(100% - 240px); }
}

/* ════════════════════════════════════
   FINANCIAL HEALTH
════════════════════════════════════ */
.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.health-score-card {
  background: var(--ink); color: #fff;
  border-radius: var(--r); padding: 32px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 12px;
}
.score-circle {
  width: 120px; height: 120px; border-radius: 50%;
  border: 4px solid rgba(200,146,42,0.3);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.score-circle::before {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; border: 4px solid transparent;
  border-top-color: var(--gold);
  animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.score-num { font-family: 'Playfair Display', serif; font-weight: 900; font-size: 2.8rem; color: var(--gold-light); }
.score-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); letter-spacing: 0.08em; text-transform: uppercase; }
.score-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; }
.score-desc { font-size: 0.8rem; color: rgba(255,255,255,0.55); max-width: 220px; line-height: 1.6; }

.health-metric-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 0.84rem;
}
.health-metric-row:last-child { border-bottom: none; }
.hm-label { color: var(--ink-2); }
.hm-value { font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.hm-good  { color: var(--green); }
.hm-warn  { color: var(--gold); }
.hm-bad   { color: var(--red); }

.health-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ════════════════════════════════════
   GOALS
════════════════════════════════════ */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.goal-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 22px; }
.goal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.goal-icon { font-size: 1.6rem; }
.goal-actions { display: flex; gap: 6px; }
.goal-name { font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.goal-target { font-size: 0.75rem; color: var(--ink-3); margin-bottom: 14px; }
.goal-progress-bar { background: var(--paper-2); border-radius: 4px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.goal-progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--green)); transition: width 0.5s ease; }
.goal-progress-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; }
.goal-eta { font-size: 0.72rem; color: var(--ink-3); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }

.add-goal-btn {
  background: none; border: 2px dashed var(--rule);
  border-radius: var(--r); padding: 28px; width: 100%;
  cursor: pointer; color: var(--ink-3); font-size: 0.85rem;
  transition: all 0.18s; display: flex; flex-direction: column;
  align-items: center; gap: 8px; font-family: 'IBM Plex Sans', sans-serif;
}
.add-goal-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.add-goal-btn span { font-size: 1.5rem; }

/* ════════════════════════════════════
   SETTINGS / PRIVACY
════════════════════════════════════ */
.settings-section { margin-bottom: 32px; }
.settings-section-title {
  font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700;
  margin-bottom: 4px; color: var(--ink);
}
.settings-section-desc { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 18px; }

.setting-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--rule); gap: 24px;
}
.setting-row:last-child { border-bottom: none; }
.setting-info h4 { font-size: 0.88rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.setting-info p  { font-size: 0.78rem; color: var(--ink-3); line-height: 1.5; max-width: 480px; }
.setting-info .legal-ref { font-size: 0.68rem; color: var(--blue); font-family: 'IBM Plex Mono', monospace; margin-top: 4px; display: block; }

/* Toggle */
.toggle-wrap { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.toggle {
  position: relative; width: 44px; height: 24px; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--rule); border-radius: 12px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; top: 3px; left: 3px;
  transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-status { font-size: 0.68rem; color: var(--ink-3); font-family: 'IBM Plex Mono', monospace; }

.danger-zone {
  background: var(--red-dim); border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--r); padding: 22px;
}
.danger-zone h3 { color: var(--red); font-size: 0.95rem; margin-bottom: 8px; }
.danger-zone p  { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 16px; line-height: 1.6; }

/* ════════════════════════════════════
   COMING SOON PLACEHOLDER
════════════════════════════════════ */
.coming-wrapper {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 400px; text-align: center;
  padding: 40px;
}
.coming-wrapper .coming-icon { font-size: 3rem; margin-bottom: 16px; }
.coming-wrapper h3 { font-size: 1.4rem; margin-bottom: 8px; }
.coming-wrapper p { color: var(--ink-3); font-size: 0.85rem; max-width: 360px; line-height: 1.7; }
.coming-badge {
  display: inline-block; background: var(--gold-dim);
  border: 1px solid rgba(200,146,42,0.25); color: var(--gold);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 6px 16px; border-radius: 20px; margin-bottom: 16px;
}

/* ════════════════════════════════════
   PRIVACY NOTICE BANNER (at top of app)
════════════════════════════════════ */
.privacy-banner {
  background: var(--blue-dim); border-bottom: 1px solid rgba(26,82,118,0.15);
  padding: 10px 28px; font-size: 0.78rem; color: var(--blue);
  display: flex; align-items: center; gap: 10px;
}
.privacy-banner strong { font-weight: 600; }
.privacy-banner a { color: var(--blue); text-decoration: underline; cursor: pointer; }

/* ════════════════════════════════════
   PRIVACY / LEGAL PAGES (in modal)
════════════════════════════════════ */
.legal-section h4 { color: var(--ink); margin: 18px 0 8px; }
.legal-section p  { color: var(--ink-2); font-size: 0.82rem; margin-bottom: 10px; }
.legal-highlight {
  background: var(--gold-dim); border-left: 3px solid var(--gold);
  padding: 12px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 12px 0; font-size: 0.8rem; color: var(--ink-2);
}
.legal-review-note {
  background: var(--red-dim); border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--r-sm); padding: 12px 16px; margin-top: 20px;
  font-size: 0.75rem; color: var(--red); line-height: 1.6;
}

/* ════════════════════════════════════
   MOBILE BOTTOM NAV
════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ink-2);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: 56px;
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  background: none;
  padding: 8px 4px;
  transition: color 0.15s;
  font-family: 'IBM Plex Sans', sans-serif;
}
.mobile-nav-item .mn-icon { font-size: 1.15rem; line-height: 1; }
.mobile-nav-item.active { color: var(--gold-light); }
.mobile-nav-item:hover  { color: #fff; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 900px) {
  /* Auth */
  #auth-screen.active { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 32px 20px; min-height: 100vh; justify-content: flex-start; padding-top: 48px; }
  .auth-panel-inner { max-width: 100%; }

  /* App shell */
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .main-content {
    padding: 20px 16px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom) + 16px);
  }

  /* Nav bar */
  .nav { padding: 0 16px; }
  .nav-inner { height: 54px; }
  .nav-user-name { display: none; }

  /* Privacy banner */
  .privacy-banner { padding: 8px 16px; font-size: 0.72rem; flex-wrap: wrap; gap: 4px; }

  /* Tax calculator */
  .calc-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .week-controls { flex-direction: column; align-items: flex-start; }
  .week-search { width: 100%; }

  /* Budget */
  .budget-summary-cards { grid-template-columns: 1fr 1fr; }
  .budget-grid { grid-template-columns: 1fr; }
  .add-entry-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .add-entry-grid .btn { grid-column: span 2; width: 100%; justify-content: center; }

  /* Health */
  .health-grid { grid-template-columns: 1fr; }
  .health-inputs { grid-template-columns: 1fr; }

  /* Goals */
  .goals-grid { grid-template-columns: 1fr; }

  /* Page headers */
  .page-header-row { flex-direction: column; gap: 12px; }
  .page-header-row .btn { width: 100%; justify-content: center; }

  /* Modals — slide up from bottom on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: var(--r) var(--r) 0 0; max-height: 92vh; }
}

@media (max-width: 600px) {
  .budget-summary-cards { grid-template-columns: 1fr; }
  .week-row { grid-template-columns: 110px 1fr 1fr; }
  .wc-net { display: none; }
  .add-entry-grid { grid-template-columns: 1fr; }
  .add-entry-grid .btn { grid-column: span 1; }
}
