:root {
  --bg: #090d16;
  --surface: #0f172a;
  --surface-hover: #141f36;
  --surface-active: #1a2744;
  --border: #1e293b;
  --border-light: rgba(255, 255, 255, 0.08);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --gabriel: #10b981;
  --gabriel-light: #34d399;
  --gabriel-bg: rgba(16, 185, 129, 0.12);
  
  --esposa: #8b5cf6;
  --esposa-light: #a78bfa;
  --esposa-bg: rgba(139, 92, 246, 0.12);
  
  --cyan: #06b6d4;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
}

/* ── Container Geral ── */
.app-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-title span {
  color: var(--gabriel-light);
}

/* Seletor de Perfil Ativo */
.user-selector {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
}

.user-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-btn.active.gabriel {
  background: var(--gabriel);
  color: #ffffff;
}

.user-btn.active.esposa {
  background: var(--esposa);
  color: #ffffff;
}

/* ── Navegador de Mês ── */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.month-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: 0.15s;
}

.month-btn:hover {
  background: var(--border);
  color: var(--text-main);
}

.month-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}

/* ── Card Resumo do Mês ── */
.summary-card {
  background: linear-gradient(145deg, #111a2e 0%, #0d1322 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

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

.summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.summary-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.summary-value {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

/* Barra de Divisão Casal */
.couple-split {
  margin-top: 14px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.split-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.split-label-gabriel {
  color: var(--gabriel-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.split-label-esposa {
  color: var(--esposa-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.split-bar-bg {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}

.split-bar-gabriel {
  background: linear-gradient(90deg, #059669, #34d399);
  height: 100%;
  transition: width 0.4s ease;
}

.split-bar-esposa {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  height: 100%;
  transition: width 0.4s ease;
}

/* ── Categorias Horizontais ── */
.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

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

.cat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.cat-pill.active {
  background: #1e293b;
  color: #ffffff;
  border-color: var(--gabriel-light);
}

/* ── Ações Rápidas ── */
.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-secondary {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.15s;
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

/* ── Lista de Gastos ── */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.feed-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gastos-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gasto-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s, background 0.15s;
}

.gasto-item:hover {
  background: var(--surface-hover);
}

.gasto-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #141d2e;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

.gasto-estabelecimento {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gasto-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.badge-resp {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-resp.Gabriel {
  background: var(--gabriel-bg);
  color: var(--gabriel-light);
}

.badge-resp.Esposa {
  background: var(--esposa-bg);
  color: var(--esposa-light);
}

.gasto-valor {
  text-align: right;
  flex-shrink: 0;
}

.gasto-preco {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.gasto-metodo {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.gasto-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.btn-icon-del {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 14px;
  transition: 0.15s;
}

.btn-icon-del:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

/* Estado Vazio */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ── BOTÃO FLUTUANTE DE SCANNER (FAB) ── */
.fab-container {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 40;
  pointer-events: none;
}

.btn-scan-fab {
  pointer-events: auto;
  background: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  color: #ffffff;
  border: none;
  padding: 14px 26px;
  border-radius: 35px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-scan-fab:active {
  transform: scale(0.95);
}

/* ── MODAIS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.2s ease forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

/* Modal Bottom Sheet */
.origem-opcoes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.origem-btn {
  background: #141d2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  color: var(--text-main);
  width: 100%;
}

.origem-btn:hover {
  background: var(--surface-hover);
  border-color: var(--cyan);
}

.origem-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.origem-info strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 2px;
}

.origem-info span {
  font-size: 11px;
  color: var(--text-dim);
}

/* Animação do Scanner IA */
.scanner-anim-box {
  position: relative;
  width: 100%;
  height: 180px;
  background: #090d16;
  border: 2px dashed #14b8a6;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
}

.laser-beam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #22d3ee, #10b981, transparent);
  box-shadow: 0 0 15px #10b981;
  animation: scanLaser 1.8s ease-in-out infinite alternate;
}

@keyframes scanLaser {
  0% { top: 5%; }
  100% { top: 92%; }
}

.scanner-text {
  font-size: 13px;
  font-weight: 700;
  color: #2dd4bf;
  margin-top: 10px;
}

/* Formulário do Gasto */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #090d16;
  border: 1.5px solid var(--border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gabriel-light);
}

.form-input-lg {
  font-size: 24px;
  font-weight: 900;
  color: var(--gabriel-light);
  text-align: center;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 12px;
  transition: opacity 0.15s;
}

.btn-primary:active {
  opacity: 0.9;
}
