/* =========================================================
   Orlando & Miami 2027 — tema "parques + pôr do sol tropical"
   ========================================================= */

:root {
  /* Fundo: azul-noite tropical com profundidade */
  --bg: #0d1b2a;
  --bg-grad-1: #12263f;
  --bg-grad-2: #0a1622;
  --surface: #16263b;
  --surface-strong: #1e3350;
  --border: #2c4a6b;

  /* Paleta Orlando/Miami */
  --coral: #ff6b6b;        /* pôr do sol de Miami */
  --sunset: #ff8e53;       /* laranja */
  --gold: #ffd166;         /* dourado mágico */
  --teal: #2ec4b6;         /* água dos parques */
  --sky: #4ea8de;          /* céu da Flórida */
  --purple: #9b5de5;       /* magia / noite */
  --pink: #f15bb5;         /* neon Miami */

  --accent: #ff6b6b;
  --accent-2: #4ea8de;

  /* Texto — alto contraste (WCAG AA) */
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #b8c6d9;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow-glow: 0 0 24px rgba(255,107,107,.25);
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,142,83,.18), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(78,168,222,.18), transparent 55%),
    linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 90px; /* espaço para navbar inferior */
  line-height: 1.5;
}

a { color: var(--sky); text-decoration: none; }

/* ---------------- Header ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(90deg, rgba(255,107,107,.15), rgba(78,168,222,.12));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; letter-spacing: .3px;
}
.topbar .brand .emoji { font-size: 1.5rem; }
.topbar .brand small { display:block; font-weight:400; font-size:.7rem; color: var(--text-muted); }
.topbar .user {
  font-size: .85rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 12px;
}
.topbar .user a { color: var(--coral); font-weight: 600; }

.container { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }

h1, h2, h3 { font-weight: 700; letter-spacing: .3px; }
.page-title { font-size: 1.35rem; margin-bottom: 4px; }
.page-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; }

/* ---------------- Cards ---------------- */
.cards { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 22px; }
.card {
  background: linear-gradient(145deg, var(--surface), var(--surface-strong));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--_glow, rgba(255,107,107,.18)); filter: blur(6px);
}
.card .label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.card .value { font-size: 1.5rem; font-weight: 700; margin-top: 6px; }
.card .value small { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
.card .hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.card.hero { grid-column: 1 / -1; }
.card.hero .value { font-size: 2rem; }
.card.c-coral  { --_glow: rgba(255,107,107,.30); }
.card.c-teal   { --_glow: rgba(46,196,182,.30); }
.card.c-sky    { --_glow: rgba(78,168,222,.30); }
.card.c-gold   { --_glow: rgba(255,209,102,.30); }
.card.c-purple { --_glow: rgba(155,93,229,.30); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
}
.badge.b-m1 { background: rgba(78,168,222,.2); color: #9fd0f0; }
.badge.b-m2 { background: rgba(241,91,181,.2); color: #f9a8d4; }
.badge.b-ambos   { background: rgba(46,196,182,.2); color: #7fe0d5; }
.badge.b-viagem  { background: rgba(255,209,102,.2); color: #ffe0a3; }
.badge.b-previa  { background: rgba(155,93,229,.2); color: #cbb0f5; }

/* ---------------- Section ---------------- */
.section { margin-bottom: 26px; }
.section h2 { font-size: 1.05rem; margin-bottom: 12px; display:flex; align-items:center; gap:8px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.chart-wrap { position: relative; height: 260px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------------- Lista de gastos ---------------- */
.gasto-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.gasto-item:last-child { border-bottom: none; }
.gasto-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
}
.gasto-main { flex: 1; min-width: 0; }
.gasto-main .desc { font-weight: 600; }
.gasto-main .meta { font-size: .78rem; color: var(--text-muted); display:flex; gap:8px; flex-wrap:wrap; margin-top:3px; }
.gasto-valor { text-align: right; font-weight: 700; white-space: nowrap; }
.gasto-valor small { display:block; color: var(--text-muted); font-weight: 400; font-size: .72rem; }

.acoes { display: flex; gap: 6px; margin-top: 8px; }

/* ---------------- Botões ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: none;
  font-weight: 600; font-size: .9rem; cursor: pointer; font-family: inherit;
  transition: transform .08s ease, box-shadow .2s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--coral), var(--sunset)); color: #fff; box-shadow: var(--shadow-glow); }
.btn-sky     { background: linear-gradient(135deg, var(--sky), var(--teal)); color: #062; color:#fff; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-warn    { background: rgba(255,209,102,.15); color: var(--gold); border: 1px solid rgba(255,209,102,.4); }
.btn-danger  { background: rgba(255,107,107,.15); color: var(--coral); border: 1px solid rgba(255,107,107,.4); }
.btn-sm { padding: 7px 12px; font-size: .8rem; }
.btn-block { width: 100%; }

/* ---------------- Formulários ---------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .82rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-size: .95rem; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,107,.2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
select.form-control option { background: var(--surface-strong); }

/* Atribuição — botões grandes de escolha */
.atrib-group { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.atrib-opt input { display: none; }
.atrib-opt label {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px; border-radius: var(--radius-sm); cursor: pointer;
  border: 2px solid var(--border); background: var(--bg);
  font-size: .82rem; text-align: center; font-weight: 600; transition: all .15s;
}
.atrib-opt label .ico { font-size: 1.4rem; }
.atrib-opt input:checked + label { border-color: var(--coral); background: rgba(255,107,107,.12); box-shadow: var(--shadow-glow); }

/* ---------------- Flash ---------------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; font-weight: 500; }
.flash.ok  { background: rgba(46,196,182,.15); color: #7fe0d5; border: 1px solid rgba(46,196,182,.4); }
.flash.erro { background: rgba(255,107,107,.15); color: #ffb3b3; border: 1px solid rgba(255,107,107,.4); }

/* ---------------- Filtros ---------------- */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filtros select { flex: 1; min-width: 120px; }

/* ---------------- Navbar inferior (mobile-first) ---------------- */
.navbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(13,27,42,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 8px 0;
}
.navbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-muted); font-size: .68rem; font-weight: 600; padding: 4px 12px;
}
.navbar a .ico { font-size: 1.25rem; }
.navbar a.active { color: var(--coral); }
.navbar a.novo .ico {
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  color: #fff; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px; box-shadow: var(--shadow-glow); font-size: 1.5rem;
}
.navbar a.novo { color: var(--coral); }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 32px 26px;
  box-shadow: var(--shadow); text-align: center;
}
.login-card .hero-emoji { font-size: 3rem; }
.login-card h1 { font-size: 1.4rem; margin: 8px 0 2px; }
.login-card .sub { color: var(--text-muted); font-size: .85rem; margin-bottom: 22px; }
.login-card .dates { color: var(--gold); font-size: .8rem; margin-bottom: 20px; font-weight:600; }
.login-card form { text-align: left; }

.empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.empty .ico { font-size: 2.5rem; }

/* ---------------- Desktop ---------------- */
@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(4,1fr); }
  .navbar {
    position: static; margin-top: 30px; border-radius: var(--radius);
    max-width: 960px; margin-left:auto; margin-right:auto; border: 1px solid var(--border);
  }
  .navbar a.novo .ico { margin-top: 0; }
}
@media (max-width: 480px) {
  .charts-grid { grid-template-columns: 1fr; }
  .card.hero .value { font-size: 1.7rem; }
}
