/* ============================================================
   GrowSIP.in — app.css
   Premium light blue fintech theme
   ============================================================ */

/* ── CSS Variables (Light Theme) ───────────────────────────── */
:root {
  --primary:        #4A90E2;
  --primary-dark:   #2F6FED;
  --primary-light:  #EAF4FF;
  --bg:             #F5F9FF;
  --surface:        #FFFFFF;
  --surface-2:      #F0F6FF;
  --border:         #D6E8FB;
  --text:           #1A2B45;
  --text-muted:     #6B82A0;
  --text-light:     #A0B3CA;
  --heading:        #0F1E35;
  --success:        #22C55E;
  --danger:         #EF4444;
  --warning:        #F59E0B;
  --info:           #3B82F6;
  --shadow-sm:      0 1px 3px rgba(74,144,226,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 16px rgba(74,144,226,.12), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 8px 32px rgba(74,144,226,.16), 0 4px 8px rgba(0,0,0,.08);
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --transition:     0.2s ease;
  --navbar-h:       64px;
  --font:           'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --primary:        #5B9FF8;
  --primary-dark:   #4A90E2;
  --primary-light:  #1A2B40;
  --bg:             #0D1B2A;
  --surface:        #162032;
  --surface-2:      #1E2D42;
  --border:         #2A3D55;
  --text:           #D0E3F7;
  --text-muted:     #7A95B0;
  --text-light:     #4A6080;
  --heading:        #EAF4FF;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.3);
  --shadow:         0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.5);
}

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

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

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

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.3;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  flex: 1;
  padding-top: var(--navbar-h);
}

.page-section {
  padding: 48px 0;
}

.page-section + .page-section {
  padding-top: 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Grid & Flex Utilities ──────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; gap: 12px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.nav-logo { display: flex; align-items: center; }

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.5px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { background: var(--primary-light); }

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-sm { padding: 16px; }

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.metric-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.metric-card .metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.2;
}

.metric-card .metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 60%);
  padding: 72px 0 56px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-title .accent { color: var(--primary); }

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

/* ── Search Bar ─────────────────────────────────────────────── */
.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,144,226,.15), var(--shadow);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 500;
  display: none;
}

.search-results-dropdown.open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--primary-light); }

.search-result-name { font-weight: 500; font-size: 0.9rem; }
.search-result-meta { font-size: 0.8rem; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74,144,226,.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Period Selector ────────────────────────────────────────── */
.period-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
}

.period-tab {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: transparent;
}

.period-tab.active, .period-tab:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.9rem;
}

.data-table thead th {
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: var(--primary-light); cursor: pointer; }

.data-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.data-table .fund-name { font-weight: 600; color: var(--heading); }
.data-table .fund-amc  { font-size: 0.8rem; color: var(--text-muted); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue { background: rgba(74,144,226,.12); color: var(--primary-dark); }
.badge-green { background: rgba(34,197,94,.12); color: #16a34a; }
.badge-red   { background: rgba(239,68,68,.12);  color: #dc2626; }
.badge-orange { background: rgba(245,158,11,.12); color: #d97706; }
.badge-gray  { background: var(--surface-2); color: var(--text-muted); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,144,226,.12);
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B82A0' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.fund-select-wrapper { position: relative; }
.fund-select-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 400;
  display: none;
}
.fund-select-dropdown.open { display: block; }
.fund-select-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.fund-select-option:last-child { border-bottom: none; }
.fund-select-option:hover { background: var(--primary-light); }

/* ── Chart Containers ───────────────────────────────────────── */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
}

.chart-area { min-height: 300px; }

/* ── Stats / Insights Row ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--heading); margin-top: 2px; }

/* ── Feature Callout Banner ─────────────────────────────────── */
.callout-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.callout-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.callout-desc  { opacity: 0.85; font-size: 0.95rem; }
.callout-banner .btn-outline {
  border-color: rgba(255,255,255,.6);
  color: #fff;
  flex-shrink: 0;
}
.callout-banner .btn-outline:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  flex-direction: column;
  gap: 16px;
  color: var(--text-muted);
}

/* ── Toast Notifications ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 340px;
  animation: slideIn 0.3s ease;
  color: var(--text);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger);  }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Fund Header Block ───────────────────────────────────────── */
.fund-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}

.fund-header-inner { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.fund-title { font-size: 1.6rem; font-weight: 800; color: var(--heading); margin-bottom: 8px; }
.fund-meta  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Overlap Result ──────────────────────────────────────────── */
.overlap-score {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.overlap-badge-low      { background: rgba(34,197,94,.12);  color: #16a34a; }
.overlap-badge-moderate { background: rgba(245,158,11,.12); color: #d97706; }
.overlap-badge-high     { background: rgba(239,68,68,.12);  color: #dc2626; }

/* ── SIP Result Cards ────────────────────────────────────────── */
.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.result-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--heading);
}

.result-card-value.positive { color: var(--success); }
.result-card-value.xirr { color: var(--primary); }

/* ── Admin Panel ─────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--navbar-h)); }

.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.admin-nav-link:hover, .admin-nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.admin-main { padding: 32px; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.admin-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3   { margin-bottom: 8px; color: var(--heading); }

/* ── Category & AMC Cards ───────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.cat-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.cat-card-title { font-size: 1rem; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.cat-card-count { font-size: 0.85rem; color: var(--text-muted); }
.cat-card-return { font-size: 1.1rem; font-weight: 700; color: var(--success); margin-top: 12px; }

/* ── SIP Quick Card ─────────────────────────────────────────── */
.sip-quick-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: #fff;
}

.sip-quick-card label { color: rgba(255,255,255,.8); font-size: 0.85rem; font-weight: 600; }
.sip-quick-card .form-control {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.sip-quick-card .form-control::placeholder { color: rgba(255,255,255,.5); }
.sip-quick-card .form-control:focus { border-color: rgba(255,255,255,.7); box-shadow: none; }

/* ── Alert / Info Boxes ─────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-info    { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.25); color: var(--info); }
.alert-success { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.25);  color: var(--success); }
.alert-danger  { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.25);  color: var(--danger); }
.alert-warning { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); color: var(--warning); }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--heading);
  display: inline-block;
  margin-bottom: 12px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.footer-disclaimer-short {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
}

.footer-links-group h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-links-group ul li { margin-bottom: 8px; }
.footer-links-group ul li a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links-group ul li a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--navbar-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow);
  }

  .nav-links.open { display: flex; }
  .nav-link { width: 100%; text-align: left; }

  .nav-inner { gap: 16px; }
  .theme-toggle { margin-left: auto; }

  .hero { padding: 48px 0 40px; }
  .hero-title { font-size: 2rem; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }

  .callout-banner { flex-direction: column; text-align: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .result-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .stats-grid, .result-cards { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .period-tabs { flex-wrap: wrap; }
  .cat-grid { grid-template-columns: 1fr; }
}

/* ── Utility ─────────────────────────────────────────────────── */
.positive { color: var(--success) !important; }
.negative { color: var(--danger)  !important; }
.hidden   { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full   { width: 100%; }
.border-t { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }

/* Rank badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.rank-badge.gold   { background: #FFF3CD; color: #856404; }
.rank-badge.silver { background: #E9ECEF; color: #495057; }
.rank-badge.bronze { background: #FFE0CC; color: #995200; }

/* GrowScore pill */
.grow-score {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary-light), rgba(74,144,226,.2));
  color: var(--primary-dark);
  border: 1px solid rgba(74,144,226,.25);
}
