/* app.css — FootballEdge App Layout & Page Styles */

/* ============================================
   APP SHELL
   ============================================ */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Top Navigation */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  padding: 0 var(--space-4);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: var(--text-sm);
}

.topnav-logo svg {
  flex-shrink: 0;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-interactive);
}
.credit-badge:hover {
  background: rgba(59, 130, 246, 0.2);
}

.user-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset-2);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all var(--transition-interactive);
  position: relative;
}
.user-menu-btn:hover { background: var(--color-surface-dynamic); color: var(--color-text); }

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  animation: fadeIn 0.15s ease;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-interactive);
  text-align: left;
}
.user-dropdown-item:hover { background: var(--color-surface-offset); color: var(--color-text); }
.user-dropdown-item.danger { color: var(--color-error); }
.user-dropdown-item.danger:hover { background: var(--color-error-highlight); }

/* Bottom Navigation (mobile) */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottomnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-1) var(--space-3);
  color: var(--color-text-faint);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-interactive);
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
}
.bottomnav-item svg { width: 20px; height: 20px; }
.bottomnav-item.active { color: var(--color-primary); }
.bottomnav-item:active { color: var(--color-primary); }

/* Main content area */
.main-content {
  flex: 1;
  padding-bottom: 72px; /* space for bottom nav */
}

@media (min-width: 768px) {
  .bottomnav { display: none; }
  .main-content { padding-bottom: 0; }
}

/* Desktop sidebar nav */
.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .app-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100dvh;
  }

  .desktop-nav {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-right: 1px solid var(--color-divider);
    padding: var(--space-4);
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .desktop-nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: var(--text-sm);
    padding: var(--space-2);
    margin-bottom: var(--space-6);
  }

  .desktop-nav-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .desktop-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-interactive);
  }
  .desktop-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
  .desktop-nav-item:hover { background: var(--color-surface-offset); color: var(--color-text); }
  .desktop-nav-item.active { background: var(--color-primary-highlight); color: var(--color-primary); }

  .desktop-nav-footer {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-divider);
  }

  .topnav { display: none; }

  .desktop-content {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .desktop-content-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    min-height: 48px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* ============================================
   PAGE: LANDING
   ============================================ */
.landing-page {
  background: var(--color-bg);
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  padding: 0 var(--space-4);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-hero {
  text-align: center;
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-4);
  max-width: 720px;
  margin: 0 auto;
}
.landing-hero h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  line-height: 1.1;
}
.landing-hero p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.hero-stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.hero-cta {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* How it works */
.landing-section {
  padding: clamp(var(--space-10), 6vw, var(--space-20)) var(--space-4);
  max-width: 960px;
  margin: 0 auto;
}
.landing-section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-8);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}
.step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.step-card h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.step-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Platform stats */
.platform-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}
.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  transition: border-color var(--transition-interactive);
}
.pricing-card:hover { border-color: var(--color-primary); }
.pricing-card.popular {
  border-color: var(--color-primary);
  position: relative;
}
.pricing-card.popular::before {
  content: 'Popular';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pricing-credits {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}
.pricing-price {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin: var(--space-2) 0;
}
.pricing-per {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* Footer */
.landing-footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}
.landing-footer p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin: 0 auto;
}
.footer-links {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-4);
}
.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-links a:hover { color: var(--color-text); }

/* ============================================
   PAGE: AUTH
   ============================================ */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  background: var(--color-bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.auth-card h1 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.auth-card .auth-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }

.auth-footer {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.auth-footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* ============================================
   PAGE: DASHBOARD
   ============================================ */
.page-padding {
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .page-padding {
    padding: var(--space-6);
  }
}

.page-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  font-weight: 500;
}
.kpi-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}
.kpi-value.green { color: var(--color-success); }
.kpi-value.red { color: var(--color-error); }
.kpi-value.blue { color: var(--color-primary); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.section-header h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.section-header a {
  font-size: var(--text-xs);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.section-header a:hover { text-decoration: underline; }

/* ============================================
   PAGE: MATCHES
   ============================================ */
.date-picker {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}

.date-btn {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition-interactive);
  min-width: max-content;
}
.date-btn:hover { color: var(--color-text); border-color: var(--color-text-faint); }
.date-btn.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.league-tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.match-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color var(--transition-interactive);
}
.match-card:hover { border-color: var(--color-text-faint); }

.match-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.match-teams {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.match-team {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}
.match-team:last-child { text-align: right; }
.match-vs {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
}
.match-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   PAGE: SIGNALS
   ============================================ */
.signal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.signal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-interactive);
}

.signal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.signal-match {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.signal-match-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.signal-locked-area {
  position: relative;
  padding: var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.signal-locked-blur {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.signal-locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 23, 0.5);
  border-radius: var(--radius-md);
}

/* Unlocked signal content */
.signal-prediction {
  padding: var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
}
.signal-prediction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.signal-prediction-outcome {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-success);
}

.prob-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.prob-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.prob-bar-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  width: 28px;
  font-weight: 500;
}
.prob-bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.prob-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.prob-bar-value {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  width: 36px;
  text-align: right;
  color: var(--color-text);
  font-weight: 500;
}

.signal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.signal-stat {
  text-align: center;
}
.signal-stat-value {
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.signal-stat-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* History items */
.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.history-result {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.history-result.won { background: var(--color-success-highlight); color: var(--color-success); }
.history-result.lost { background: var(--color-error-highlight); color: var(--color-error); }
.history-result.void { background: var(--color-surface-offset); color: var(--color-text-faint); }

.history-info { flex: 1; min-width: 0; }
.history-match {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   PAGE: CREDITS
   ============================================ */
.credits-balance {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}
.credits-balance-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.credits-balance-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.credit-packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .credit-packs { grid-template-columns: repeat(4, 1fr); }
}

.credit-pack {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  transition: border-color var(--transition-interactive);
  cursor: pointer;
}
.credit-pack:hover { border-color: var(--color-primary); }
.credit-pack.featured {
  border-color: var(--color-primary);
  position: relative;
}
.credit-pack.featured::before {
  content: 'Best Value';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.credit-pack-amount {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.credit-pack-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.credit-pack-price {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}
.credit-pack-per {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.transaction-info { flex: 1; }
.transaction-type {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.transaction-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.transaction-amount {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.transaction-amount.positive { color: var(--color-success); }
.transaction-amount.negative { color: var(--color-error); }

/* ============================================
   UTILITIES
   ============================================ */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (min-width: 768px) {
  .toast { bottom: 32px; }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-surface-dynamic);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

/* Confirm animation */
.confirm-pop {
  animation: confirmPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme toggle for light mode on landing */
[data-theme="light"] .landing-nav {
  background: rgba(245, 246, 248, 0.85);
}

/* ============================================
   PAGE: SETTINGS
   ============================================ */
.settings-section {
  margin-bottom: var(--space-6);
}
.settings-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.settings-section-title svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.settings-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.settings-row:last-child {
  border-bottom: none;
}
.settings-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.settings-subsection-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.settings-subsection-title svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* Toggle group */
.toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  transition: all var(--transition-interactive);
  white-space: nowrap;
}
.toggle-btn.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.toggle-btn:hover:not(.active) {
  background: var(--color-surface-offset);
}
.toggle-btn svg { width: 14px; height: 14px; }

/* Select input */
.input-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' 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 12px center;
  padding-right: 32px;
}

/* Binding status grid */
.binding-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (min-width: 768px) {
  .binding-status-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.binding-status-item {
  padding: var(--space-2) 0;
}
.binding-status-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}
.binding-status-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.connected {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}
.status-dot.disconnected {
  background: var(--color-text-faint);
}

/* Auto status label */
.auto-status {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.auto-status.enabled {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.auto-status.disabled {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
}

/* Binding actions */
.binding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.danger-text { color: var(--color-error) !important; }

/* Config grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .config-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Empty state inline */
.empty-state-inline {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.empty-state-inline svg {
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.empty-state-inline h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.empty-state-inline p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   PAGE: AUTO-BETS
   ============================================ */

/* KPI grid override for 6 items */
@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Chart container */
.chart-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow: hidden;
}
.chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chart-scroll svg {
  display: block;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Auto-bets table */
.ab-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.ab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 480px;
}
.ab-table thead {
  background: var(--color-surface-offset);
}
.ab-table th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ab-table td {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-divider);
  white-space: nowrap;
  color: var(--color-text);
}
.ab-table .positive { color: var(--color-success); font-weight: 600; }
.ab-table .negative { color: var(--color-error); font-weight: 600; }
