/* Painel financeiro — mobile-first.
   O celular é o alvo principal: navegação no alcance do polegar, alvos de
   toque de 44px+, inputs com 16px (menos que isso o iOS dá zoom sozinho)
   e bottom sheets no lugar de modais. */

:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --card: #161a24;
  --card-2: #1c2130;
  --line: #262c3b;
  --txt: #e7eaf3;
  --txt-2: #99a1b8;
  --txt-3: #656d84;
  --accent: #7c5cff;
  --accent-2: #a78bfa;
  --ok: #2fd08a;
  --warn: #ffb020;
  --danger: #ff5a6a;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 62px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f9;
    --bg-2: #ffffff;
    --card: #ffffff;
    --card-2: #f1f2f7;
    --line: #e3e6ef;
    --txt: #171b26;
    --txt-2: #5b6479;
    --txt-3: #8a92a6;
    --shadow: 0 10px 30px rgba(20, 24, 40, .14);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ================= layout mobile ================= */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  display: flex; align-items: center; gap: 12px;
}
.topbar h1 { font-size: 20px; font-weight: 660; letter-spacing: -.4px; flex: 1; }
.topbar .sub { font-size: 12px; color: var(--txt-3); font-weight: 500; display: block; margin-top: 1px; letter-spacing: 0; }
.topbar .status { font-size: 11px; color: var(--txt-3); white-space: nowrap; }

main {
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 84px);
  max-width: 1180px; margin: 0 auto;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 2px calc(var(--safe-b) + 6px);
  display: grid; grid-template-columns: repeat(8, 1fr);
}
.tabbar button {
  background: none; border: none; color: var(--txt-3); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; font: inherit; font-size: 8.8px; font-weight: 600;
  border-radius: 12px; min-height: 48px; transition: color .15s;
  position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.2px;
}
.tabbar button .ic { font-size: 17px; line-height: 1; }
.tabbar button.on { color: var(--accent-2); }

/* bolinha de pendências na aba Agenda */
.badge {
  position: absolute; top: 3px; right: 50%; margin-right: -18px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 31;
  width: 58px; height: 58px; border-radius: 20px; border: none; cursor: pointer;
  background: linear-gradient(140deg, var(--accent), #ff7ac6);
  color: #fff; font-size: 28px; line-height: 1;
  box-shadow: 0 10px 26px rgba(124, 92, 255, .45);
  display: grid; place-items: center;
  transition: transform .12s;
}
.fab:active { transform: scale(.93); }

/* ================= componentes ================= */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 14px; }
.card h3 { font-size: 13.5px; font-weight: 650; margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.card h3 small { color: var(--txt-3); font-weight: 500; font-size: 11.5px; }
.card h3 .push { margin-left: auto; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, 1fr); }

.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px; position: relative; overflow: hidden;
}
.kpi::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.kpi.ok::after { background: var(--ok); }
.kpi.warn::after { background: var(--warn); }
.kpi.danger::after { background: var(--danger); }
.kpi .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-3); font-weight: 700; line-height: 1.3; }
.kpi .val { font-size: 21px; font-weight: 680; letter-spacing: -.7px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11.5px; color: var(--txt-2); margin-top: 2px; line-height: 1.35; }

/* linhas de lista — substituem tabelas no mobile */
.rows { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
  min-height: 56px; text-align: left; width: 100%;
  background: none; border-left: none; border-right: none; border-top: none;
  color: inherit; font: inherit; cursor: pointer;
}
.rows .row-item:last-child { border-bottom: none; }
.row-item:active { background: var(--card-2); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t1 { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .t2 { display: block; font-size: 12px; color: var(--txt-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .v { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 15px; white-space: nowrap; }
.row-item .v small { display: block; font-size: 11px; font-weight: 500; color: var(--txt-3); text-align: right; margin-top: 2px; }
.row-item .chev { color: var(--txt-3); font-size: 17px; }

/* item da agenda: círculo de concluir + texto */
.check {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--line); background: none; cursor: pointer;
  display: grid; place-items: center; font-size: 15px; color: transparent;
  transition: all .15s;
}
.check:active { transform: scale(.88) }
.check.on { background: var(--ok); border-color: var(--ok); color: #06281a; }
.item-feito .t1 { text-decoration: line-through; color: var(--txt-3); }
.hora-chip {
  flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 700;
  font-size: 13px; color: var(--accent-2); min-width: 42px;
}
.hora-chip.vazia { color: var(--txt-3); font-weight: 500; }

.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--card-2); color: var(--accent-2);
}

.btn {
  background: var(--accent); color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: filter .15s, transform .06s;
}
.btn:active { transform: scale(.98); filter: brightness(.92); }
.btn.ghost { background: var(--card-2); color: var(--txt); border: 1px solid var(--line); }
.btn.danger { background: rgba(255, 90, 106, .12); color: var(--danger); border: 1px solid rgba(255, 90, 106, .3); }
.btn.full { width: 100%; }
.btn.sm { padding: 9px 13px; font-size: 13.5px; min-height: 38px; border-radius: 10px; }
.btn:disabled { opacity: .45; }

.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

input, select, textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--txt);
  border-radius: 12px; padding: 12px 14px; font: inherit;
  font-size: 16px; /* < 16px faz o iOS dar zoom ao focar */
  width: 100%; min-height: 48px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--txt-3) 50%), linear-gradient(135deg, var(--txt-3) 50%, transparent 50%); background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; line-height: 1.8; min-height: 150px; }
label { font-size: 12.5px; color: var(--txt-2); font-weight: 600; display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }

/* valor grande na entrada rápida */
.valor-big {
  font-size: 34px !important; font-weight: 700; text-align: center;
  letter-spacing: -1px; padding: 14px !important; min-height: 68px;
  font-variant-numeric: tabular-nums;
}

/* chips de seleção por toque */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card-2); border: 1px solid var(--line); color: var(--txt-2);
  border-radius: 999px; padding: 10px 15px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; min-height: 42px; display: inline-flex; align-items: center; gap: 6px;
  transition: all .12s;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.bloq { background: rgba(255, 90, 106, .14); border-color: rgba(255, 90, 106, .45); color: var(--danger); }
.chip.dim { font-size: 13px; padding: 8px 13px; min-height: 38px; }

/* fila de chips que rola na horizontal (filtros) */
.chips.scroll {
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none;
}
.chips.scroll::-webkit-scrollbar { height: 0; }
.chips.scroll .chip { flex: 0 0 auto; }

/* barra de filtros que gruda no topo ao rolar */
.filtros {
  position: sticky; top: 0; z-index: 15;
  background: var(--bg); margin: -16px -16px 14px; padding: 12px 16px 4px;
  border-bottom: 1px solid var(--line);
}
.filtros .rotulo { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-3); font-weight: 700; margin-bottom: 7px; }
.filtros .resumo-filtro { font-size: 12.5px; color: var(--txt-2); padding: 4px 0 8px; }
.filtros .resumo-filtro b { color: var(--txt); }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; background: var(--card-2); color: var(--txt-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.tag.ok { color: var(--ok); border-color: rgba(47, 208, 138, .3); background: rgba(47, 208, 138, .1); }
.tag.warn { color: var(--warn); border-color: rgba(255, 176, 32, .3); background: rgba(255, 176, 32, .1); }
.tag.danger { color: var(--danger); border-color: rgba(255, 90, 106, .3); background: rgba(255, 90, 106, .1); }
.tag.accent { color: var(--accent-2); border-color: rgba(124, 92, 255, .35); background: rgba(124, 92, 255, .12); }

.empty { text-align: center; padding: 30px 16px; color: var(--txt-3); font-size: 13.5px; line-height: 1.6; }
.empty .big { font-size: 32px; display: block; margin-bottom: 10px; opacity: .55; }

.bar-track { height: 7px; background: var(--card-2); border-radius: 99px; overflow: hidden; margin-top: 9px; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-fill.warn { background: linear-gradient(90deg, var(--warn), #ff8a3d); }
.bar-fill.danger { background: linear-gradient(90deg, var(--danger), #ff8080); }

.banner { border-radius: 13px; padding: 13px 15px; font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
.banner.warn { background: rgba(255, 176, 32, .1); border: 1px solid rgba(255, 176, 32, .28); color: var(--warn); }
.banner.info { background: rgba(124, 92, 255, .1); border: 1px solid rgba(124, 92, 255, .28); color: var(--accent-2); }
.banner.ok { background: rgba(47, 208, 138, .1); border: 1px solid rgba(47, 208, 138, .28); color: var(--ok); }

/* gráficos: rolam na horizontal quando não cabem */
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.chart-scroll::-webkit-scrollbar { height: 0; }
svg .grid-line { stroke: var(--line); stroke-width: 1; }
svg text { fill: var(--txt-3); font-family: inherit; }

.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.muted { color: var(--txt-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ================= liturgia ================= */

/* A cor litúrgica do dia vira o acento da tela inteira */
.liturgia { --lit: var(--accent); }

.lit-capa {
  background: linear-gradient(150deg, color-mix(in srgb, var(--lit) 22%, var(--card)), var(--card) 65%);
  border: 1px solid color-mix(in srgb, var(--lit) 35%, var(--line));
  border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden;
}
.lit-capa::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--lit); opacity: .12;
}
.lit-capa .dia { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-3); font-weight: 700; }
.lit-capa .celebracao { font-size: 19px; font-weight: 680; letter-spacing: -.4px; margin-top: 5px; line-height: 1.3; }
.lit-capa .cor {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 11px;
  font-size: 12px; font-weight: 600; color: var(--txt-2);
  background: var(--bg); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px;
}
.lit-capa .cor i { width: 11px; height: 11px; border-radius: 50%; background: var(--lit); display: block; }

/* navegação entre os dias */
.lit-dias { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
.lit-dias .btn { flex: 0 0 auto; }
.lit-dias .atual { flex: 1; text-align: center; font-size: 13px; font-weight: 650; }

/* ---- linha do tempo das leituras ---- */
.timeline { position: relative; padding-left: 34px; margin-top: 6px; }
.timeline::before {
  content: ''; position: absolute; left: 14px; top: 14px; bottom: 14px;
  width: 2px; background: linear-gradient(var(--lit), color-mix(in srgb, var(--lit) 20%, transparent));
  opacity: .5;
}

.tl-item { position: relative; margin-bottom: 12px; }
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute; left: -34px; top: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
  background: var(--card); border: 2px solid color-mix(in srgb, var(--lit) 55%, var(--line));
  z-index: 1;
}

.tl-cabeca {
  width: 100%; text-align: left; background: var(--card); color: inherit; font: inherit;
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; transition: border-color .15s;
}
.tl-cabeca:active { background: var(--card-2); }
.tl-item.aberto .tl-cabeca { border-color: color-mix(in srgb, var(--lit) 45%, var(--line)); border-radius: 14px 14px 0 0; border-bottom-color: transparent; }
.tl-cabeca .rotulo { font-weight: 650; font-size: 14.5px; display: block; }
.tl-cabeca .ref { font-size: 12.5px; color: var(--lit); font-weight: 600; display: block; margin-top: 2px; }
.tl-cabeca .seta { margin-left: auto; color: var(--txt-3); font-size: 13px; transition: transform .2s; }
.tl-item.aberto .tl-cabeca .seta { transform: rotate(180deg); }

.tl-corpo {
  display: none;
  border: 1px solid color-mix(in srgb, var(--lit) 45%, var(--line));
  border-top: none; border-radius: 0 0 14px 14px;
  padding: 4px 15px 15px;
  background: var(--card);
}
.tl-item.aberto .tl-corpo { display: block; }
.tl-corpo .subtitulo { font-size: 12.5px; color: var(--txt-3); font-style: italic; margin-bottom: 10px; }
.tl-corpo .texto { font-size: 15px; line-height: 1.72; white-space: pre-wrap; }
.tl-corpo .refrao {
  background: color-mix(in srgb, var(--lit) 12%, transparent);
  border-left: 3px solid var(--lit); border-radius: 0 10px 10px 0;
  padding: 11px 13px; margin-bottom: 12px; font-size: 14.5px; font-weight: 550; line-height: 1.6;
}
.tl-corpo .refrao b { color: var(--lit); }

/* anotação do dia */
.lit-nota {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ok); border-radius: 14px;
  padding: 14px 16px; font-size: 15px; line-height: 1.7; white-space: pre-wrap;
}
.lit-vazio {
  border: 1px dashed var(--line); border-radius: 14px; padding: 18px;
  text-align: center; color: var(--txt-3); font-size: 13.5px;
}

.lit-streak {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .3);
  color: var(--warn); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 650;
}

/* ================= produção de conteúdo ================= */

/* barrinha colorida de identificação do cliente */
.prod-cor { width: 4px; flex: 0 0 auto; border-radius: 4px; align-self: stretch; min-height: 34px; }
.prod-cliente-item { display: flex; align-items: center; gap: 11px; }

.prod-thumb {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
  background: var(--card-2); display: grid; place-items: center; font-size: 16px; overflow: hidden;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* zona de upload — funciona por toque (abre o seletor) e por arrastar no desktop */
.prod-drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 26px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.prod-drop.ativo { border-color: var(--accent); background: rgba(124, 92, 255, .08); }
.prod-drop input[type="file"] { display: none; }

.prod-lista-arquivos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.prod-arquivo-pill {
  display: flex; align-items: center; gap: 6px; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; font-size: 12.5px; max-width: 100%;
}
.prod-arquivo-pill .x { background: none; border: none; color: var(--txt-3); cursor: pointer; font-size: 14px; padding: 0 2px; }

/* status/prioridade com cor própria, reaproveitando .tag */
.tag.status-rascunho { color: var(--txt-3); }
.tag.status-edicao { color: var(--accent-2); border-color: rgba(124,92,255,.35); background: rgba(124,92,255,.1); }
.tag.status-pronto { color: var(--warn); border-color: rgba(255,176,32,.3); background: rgba(255,176,32,.1); }
.tag.status-agendado { color: #4d9dff; border-color: rgba(77,157,255,.3); background: rgba(77,157,255,.1); }
.tag.status-publicado { color: var(--ok); border-color: rgba(47,208,138,.3); background: rgba(47,208,138,.1); }
.tag.status-cancelado { color: var(--danger); border-color: rgba(255,90,106,.3); background: rgba(255,90,106,.1); }
.tag.prioridade-alta { color: var(--danger); }

/* dia da semana no board — mesma estrutura de card usada na agenda */
.prod-dia-cabeca { display: flex; align-items: center; gap: 8px; }
.prod-dia-cabeca .qtd { font-size: 12px; color: var(--txt-3); font-weight: 600; }
.prod-dia-hoje { border-color: rgba(124,92,255,.45) !important; }

/* ================= bottom sheet ================= */

.sheet-bg {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 7, 12, .6); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } }
@keyframes slideUp { from { transform: translateY(100%) } }

.sheet {
  background: var(--card); width: 100%; max-width: 620px;
  border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
  max-height: 92dvh; display: flex; flex-direction: column;
  animation: slideUp .26s cubic-bezier(.22, 1, .36, 1);
  box-shadow: var(--shadow);
}
.sheet .grabber { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 9px auto 0; flex: 0 0 auto; }
.sheet header { padding: 14px 18px 12px; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sheet header h2 { font-size: 17px; font-weight: 660; flex: 1; letter-spacing: -.3px; }
.sheet .body { padding: 4px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
.sheet footer {
  padding: 12px 18px calc(var(--safe-b) + 14px); border-top: 1px solid var(--line);
  background: var(--card); display: flex; gap: 10px; flex: 0 0 auto;
}
.sheet footer > * { flex: 1; }
.x { background: var(--card-2); border: none; color: var(--txt-2); width: 34px; height: 34px; border-radius: 50%; font-size: 19px; cursor: pointer; line-height: 1; flex: 0 0 auto; }

.toast {
  position: fixed; left: 16px; right: 16px; z-index: 80;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 14px; padding: 13px 16px; font-size: 14px; text-align: center;
  animation: up .22s ease;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes up { from { opacity: 0; transform: translateY(12px) } }

.msg-preview {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.6;
  max-height: 300px; overflow: auto;
}

/* ================= desktop ================= */

@media (min-width: 880px) {
  :root { --tabbar-h: 0px; }

  .filtros { margin: -22px -32px 16px; padding: 16px 32px 6px; }
  .chips.scroll { margin: 0 -32px; padding: 2px 32px 6px; flex-wrap: wrap; overflow-x: visible; }

  body { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

  .topbar {
    grid-column: 2; position: sticky; top: 0;
    padding: 22px 32px 16px;
  }
  .topbar h1 { font-size: 25px; }

  main { grid-column: 2; padding: 22px 32px 60px; width: 100%; }

  .tabbar {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto;
    grid-row: 1 / span 2; grid-column: 1;
    height: 100vh; align-content: start; gap: 4px;
    display: grid; grid-template-columns: 1fr;
    border-top: none; border-right: 1px solid var(--line);
    padding: 18px 12px; background: var(--bg-2);
  }
  .tabbar::before {
    content: '💳  Financeiro'; display: block; font-size: 15px; font-weight: 650;
    padding: 4px 12px 18px; color: var(--txt);
  }
  .tabbar button {
    flex-direction: row; justify-content: flex-start; gap: 11px;
    font-size: 14px; padding: 11px 13px; min-height: 44px;
  }
  .tabbar button .ic { font-size: 17px; width: 20px; text-align: center; }
  .badge { position: static; margin: 0 0 0 auto; }
  .tabbar button:hover { background: var(--card); color: var(--txt); }
  .tabbar button.on { background: var(--accent); color: #fff; }

  .fab { bottom: 30px; right: 30px; }

  .grid.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .grid.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .kpi .val { font-size: 25px; }
  .card { padding: 18px 20px; }

  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { border-radius: 18px; border: 1px solid var(--line); max-height: 86vh; animation: fade .18s; }
  .sheet .grabber { display: none; }
  .sheet footer { padding: 14px 18px; }

  .toast { left: auto; right: 24px; bottom: 24px; width: auto; max-width: 400px; }
}

@media (min-width: 880px) {
  .g4 { display: grid; }
}
