:root {
  --blue-900: #172554;
  --blue-800: #1e3a8a;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --bg: #f5f7fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5eaf3;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow: #d97706;
  --yellow-dot: #f59e0b;
  --yellow-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 10px 30px -12px rgba(30, 64, 175, .14);
  --side: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(700px 400px at 20% 0%, rgba(147,197,253,.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); margin: 4px 0 0; }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: rgba(255,255,255,.75); backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  color: var(--text); padding: 26px 16px; display: flex; flex-direction: column; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 17px; line-height: 1.1; }
.brand span { font-size: 13px; color: var(--muted); }
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); color: #fff;
  box-shadow: 0 8px 18px -6px rgba(37,99,235,.55);
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  padding: 12px 14px; border-radius: 12px; cursor: pointer; font-weight: 600; text-align: left;
}
.nav-btn:hover { background: var(--blue-50); color: var(--blue-700); }
.nav-btn.active { background: var(--blue-600); color: #fff; box-shadow: 0 10px 20px -8px rgba(37,99,235,.6); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-foot .btn { color: var(--muted); justify-content: flex-start; }
.side-foot .btn:hover { background: var(--blue-50); color: var(--blue-700); }

.main { margin-left: var(--side); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 32px; background: rgba(245,247,252,.7); backdrop-filter: blur(14px);
}
.content { padding: 8px 32px 48px; max-width: 1240px; }
.mobile-only { display: none; }

.month-switch {
  display: flex; align-items: center; gap: 4px; background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow);
}
.month-label {
  border: 0; background: none; font-weight: 700; min-width: 150px; padding: 6px 8px; cursor: pointer; border-radius: 999px;
}
.month-label:hover { background: var(--blue-50); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 999px;
  background: transparent; color: var(--blue-700); cursor: pointer;
}
.icon-btn:hover { background: var(--blue-50); }
.icon-btn.danger { color: var(--muted); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }
.icon-btn svg.ic { width: 18px; height: 18px; }

.bottom-nav { display: none; }

/* ---------- Common ---------- */
.page-head, .hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  border: 1px solid rgba(226,232,240,.7); box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { color: var(--blue-600); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.section-gap { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 600; cursor: pointer;
  background: var(--blue-50); color: var(--blue-700); white-space: nowrap;
}
.btn svg.ic { width: 18px; height: 18px; }
.btn:hover { background: var(--blue-100); }
.btn.primary { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.btn.primary:hover { background: var(--blue-700); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 12px; font-size: 14px; }
.btn.block { width: 100%; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=number], input[type=date], select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 12px; background: #fbfcff; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(59,130,246,.15); background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 14px; }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); font-weight: 500; cursor: pointer; }
.check-label input { width: 20px; height: 20px; accent-color: var(--blue-600); }
.row-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }

.empty {
  text-align: center; color: var(--muted); padding: 26px 12px; font-size: 14px;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
}
.empty svg.ic { width: 28px; height: 28px; color: var(--blue-200); display: block; margin: 0 auto 8px; }

/* ---------- Painel ---------- */
.banner {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--radius); margin-bottom: 18px;
  border: 1px solid transparent;
}
.banner svg.ic { width: 28px; height: 28px; }
.banner strong { display: block; font-size: 18px; }
.banner span { font-size: 14px; opacity: .85; }
.banner.ok { background: var(--green-bg); color: #14532d; border-color: #bbf7d0; }
.banner.ok svg { color: var(--green); }
.banner.bad { background: var(--red-bg); color: #7f1d1d; border-color: #fecaca; }
.banner.bad svg { color: var(--red); }

.stat { display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 14px; }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.stat-ic.in { background: var(--blue-50); color: var(--blue-600); }
.stat-ic.out { background: #fff1f2; color: #e11d48; }
.stat-ic.bal { background: var(--blue-600); color: #fff; }
.stat-val { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.stat-sub { font-size: 13px; color: var(--muted); }
.stat.hero { background: linear-gradient(135deg, var(--blue-600), var(--blue-800)); color: #fff; border: 0; }
.stat.hero .stat-top, .stat.hero .stat-sub { color: rgba(255,255,255,.8); }
.stat.hero .stat-ic.bal { background: rgba(255,255,255,.18); }
.val-pos { color: var(--green); }
.val-neg { color: var(--red); }
.pill-status.ok { background: #bbf7d0; color: #14532d; }
.pill-status.bad { background: #fecaca; color: #7f1d1d; }

.meter { height: 10px; border-radius: 999px; background: var(--blue-100); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width .4s; }
.meter.warn > i { background: var(--yellow-dot); }
.meter.over > i { background: var(--red); }
.meter-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 280px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; padding: 20px; }

/* Hero do painel */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 28px; color: #fff; margin: 4px 0 0;
  background:
    radial-gradient(500px 260px at 95% -20%, rgba(147,197,253,.55), transparent 60%),
    radial-gradient(420px 260px at -10% 120%, rgba(30,58,138,.9), transparent 60%),
    linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
  box-shadow: 0 24px 50px -24px rgba(29,78,216,.7);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%;
  border: 40px solid rgba(255,255,255,.06); pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.hero h1 { font-size: 30px; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.hero-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: end; margin-top: 28px; position: relative; z-index: 1; }
.hero-balance > span:first-child { display: block; font-size: 14px; color: rgba(255,255,255,.75); font-weight: 500; }
.hero-balance strong { display: block; font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 12px; }
.pill-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero .pill-status.ok { background: rgba(134,239,172,.2); color: #bbf7d0; }
.hero .pill-status.bad { background: rgba(252,165,165,.22); color: #fecaca; }
.hero-meter { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 16px; backdrop-filter: blur(6px); }
.hero-meter .meter-row { color: rgba(255,255,255,.8); }
.hero-meter .meter-row b { color: #fff; font-size: 15px; }
.hero-meter .meter-row.foot { margin: 8px 0 0; font-size: 12px; }
.hero-meter .meter { background: rgba(255,255,255,.18); }
.hero-meter .meter > i { background: #fff; }
.hero-meter .meter.warn > i { background: #fcd34d; }
.hero-meter .meter.over > i { background: #fca5a5; }
.btn.light { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.btn.light:hover { background: rgba(255,255,255,.26); }

/* Card de situação (verde / vermelho) */
.stat.status .stat-ic { background: rgba(255,255,255,.7); }
.stat.status.ok { background: linear-gradient(160deg, #f0fdf4, #dcfce7); border-color: #bbf7d0; }
.stat.status.ok .stat-top, .stat.status.ok .stat-val { color: #15803d; }
.stat.status.ok .stat-ic { color: var(--green); }
.stat.status.bad { background: linear-gradient(160deg, #fef2f2, #fee2e2); border-color: #fecaca; }
.stat.status.bad .stat-top, .stat.status.bad .stat-val { color: #b91c1c; }
.stat.status.bad .stat-ic { color: var(--red); }
.stat.status.neutral .stat-ic { background: var(--blue-50); color: var(--blue-600); }
.stat-val.sm { font-size: 20px; }
.stat-ic { transition: transform .2s; }
.card.stat:hover .stat-ic { transform: scale(1.06); }

/* ---------- Contas (bill rows) ---------- */
.bill-list { display: flex; flex-direction: column; gap: 8px; }
.bill {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: #fbfcff; border: 1px solid var(--border); border-left: 4px solid var(--blue-200);
}
.bill.st-pago { border-left-color: var(--green); }
.bill.st-breve { border-left-color: var(--yellow-dot); }
.bill.st-atrasado { border-left-color: var(--red); }
.bill.st-pago .bill-name { color: var(--muted); }
.check {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--blue-200); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; padding: 0;
}
.check svg.ic { width: 16px; height: 16px; stroke-width: 3; }
.check:hover { border-color: var(--blue-500); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.bill-main { flex: 1; min-width: 0; }
.bill-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bill-meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.bill-val { font-weight: 700; white-space: nowrap; }
.bill-actions { display: flex; gap: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.tag { font-size: 12px; font-weight: 700; background: var(--blue-100); color: var(--blue-700); padding: 2px 8px; border-radius: 999px; }
.st-label { font-weight: 600; }
.st-label.pago { color: var(--green); }
.st-label.breve { color: var(--yellow); }
.st-label.atrasado { color: var(--red); }
.st-label.pendente { color: var(--blue-600); }
.inst-bar { height: 5px; background: var(--blue-100); border-radius: 999px; margin-top: 7px; overflow: hidden; max-width: 260px; }
.inst-bar i { display: block; height: 100%; background: var(--blue-500); border-radius: inherit; }

.alert-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.yellow { background: var(--yellow-bg); color: var(--yellow); }

/* ---------- Despesas ---------- */
.tabs { display: flex; gap: 8px; background: var(--card); padding: 6px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 18px; box-shadow: var(--shadow); }
.tab {
  flex: 1; border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; color: var(--muted);
}
.tab small { font-weight: 700; font-size: 12px; background: var(--blue-50); color: var(--blue-700); border-radius: 999px; padding: 1px 8px; }
.tab.active { background: var(--blue-600); color: #fff; }
.tab.active small { background: rgba(255,255,255,.2); color: #fff; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.mini { background: var(--blue-50); border-radius: 14px; padding: 12px 14px; }
.mini span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.mini strong { font-size: 18px; }

/* ---------- Calendário ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week { margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.day {
  min-height: 92px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcff; padding: 6px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; overflow: hidden;
}
.day:hover { border-color: var(--blue-200); background: var(--blue-50); }
.day.blank { visibility: hidden; }
.day .num { font-weight: 700; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; }
.day.today .num { background: var(--blue-600); color: #fff; }
.day.sel { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.day.has-pago { background: #f0fdf4; }
.day.has-breve { background: #fffbeb; }
.day.has-atrasado { background: #fef2f2; }
.day .pills { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pill {
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--blue-100); color: var(--blue-800);
}
.pill.st-pago { background: var(--green-bg); color: #166534; }
.pill.st-breve { background: var(--yellow-bg); color: #92400e; }
.pill.st-atrasado { background: var(--red-bg); color: #991b1b; }
.pill.more { background: transparent; color: var(--muted); padding: 0 6px; }
.dots { display: none; gap: 3px; flex-wrap: wrap; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-500); }
.dots i.st-pago { background: var(--green); }
.dots i.st-breve { background: var(--yellow-dot); }
.dots i.st-atrasado { background: var(--red); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 14px; }
.legend span { display: flex; align-items: center; gap: 6px; }

/* ---------- Guardado ---------- */
.goal { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: #fbfcff; }
.goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.goal-name svg { color: var(--blue-600); }
.goal-nums { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.goal-nums b { color: var(--text); }
.goal .meter { height: 12px; }
.goal.done .meter > i { background: var(--green); }
.goal-add { display: flex; gap: 8px; margin-top: 12px; }
.goal-add input { margin-top: 0; }
.goal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.hist-row:last-child { border-bottom: 0; }
.hist-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.hist-ic.in { background: var(--green-bg); color: var(--green); }
.hist-ic.out { background: var(--red-bg); color: var(--red); }
.hist-ic svg.ic { width: 16px; height: 16px; }
.hist-main { flex: 1; min-width: 0; }
.hist-main small { display: block; color: var(--muted); font-size: 12px; }
.seg { display: flex; background: var(--blue-50); border-radius: 12px; padding: 4px; gap: 4px; margin-top: 6px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border-radius: 9px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted);
}
.seg span svg.ic { width: 16px; height: 16px; }
.seg input:checked + span { background: #fff; color: var(--blue-700); box-shadow: 0 2px 8px rgba(30,64,175,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--blue-500); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 30px 60px rgba(15,23,42,.25);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.kf { display: none; }
form[data-kind=fixa] .k-fixa, form[data-kind=parcelada] .k-parcelada, form[data-kind=variavel] .k-variavel { display: block; }
.calc { background: var(--blue-50); color: var(--blue-800); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--blue-900); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  transition: .25s; z-index: 200; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Login e sincronização ---------- */
.top-right { display: flex; align-items: center; gap: 10px; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sync svg.ic { width: 17px; height: 17px; }
.sync.ok svg { color: var(--green); }
.sync.saving svg { color: var(--blue-500); animation: pulse 1s infinite alternate; }
.sync.off { color: var(--yellow); }
@keyframes pulse { to { opacity: .35; } }

.login {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(600px 400px at 85% 0%, rgba(147,197,253,.5), transparent 60%),
    linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
}
.login[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: 26px; padding: 32px 24px; text-align: center;
  box-shadow: 0 30px 60px -20px rgba(15,23,42,.45);
}
.login-card h1 { font-size: 22px; margin-top: 16px; }
.login-card .muted { margin-bottom: 20px; }
.login-card input { text-align: center; font-size: 22px; letter-spacing: .4em; padding: 14px; }
.brand-logo.lg { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto; }
.brand-logo.lg svg.ic { width: 26px; height: 26px; }
.login-error { color: var(--red); font-size: 14px; font-weight: 600; min-height: 20px; margin: 10px 0; }
.login-card.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.three > .stat.hero { grid-column: span 2; }
  .cal-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { font-size: 15px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { justify-content: space-between; padding: 10px 16px; }
  .mobile-only { display: flex; }
  .topbar .brand-logo { width: 36px; height: 36px; border-radius: 11px; }
  .content { padding: 4px 16px 28px; }
  h1 { font-size: 23px; }
  .month-label { min-width: 0; font-size: 14px; padding: 6px 4px; }
  .icon-btn { width: 32px; height: 32px; }
  .top-right { gap: 6px; }
  .sync span { display: none; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(30,64,175,.08);
  }
  .bottom-nav .nav-btn {
    flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; color: var(--muted); justify-content: center; align-items: center; text-align: center;
  }
  .bottom-nav .nav-btn:hover { background: transparent; color: var(--blue-700); }
  .bottom-nav .nav-btn.active { background: var(--blue-50); color: var(--blue-700); box-shadow: none; }

  .grid.two, .grid.charts { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .grid.three { grid-template-columns: 1fr; gap: 12px; }
  .grid.three > .stat.hero { grid-column: auto; order: -1; }
  .stat-val { font-size: 24px; }
  .card { padding: 16px; }
  .hero .btn span, .page-head .btn span { display: none; }
  .hero .btn, .page-head .btn { padding: 11px; }
  .hero { padding: 22px 18px; border-radius: 24px; }
  .hero h1 { font-size: 25px; }
  .hero-body { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
  .hero-balance strong { font-size: 36px; }
  .row-form { grid-template-columns: 1fr 1fr; }
  .row-form .full { grid-column: 1 / -1; }
  .tab { padding: 9px 4px; font-size: 13px; gap: 5px; }
  .tab svg.ic { display: none; }
  .mini-stats { gap: 8px; }
  .mini { padding: 10px; }
  .mini strong { font-size: 15px; }
  .bill { padding: 11px 10px; gap: 10px; flex-wrap: wrap; }
  .bill-main { flex-basis: calc(100% - 140px); }
  .chart-box, .chart-box.tall { height: 230px; }

  .day { min-height: 54px; padding: 4px; align-items: center; }
  .day .pills { display: none; }
  .dots { display: flex; justify-content: center; }
  .cal-week, .cal-grid { gap: 4px; }

  .modal { place-items: end center; padding: 0; }
  .modal-card { border-radius: 22px 22px 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .topbar .brand div:last-child { display: none; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .mini-stats .mini:last-child { grid-column: span 2; }
}
