/* ============================================================
   Plotwise Save — Master Stylesheet
   BAKAIMA Group | Department of ICT
   Aesthetic: East African Wealth Builder
   Fonts: Cormorant Garamond (display) + Outfit (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --green-900:  #0D2418;
  --green-800:  #1B4332;
  --green-700:  #2D6A4F;
  --green-600:  #40916C;
  --green-400:  #74C69D;
  --green-100:  #D8F3DC;

  --amber-700:  #B45309;
  --amber-600:  #D4801A;
  --amber-500:  #F59E0B;
  --amber-300:  #FCD34D;
  --amber-100:  #FEF3C7;

  --cream-100:  #FAF7F0;
  --cream-200:  #F2EBD9;
  --cream-300:  #E8DFC8;

  --slate-800:  #1E293B;
  --slate-600:  #475569;
  --slate-400:  #94A3B8;
  --slate-200:  #E2E8F0;
  --slate-100:  #F1F5F9;
  --white:      #FFFFFF;

  --red-600:    #DC2626;
  --red-100:    #FEE2E2;
  --blue-600:   #2563EB;
  --blue-100:   #DBEAFE;

  /* Semantic */
  --primary:       var(--green-800);
  --primary-light: var(--green-700);
  --primary-dark:  var(--green-900);
  --accent:        var(--amber-600);
  --accent-light:  var(--amber-500);
  --surface:       var(--white);
  --background:    var(--cream-100);
  --border:        var(--cream-300);
  --text:          var(--slate-800);
  --text-muted:    var(--slate-600);
  --text-faint:    var(--slate-400);

  /* Sidebar */
  --sidebar-w:     260px;
  --sidebar-bg:    var(--green-900);
  --sidebar-text:  rgba(255,255,255,0.85);
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active:var(--amber-600);

  /* Effects */
  --radius:     10px;
  --radius-lg:  16px;
  --radius-sm:  6px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);

  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

img { display: block; max-width: 100%; }

input, textarea, select, button { font-family: inherit; font-size: inherit; }

ul, ol { list-style: none; }

/* ── Typography Scale ───────────────────────────────────────── */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.8125rem; }
.text-base { font-size: 0.9375rem; }
.text-lg   { font-size: 1.0625rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 2rem; }
.text-4xl  { font-size: 2.75rem; }

.font-light  { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semi   { font-weight: 600; }
.font-bold   { font-weight: 700; }

.serif { font-family: 'Cormorant Garamond', serif; }
.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-primary{ color: var(--primary); }
.text-white  { color: var(--white); }
.text-success{ color: var(--green-700); }
.text-danger { color: var(--red-600); }

/* ── Layout Utilities ───────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.grid   { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Spacing ────────────────────────────────────────────────── */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* ══════════════════════════════════════════════════════════════
   PUBLIC PAGES (Home, Login, Register)
   ══════════════════════════════════════════════════════════════ */

/* ── Public Navbar ──────────────────────────────────────────── */
.pub-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  height: 68px;
  background: rgba(13,36,24,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pub-nav .nav-logo {
  display: flex; align-items: center; gap: 10px;
}
.pub-nav .nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--amber-600), var(--amber-500));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: white; font-weight: 700;
}
.pub-nav .nav-logo .logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}
.pub-nav .nav-logo .logo-text span { color: var(--amber-300); }

.pub-nav .nav-links {
  display: flex; align-items: center; gap: 0.5rem;
}
.pub-nav .nav-links a {
  color: rgba(255,255,255,0.75);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.pub-nav .nav-links a:hover { color: white; background: rgba(255,255,255,0.08); }
.pub-nav .nav-links .btn-nav {
  background: var(--accent);
  color: white;
  padding: 0.45rem 1.25rem;
}
.pub-nav .nav-links .btn-nav:hover { background: var(--amber-500); }

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  background: var(--green-900);
  display: flex; align-items: center;
  padding: 6rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 80% 50%, rgba(212,128,26,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 20% 80%, rgba(45,106,79,0.3) 0%, transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero .container {
  max-width: 1120px; margin: 0 auto; padding: 0 2rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
  position: relative; z-index: 1;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(212,128,26,0.15);
  border: 1px solid rgba(212,128,26,0.3);
  color: var(--amber-300);
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 1.5rem;
}
.hero-tag::before { content: '●'; font-size: 0.5rem; animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 {
  font-size: 3.5rem; font-weight: 700;
  color: var(--white); line-height: 1.1;
  margin-bottom: 1.5rem;
}
.hero h1 .accent-word {
  color: var(--amber-300);
  font-style: italic;
}
.hero-sub {
  font-size: 1.0625rem; color: rgba(255,255,255,0.65);
  line-height: 1.7; margin-bottom: 2.5rem;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero visual card */
.hero-visual {
  display: flex; flex-direction: column; gap: 1rem;
  animation: floatUp 0.8s ease both;
}
@keyframes floatUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
}
.hero-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.hero-card-title {
  color: rgba(255,255,255,0.6); font-size: 0.8125rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.hero-card-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--amber-700), var(--amber-500));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.hero-card-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 700;
  color: var(--white); margin-bottom: 0.75rem;
}
.hero-progress-wrap { margin-bottom: 0.5rem; }
.hero-progress-track {
  height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 100px; overflow: hidden;
}
.hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--amber-500));
  border-radius: 100px;
  width: 40%;
  animation: progressGrow 1.5s 0.5s ease both;
}
@keyframes progressGrow {
  from { width: 0; }
  to   { width: 40%; }
}
.hero-progress-label {
  font-size: 0.75rem; color: rgba(255,255,255,0.5);
  margin-top: 0.4rem; text-align: right;
}

.hero-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}
.hero-stat {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
}
.hero-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--amber-300);
  display: block;
}
.hero-stat-lbl {
  font-size: 0.7rem; color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ── How It Works Section ───────────────────────────────────── */
.section {
  padding: 5rem 0;
}
.section.alt { background: var(--surface); }
.container {
  max-width: 1120px; margin: 0 auto; padding: 0 2rem;
}
.section-tag {
  display: inline-block;
  color: var(--accent); font-size: 0.8125rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: 2.25rem; font-weight: 700;
  color: var(--text); margin-bottom: 1rem;
  max-width: 560px;
}
.section-sub {
  color: var(--text-muted); font-size: 1.0625rem; line-height: 1.7;
  max-width: 540px; margin-bottom: 3rem;
}

.steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem 1.5rem;
  position: relative; transition: all var(--transition);
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-400);
}
.step-number {
  width: 40px; height: 40px;
  background: var(--cream-100);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.125rem; font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}
.step-card h4 {
  font-size: 1.0625rem; margin-bottom: 0.5rem;
}
.step-card p {
  font-size: 0.875rem; color: var(--text-muted); line-height: 1.65;
}

/* Goal type cards */
.goals-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
}
.goal-type-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.5rem;
  text-align: center; transition: all var(--transition);
  cursor: default;
}
.goal-type-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.goal-type-emoji {
  font-size: 2.5rem; margin-bottom: 1rem;
  display: block;
}
.goal-type-card h4 {
  font-size: 1rem; margin-bottom: 0.5rem;
}
.goal-type-card p { font-size: 0.8125rem; color: var(--text-muted); }

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 60%, rgba(212,128,26,0.3) 100%);
  padding: 5rem 0;
  text-align: center;
  position: relative; overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(212,128,26,0.1) 0%, transparent 70%);
}
.cta-banner h2 {
  font-size: 2.75rem; color: white; margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.cta-banner p {
  color: rgba(255,255,255,0.65); font-size: 1.0625rem;
  margin-bottom: 2rem; position: relative; z-index: 1;
}
.cta-banner .btn-group { position: relative; z-index: 1; }

/* Footer */
.pub-footer {
  background: var(--green-900);
  padding: 3rem 0 2rem;
  color: rgba(255,255,255,0.5);
}
.pub-footer .footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.pub-footer .footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; color: rgba(255,255,255,0.8);
}
.pub-footer .footer-logo span { color: var(--amber-300); }
.pub-footer .footer-copy { font-size: 0.8125rem; }
.pub-footer .footer-links { display: flex; gap: 1.5rem; }
.pub-footer .footer-links a {
  color: rgba(255,255,255,0.45); font-size: 0.8125rem;
  transition: color var(--transition);
}
.pub-footer .footer-links a:hover { color: rgba(255,255,255,0.8); }

/* ── Auth Pages (Login / Register) ─────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-panel-left {
  background: var(--green-900);
  display: flex; flex-direction: column;
  justify-content: center; padding: 4rem 3.5rem;
  position: relative; overflow: hidden;
}
.auth-panel-left::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 70%, rgba(45,106,79,0.4) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(212,128,26,0.15) 0%, transparent 50%);
}
.auth-left-content { position: relative; z-index: 1; }
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 3rem;
  text-decoration: none;
}
.auth-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--amber-600), var(--amber-400));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: white; font-weight: 700;
}
.auth-logo .logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 700;
  color: white; letter-spacing: 0.01em;
}
.auth-logo .logo-text span { color: var(--amber-300); }

.auth-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem; font-weight: 700;
  color: white; line-height: 1.2;
  margin-bottom: 1.25rem;
}
.auth-tagline em { color: var(--amber-300); font-style: italic; }
.auth-sub {
  color: rgba(255,255,255,0.6); font-size: 1rem; line-height: 1.7;
  max-width: 380px; margin-bottom: 3rem;
}
.auth-features { display: flex; flex-direction: column; gap: 1rem; }
.auth-feature {
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.auth-feature-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: rgba(212,128,26,0.2);
  border: 1px solid rgba(212,128,26,0.3);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
}
.auth-feature-text strong {
  display: block; color: rgba(255,255,255,0.9);
  font-size: 0.875rem; font-weight: 600; margin-bottom: 0.1rem;
}
.auth-feature-text span {
  color: rgba(255,255,255,0.45); font-size: 0.8125rem;
}

.auth-panel-right {
  background: var(--cream-100);
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 3.5rem;
}
.auth-form-wrap {
  width: 100%; max-width: 420px;
}
.auth-form-title {
  font-size: 2rem; font-weight: 700;
  margin-bottom: 0.5rem;
}
.auth-form-sub {
  color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9375rem;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ══════════════════════════════════════════════════════════════ */

.dashboard-layout {
  display: flex; min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; margin-bottom: 0;
}
.sidebar-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--amber-600), var(--amber-400));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; color: white; font-weight: 700; flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; font-weight: 700; color: white;
}
.sidebar-logo .logo-text span { color: var(--amber-300); }
.sidebar-role-badge {
  display: inline-block;
  background: rgba(212,128,26,0.2);
  border: 1px solid rgba(212,128,26,0.35);
  color: var(--amber-300);
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 100px;
  margin-top: 0.6rem;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; color: white;
}
.sidebar-user-name {
  font-size: 0.875rem; font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-section-label {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  margin-top: 0.5rem;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: var(--sidebar-text);
  font-size: 0.875rem; font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: white; }
.sidebar-nav a.active {
  color: white;
  background: rgba(212,128,26,0.15);
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--amber-500);
  border-radius: 0 2px 2px 0;
}
.sidebar-nav a .nav-icon {
  width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0;
}
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--amber-600); color: white;
  font-size: 0.6875rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 100px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 0.75rem;
  color: rgba(255,255,255,0.45); font-size: 0.8125rem;
  padding: 0.5rem 0;
  transition: color var(--transition);
  text-decoration: none;
}
.sidebar-footer a:hover { color: rgba(255,255,255,0.8); }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 600; color: var(--text);
}
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-date {
  font-size: 0.8125rem; color: var(--text-muted);
}

.page-body {
  padding: 2rem;
  flex: 1;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem;
}
.page-title { font-size: 1.75rem; margin-bottom: 0.25rem; }
.page-sub { color: var(--text-muted); font-size: 0.9375rem; }

/* ── Stats Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card::after {
  content: '';
  position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.06;
}
.stat-card.green::after { background: var(--green-600); }
.stat-card.amber::after { background: var(--amber-500); }
.stat-card.blue::after  { background: var(--blue-600); }
.stat-card.red::after   { background: var(--red-600); }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.stat-icon.green { background: var(--green-100); }
.stat-icon.amber { background: var(--amber-100); }
.stat-icon.blue  { background: var(--blue-100); }
.stat-icon.red   { background: var(--red-100); }

.stat-label {
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.35rem;
}
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem; font-weight: 700;
  color: var(--text); line-height: 1;
}
.stat-sub {
  font-size: 0.75rem; color: var(--text-faint); margin-top: 0.35rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.125rem; font-weight: 700;
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--cream-100);
}

/* ── Goal Cards ─────────────────────────────────────────────── */
.goals-list { display: flex; flex-direction: column; gap: 1rem; }
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}
.goal-card:hover {
  border-color: var(--green-400);
  box-shadow: var(--shadow);
}
.goal-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.goal-card-info { display: flex; align-items: flex-start; gap: 0.875rem; }
.goal-emoji {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--cream-100);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.goal-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 0.2rem;
}
.goal-type-tag {
  font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
}
.goal-amounts {
  text-align: right;
}
.goal-saved {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem; font-weight: 700; color: var(--primary);
}
.goal-target {
  font-size: 0.8rem; color: var(--text-muted);
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-wrap { margin-bottom: 0.5rem; }
.progress-bar {
  height: 8px;
  background: var(--cream-200);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--green-700), var(--green-500));
  transition: width 0.6s ease;
}
.progress-fill.amber {
  background: linear-gradient(90deg, var(--amber-600), var(--amber-400));
}
.progress-fill.success {
  background: linear-gradient(90deg, var(--green-700), var(--amber-500));
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 0.35rem;
}
.progress-pct {
  font-weight: 600; color: var(--primary);
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
}
thead th {
  background: var(--cream-100);
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--cream-100); }

.td-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem; font-weight: 700;
  color: var(--primary);
}
.td-name { font-weight: 600; }
.td-sub  { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.65rem; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-success { background: var(--green-100); color: var(--green-700); }
.badge-primary { background: var(--blue-100);  color: var(--blue-600); }
.badge-warning { background: var(--amber-100); color: var(--amber-700); }
.badge-danger  { background: var(--red-100);   color: var(--red-600); }
.badge-muted   { background: var(--slate-100); color: var(--slate-600); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: white;
}
.btn-primary:hover { background: var(--primary-light); color: white; transform: translateY(-1px); }

.btn-accent {
  background: var(--accent); color: white;
}
.btn-accent:hover { background: var(--amber-500); color: white; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(27,67,50,0.04); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover { background: var(--cream-100); color: var(--text); }

.btn-danger-outline {
  background: transparent; border: 1.5px solid var(--red-600); color: var(--red-600);
}
.btn-danger-outline:hover { background: var(--red-100); }

.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-group.center { justify-content: center; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
label {
  display: block;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.45rem;
}
label .required { color: var(--red-600); margin-left: 2px; }

.input, input[type="text"], input[type="email"],
input[type="password"], input[type="number"], input[type="tel"],
input[type="date"], select, textarea {
  display: block; width: 100%;
  padding: 0.65rem 0.875rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.08);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px; padding-right: 2.5rem; cursor: pointer; }
textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-error { font-size: 0.8125rem; color: var(--red-600); margin-top: 0.35rem; font-weight: 500; }
input.error, select.error { border-color: var(--red-600); }

/* Input with prefix */
.input-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 0; top: 0; bottom: 0;
  display: flex; align-items: center; padding: 0 0.875rem;
  background: var(--cream-100); border-right: 1.5px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}
.input-wrap .input-prefix + input {
  padding-left: 4.5rem;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.alert-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; margin-top: 1px;
}
.alert-success { background: var(--green-100); color: var(--green-700); border: 1px solid rgba(45,106,79,0.2); }
.alert-success .alert-icon { background: var(--green-700); color: white; }
.alert-error   { background: var(--red-100);   color: var(--red-600);   border: 1px solid rgba(220,38,38,0.2); }
.alert-error   .alert-icon { background: var(--red-600);   color: white; }
.alert-warning { background: var(--amber-100); color: var(--amber-700); border: 1px solid rgba(212,128,26,0.25); }
.alert-warning .alert-icon { background: var(--amber-600); color: white; }
.alert-info    { background: var(--blue-100);  color: var(--blue-600);  border: 1px solid rgba(37,99,235,0.2); }
.alert-info    .alert-icon { background: var(--blue-600);  color: white; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3.5rem 2rem;
}
.empty-icon {
  font-size: 3rem; margin-bottom: 1rem; display: block;
  opacity: 0.4;
}
.empty-title {
  font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem;
}
.empty-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── Section Divider ────────────────────────────────────────── */
.divider {
  border: none; border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Misc ───────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.two-col-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
}
.avatar-lg {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.5rem; color: white;
  flex-shrink: 0;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; }
.info-value { font-size: 0.9rem; font-weight: 600; }

/* ── Responsive ─────────────────────────────────────────────── */
/* ════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════ */

/* ── Tablet (≤1024px) ──────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .steps-grid  { grid-template-columns: repeat(2, 1fr); }
  .goals-grid  { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { display: none; }
}

/* ── Mobile (≤768px) ───────────────────────────── */
@media (max-width: 768px) {

  /* Auth pages */
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }

  /* Sidebar — off-canvas on mobile */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
    position: fixed;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block !important; }
  .main-content { margin-left: 0 !important; }

  /* Show hamburger button */
  #sidebar-toggle { display: flex !important; }

  /* Topbar */
  .topbar { padding: 0 1rem; }
  .topbar-date { display: none; }
  .topbar-right .btn { font-size: 0.75rem; padding: 0.35rem 0.6rem; }

  /* Page body */
  .page-body { padding: 1rem; }

  /* Grids → single column */
  .stats-grid       { grid-template-columns: 1fr 1fr; }
  .form-row         { grid-template-columns: 1fr !important; }
  .two-col,
  .two-col-equal    { grid-template-columns: 1fr !important; }
  .steps-grid       { grid-template-columns: 1fr 1fr; }
  .goals-grid       { grid-template-columns: 1fr; }

  /* Page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-header .btn-group,
  .page-header .btn,
  .page-header a.btn { width: 100%; justify-content: center; }

  /* Cards */
  .card-header { flex-wrap: wrap; gap: 0.5rem; }

  /* Tables — horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 480px; }

  /* Stat cards — smaller font */
  .stat-value { font-size: 1.4rem !important; }

  /* Deposit page specific */
  .payment-method-grid { grid-template-columns: repeat(3,1fr) !important; }
  .payment-method-grid button { padding: 0.625rem 0.25rem !important; }

  /* Digital card */
  #plotwise-card-wrap { max-width: 100% !important; }

  /* Modal dialogs */
  #plot-modal > div,
  #reserve-modal > div {
    width: 96% !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
    max-height: 85vh;
    overflow-y: auto;
  }

  /* Info rows */
  .info-row {
    flex-direction: column;
    gap: 0.15rem;
  }
  .info-label { min-width: unset; }

  /* Btn groups */
  .btn-group { flex-wrap: wrap; }

  /* Hero */
  .hero h1 { font-size: 2rem; }

  /* Sidebar nav — larger touch targets */
  .sidebar-nav a { padding: 0.75rem 1.5rem; font-size: 0.9375rem; }
}

/* ── Small mobile (≤480px) ─────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .page-body  { padding: 0.875rem; }
  .topbar     { padding: 0 0.875rem; }

  /* Stack stat cards 2×2 on small phones */
  .stat-card .stat-value { font-size: 1.25rem !important; }

  /* Full-width buttons on small screens */
  .btn-lg { width: 100%; justify-content: center; }

  /* Deposit method tabs — keep 3 across but smaller */
  .payment-method-grid button div:last-child { display: none; } /* hide subtitle */

  /* Form inputs — larger for touch */
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
    min-height: 44px;
  }

  /* Table cells smaller */
  .td-name { font-size: 0.8125rem; }
  .td-sub  { font-size: 0.7rem; }
  .td-amount { font-size: 0.875rem; }
}

/* ── Very small (≤360px) ───────────────────────── */
@media (max-width: 360px) {
  .page-body { padding: 0.75rem; }
  .card-body { padding: 1rem !important; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Touch device improvements ─────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Bigger tap targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .sidebar-nav a { min-height: 48px; display: flex; align-items: center; }

  /* Remove hover-only states that confuse touch */
  .card:hover { box-shadow: var(--shadow); }
}
