﻿/* === Variáveis Globais === */
:root {
  --bg:#f2f2f2;
  --card-bg: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --success: #16a34a;
  --danger: #dc2626;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 3px 6px rgba(0,0,0,0.08);
}

/* === Reset / Global === */
* {
  box-sizing: border-box;
  margin: auto;
  padding: auto;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Estilo para spans - CADA SPAN EM UMA LINHA === */
span {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}

/* === Cabeçalho === */
header {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}

header div {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header strong {
  font-size: 1.2rem;
  font-weight: 600;
}

header nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 12px;
  font-size: 0.95rem;
}

header nav a:hover {
  text-decoration: underline;
}

/* === Layout Principal === */
main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 16px;
}

/* === Títulos === */
h2, h3 {
  margin-bottom: 10px;
  color: #2d3436;
}

/* === Formulários === */
form {
  background: var(--card-bg);
  padding: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

input, select, button {
  width: 100%;
  padding: 8px 10px;
  margin: 6px 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

button:hover {
  background: var(--primary-dark);
}

/* === Tabelas === */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f1f3f5;
}

/* === Dashboard / Gráfico === */
.dashboard-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 350px;
  max-width: 420px;
}

.dashboard-card h3 {
  margin-bottom: 15px;
  text-align: center;
}

/* === Resumo (Receita / Despesa / Saldo) === */
.dashboard-summary {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dashboard-summary .card {
  flex: 1;
  min-width: 120px;
  background: var(--card-bg);
  padding: 15px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s;
}

.dashboard-summary .card:hover {
  transform: translateY(-3px);
}

.dashboard-summary .income h4 { color: var(--success); }
.dashboard-summary .expense h4 { color: var(--danger); }
.dashboard-summary .balance h4.positive { color: #2c3e50; }
.dashboard-summary .balance h4.negative { color: var(--danger); }

.dashboard-summary p {
  font-size: 1.4em;
  font-weight: bold;
  margin-top: 5px;
}

/* === Containers / Layout Responsivo === */
section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px;
}

@media (max-width: 768px) {
  section {
    flex-direction: column;
  }

  table, form, button {
    font-size: 14px;
  }
}