/* ============================================================
   TOTALIZAÇÃO PARALELA — Design System v1.0
   Aplicativo de Fiscalização Cidadã das Eleições
   Mobile-first • Institucional • Premium
   ============================================================ */

/* --- CSS VARIABLES --- */
:root {
  /* Primary: Azul Institucional */
  --primary-900: #061325;
  --primary-800: #0A1E3D;
  --primary-700: #0F2D5A;
  --primary-600: #153D78;
  --primary-500: #1B4D96;
  --primary-400: #2E6BC4;
  --primary-300: #5A92DB;
  --primary-200: #9BBEEF;
  --primary-100: #D0E2F7;
  --primary-50:  #EBF2FC;

  /* Secondary: Verde Discreto */
  --secondary-700: #0E5A2A;
  --secondary-600: #147A38;
  --secondary-500: #1B8B3D;
  --secondary-400: #2EA75A;
  --secondary-300: #5EC47E;
  --secondary-200: #A3DDB6;
  --secondary-100: #D6F0DE;
  --secondary-50:  #EDF8F1;

  /* Neutral */
  --gray-900: #1A1F2B;
  --gray-800: #2D3443;
  --gray-700: #3E4758;
  --gray-600: #556070;
  --gray-500: #6E7A8A;
  --gray-400: #94A0B0;
  --gray-300: #BFC8D4;
  --gray-200: #DEE3EA;
  --gray-100: #EEF1F5;
  --gray-50:  #F6F8FA;

  /* Semantic */
  --success: #0E8345;
  --success-bg: #E8F5EC;
  --warning: #D4930A;
  --warning-bg: #FFF8E1;
  --danger: #C62828;
  --danger-bg: #FFEBEE;
  --info: #1565C0;
  --info-bg: #E3F2FD;

  /* Accent */
  --accent: #F5A623;
  --accent-hover: #E09100;

  /* Status */
  --status-rascunho: var(--gray-400);
  --status-enviado: var(--info);
  --status-pendente: var(--warning);
  --status-validado: var(--success);
  --status-rejeitado: var(--danger);
  --status-duplicado: #7B1FA2;
  --status-divergente: #E65100;
  --status-analise: #00838F;
  --status-simulado: #6D4C41;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(10,30,61,0.04);
  --shadow-sm: 0 1px 4px rgba(10,30,61,0.06), 0 1px 2px rgba(10,30,61,0.04);
  --shadow-md: 0 4px 12px rgba(10,30,61,0.08);
  --shadow-lg: 0 8px 24px rgba(10,30,61,0.10);
  --shadow-xl: 0 16px 48px rgba(10,30,61,0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --app-max-width: 480px;
  --topbar-height: 56px;
  --bottomnav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- APP SHELL --- */
.app-shell {
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--gray-50);
  position: relative;
}

.app-content {
  padding-bottom: calc(var(--bottomnav-height) + var(--safe-bottom) + 16px);
}

/* --- TOP BAR --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--primary-800);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
  display: block;
  line-height: 1.2;
}

.topbar .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.topbar .btn-icon:hover {
  background: rgba(255,255,255,0.2);
}

/* Simulation mode topbar (legacy - keeping selector) */
.topbar.topbar-simulado {
  background: var(--primary-800);
}

/* --- BOTTOM NAV --- */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: calc(var(--bottomnav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.bottomnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--gray-500);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
  padding: 6px 4px;
}

.bottomnav-item i {
  font-size: 1.25rem;
  line-height: 1;
}

.bottomnav-item.active {
  color: var(--primary-600);
  font-weight: 700;
}

.bottomnav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: var(--primary-600);
  border-radius: 0 0 3px 3px;
}

.bottomnav-item .badge-dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

/* --- TYPOGRAPHY --- */
h1, .h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2, .h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
h3, .h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
h4, .h4 { font-size: 1rem; font-weight: 600; line-height: 1.35; }
h5, .h5 { font-size: 0.875rem; font-weight: 600; line-height: 1.4; }

.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.8rem; }
.text-base { font-size: 0.9rem; }
.text-lg { font-size: 1.05rem; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-600) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

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

.btn-secondary {
  background: var(--secondary-600);
  color: #fff;
}
.btn-secondary:hover { background: var(--secondary-700); color: #fff; }

.btn-accent {
  background: var(--accent);
  color: var(--gray-900);
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-outline-primary {
  background: transparent;
  color: var(--primary-600);
  border: 1.5px solid var(--primary-300);
}
.btn-outline-primary:hover { background: var(--primary-50); }

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

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- CARDS --- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

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

.card-body {
  padding: var(--space-md);
}

.card-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Stat Card */
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.stat-primary::before { background: var(--primary-500); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-danger::before { background: var(--danger); }
.stat-card.stat-info::before { background: var(--info); }
.stat-card.stat-purple::before { background: var(--status-duplicado); }

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-top: 4px;
}

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

/* --- FORMS --- */
.form-group {
  margin-bottom: var(--space-md);
}

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

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: #fff;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(27,77,150,0.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-valid {
  border-color: var(--success);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-error {
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236E7A8A' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary-600);
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.5;
}

/* Search Input */
.search-input-wrap {
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1rem;
}

.search-input-wrap .form-control {
  padding-left: 38px;
}

/* --- STATUS BADGES --- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 50px;
  white-space: nowrap;
}

.badge-rascunho   { background: #f0f0f0; color: var(--gray-600); }
.badge-enviado    { background: var(--info-bg); color: var(--info); }
.badge-pendente   { background: var(--warning-bg); color: var(--warning); }
.badge-validado   { background: var(--success-bg); color: var(--success); }
.badge-rejeitado  { background: var(--danger-bg); color: var(--danger); }
.badge-duplicado  { background: #F3E5F5; color: var(--status-duplicado); }
.badge-divergente { background: #FBE9E7; color: var(--status-divergente); }
.badge-analise    { background: #E0F7FA; color: var(--status-analise); }
.badge-simulado   { background: #EFEBE9; color: var(--status-simulado); }

/* --- ALERTS --- */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  border: 1px solid transparent;
}

.alert i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.alert-info    { background: var(--info-bg); color: var(--info); border-color: rgba(21,101,192,0.15); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(14,131,69,0.15); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(212,147,10,0.15); }
.alert-danger  { background: var(--danger-bg); color: var(--danger); border-color: rgba(198,40,40,0.15); }

.alert-institutional {
  background: linear-gradient(135deg, var(--primary-50), #fff);
  border: 1.5px solid var(--primary-200);
  color: var(--primary-700);
}

/* --- TABLES (Responsive) --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table th {
  background: var(--gray-50);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-600);
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 2px solid var(--gray-200);
  text-align: left;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

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

/* --- SECTION / DIVIDERS --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
}

.section-action {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-500);
  text-decoration: none;
}

.divider {
  height: 1px;
  background: var(--gray-200);
  margin: var(--space-md) 0;
}

.section-gap {
  height: 8px;
  background: var(--gray-50);
}

/* --- PAGE PADDING --- */
.page-padding {
  padding: var(--space-md);
}

/* --- LIST ITEMS --- */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}

.list-item:hover, .list-item:active {
  background: var(--gray-50);
}

.list-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-900);
}

.list-item-subtitle {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 1px;
}

.list-item-arrow {
  color: var(--gray-400);
  font-size: 1rem;
}

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: var(--space-md);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: var(--space-xs);
}

.empty-state-text {
  font-size: 0.85rem;
  color: var(--gray-500);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- LOADING STATE --- */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-state {
  text-align: center;
  padding: var(--space-2xl);
}

.loading-state .loading-spinner {
  width: 36px;
  height: 36px;
}

.loading-state p {
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--gray-500);
}

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

/* --- SKELETON LOADING --- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- CHIPS / FILTERS --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1.5px solid var(--gray-300);
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip.active {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

.chip-scroll {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: var(--space-sm) var(--space-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar { display: none; }

/* --- PROGRESS BAR --- */
.progress-bar-wrap {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary-500);
  transition: width var(--transition-slow);
}

.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger  { background: var(--danger); }

/* --- AVATAR --- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--primary-100);
  color: var(--primary-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; }

/* --- TABS --- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #fff;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-item {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.tab-item.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
}

/* --- STEPPER --- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-md);
  background: #fff;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.stepper-step.active .stepper-circle {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #fff;
}

.stepper-step.completed .stepper-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.stepper-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gray-500);
  display: none;
}

.stepper-step.active .stepper-label {
  display: block;
  color: var(--primary-600);
}

.stepper-line {
  width: 24px;
  height: 2px;
  background: var(--gray-300);
  margin: 0 2px;
}

.stepper-step.completed + .stepper-line {
  background: var(--success);
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,30,61,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  width: 100%;
  max-width: var(--app-max-width);
  max-height: 85vh;
  background: #fff;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  margin: 10px auto 0;
}

.modal-header {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}

.modal-body {
  padding: var(--space-md);
}

/* --- UPLOAD / CAMERA --- */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  background: var(--gray-50);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.upload-area-icon {
  font-size: 2.5rem;
  color: var(--gray-400);
  margin-bottom: var(--space-sm);
}

/* --- NOTIFICATION DOT --- */
.notif-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

/* --- INSTITUTIONAL DISCLAIMER --- */
.disclaimer-box {
  background: linear-gradient(135deg, var(--primary-50), var(--gray-50));
  border: 1.5px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--primary-700);
}

.disclaimer-box i {
  color: var(--primary-500);
  font-size: 1.1rem;
}

/* --- CANDIDATE CARD --- */
.candidate-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  position: relative;
}

.candidate-photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--gray-200);
  flex-shrink: 0;
}

.candidate-info { flex: 1; min-width: 0; }

.candidate-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
}

.candidate-party {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: 1px;
}

.candidate-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-600);
  font-variant-numeric: tabular-nums;
}

.candidate-votes {
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.candidate-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.candidate-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.candidate-rank {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gray-400);
}

/* --- SIMULATION BADGE (discrete) --- */
.sim-badge-topbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,152,0,0.2);
  color: #FFB74D;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 50px;
  border: 1px solid rgba(255,152,0,0.35);
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
}
.sim-badge-topbar i { font-size: 0.6rem; }

/* --- CHART PLACEHOLDER --- */
.chart-container {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.chart-canvas {
  width: 100%;
  height: 200px;
}

/* --- MAP PLACEHOLDER --- */
.map-container {
  background: var(--primary-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* --- TOGGLE SWITCH --- */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-800);
}

.toggle-sublabel {
  font-size: 0.72rem;
  color: var(--gray-500);
}

.toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--gray-300);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle.active {
  background: var(--primary-500);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform var(--transition-fast);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* --- ACTION SHEET --- */
.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 14px var(--space-md);
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.action-btn i { font-size: 1.15rem; color: var(--gray-500); width: 24px; text-align: center; }
.action-btn.danger { color: var(--danger); }
.action-btn.danger i { color: var(--danger); }

/* --- FAB (Floating Action Button) --- */
.fab {
  position: fixed;
  bottom: calc(var(--bottomnav-height) + var(--safe-bottom) + 16px);
  right: calc(50% - var(--app-max-width)/2 + 16px);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary-600);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 50;
  transition: all var(--transition-fast);
}

.fab:hover {
  background: var(--primary-700);
  transform: scale(1.05);
}

@media (max-width: 480px) {
  .fab {
    right: 16px;
  }
}

/* --- UTILITY --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.p-md { padding: var(--space-md); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.bg-white { background: #fff; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }
