/* ============================ Indobro ============================ */
:root {
  --bg: #F3F0E8;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --ink: #14201D;
  --muted: #5F6C68;
  --line: #E3DDD0;
  --primary: #0E6B5C;
  --primary-2: #0A5246;
  --primary-soft: #DDEFE9;
  --on-primary: #FFFFFF;
  --accent: #D7F26A;
  --accent-ink: #1C2A06;
  --pos: #12805C;
  --neg: #C2410C;
  --warn: #A16207;
  --warn-soft: #FDF3D8;
  --neg-soft: #FCE7DC;
  --pos-soft: #DCF3E8;
  --shadow: 0 1px 2px rgba(20, 32, 29, .05), 0 8px 24px -12px rgba(20, 32, 29, .18);
  --r: 18px;
  --r-sm: 12px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1412; --surface: #14201D; --surface-2: #101A17; --ink: #E7EEEB; --muted: #94A49F;
    --line: #22312D; --primary: #3CC4A6; --primary-2: #2FA88E; --primary-soft: #133A32; --on-primary: #06201A;
    --pos: #4ADE9B; --neg: #FB923C; --warn: #FACC15; --warn-soft: #2D2610; --neg-soft: #33190C; --pos-soft: #0F2E22;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1412; --surface: #14201D; --surface-2: #101A17; --ink: #E7EEEB; --muted: #94A49F;
  --line: #22312D; --primary: #3CC4A6; --primary-2: #2FA88E; --primary-soft: #133A32; --on-primary: #06201A;
  --pos: #4ADE9B; --neg: #FB923C; --warn: #FACC15; --warn-soft: #2D2610; --neg-soft: #33190C; --pos-soft: #0F2E22;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font);
  font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.com-sheet { overflow: hidden; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------------- layout ---------------- */
.app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 21px; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; }
.logo-mark svg { width: 20px; height: 20px; }
main { padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 760px; margin: 0 auto; }

.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
}
.bottomnav a.ativo { color: var(--primary); }
.bottomnav .fab {
  width: 52px; height: 52px; margin: -18px auto 0; border-radius: 18px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}
.bottomnav .fab .ic { width: 26px; height: 26px; }
.sidenav { display: none; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh;
    padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidenav .logo { padding: 0 10px 22px; }
  .sidenav a.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    color: var(--muted); text-decoration: none; font-weight: 600;
  }
  .sidenav a.nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .sidenav a.nav-item.ativo { background: var(--primary-soft); color: var(--primary); }
  .sidenav .btn { margin: 14px 4px 0; }
  .bottomnav, .topbar .so-mobile { display: none; }
  main { padding: 8px 32px 48px; max-width: 980px; }
  .topbar { padding: 22px 32px 14px; }
}

/* ---------------- componentes ---------------- */
.card {
  background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.card + .card, .bloco + .bloco { margin-top: 14px; }
.card h3, .secao-t { font-size: 15px; font-weight: 700; }
.secao { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 22px 2px 10px; }
.secao h2 { font-size: 17px; }
.secao a, .link { font-size: 13px; font-weight: 700; color: var(--primary); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 960px) { .grid-desk-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; } .grid-desk-2 > .card + .card { margin-top: 0; } }

.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px; color: #F1FBF7;
  background: radial-gradient(120% 140% at 100% 0%, #1A8F7A 0%, #0E6B5C 42%, #0A3F37 100%);
  box-shadow: 0 18px 40px -22px rgba(10, 63, 55, .8);
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%;
  border: 26px solid rgba(215, 242, 106, .14);
}
.hero .rot { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .78; }
.hero .valor { font-size: 34px; font-weight: 800; letter-spacing: -.035em; margin: 6px 0 2px; }
.hero .sub { font-size: 13px; opacity: .8; }
.hero .linhas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hero .mini { background: rgba(255,255,255,.09); border-radius: 14px; padding: 10px 12px; }
.hero .mini span { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; }
.hero .mini strong { font-size: 17px; display: block; margin-top: 2px; }
.hero .mini .ic { width: 15px; height: 15px; }
.hero .olho { position: absolute; right: 14px; top: 14px; z-index: 2; color: inherit; background: rgba(255,255,255,.1); }
.oculto .valor-oc, .borrado { filter: blur(9px); }

.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--primary); color: var(--on-primary); }
.seg.cheio { display: flex; } .seg.cheio button { flex: 1; }

.atalhos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.atalhos a, .atalhos button {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.atalhos .bola { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }

.kpi { padding: 14px; }
.kpi .rot { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.kpi .d { font-size: 12px; margin-top: 2px; }

.lista { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; color: inherit;
}
.lista > li:last-child .item, .lista > .item:last-child { border-bottom: 0; }
.item .tx { flex: 1; min-width: 0; }
.item .t1, .item .t2 { display: block; }
.item .t1 { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .vl { font-weight: 800; text-align: right; white-space: nowrap; }
.item .vl small { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.dia { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 4px 4px; }

.cbola { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px;
  background: color-mix(in srgb, var(--c, #64748B) 16%, transparent); color: var(--c, #64748B); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 800; font-size: 12.5px;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--c); border: 2px solid var(--surface); }
.avatar.g { width: 44px; height: 44px; font-size: 15px; }
.avatares { display: flex; } .avatares .avatar + .avatar { margin-left: -8px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--pos-soft); color: var(--pos); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.neg { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.chip.pri { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

.barra { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.barra.warn > i { background: var(--warn); } .barra.neg > i { background: var(--neg); }

.aviso { display: flex; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--ink); font-size: 13.5px; }
.aviso .ic { color: var(--warn); margin-top: 1px; }
.aviso.info { background: var(--primary-soft); } .aviso.info .ic { color: var(--primary); }
.aviso.neg { background: var(--neg-soft); } .aviso.neg .ic { color: var(--neg); }
.aviso + .aviso { margin-top: 8px; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primario { background: var(--primary); color: var(--on-primary); }
.btn.primario:hover { background: var(--primary-2); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.perigo { background: var(--neg); color: #fff; }
.btn.acento { background: var(--accent); color: var(--accent-ink); }
.btn.peq { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.bloco { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); position: relative; flex: none; }
.icon-btn .badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.acoes { display: flex; gap: 10px; margin-top: 18px; } .acoes .btn { flex: 1; }

/* formulários */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 13px; border: 1.5px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .15s;
}
.campo textarea { min-height: 80px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--primary); }
.campo small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.valor-grande { font-size: 30px !important; font-weight: 800; letter-spacing: -.03em; text-align: center; min-height: 64px !important; }
.linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface); margin-bottom: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.check .tx { flex: 1; }
.tabs-tipo { margin-bottom: 16px; }
.tabs-tipo button[data-v="despesa"].on { background: var(--neg); color: #fff; }
.tabs-tipo button[data-v="receita"].on { background: var(--pos); color: #fff; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(8, 16, 14, .5); opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
  padding-bottom: var(--safe-b);
}
.sheet.largo { max-width: 720px; }
.sheet-wrap.aberto .sheet-bg { opacity: 1; } .sheet-wrap.aberto .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.sheet-head h2 { flex: 1; font-size: 18px; }
.sheet-body { padding: 6px 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; padding: 20px; }
  .sheet { border-radius: 24px; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet-wrap.aberto .sheet { opacity: 1; }
}
.confirm-msg { font-size: 15.5px; margin: 4px 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); z-index: 200;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.erro { background: var(--neg); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

.carregando { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: gira .7s linear infinite; display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }
.vazio { text-align: center; padding: 34px 18px; color: var(--muted); }
.vazio strong { display: block; color: var(--ink); font-size: 16px; }
.vazio p { margin: 6px 0 14px; font-size: 14px; }
.vazio-ic { width: 54px; height: 54px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.vazio-ic .ic { width: 26px; height: 26px; }

/* mês */
.mesnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.mesnav strong { text-transform: capitalize; font-size: 16px; }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .logo { justify-content: center; font-size: 30px; }
.auth-brand .logo-mark { width: 42px; height: 42px; border-radius: 13px; }
.auth-brand .logo-mark svg { width: 28px; height: 28px; }
.auth-brand p { margin: 8px 0 0; font-size: 11.5px; letter-spacing: .16em; font-weight: 800; color: var(--muted); }
.auth .card { padding: 22px; }
.auth h2 { font-size: 21px; margin-bottom: 4px; }
.auth .sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.auth .troca { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }

/* parcelas / cartões */
.cartao-vis { border-radius: 20px; padding: 18px; color: #fff; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--c, #1E293B), color-mix(in srgb, var(--c, #1E293B) 55%, #000)); box-shadow: var(--shadow); cursor: pointer; border: 0; text-align: left; width: 100%; }
.cartao-vis .nm { font-weight: 800; font-size: 17px; display: flex; justify-content: space-between; }
.cartao-vis .fat { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.cartao-vis small { opacity: .8; font-size: 12px; }
.cartoes-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .cartoes-grid { grid-template-columns: 1fr 1fr; } }

.divisao-prev { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 4px 14px; margin-bottom: 14px; }
.part-linha { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.part-linha:last-child { border-bottom: 0; }
.part-linha .nm { flex: 1; font-weight: 700; min-width: 0; }
.part-linha input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.part-linha input.peso { width: 74px; min-height: 38px; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); text-align: right; }
.part-linha .vp { width: 92px; text-align: right; font-weight: 800; }

.qr-box { display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 18px; margin: 4px auto 14px; width: fit-content; }
.qr-box svg, .qr-box img { width: 220px; height: 220px; display: block; }
.leitor { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 1; }
.leitor video { width: 100%; height: 100%; object-fit: cover; }
.leitor::after { content: ''; position: absolute; inset: 18%; border: 3px solid var(--accent); border-radius: 18px; }

.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tabela td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.tabela td.r, .tabela th.r { text-align: right; }
.tabela tr:last-child td { border-bottom: 0; }

.chart-box { position: relative; height: 220px; }
.legenda { display: grid; gap: 8px; margin-top: 12px; }
.legenda div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legenda span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grupo-head { display: flex; align-items: center; gap: 12px; }
.grupo-head .tx { flex: 1; min-width: 0; }
.tabsbar { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0; scrollbar-width: none; }
.tabsbar button { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.tabsbar button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.notif { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif.nl .t1::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: middle; }
.setup { max-width: 560px; margin: 10vh auto; padding: 24px; }
.setup code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.install-banner { display: flex; align-items: center; gap: 12px; }
.grid2 > .card + .card, .grid3 > .card + .card, .cartoes-grid > * + * { margin-top: 0; }
.sidenav a.nav-item { border: 0; }
