/* =========================
   RESET + VARIÁVEIS
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
  --bg: #0f172a;
  --bg-light: #111827;
  --card: #1e293b;
  --primary: #22c55e;
  --danger: #ef4444;
  --info: #3b82f6;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --radius: 14px;
}

/* =========================
   BODY
========================= */
body {
  background: linear-gradient(135deg, #020617, #0f172a);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
  width: 100%;
  max-width: 280px;
  background: rgba(15, 23, 42, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar h2 {
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.sidebar button {
  background: none;
  border: none;
  color: var(--text);
  padding: 14px;
  text-align: left;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: 0.25s;
}

.sidebar button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =========================
   CONTEÚDO
========================= */
.content {
  flex: 1;
  padding: 24px;
}

/* =========================
   PÁGINAS
========================= */
.page {
  display: none;
  animation: fade 1s ease;
}

.page.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   CARDS DASHBOARD
========================= */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: linear-gradient(145deg, #1e293b, #020617);
  padding: 22px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card span {
  font-size: 0.9rem;
  color: var(--muted);
}

.card strong {
  font-size: 1.6rem;
}

.card.green strong {
  color: var(--primary);
}

.card.red strong {
  color: var(--danger);
}

.card.blue strong {
  color: var(--info);
}

/* =========================
   BOX INPUT
========================= */
.box {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-direction: column;
}

/* =========================
   INPUTS
========================= */
input {
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  background: #020617;
  color: var(--text);
  font-size: 1rem;
}

input::placeholder {
  color: var(--muted);
}

/* =========================
   BOTÕES
========================= */
button {
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  background: var(--primary);
  color: #052e16;
  transition: 0.25s;
}

button:hover {
  opacity: 0.85;
}

button.danger {
  background: var(--danger);
  color: #450a0a;
}

/* =========================
   LISTAS
========================= */
ul {
  list-style: none;
  margin-top: 16px;
}

li {
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

li button {
  background: none;
  color: var(--danger);
  font-size: 1.1rem;
}

/* =========================
   GRÁFICO
========================= */
.grafico-box {
  background: var(--card);
  padding: 10px;
  border-radius: 12px;
  margin-top: 20px;
}

.grafico-box canvas {
  content: normal;
}

/* =========================
   FILTRO MÊS
========================= */
.filtro-mes {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter {
  color: var(--text);
  background: var(--card);
}

/* =========================
   RESPONSIVO
========================= */
@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;

    height: 64px;
    max-width: none;
    width: 100%;

    flex-direction: row;
    justify-content: space-around;
    align-items: center;

    padding: 8px 8px;
    border-right: none;
    border-radius: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    background-color: #020617;
  }

  .sidebar h2 {
    display: none;
  }

  .sidebar button {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.9rem;
  }

  .content {
    padding-bottom: 80px;
    /* espaço pra barra não cobrir conteúdo */
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }

  .box-gastos {
    width: clamp(350px, 100%, 450px);
    padding: 24px;
    text-align: center;
    margin-left: 350px;
  }
}