/* style.css - Design de Alta Fidelidade com Efeito Vidro (Glassmorphism) */

:root {
  --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #030712 100%);
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --card-bg: rgba(30, 41, 59, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Cores Temáticas dos Lançamentos */
  --color-dinheiro: #10b981;
  --color-dinheiro-glow: rgba(16, 185, 129, 0.25);
  --color-pix: #06b6d4;
  --color-pix-glow: rgba(6, 182, 212, 0.25);
  --color-premio: #f59e0b;
  --color-premio-glow: rgba(245, 158, 11, 0.25);
  --color-gasto: #ef4444;
  --color-gasto-glow: rgba(239, 68, 68, 0.25);
  
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Geral */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 60px;
  position: relative;
  overflow-x: hidden;
}

/* Esferas de Efeito Brilho Traseiro */
.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

.glow-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0) 70%);
  top: -100px;
  left: -150px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0) 70%);
  bottom: 20%;
  right: -200px;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0) 70%);
  top: 40%;
  left: 25%;
}

/* Layout Container */
.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Cabeçalho */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.app-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Tabs Navegação */
.navigation-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Seções de Abas */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* Grid Principal */
.main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

/* Estilo Cartão (Glassmorphism) */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-header {
  margin-bottom: 24px;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.card-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Formulário e Grupos */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group.relative {
  position: relative;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="text"],
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-fast);
  outline: none;
}

input[type="text"] {
  padding-left: 44px;
}

input[type="number"] {
  padding-left: 44px;
}

input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(15, 23, 42, 0.85);
}

.row-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Selecionador de tipo de Lançamento (Chips Rápidos) */
.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-selector input[type="radio"] {
  display: none;
}

.type-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
  text-align: center;
  user-select: none;
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition-fast);
}

/* Hover e Estados Ativos do Chip */
.type-chip:hover {
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
}

.type-selector input[value="entrada_dinheiro"]:checked + .type-chip {
  background: var(--color-dinheiro-glow);
  border-color: var(--color-dinheiro);
  color: var(--color-dinheiro);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.type-selector input[value="entrada_dinheiro"]:checked + .type-chip .chip-dot {
  background: var(--color-dinheiro);
}

.type-selector input[value="entrada_pix"]:checked + .type-chip {
  background: var(--color-pix-glow);
  border-color: var(--color-pix);
  color: var(--color-pix);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}
.type-selector input[value="entrada_pix"]:checked + .type-chip .chip-dot {
  background: var(--color-pix);
}

.type-selector input[value="premio"]:checked + .type-chip {
  background: var(--color-premio-glow);
  border-color: var(--color-premio);
  color: var(--color-premio);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}
.type-selector input[value="premio"]:checked + .type-chip .chip-dot {
  background: var(--color-premio);
}

.type-selector input[value="gasto"]:checked + .type-chip {
  background: var(--color-gasto-glow);
  border-color: var(--color-gasto);
  color: var(--color-gasto);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}
.type-selector input[value="gasto"]:checked + .type-chip .chip-dot {
  background: var(--color-gasto);
}

/* Autocomplete Inteligente */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 0 12px 12px;
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.autocomplete-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  user-select: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.5);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.35);
}

.btn-success:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.5);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.45);
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.btn-icon {
  padding: 10px 14px;
  font-size: 13px;
}

/* Painel de Dashboard e Cards */
.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.summary-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

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

.card-info h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-info .value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}

.card-icon {
  font-size: 24px;
  opacity: 0.9;
}

/* Estilização Individual dos Cards de Resumo */
.card-dinheiro::before { background: var(--color-dinheiro); }
.card-premios::before { background: var(--color-premio); }
.card-gastos::before { background: var(--color-gasto); }
.card-pix::before { background: var(--color-pix); }

.badge-pix {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-pix);
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 6px;
}

/* Card Especial de Saldo */
.saldo-card {
  padding: 28px;
  position: relative;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

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

.saldo-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.saldo-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.saldo-actions {
  display: flex;
  gap: 8px;
}

.saldo-value {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 20px;
  transition: var(--transition-normal);
}

.saldo-value.positive {
  color: var(--color-dinheiro);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.saldo-value.negative {
  color: var(--color-gasto);
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.closure-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0 20px 0;
}

.closure-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
}

.closure-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tabelas */
.table-card {
  margin-top: 10px;
}

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

.table-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.table-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.table-filters input {
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 8px;
  width: 220px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.max-h-350 {
  max-height: 350px;
  overflow-y: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.app-table th,
.app-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-table th {
  font-weight: 700;
  text-transform: uppercase;
  color: #cbd5e1;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.3);
}

.app-table td {
  color: #cbd5e1;
  font-weight: 500;
}

.app-table tbody tr {
  transition: var(--transition-fast);
}

.app-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.text-success { color: var(--color-dinheiro) !important; }
.text-info { color: var(--color-pix) !important; }
.text-red { color: var(--color-gasto) !important; }
.text-orange { color: var(--color-premio) !important; }

/* Status Badges */
.badge-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-status.dinero {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-dinheiro);
}

.badge-status.pix {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-pix);
}

.badge-status.premio {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-premio);
}

.badge-status.gasto {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-gasto);
}

/* ── Cards de Lançamentos (Mobile-First) ────── */
.lancamento-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 4px solid #94a3b8;
  border-radius: 12px;
  padding: 12px 14px 10px;
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.lancamento-card:hover {
  background: rgba(30, 41, 59, 0.75);
}

.lancamento-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.lancamento-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.lancamento-card-cliente {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lancamento-card-data {
  font-size: 12px;
  color: var(--text-muted);
}

.lancamento-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.lancamento-card-valor {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.lancamento-card-actions {
  display: flex;
  gap: 8px;
}

.card-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.card-action-edit {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

.card-action-edit:hover {
  background: rgba(59, 130, 246, 0.2);
}

.card-action-delete {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.card-action-delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

.lancamento-vazio {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 0;
  font-size: 14px;
}

/* Botões de Ação na Tabela */
.action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
}

.action-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-gasto);
}

.btn-detail {
  color: var(--accent-color);
}
.btn-detail:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.action-btn-edit {
  color: #60a5fa;
}
.action-btn-edit:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* Modais */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 17, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

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

.modal-content {
  background: rgba(21, 32, 54, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.open .modal-content {
  transform: scale(1);
}

.modal-large {
  max-width: 760px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  text-align: left;
}

.modal-body p {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.6;
}

.modal-period-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.modal-period-date label {
  font-size: 11px;
}

.danger-warning {
  margin-top: 24px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #fca5a5;
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.footer-actions-left {
  margin-right: auto;
}

/* Detalhes do Histórico */
.detalhe-totais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.detalhe-total-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detalhe-total-card span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detalhe-total-card strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #cbd5e1;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Sistema de Toast/Notificações */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1010;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  width: 100%;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
  border-left: 4px solid var(--color-dinheiro);
}

.toast.error {
  border-left: 4px solid var(--color-gasto);
}

.toast.info {
  border-left: 4px solid var(--accent-color);
}

/* Animações CSS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Ocultar template do PDF de forma que o html2pdf consiga renderizar (off-screen) */
.pdf-only {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 794px; /* A4 width */
  background: #ffffff !important;
  color: #000000 !important;
}

/* Responsividade */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 14px;
  }
  
  .app-header {
    margin-bottom: 24px;
  }
  
  .card {
    padding: 18px;
  }
}

@media (max-width: 540px) {
  .app-container {
    padding: 8px;
  }
  
  .app-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    margin-bottom: 18px;
  }
  
  .header-brand {
    flex-direction: column;
    gap: 8px;
  }
  
  .navigation-tabs {
    width: 100%;
    justify-content: space-around;
  }
  
  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 13px;
    gap: 6px;
  }
  
  .card {
    padding: 14px;
    border-radius: 16px;
  }
  
  .row-inputs {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .type-selector {
    gap: 8px;
  }
  
  .type-chip {
    padding: 10px;
    font-size: 12px;
  }
  
  /* Mantém 2 colunas nos totais para economizar espaço e evitar rolagem infinita */
  .summary-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .summary-card {
    padding: 12px;
    border-radius: 12px;
  }
  
  .card-info h3 {
    font-size: 9.5px;
  }
  
  .card-info .value {
    font-size: 15px;
    margin-top: 4px;
  }
  
  .card-icon {
    font-size: 18px;
  }
  
  /* Card do Saldo */
  .saldo-card {
    padding: 16px;
  }
  
  .saldo-header h2 {
    font-size: 14px;
  }
  
  .saldo-value {
    font-size: 26px;
    margin-bottom: 12px;
  }
  
  .closure-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .closure-text {
    text-align: center;
  }
  
  /* Ajuste das tabelas no celular */
  .app-table th,
  .app-table td {
    padding: 10px 8px;
    font-size: 11.5px;
  }
  
  .table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .table-filters input {
    width: 100%;
  }
  
  .action-btn {
    padding: 4px;
  }
  
  /* Modais no celular */
  .modal-content {
    border-radius: 16px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-period-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
  }
  
  .footer-actions-left {
    margin-right: 0;
    width: 100%;
  }
  
  .modal-footer button {
    width: 100%;
  }
  
  .detalhe-totais-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .detalhe-total-card {
    padding: 8px;
  }
  
  .detalhe-total-card strong {
    font-size: 13px;
  }
}

/* ==================== ESTILOS DE IMPRESSÃO A4 (Para PDF) ==================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  .app-container,
  .modal-backdrop,
  .toast-container,
  .glow-sphere {
    display: none !important;
  }
  
  .pdf-only {
    display: block !important;
    padding: 20px;
    color: #000;
  }
  
  .pdf-header {
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  
  .pdf-header h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
  }
  
  .pdf-header p {
    font-size: 12px;
    color: #555;
    margin: 2px 0 0 0;
  }
  
  .pdf-totais-box {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 24px;
  }
  
  .pdf-total-card {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
  }
  
  .pdf-total-card span {
    font-size: 9px;
    text-transform: uppercase;
    color: #666;
    display: block;
    margin-bottom: 4px;
  }
  
  .pdf-total-card strong {
    font-size: 14px;
    font-weight: 700;
    color: #000;
  }
  
  .pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
  }
  
  .pdf-table th, 
  .pdf-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    font-size: 11px;
    text-align: left;
  }
  
  .pdf-table th {
    background-color: #f3f4f6;
    font-weight: 700;
  }
  
  .text-right {
    text-align: right;
  }
}

/* ── Estilos da Tela de Login / Autenticação (Premium) ────── */
.login-card {
  max-width: 420px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.2) !important;
  padding: 32px 28px !important;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px 6px 8px;
  border-radius: 30px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.login-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.login-brand-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #60a5fa;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.login-header p {
  font-size: 13px;
  color: #94a3b8;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.login-input {
  width: 100%;
  font-size: 16px !important;
  letter-spacing: 3px;
  padding: 13px 44px 13px 44px !important;
  background: rgba(30, 41, 59, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  color: #f8fafc !important;
  transition: all 0.2s ease !important;
}

.login-input:focus {
  border-color: #3b82f6 !important;
  background: rgba(30, 41, 59, 0.95) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25) !important;
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.toggle-password-btn:hover {
  color: #94a3b8;
}

.login-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.btn-login-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
  transition: all 0.2s ease !important;

}

.btn-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5) !important;
}

.btn-login-submit:active {
  transform: translateY(1px);
}

.login-footer {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.btn-lock {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-lock:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
}

/* Animação Shake para erro de senha */
.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}


