﻿/* =========================
   VARIÁVEIS (INALTERADAS)
========================= */
:root {
  --bg: #03082e;
  --card-bg: #0a1045;
  --green: #4d9fff;
  --green-dark: #1a6fd4;
  --red: #ef4444;
  --text: #e2e8f0;
  --border: #1a2a6c;
}

/* =========================
   RESET (INALTERADO)
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  transition: all 0.2s ease-in-out;
}

/* =========================
   BODY (INALTERADO)
========================= */
body {
  background: radial-gradient(ellipse at top, #0d1b6e 0%, #03082e 60%);
  color: var(--text);
  padding: 20px;
  min-height: 100vh;
}

/* =========================
   CONTAINER
========================= */
.container {
  max-width: 1000px;
  margin: auto;
  animation: fadeIn 0.5s ease;
}

/* ANIMAÇÃO (INALTERADA)
========================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   HEADER
========================= */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.logo h1 {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 2px;
  font-size: 1.2rem;
}

.logo span {
  color: var(--green);
}

#status-dot {
  font-size: 10px;
  color: #ef4444;
  transition: color 0.5s;
}

#status-dot.connected {
  color: #22c55e;
}

.neon-icon {
  color: var(--green);
  margin-right: 10px;
  font-size: 1.5rem;
}

/* =========================
   TOTAL HUB
========================= */
.total-hub {
  background: linear-gradient(135deg, #0a1a6e, #0a1045);
  border: 1px solid #1a3a8c;
  padding: 30px;
  border-radius: 12px;
  margin: 30px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: 0 4px 30px rgba(30, 80, 200, 0.3);
}

.total-hub::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(var(--green), var(--green-dark));
  border-radius: 12px 0 0 12px;
}

.total-hub h2 {
  font-size: 2.5rem;
  color: var(--green);
  font-family: "Orbitron";
}

/* =========================
   CHART
========================= */
.chart-container {
  max-width: 400px;
  margin: 0 auto 30px auto;
}

/* =========================
   FORM
========================= */
.form-container {
  background: linear-gradient(135deg, #0a1a6e, #0a1045);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid #1a3a8c;
  box-shadow: 0 4px 30px rgba(30, 80, 200, 0.3);
}

#gasto-form {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1.2fr 1.2fr auto;
  gap: 15px;
  align-items: end;
}

/* =========================
   INPUTS
========================= */
.input-box {
  position: relative;
}

.input-box input,
.input-box select {
  width: 100%;
  padding: 8px;
  background: rgba(3, 8, 46, 0.8);
  border: 1px solid #1a3a8c;
  border-radius: 6px;
  color: var(--text);
  outline: none;
}

.input-box input:focus,
.input-box select:focus {
  border-color: var(--green);
}

.input-box select {
  padding: 10px;
  appearance: none;
}

.input-box label {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #64748b;
  transition: 0.3s;
  pointer-events: none;
}

.input-box input:focus ~ label,
.input-box input:not(:placeholder-shown) ~ label {
  top: -15px;
  font-size: 12px;
  color: var(--green);
}

.input-box input[type="date"] ~ label,
.input-box select ~ label {
  top: -15px;
  font-size: 12px;
  color: var(--green);
}

/* =========================
   BOTÃO PRINCIPAL
========================= */
.btn-neon {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  border: none;
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 0 15px rgba(77,159,255,0.4);
}

.btn-neon:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(77,159,255,0.6);
}

/* =========================
   TABELA
========================= */
.table-container {
  background: linear-gradient(135deg, #0a1a6e, #0a1045);
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid #1a3a8c;
  box-shadow: 0 4px 30px rgba(30, 80, 200, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: rgba(0,0,0,0.3);
  padding: 15px 10px;
  text-align: left;
  color: var(--green);
  font-size: 0.8rem;
}

td {
  padding: 10px;
  border-bottom: 1px solid #1a2a6c;
  font-size: 0.9rem;
}

/* MELHORIA SEM ALTERAR DESIGN */
tr:hover {
  background: rgba(77, 159, 255, 0.08);
}

/* =========================
   DELETE
========================= */
.btn-delete {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.btn-delete:hover {
  background: var(--red);
  color: #fff;
}

/* =========================
   CSV BUTTON
========================= */
.btn-csv {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  border: none;
  padding: 15px 25px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.btn-csv:hover {
  transform: scale(1.05);
}

/* =========================
   FIXES TÉCNICOS
========================= */

/* remove setas input number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* melhora acessibilidade sem mudar visual */
button {
  outline: none;
}

/* evita bug de zoom em mobile input focus */
input, select {
  font-size: 16px;
}