/* =============================================
   Sistema Financeiro - Estilos personalizados
   ============================================= */

/* Botões extra-pequenos */
.btn-xs {
  padding: 2px 7px;
  font-size: 0.75rem;
  line-height: 1.4;
  border-radius: 4px;
}

/* Tabela compacta */
.table-sm td,
.table-sm th {
  padding: 0.35rem 0.5rem;
}

/* Card estatísticas */
.stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1) !important;
}

/* Linha vencida na tabela */
tr.vencido td {
  background-color: rgba(220,53,69,.06) !important;
}

/* Scrollbar fina para tabelas */
.table-responsive::-webkit-scrollbar {
  height: 5px;
}
.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Badge de status inline */
.badge-pago { background: #d4edda; color: #155724; }
.badge-pendente { background: #fff3cd; color: #856404; }
.badge-cancelado { background: #e2e3e5; color: #383d41; }

/* Formulário de novo lançamento - destaque */
#formLanc .card-body {
  background: #f8f9ff;
}

/* Gráficos responsivos */
canvas {
  max-width: 100%;
}

/* Navbar link ativo */
.navbar-nav .nav-link.active {
  font-weight: 600;
}

/* Footer fixo na base */
footer {
  position: relative;
}

/* WhatsApp button */
.btn-whatsapp {
  background-color: #25d366;
  color: #fff;
  border: none;
}
.btn-whatsapp:hover {
  background-color: #1ebe5d;
  color: #fff;
}

/* Print */
@media print {
  .navbar, footer, .btn, .alert, .calc-fab, .calc-widget { display: none !important; }
}

/* Login hero animado (apenas auth) */
.auth-page .auth-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 95%, rgba(255,255,255,0.045) 96%),
    linear-gradient(90deg, transparent 95%, rgba(255,255,255,0.045) 96%);
  background-size: 44px 44px;
}

.auth-page .auth-hero-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-page .hero-area {
  fill: url(#heroArea);
  animation: heroAreaFloat 8s ease-in-out infinite;
}

.auth-page .hero-wave {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.32));
}

.auth-page .hero-wave-a {
  stroke: url(#heroLineA);
  stroke-dasharray: 18 8;
  animation: authWaveShift 10s linear infinite;
}

.auth-page .hero-wave-b {
  stroke: url(#heroLineB);
  stroke-width: 2.7;
  stroke-dasharray: 13 10;
  animation: authWaveShift 14s linear infinite reverse;
}

.auth-page .hero-bars rect {
  fill: rgba(56, 189, 248, 0.32);
  stroke: rgba(125, 211, 252, 0.45);
  stroke-width: 1;
  animation: heroBarsPulse 2.2s ease-in-out infinite;
}

.auth-page .hero-bars rect:nth-child(2n) {
  animation-delay: .35s;
}

.auth-page .hero-candles line {
  stroke: rgba(148, 163, 184, 0.55);
  stroke-width: 2;
}

.auth-page .hero-candles rect {
  fill: rgba(45, 212, 191, 0.45);
  stroke: rgba(94, 234, 212, 0.6);
  stroke-width: 1;
}

.auth-page .hero-points circle {
  fill: rgba(125, 211, 252, 0.9);
  animation: authPulse 2.6s ease-in-out infinite;
}

.auth-page .hero-points circle:nth-child(2) { animation-delay: .55s; }
.auth-page .hero-points circle:nth-child(3) { animation-delay: 1.1s; }

.auth-page .auth-hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 16% 8%, rgba(56, 189, 248, 0.22), rgba(56, 189, 248, 0) 42%),
    radial-gradient(ellipse at 82% 92%, rgba(45, 212, 191, 0.16), rgba(45, 212, 191, 0) 40%),
    linear-gradient(180deg, rgba(6, 11, 25, 0.30), rgba(2, 6, 23, 0.70));
}

.auth-page .auth-card {
  position: relative;
  z-index: 2;
}

@keyframes authWaveShift {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -280; }
}

@keyframes authPulse {
  0%, 100% { opacity: .42; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}

@keyframes heroAreaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes heroBarsPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .95; }
}

@media (max-width: 767.98px) {
  .auth-page .auth-hero,
  .auth-page .auth-hero-overlay {
    opacity: .68;
  }

  .auth-page .hero-bars,
  .auth-page .hero-candles {
    opacity: .65;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .hero-area,
  .auth-page .hero-wave-a,
  .auth-page .hero-wave-b,
  .auth-page .hero-bars rect,
  .auth-page .hero-points circle {
    animation: none !important;
  }
}

/* Atalhos mobile (app-like) */
.mobile-quickbar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1040;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(13, 110, 253, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
  display: none;
  padding: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.mobile-quickbar__item {
  border: 0;
  background: transparent;
  text-decoration: none;
  color: #495057;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  padding: 6px 2px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
}

.mobile-quickbar__item i {
  font-size: 18px;
}

.mobile-quickbar__item.active {
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.08);
}

.mobile-quickbar__item.quickbar-add i {
  color: #198754;
  font-size: 21px;
}

@media (max-width: 991.98px) {
  .mobile-quickbar {
    display: grid;
  }

  main.container-fluid {
    padding-bottom: 84px !important;
  }
}

/* Calculadora flutuante */
.calc-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #0d6efd, #3b82f6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(13, 110, 253, 0.35);
  z-index: 1060;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.calc-fab:active {
  cursor: grabbing;
}

.calc-fab i {
  font-size: 20px;
}

.calc-widget {
  position: fixed;
  width: 280px;
  max-width: calc(100vw - 24px);
  border-radius: 14px;
  border: 1px solid rgba(13, 110, 253, 0.25);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  background: #fff;
  z-index: 1061;
}

.calc-widget__header {
  background: linear-gradient(135deg, #0d6efd, #2563eb);
  color: #fff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.calc-widget__body {
  padding: 10px;
}

.calc-result {
  min-height: 40px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
  padding: 8px 10px;
  text-align: right;
  font-weight: 700;
  font-size: 1.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.2px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.calc-grid .btn {
  font-weight: 600;
}
