/* ==========================================================================
   Apple Human Interface Guidelines (HIG) Design System for MinisterSimAI
   ========================================================================== */

:root {
  /* Apple System Colors */
  --bg-primary: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-card-secondary: #FAFAFC;
  --bg-glass: rgba(255, 255, 255, 0.78);
  --bg-glass-heavy: rgba(245, 245, 247, 0.85);
  --bg-sheet: #FFFFFF;
  --bg-overlay: rgba(0, 0, 0, 0.35);

  /* Typography */
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --text-inverse: #FFFFFF;

  /* Vibrant Accents reserved for actions & status */
  --apple-blue: #0071E3;
  --apple-blue-hover: #0077ED;
  --apple-blue-light: rgba(0, 113, 227, 0.12);
  --apple-green: #34C759;
  --apple-green-light: rgba(52, 199, 89, 0.14);
  --apple-red: #FF3B30;
  --apple-red-light: rgba(255, 59, 48, 0.14);
  --apple-orange: #FF9500;
  --apple-orange-light: rgba(255, 149, 0, 0.14);
  --apple-purple: #AF52DE;
  --apple-gray: #8E8E93;

  /* Separators & Borders */
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-sheet: rgba(0, 0, 0, 0.12);
  --separator: #E5E5EA;

  /* Shadows */
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.12);
  --shadow-drawer: -10px 0 35px rgba(0, 0, 0, 0.1);
  --shadow-tab: 0 -1px 0 rgba(0, 0, 0, 0.06), 0 -4px 16px rgba(0, 0, 0, 0.03);

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Font */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Roboto", "Helvetica Neue", sans-serif;
  --transition-default: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-system);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container */
.app-container {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-primary);
  padding-bottom: 96px; /* space for iOS bottom tab bar */
}

/* --------------------------------------------------------------------------
   Top Sticky Frosted Glass Header
   -------------------------------------------------------------------------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1D1D1F 0%, #3A3A3C 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.brand-title h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.user-status-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pc {
  background: var(--apple-orange-light);
  color: var(--apple-orange);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 149, 0, 0.2);
}

.badge-region {
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(0, 113, 227, 0.16);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Sub-Header / National Overview Bar
   -------------------------------------------------------------------------- */
.national-ticker {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.national-stat {
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.stat-val.positive { color: var(--apple-green); }
.stat-val.warning { color: var(--apple-orange); }
.stat-val.danger { color: var(--apple-red); }

.cycle-countdown {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.04);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--apple-green);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(52, 199, 89, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

/* --------------------------------------------------------------------------
   View Container & Tab Switching
   -------------------------------------------------------------------------- */
.main-content {
  padding: 16px 18px;
  flex: 1;
}

.view-panel {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title-wrap {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   District View: Floating Apple HIG Cards
   -------------------------------------------------------------------------- */
.district-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.floating-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-default);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.floating-card:active {
  transform: scale(0.985);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card-icon.infra { background: rgba(0, 113, 227, 0.1); color: var(--apple-blue); }
.card-icon.health { background: rgba(52, 199, 89, 0.12); color: var(--apple-green); }
.card-icon.edu { background: rgba(175, 82, 222, 0.12); color: var(--apple-purple); }
.card-icon.ind { background: rgba(255, 149, 0, 0.12); color: var(--apple-orange); }
.card-icon.tax { background: rgba(88, 86, 214, 0.12); color: #5856D6; }

.card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.card-level-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Progress bar inside card */
.progress-container {
  width: 100%;
  height: 6px;
  background: #EBEBED;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 10px 0 12px;
}

.progress-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.progress-fill.green { background: var(--apple-green); }
.progress-fill.orange { background: var(--apple-orange); }
.progress-fill.purple { background: var(--apple-purple); }

.card-footer-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding-top: 10px;
}

.card-tap-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-blue);
}

/* Hero Overview Card */
.hero-card {
  background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%);
  color: #FFF;
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.district-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.district-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metric {
  display: flex;
  flex-direction: column;
}

.hero-metric-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.hero-metric-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Parliament View: Bills Docket & Slide-in Detail Drawer
   -------------------------------------------------------------------------- */
.parliament-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-primary {
  background-color: var(--apple-blue);
  color: #FFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-default);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

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

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-default);
}

.btn-secondary:hover {
  background: #EFEFF4;
}

.bills-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bill-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: var(--transition-default);
  position: relative;
}

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

.bill-card:active {
  transform: scale(0.985);
}

.bill-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bill-category-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.category-economy { background: var(--apple-green-light); color: var(--apple-green); }
.category-healthcare { background: rgba(52, 199, 89, 0.12); color: #28A745; }
.category-security { background: var(--apple-red-light); color: var(--apple-red); }
.category-infrastructure { background: var(--apple-blue-light); color: var(--apple-blue); }

.bill-author {
  font-size: 12px;
  color: var(--text-tertiary);
}

.bill-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.bill-card-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Voting meter */
.voting-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voting-ratio-bar {
  display: flex;
  height: 8px;
  background: #E5E5EA;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.ratio-aye {
  background: var(--apple-green);
  transition: width 0.3s ease;
}

.ratio-nay {
  background: var(--apple-red);
  transition: width 0.3s ease;
}

.voting-counts {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}

.count-aye { color: var(--apple-green); }
.count-nay { color: var(--apple-red); }

/* Slide-in Bill Detail Drawer */
.bill-drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bill-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bill-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 500px;
  background: #FFFFFF;
  box-shadow: var(--shadow-drawer);
  z-index: 1001;
  transform: translateX(100%);
  transition: var(--transition-spring);
  display: flex;
  flex-direction: column;
}

.bill-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
}

.drawer-close-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.drawer-bill-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.drawer-bill-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.drawer-bill-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 24px;
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.drawer-impact-box {
  background: #FAFAFC;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.drawer-impact-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.drawer-impact-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.impact-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

/* Voting Controls in Drawer */
.drawer-voting-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  display: flex;
  gap: 12px;
}

.btn-vote {
  flex: 1;
  padding: 14px 12px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-default);
}

.btn-vote:active {
  transform: scale(0.96);
}

.btn-aye {
  background: var(--apple-green);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(52, 199, 89, 0.3);
}

.btn-nay {
  background: var(--apple-red);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(255, 59, 48, 0.3);
}

.btn-abstain {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Feed & Crises View: AI Game Master Incident Room
   -------------------------------------------------------------------------- */
.ai-master-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.1) 0%, rgba(175, 82, 222, 0.1) 100%);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-blue);
  border: 1px solid rgba(0, 113, 227, 0.15);
  margin-bottom: 14px;
}

.crisis-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.crisis-card.critical {
  border-left: 5px solid var(--apple-red);
}

.crisis-card.moderate {
  border-left: 5px solid var(--apple-orange);
}

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

.crisis-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.crisis-badge.critical { background: var(--apple-red-light); color: var(--apple-red); }
.crisis-badge.moderate { background: var(--apple-orange-light); color: var(--apple-orange); }
.crisis-badge.minor { background: rgba(0,0,0,0.06); color: var(--text-secondary); }

.crisis-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.crisis-narrative {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.crisis-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-default);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.choice-btn:hover {
  background: #EBEBED;
  border-color: rgba(0,0,0,0.15);
}

.choice-btn:active {
  transform: scale(0.985);
}

.choice-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.choice-effect {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Local Event Feed List */
.local-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-ticker-item {
  background: var(--bg-card);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.event-time {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   CSS-Driven Bottom Sheet Modal for District Upgrades
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-sheet);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-sheet);
  z-index: 1001;
  transform: translateY(100%);
  transition: var(--transition-spring);
  padding: 12px 22px 34px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-grabber-bar {
  width: 40px;
  height: 5px;
  background: #D1D1D6;
  border-radius: var(--radius-pill);
  margin: 0 auto 16px;
  cursor: grab;
}

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

.sheet-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.sheet-close-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.sheet-body {
  overflow-y: auto;
  flex: 1;
}

.upgrade-detail-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border-subtle);
}

.upgrade-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.upgrade-costs {
  display: flex;
  gap: 12px;
}

.cost-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 14px;
}

.cost-tag.pc { color: var(--apple-orange); }
.cost-tag.budget { color: var(--apple-green); }

.upgrade-benefits-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.benefit-item span.icon {
  color: var(--apple-green);
  font-weight: 700;
}

.sheet-action-footer {
  margin-top: 16px;
}

.btn-confirm-upgrade {
  width: 100%;
  padding: 16px;
  background: var(--apple-blue);
  color: #FFF;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-default);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
}

.btn-confirm-upgrade:hover {
  background: var(--apple-blue-hover);
}

.btn-confirm-upgrade:active {
  transform: scale(0.98);
}

.btn-confirm-upgrade:disabled {
  background: #C7C7CC;
  box-shadow: none;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Persistent iOS Bottom Tab Bar
   -------------------------------------------------------------------------- */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 640px;
  margin: 0 auto;
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-tab);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 99;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition-default);
  position: relative;
}

.tab-btn .tab-icon {
  font-size: 20px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-btn .tab-label {
  font-size: 11px;
  font-weight: 500;
}

.tab-btn.active {
  color: var(--apple-blue);
}

.tab-btn.active .tab-icon {
  transform: scale(1.1);
}

.tab-btn.active .tab-label {
  font-weight: 700;
}

.tab-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 18px);
  background: var(--apple-red);
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(255, 59, 48, 0.4);
}

/* --------------------------------------------------------------------------
   Modal for Proposing a Bill
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  font-family: var(--font-system);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--apple-blue);
  background: #FFF;
}

/* Toast Notifications (iOS dynamic notification banner) */
.toast-container {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive adjustments */
@media (min-width: 641px) {
  body {
    background-color: #E5E5EA;
  }
  .app-container {
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
  }
}
