/* ============================================================
   DoméstiControl - CSS Principal
   ============================================================ */

:root {
  --primary: #2196F3;
  --primary-dark: #1565C0;
  --primary-light: #E3F2FD;
  --green: #4CAF50;
  --green-light: #E8F5E9;
  --yellow: #FFC107;
  --yellow-light: #FFF8E1;
  --orange: #FF9800;
  --orange-light: #FFF3E0;
  --red: #F44336;
  --red-light: #FFEBEE;
  --purple: #9C27B0;
  --purple-light: #F3E5F5;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface2: #F0F4F8;
  --border: #E2E8F0;
  --text: #1A202C;
  --text2: #4A5568;
  --text3: #718096;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --nav-height: 64px;
  --topbar-height: 56px;
  --transition: 0.2s ease;
}

.theme-dark {
  --bg: #0F1117;
  --surface: #1A1D27;
  --surface2: #252836;
  --border: #2D3748;
  --text: #F7FAFC;
  --text2: #CBD5E0;
  --text3: #718096;
  --primary-light: #1a2840;
  --green-light: #1a2e1a;
  --yellow-light: #2d2500;
  --red-light: #2d1515;
  --orange-light: #2d1e00;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  height: 100%;
}

/* ============ SPLASH SCREEN ============ */
.splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1565C0 0%, #2196F3 50%, #42A5F5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; }
.splash-content {
  text-align: center;
  color: white;
}
.splash-logo {
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.2);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 48px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.splash-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.splash-subtitle {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 40px;
}
.splash-loader {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: white;
  border-radius: 2px;
  animation: loading 1.8s ease forwards;
}
@keyframes loading {
  from { width: 0; }
  to { width: 100%; }
}

/* ============ APP WRAPPER ============ */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ============ TOP BAR ============ */
.top-bar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  gap: 8px;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.top-bar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding-left: 4px;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-icon {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  position: relative;
  transition: background var(--transition);
}
.btn-icon:active { background: var(--surface2); }
.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ============ SEARCH BAR ============ */
.search-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  border: none;
  background: var(--surface2);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.search-icon { color: var(--text3); }
.search-bar button {
  border: none;
  background: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + 16px);
}
.page { display: none; }
.page.active { display: block; }

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  position: relative;
  z-index: 100;
}
.nav-item {
  flex: 1;
  height: 100%;
  border: none;
  background: none;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  position: relative;
  transition: color var(--transition);
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--primary); }
.nav-item.active i {
  animation: navPop 0.2s ease;
}
@keyframes navPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  background: var(--red);
  color: white;
  border-radius: 10px;
  font-size: 9px;
  padding: 1px 5px;
  font-weight: 700;
}

/* ============ MORE MENU ============ */
.more-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.more-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.more-menu-content {
  position: absolute;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.more-menu-grid button {
  border: none;
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text2);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: all var(--transition);
}
.more-menu-grid button i { font-size: 22px; color: var(--primary); }
.more-menu-grid button:active { background: var(--primary-light); }

/* ============ DASHBOARD ============ */
.dashboard-grid {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-left: 4px solid transparent;
}
.stat-card:active { transform: scale(0.97); }
.stat-card.green { border-left-color: var(--green); }
.stat-card.yellow { border-left-color: var(--yellow); }
.stat-card.red { border-left-color: var(--red); }
.stat-card.blue { border-left-color: var(--primary); }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.green .stat-icon { background: var(--green-light); color: var(--green); }
.yellow .stat-icon { background: var(--yellow-light); color: var(--yellow); }
.red .stat-icon { background: var(--red-light); color: var(--red); }
.blue .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text3); margin-top: 3px; font-weight: 500; }

.card-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.section-title i { color: var(--primary); }
.badge-count {
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}

/* Alerts */
.alerts-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.alert-item:last-child { border-bottom: none; }
.alert-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert-dot.red { background: var(--red); }
.alert-dot.yellow { background: var(--yellow); }
.alert-dot.orange { background: var(--orange); }
.alert-dot.green { background: var(--green); }

/* Month spending */
.month-spending { display: flex; flex-direction: column; gap: 8px; }
.spending-value { font-size: 28px; font-weight: 800; color: var(--text); }
.spending-label { font-size: 12px; color: var(--text3); }
.progress-bar-container {
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--primary));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-bar.warning { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.progress-bar.danger { background: linear-gradient(90deg, var(--orange), var(--red)); }

/* Últimas compras mini */
.purchase-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.purchase-mini:last-child { border-bottom: none; }
.purchase-mini-name { font-weight: 600; color: var(--text); }
.purchase-mini-info { font-size: 11px; color: var(--text3); margin-top: 2px; }
.purchase-mini-value { font-weight: 700; color: var(--primary); }

/* Shopping list mini */
.lista-mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.lista-mini-item:last-child { border-bottom: none; }
.lista-mini-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }

/* ============ PAGE TOOLBAR ============ */
.page-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}
.chip.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.chip.red.active { background: var(--red-light); color: var(--red); border-color: var(--red); }
.chip.yellow.active { background: var(--yellow-light); color: #b45309; border-color: var(--yellow); }
.chip.orange.active { background: var(--orange-light); color: var(--orange); border-color: var(--orange); }
.chip.red2.active { background: var(--red-light); color: var(--red); border-color: var(--red); }
.chip.green.active { background: var(--green-light); color: var(--green); border-color: var(--green); }
.chip.blue.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.sort-filter {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.select-mini {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  max-width: 90px;
}

/* ============ PRODUCTS GRID ============ */
.products-grid {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-left: 4px solid var(--border);
  position: relative;
}
.product-card:active { transform: scale(0.98); }
.product-card.status-ok { border-left-color: var(--green); }
.product-card.status-low { border-left-color: var(--yellow); }
.product-card.status-empty { border-left-color: var(--red); }
.product-card.status-expiring { border-left-color: var(--orange); }
.product-card.status-expired { border-left-color: var(--red); background: var(--red-light); }

.product-photo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}
.product-photo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 22px;
  flex-shrink: 0;
}
.product-info { flex: 1; min-width: 0; }
.product-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.product-qty {
  text-align: right;
  flex-shrink: 0;
}
.product-qty-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.product-qty-unit { font-size: 10px; color: var(--text3); }
.product-status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}
.badge-ok { background: var(--green-light); color: var(--green); }
.badge-low { background: var(--yellow-light); color: #92400e; }
.badge-empty { background: var(--red-light); color: var(--red); }
.badge-expiring { background: var(--orange-light); color: var(--orange); }
.badge-expired { background: var(--red-light); color: var(--red); }

/* ============ ESTOQUE ============ */
.estoque-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
}
.btn-action {
  flex: 1;
  padding: 12px 8px;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.btn-action.green { background: var(--green-light); color: var(--green); }
.btn-action.red { background: var(--red-light); color: var(--red); }
.btn-action.blue { background: var(--primary-light); color: var(--primary); }
.btn-action:active { opacity: 0.8; transform: scale(0.97); }

.movements-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.movement-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.mov-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mov-icon.entrada { background: var(--green-light); color: var(--green); }
.mov-icon.saida { background: var(--red-light); color: var(--red); }
.mov-icon.ajuste { background: var(--primary-light); color: var(--primary); }
.mov-info { flex: 1; }
.mov-produto { font-weight: 600; font-size: 13px; }
.mov-obs { font-size: 11px; color: var(--text3); margin-top: 2px; }
.mov-date { font-size: 10px; color: var(--text3); }
.mov-qty {
  font-weight: 800;
  font-size: 16px;
  text-align: right;
}
.mov-qty.entrada { color: var(--green); }
.mov-qty.saida { color: var(--red); }
.mov-qty.ajuste { color: var(--primary); }

/* ============ LISTA DE COMPRAS ============ */
.lista-summary {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
}
.shopping-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lista-category-group { margin-bottom: 8px; }
.lista-category-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
  margin-bottom: 4px;
}
.lista-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
}
.lista-item.comprado { opacity: 0.6; }
.lista-item.comprado .lista-item-name { text-decoration: line-through; }
.lista-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.lista-item-info { flex: 1; }
.lista-item-name { font-weight: 600; font-size: 14px; }
.lista-item-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.lista-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-urgente { background: var(--red); }
.priority-normal { background: var(--yellow); }
.priority-baixa { background: var(--green); }
.lista-item-actions {
  display: flex;
  gap: 4px;
}
.btn-lista-action {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.btn-share {
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

/* ============ COMPRAS ============ */
.purchases-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.purchase-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
}
.purchase-card:active { transform: scale(0.98); }
.purchase-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.purchase-card-market { font-weight: 700; font-size: 15px; }
.purchase-card-date { font-size: 12px; color: var(--text3); }
.purchase-card-total { font-size: 20px; font-weight: 800; color: var(--primary); }
.purchase-card-info {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text3);
}
.purchase-card-info span { display: flex; align-items: center; gap: 4px; }
.gastos-mes-mini {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
}

/* ============ VALIDADE ============ */
.validity-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.validity-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.validity-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.validity-badge.expired { background: var(--red-light); color: var(--red); }
.validity-badge.days7 { background: var(--orange-light); color: var(--orange); }
.validity-badge.days15 { background: var(--yellow-light); color: #92400e; }
.validity-badge.days30 { background: var(--primary-light); color: var(--primary); }
.validity-badge.ok { background: var(--green-light); color: var(--green); }
.validity-info { flex: 1; }
.validity-name { font-weight: 600; font-size: 13px; }
.validity-date { font-size: 11px; color: var(--text3); }

/* ============ RELATÓRIOS ============ */
.relatorios-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}
.relatorios-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.relatorio-content { display: none; padding: 16px; }
.relatorio-content.active { display: block; }
.chart-container { position: relative; }
.report-table { margin-top: 16px; }
.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.report-row:last-child { border-bottom: none; }
.report-row-label { font-weight: 600; }
.report-row-value { font-weight: 700; color: var(--primary); }

/* ============ FINANCEIRO ============ */
.financeiro-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
}
.month-nav button {
  border: none;
  background: var(--surface2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.financeiro-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
}
.fin-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.fin-label { font-size: 11px; color: var(--text3); display: block; margin-bottom: 4px; }
.fin-value { font-size: 15px; font-weight: 800; color: var(--text); }
.orcamento-config {
  padding: 12px 16px;
  background: var(--surface);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.orcamento-config label { font-size: 12px; color: var(--text3); display: block; margin-bottom: 8px; }
.input-row { display: flex; gap: 8px; align-items: center; }

/* ============ MERCADOS ============ */
.markets-list, .locals-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.market-card, .local-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.market-icon, .local-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.market-info, .local-info { flex: 1; }
.market-name, .local-name { font-weight: 700; font-size: 15px; }
.market-address, .local-count { font-size: 12px; color: var(--text3); margin-top: 2px; }
.market-stats { text-align: right; }
.market-total { font-weight: 700; color: var(--primary); font-size: 15px; }
.market-visits { font-size: 11px; color: var(--text3); }
.card-actions {
  display: flex;
  gap: 6px;
}
.btn-card-action {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.btn-card-action.danger { color: var(--red); }

/* ============ CONFIGURAÇÕES ============ */
.config-list { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.config-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.config-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.config-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}
.config-item i { color: var(--primary); width: 20px; text-align: center; }
.config-item.danger { color: var(--red); }
.config-item.danger i { color: var(--red); }
.toggle-item {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.toggle-item span { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.about-info { font-size: 13px; color: var(--text3); line-height: 1.7; }
.about-info strong { color: var(--text); }
.categories-manage { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.category-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}
.category-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.category-tag-name { flex: 1; }
.btn-delete-cat {
  border: none;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-size: 13px;
}
.danger-zone .config-item.danger { padding: 12px 16px; border-radius: var(--radius-sm); }

/* ============ FAB ============ */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(33,150,243,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  transition: all var(--transition);
}
.fab:active { transform: scale(0.92); box-shadow: 0 2px 8px rgba(33,150,243,0.3); }

/* ============ MODALS ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
  overflow: hidden;
}
.modal-content.modal-large { max-height: 95dvh; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-header button {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface2);
  border-radius: 50%;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============ FORM ELEMENTS ============ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}
.input-field:focus { border-color: var(--primary); }
.input-field.textarea { resize: vertical; min-height: 80px; }
select.input-field { cursor: pointer; }

.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
}
.form-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}
.form-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.form-tab-content { display: none; }
.form-tab-content.active { display: block; }

.photo-upload {
  width: 100%;
  height: 140px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition);
}
.photo-upload:hover { border-color: var(--primary); }
#prodFotoPlaceholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text3);
}
#prodFotoPlaceholder i { font-size: 32px; }
#prodFotoPlaceholder span { font-size: 13px; font-weight: 600; }

.barcode-input { display: flex; gap: 8px; }
.barcode-input .input-field { flex: 1; }
.btn-camera {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.btn-cancel {
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-save {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-save:active { opacity: 0.85; transform: scale(0.98); }
.btn-full {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-full.blue { background: var(--primary-light); color: var(--primary); }

/* ============ COMPRA ITENS ============ */
.compra-itens { display: flex; flex-direction: column; gap: 10px; }
.compra-item-row {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.compra-item-row .form-row { margin-bottom: 0; }
.compra-item-row input, .compra-item-row select {
  background: var(--surface);
  margin-bottom: 0;
}
.btn-remove-item {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  float: right;
  margin-bottom: 6px;
}
.btn-add-item {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  transition: all var(--transition);
}
.btn-add-item:hover { border-color: var(--primary); color: var(--primary); }
.compra-total {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 0 0;
  color: var(--text);
}

/* ============ ICON PICKER ============ */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-opt {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}
.icon-opt.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* ============ DETALHE PRODUTO ============ */
.detalhe-foto {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.detalhe-status-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detalhe-section { margin-bottom: 16px; }
.detalhe-section h4 {
  font-size: 12px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.detalhe-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detalhe-row:last-child { border-bottom: none; }
.detalhe-row-label { color: var(--text3); }
.detalhe-row-value { font-weight: 600; color: var(--text); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1A202C;
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9000;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.theme-dark .toast { background: var(--surface2); }
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success::before { content: '✅ '; }
.toast.error::before { content: '❌ '; }
.toast.warning::before { content: '⚠️ '; }
.toast.info::before { content: 'ℹ️ '; }

/* ============ EMPTY STATES ============ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.empty-state i { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* ============ NOTIFICATION ITEMS ============ */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============ UTILS ============ */
.text-green { color: var(--green) !important; }
.text-yellow { color: var(--yellow) !important; }
.text-red { color: var(--red) !important; }
.text-blue { color: var(--primary) !important; }
.text-orange { color: var(--orange) !important; }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.no-data {
  text-align: center;
  padding: 24px;
  color: var(--text3);
  font-size: 13px;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 480px) {
  .app-wrapper { box-shadow: 0 0 40px rgba(0,0,0,0.15); }
  .fab { right: calc(50% - 240px + 20px); }
  .toast { max-width: 400px; }
}

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

/* ============ PRINT ============ */
@media print {
  .bottom-nav, .top-bar, .fab, .modal { display: none !important; }
  .main-content { overflow: visible; }
  .page { display: block !important; }
}
