/* ============================================================
   RWB Business Builder — Dark Theme Only, Mobile-First
   ============================================================ */

:root {
  --bg-deep: #060912;
  --bg-primary: #0A0F1A;
  --bg-secondary: #0F1525;
  --bg-card: #131A2E;
  --bg-card-hover: #182038;
  --bg-elevated: #1A2340;
  --bg-input: #0D1322;
  --bg-nav: rgba(10,15,26,0.95);

  --text-primary: #EDF0F7;
  --text-secondary: #9CA3B8;
  --text-dim: #5C6885;

  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --accent-dim: rgba(59,130,246,0.1);
  --accent-strong: rgba(59,130,246,0.18);
  --accent-glow: 0 0 20px rgba(59,130,246,0.15);

  --green: #10B981;
  --green-dim: rgba(16,185,129,0.1);
  --green-strong: rgba(16,185,129,0.2);
  --yellow: #F59E0B;
  --yellow-dim: rgba(245,158,11,0.1);
  --red: #EF4444;
  --red-dim: rgba(239,68,68,0.1);
  --purple: #8B5CF6;
  --purple-dim: rgba(139,92,246,0.1);
  --cyan: #06B6D4;
  --cyan-dim: rgba(6,182,212,0.1);

  --border: #1A2340;
  --border-light: #232D4A;
  --border-accent: rgba(59,130,246,0.3);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-w: 240px;
  --bottombar-h: 64px;
  --header-h: 56px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: var(--bottombar-h);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
.hidden { display: none !important; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.gradient-text {
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-family: var(--font); font-size: 14px; font-weight: 600;
  border: none; border-radius: 12px; cursor: pointer;
  transition: all var(--transition); white-space: nowrap; letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--accent); color: #FFF;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.4); color: #FFF; }
.btn-secondary {
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-full { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; padding: 0; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-elevated); border-color: var(--border-light); color: var(--accent); }
.btn-icon.primary { background: var(--accent); color: #FFF; border-color: var(--accent); }

/* ---- Bottom Tab Bar (Mobile) ---- */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--bottombar-h);
  background: var(--bg-nav);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 4px; padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 10px; min-width: 0; flex: 1;
  background: none; border: none; border-radius: 12px;
  color: var(--text-dim); font-size: 10px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
  position: relative;
}
.tab-btn svg { width: 20px; height: 20px; }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::before {
  content: ''; position: absolute; top: -1px; width: 24px; height: 2px;
  background: var(--accent); border-radius: 0 0 2px 2px;
}

/* ---- Desktop Sidebar ---- */
.sidebar {
  display: none;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  width: var(--sidebar-w);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  flex-direction: column; padding: 20px 16px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
  color: var(--text-primary); margin-bottom: 28px; padding: 0 8px;
}

.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #FFF; font-size: 16px; font-weight: 900;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  background: none; border: none; font-family: var(--font); text-align: left; width: 100%;
}
.sidebar-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
.sidebar-link.active { background: var(--accent-dim); color: var(--accent); }
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 8px;
}

.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  color: #FFF; font-weight: 800; font-size: 14px; flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-biz { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Main Content Area ---- */
.main-content {
  min-height: 100vh; min-height: 100dvh;
}

/* ---- Page System ---- */
.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Page Header ---- */
.page-header {
  padding: 20px 20px 16px;
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-deep);
}

.page-header h1 { font-size: 22px; font-weight: 800; }
.page-header p { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.page-body { padding: 0 20px 24px; }

/* ---- Dashboard ---- */
.welcome-card {
  background: linear-gradient(135deg, var(--accent-dim), rgba(6,182,212,0.08));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.welcome-card h2 { font-size: 20px; margin-bottom: 6px; }
.welcome-card p { font-size: 14px; color: var(--text-secondary); }
.welcome-card .highlight { color: var(--accent); font-weight: 700; }

.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.stat-num { display: block; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-top: 4px; }
.stat-accent .stat-num { color: var(--accent); }
.stat-green .stat-num { color: var(--green); }
.stat-yellow .stat-num { color: var(--yellow); }
.stat-red .stat-num { color: var(--red); }
.stat-purple .stat-num { color: var(--purple); }

.section-title {
  font-size: 15px; font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

/* ---- Business Profile ---- */
.profile-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
}

.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.profile-avatar-lg {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #FFF; font-weight: 900; flex-shrink: 0;
}
.profile-name { font-size: 20px; font-weight: 800; }
.profile-status {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; margin-top: 4px;
}
.profile-status.active { background: var(--green-dim); color: var(--green); }
.profile-status.setup { background: var(--yellow-dim); color: var(--yellow); }

.form-grid { display: grid; gap: 14px; }
.form-group { text-align: left; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary); font-size: 14px; font-family: var(--font);
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}

.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.detail-label { font-size: 13px; color: var(--text-dim); }
.detail-value { font-size: 14px; font-weight: 600; }
.detail-value.good { color: var(--green); }
.detail-value.pending { color: var(--yellow); }

/* ---- Service Provider Cards ---- */
.service-grid { display: grid; gap: 14px; margin-bottom: 24px; }

.service-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; transition: all var(--transition);
  position: relative; overflow: hidden;
}
.service-card:hover { border-color: var(--border-accent); box-shadow: var(--accent-glow); }

.service-card.featured { border-color: var(--border-accent); }
.service-card.featured::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.service-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px;
}
.service-icon.blue { background: var(--accent-dim); color: var(--accent); }
.service-icon.green { background: var(--green-dim); color: var(--green); }
.service-icon.purple { background: var(--purple-dim); color: var(--purple); }
.service-icon.cyan { background: var(--cyan-dim); color: var(--cyan); }

.service-card h3 { font-size: 18px; margin-bottom: 4px; }
.service-url { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.service-card .service-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.service-price { font-size: 20px; font-weight: 900; color: var(--accent); margin-bottom: 14px; }
.service-features { list-style: none; margin-bottom: 16px; }
.service-features li {
  font-size: 12px; color: var(--text-secondary); padding: 4px 0;
  display: flex; align-items: center; gap: 8px;
}
.service-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

@media (min-width: 600px) { .service-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .service-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Source Cards ---- */
.source-grid { display: grid; gap: 12px; }

.source-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: all var(--transition);
}
.source-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-md); }
.source-card.status-applied { border-left: 2px solid var(--accent); }
.source-card.status-pending { border-left: 2px solid var(--yellow); }
.source-card.status-approved { border-left: 2px solid var(--green); }
.source-card.status-denied { border-left: 2px solid var(--red); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.card-name { font-size: 15px; font-weight: 700; flex: 1; }

.status-dot {
  padding: 4px 10px; border-radius: 20px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; white-space: nowrap;
  font-family: var(--font); border: 1px solid transparent; flex-shrink: 0;
}
.status-dot.not_started { background: var(--bg-elevated); color: var(--text-dim); border-color: var(--border); }
.status-dot.researching { background: var(--accent-dim); color: var(--accent); border-color: rgba(59,130,246,0.25); }
.status-dot.applied { background: var(--accent-strong); color: var(--accent); }
.status-dot.pending { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(245,158,11,0.25); }
.status-dot.approved { background: var(--green-dim); color: var(--green); border-color: rgba(16,185,129,0.25); }
.status-dot.denied { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.25); }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag {
  padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em; border: 1px solid var(--border);
}
.tag-cat { background: var(--bg-elevated); color: var(--text-dim); }
.tag-good { background: var(--green-dim); color: var(--green); border-color: rgba(16,185,129,0.2); }
.tag-info { background: var(--accent-dim); color: var(--accent); border-color: rgba(59,130,246,0.2); }
.tag-warn { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(245,158,11,0.2); }
.tag-purple { background: var(--purple-dim); color: var(--purple); border-color: rgba(139,92,246,0.2); }
.tag-crit { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.2); }

.card-amount { font-size: 19px; font-weight: 900; color: var(--green); margin-bottom: 2px; letter-spacing: -0.02em; }
.card-amount.muted { color: var(--text-dim); font-size: 14px; font-weight: 600; }
.card-rate { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.card-desc {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-apply {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--accent); color: #FFF;
  font-weight: 700; font-size: 11px; border-radius: 10px;
  text-decoration: none; transition: all var(--transition);
}
.btn-apply:hover { background: var(--accent-hover); transform: translateY(-1px); color: #FFF; }
.btn-sm-outline {
  padding: 8px 16px; background: transparent; color: var(--text-dim);
  font-weight: 600; font-size: 11px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.btn-sm-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-track {
  padding: 8px 16px; background: var(--bg-elevated); color: var(--text-dim);
  font-weight: 600; font-size: 11px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.btn-track:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

@media (min-width: 600px) { .source-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .source-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- Quick Filters ---- */
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.filter-chip {
  padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; font-family: var(--font); transition: all var(--transition); white-space: nowrap;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ---- Search & Filter Bar ---- */
.search-wrap { margin-bottom: 16px; }
.search-input {
  width: 100%; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text-primary); font-size: 14px; font-family: var(--font);
  margin-bottom: 10px; transition: all var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.active-filter-tag {
  display: inline-block; padding: 5px 12px; background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.25); border-radius: 20px;
  font-size: 11px; font-weight: 600; color: var(--red); cursor: pointer; margin-bottom: 8px;
}
.results-count { font-size: 11px; color: var(--text-dim); font-weight: 500; margin-bottom: 10px; }

/* ---- PAYDEX / Credit ---- */
.paydex-scale { display: flex; flex-direction: column; gap: 5px; margin-bottom: 20px; }
.paydex-range {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 10px; border: 1px solid transparent;
}
.risk-high { background: var(--red-dim); border-color: rgba(239,68,68,0.2); }
.risk-med { background: var(--yellow-dim); border-color: rgba(245,158,11,0.15); }
.risk-fair { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.1); }
.risk-good { background: var(--green-dim); border-color: rgba(16,185,129,0.15); }
.risk-best { background: var(--green-strong); border-color: rgba(16,185,129,0.3); }
.paydex-range .pr-num { font-size: 14px; font-weight: 900; min-width: 50px; }
.paydex-range .pr-label { font-size: 13px; font-weight: 700; flex: 1; }
.paydex-range .pr-desc { font-size: 11px; color: var(--text-dim); }

.paydex-steps { display: grid; gap: 10px; margin-bottom: 20px; }

/* ---- Bureau Cards ---- */
.bureau-grid { display: grid; gap: 12px; margin-bottom: 20px; }
.bureau-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.bureau-card h4 { font-size: 15px; margin-bottom: 4px; }
.bureau-score { color: var(--accent); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.bureau-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
@media (min-width: 768px) { .bureau-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* ---- Credit Builder ---- */
.credit-steps { display: grid; gap: 12px; }
.credit-step {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; transition: all var(--transition);
}
.credit-step:hover { border-color: var(--border-light); }
.credit-step.done { opacity: 0.6; }
.step-num-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #FFF; font-weight: 900; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.credit-step.done .step-num-circle { background: var(--green); }
.step-body { flex: 1; }
.step-body h4 { font-size: 15px; margin-bottom: 3px; }
.step-body p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.step-check-circle {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; flex-shrink: 0; transition: all var(--transition);
}
.step-check-circle:hover { border-color: var(--accent); }
.step-check-circle.checked { background: var(--accent); border-color: var(--accent); }
.step-check-circle.checked::after {
  content: '✓'; display: flex; align-items: center; justify-content: center;
  color: #FFF; font-weight: 900; font-size: 12px; height: 100%;
}

/* ---- Action Plan ---- */
.plan-progress-wrap { margin-bottom: 20px; }
.plan-progress-bar {
  height: 8px; background: var(--bg-elevated); border-radius: 8px;
  overflow: hidden; margin-bottom: 8px;
}
.plan-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 8px; transition: width 0.5s ease; width: 0%;
}
.plan-progress-text { font-size: 13px; font-weight: 600; color: var(--text-dim); }

.plan-phase {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
}
.phase-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.phase-header h4 { font-size: 14px; }
.phase-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.phase-badge { font-size: 12px; font-weight: 700; color: var(--accent); }
.task-list { padding: 6px; }
.task-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-radius: 10px; transition: background var(--transition);
}
.task-row:hover { background: var(--bg-card-hover); }
.task-row.done .task-label { text-decoration: line-through; color: var(--text-dim); }
.task-checkbox {
  width: 22px; height: 22px; border: 2px solid var(--border);
  border-radius: 50%; cursor: pointer; flex-shrink: 0; transition: all var(--transition);
}
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.task-checkbox.checked::after {
  content: '✓'; display: flex; align-items: center; justify-content: center;
  color: #FFF; font-weight: 900; font-size: 11px; height: 100%;
}
.task-checkbox.disabled { opacity: 0.35; cursor: pointer; }
.task-label { font-size: 13px; line-height: 1.5; flex: 1; }
.task-link { display: inline-block; font-size: 11px; margin-top: 4px; color: var(--accent); font-weight: 600; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -23px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-elevated); border: 2px solid var(--border-light);
}
.timeline-dot.done { background: var(--green); border-color: var(--green); }
.timeline-dot.now { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.timeline-content h4 { font-size: 14px; font-weight: 700; }
.timeline-content p { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---- Login Nudge ---- */
.login-nudge {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--accent-dim);
  border: 1px solid var(--border-accent); border-radius: 12px;
  margin-bottom: 18px; font-size: 13px;
}
.login-nudge span { flex: 1; min-width: 180px; }

/* ---- Comparison Table ---- */
.table-wrap { overflow-x: auto; margin-bottom: 20px; }
.comp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.comp-table th, .comp-table td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; }
.comp-table th { background: var(--bg-secondary); color: var(--accent); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.comp-table td { background: var(--bg-card); }
.comp-table tr:hover td { background: var(--bg-card-hover); }

/* ---- Section Headers ---- */
.sec-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 6px;
}

/* ---- Modals ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(6,9,18,0.7); backdrop-filter: blur(6px);
  z-index: 500; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  padding: 28px; position: relative; box-shadow: var(--shadow-xl);
}
.modal-sm { max-width: 400px; }
.modal-close {
  position: absolute; right: 14px; top: 14px;
  width: 34px; height: 34px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-secondary); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.modal-close:hover { background: var(--red-dim); color: var(--red); border-color: var(--red); }
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.modal-amount { font-size: 26px; font-weight: 900; color: var(--green); margin-bottom: 2px; }
.modal-amount.muted { color: var(--text-dim); font-size: 16px; }
.modal-rate { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.modal-section { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-section h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--accent); }
.modal-section ul { padding-left: 20px; font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.modal-section p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.status-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.status-opt {
  padding: 10px 6px; border: 1px solid var(--border); border-radius: 10px;
  text-align: center; font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: var(--font); background: var(--bg-card); color: var(--text-secondary);
  transition: all var(--transition);
}
.status-opt:hover { border-color: var(--accent); color: var(--accent); }
.status-opt.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.status-notes textarea, .status-amount, #importTextarea {
  width: 100%; padding: 10px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary); font-size: 13px; font-family: var(--font);
  resize: vertical; margin-bottom: 12px;
}
.status-notes textarea:focus, .status-amount:focus { outline: none; border-color: var(--accent); }
.status-notes label { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Auth Modal ---- */
.auth-brand { font-size: 18px; font-weight: 800; color: var(--accent); margin-bottom: 16px; text-align: center; }
.auth-inner h3 { font-size: 18px; margin-bottom: 16px; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; }
.auth-field input {
  width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary); font-size: 14px; font-family: var(--font);
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-switch { color: var(--text-dim); font-size: 12px; margin-top: 16px; text-align: center; }
.auth-switch a { color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-error {
  background: var(--red-dim); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px; padding: 10px; color: var(--red); font-size: 12px;
  margin-top: 12px; text-align: center;
}

/* ---- Desktop: Show Sidebar, Hide Bottom Bar ---- */
@media (min-width: 768px) {
  body { padding-bottom: 0; padding-left: var(--sidebar-w); }
  .bottombar { display: none; }
  .sidebar { display: flex; }
  .page-header { padding: 24px 28px 16px; }
  .page-body { padding: 0 28px 32px; }
  .page-header h1 { font-size: 26px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(5, 1fr); }
  .form-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Responsive Helpers ---- */
@media (max-width: 480px) {
  .status-opts { grid-template-columns: 1fr 1fr; }
}
