/* =====================================================================
   MC Tarefas — estilos partilhados por todas as páginas
   Linguagem visual do protótipo "Ordenado em Casa" (Claude Design):
   cores e tipografia iOS, cartões brancos sobre cinza agrupado,
   barra de separadores flutuante no telemóvel e barra lateral no PC.
   ===================================================================== */

:root {
  --bg: #F2F2F7;
  --bg-side: #F5F5F7;
  --card: #FFFFFF;
  --label: #000000;
  --label-1: #1d1d1f;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .12);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .16);
  --icon-off: rgba(60, 60, 67, .45);
  --blue: #007AFF;
  --blue-soft: rgba(0, 122, 255, .12);
  --green: #34C759;
  --green-t: #248A3D;
  --green-soft: rgba(52, 199, 89, .12);
  --red: #FF3B30;
  --red-t: #D70015;
  --orange: #FF9500;
  --orange-t: #C93400;
  --orange-soft: rgba(255, 149, 0, .14);
  --glass: rgba(255, 255, 255, .8);
  --shadow-bar: 0 8px 30px rgba(0, 0, 0, .12), inset 0 0 0 .5px rgba(0, 0, 0, .06);
  --r-card: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-side: #111113;
    --card: #1C1C1E;
    --label: #FFFFFF;
    --label-1: #F5F5F7;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55);
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .32);
    --icon-off: rgba(235, 235, 245, .5);
    --blue: #0A84FF;
    --blue-soft: rgba(10, 132, 255, .2);
    --green: #30D158;
    --green-t: #30D158;
    --green-soft: rgba(48, 209, 88, .18);
    --red: #FF453A;
    --red-t: #FF6961;
    --orange: #FF9F0A;
    --orange-t: #FFB340;
    --orange-soft: rgba(255, 159, 10, .2);
    --glass: rgba(30, 30, 32, .78);
    --shadow-bar: 0 8px 30px rgba(0, 0, 0, .5), inset 0 0 0 .5px rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Estrutura ------------------------------------------------ */
.app { min-height: 100vh; display: flex; }
.main {
  flex: 1; min-width: 0;
  padding: calc(env(safe-area-inset-top) + 12px) 0 calc(env(safe-area-inset-bottom) + 120px);
}
.page { max-width: 720px; margin: 0 auto; }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    width: 244px; flex: none;
    position: sticky; top: 0; height: 100vh;
    background: var(--bg-side);
    border-right: .5px solid var(--sep);
    padding: 20px 12px;
  }
  .main { padding: 26px 30px 40px; }
  .tabbar { display: none !important; }
  .only-mobile { display: none !important; }
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-logo { width: 32px; height: 32px; flex: none; display: block; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }

.side-link {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 9px; color: var(--label-1); font-size: 14px; font-weight: 500;
}
.side-link svg { color: var(--label-2); }
.side-link:hover { background: var(--fill); }
.side-link.on { background: rgba(0, 0, 0, .07); font-weight: 600; }
.side-link.on svg { color: var(--blue); }
@media (prefers-color-scheme: dark) { .side-link.on { background: rgba(255, 255, 255, .1); } }

.side-foot { margin-top: auto; }
.user-chip {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; border-radius: 12px; background: var(--card);
  cursor: pointer; text-align: left;
}
.user-chip .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-chip .who b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 12px; color: var(--label-2); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--fill-2); color: var(--label); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Barra de separadores (telemóvel) -------------------------- */
.tabbar {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px);
  height: 64px; border-radius: 999px; z-index: 20;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-bar);
  display: flex; align-items: center; padding: 4px;
  max-width: 560px; margin: 0 auto;
}
.tab {
  flex: 1; height: 56px; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--label-1);
}
.tab span { font-size: 10px; font-weight: 600; }
.tab.on { background: rgba(0, 0, 0, .06); color: var(--blue); }
@media (prefers-color-scheme: dark) { .tab.on { background: rgba(255, 255, 255, .1); } }

/* ---------- Cabeçalho de página -------------------------------------- */
.head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 8px 20px 0;
}
.head-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eyebrow {
  font-size: 13px; font-weight: 600; color: var(--label-2);
  text-transform: uppercase; letter-spacing: .2px;
}
.eyebrow.today { color: var(--red-t); }
.title { font-size: 34px; font-weight: 700; letter-spacing: .4px; line-height: 41px; margin: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
@media (min-width: 1024px) {
  .head { padding: 0; }
  .title { font-size: 30px; letter-spacing: -.4px; line-height: 1.2; }
}

/* ---------- Botões --------------------------------------------------- */
.pill {
  height: 36px; padding: 0 16px; border-radius: 999px; border: none;
  background: var(--blue-soft); color: var(--blue); font-size: 15px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.pill.solid { background: var(--blue); color: #fff; }
.pill.gray { background: var(--fill); }
.pill.red { background: rgba(255, 59, 48, .12); color: var(--red-t); }
.pill.green { background: var(--green-soft); color: var(--green-t); }
.pill:disabled { opacity: .45; cursor: default; }
.pill.lg { height: 52px; font-size: 17px; width: 100%; }

.round {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--fill);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.round:disabled { cursor: default; opacity: .35; }

/* ---------- Controlo segmentado (crianças) ---------------------------- */
.seg {
  margin: 16px 16px 0; padding: 3px; border-radius: 12px; background: var(--fill);
  display: flex; gap: 2px;
}
.seg button {
  flex: 1; height: 38px; border: none; border-radius: 10px; background: transparent;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.seg button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.seg.sm button { font-size: 13px; padding: 0 4px; }
.kid-dot {
  width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* ---------- Faixa de dias -------------------------------------------- */
.week { display: flex; align-items: center; gap: 4px; margin: 18px 8px 0; }
.week-days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.wd {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: none; border: none; padding: 0; cursor: pointer;
}
.wd:disabled { cursor: default; }
.wd .l { font-size: 11px; font-weight: 600; color: var(--label-2); }
.wd .n {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 500; color: var(--label);
}
.wd.today .n { color: var(--red-t); font-weight: 700; }
.wd.sel .n { background: var(--label); color: var(--card); font-weight: 700; }
.wd.sel.today .n { background: var(--red); color: #fff; }
.wd:disabled .n { color: var(--label-3); }
.wd .d { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.wd .d.pos { background: var(--green); }
.wd .d.neg { background: var(--red); }
.wd .d.zero { background: var(--fill-2); }
.wd .d.pend { background: var(--orange); }

/* ---------- Cartões e listas ----------------------------------------- */
.card { margin: 14px 16px 0; background: var(--card); border-radius: var(--r-card); }
.card.pad { padding: 16px 18px; }
@media (min-width: 1024px) { .card, .seg { margin-left: 0; margin-right: 0; } .week { margin-left: 0; margin-right: 0; } }

.sec-h {
  padding: 24px 36px 7px; font-size: 13px; color: var(--label-2); text-transform: uppercase;
  display: flex; justify-content: space-between; gap: 8px;
}
.sec-h b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-f { padding: 7px 36px 0; font-size: 13px; line-height: 1.4; color: var(--label-2); text-wrap: pretty; }
@media (min-width: 1024px) { .sec-h, .sec-f { padding-left: 20px; padding-right: 20px; } }
.list { margin: 0 16px; background: var(--card); border-radius: var(--r-card); overflow: hidden; }
@media (min-width: 1024px) { .list { margin: 0; } }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px 9px 18px; min-height: 62px;
  border-bottom: .5px solid var(--sep);
}
.row:last-child { border-bottom: none; }
.row-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  background: none; border: none; padding: 0; text-align: left; cursor: pointer;
}
.row-name { font-size: 16px; letter-spacing: -.3px; line-height: 1.25; text-wrap: pretty; }
.row-name .star { color: var(--orange-t); font-weight: 600; }
.row-val { font-size: 14px; font-weight: 500; color: var(--label-2); font-variant-numeric: tabular-nums; }
.row-val.pos { color: var(--green-t); }
.row-val.neg { color: var(--red-t); }
.row-val.void { color: var(--label-3); text-decoration: line-through; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--fill); color: var(--label-2);
}
.tag.pend { background: var(--orange-soft); color: var(--orange-t); }
.row-note { font-size: 13px; color: var(--label-2); font-style: italic; line-height: 1.35; }

.marks { display: flex; gap: 8px; flex: none; }
.mk {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--fill);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, transform .1s; color: var(--icon-off);
}
.mk:active:not(:disabled) { transform: scale(.92); }
.mk.ok.on { background: var(--green); color: #fff; }
.mk.nok.on { background: var(--red); color: #fff; }
.mk.ok.pend { background: var(--orange-soft); color: var(--orange-t); box-shadow: inset 0 0 0 2px var(--orange); }
.mk:disabled { cursor: default; }
.mk:disabled:not(.on):not(.pend) { opacity: .45; }
.mk.ghost { visibility: hidden; }
@media (min-width: 1024px) {
  .row { min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
  .mk { width: 36px; height: 36px; }
}

/* ---------- Total do dia --------------------------------------------- */
.total { display: flex; align-items: center; gap: 16px; }
.total-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.total-lbl { font-size: 13px; font-weight: 500; color: var(--label-2); }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big.pos { color: var(--green-t); }
.big.neg { color: var(--red-t); }
.total-sub { font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.ring {
  width: 66px; height: 66px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.ring-in {
  width: 54px; height: 54px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-in b { font-size: 17px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-in span { font-size: 10px; color: var(--label-2); }

/* ---------- Linhas com ligação e totais à direita --------------------- */
a.row, .row.link { color: inherit; }
.row.link { min-height: 56px; padding-right: 14px; }
.row.link:hover { background: var(--fill); }
.row.off { opacity: .55; }
.row.off:hover { background: none; }
span.row-main { cursor: inherit; }
.row-total { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-total.pos { color: var(--green-t); }
.row-total.neg { color: var(--red-t); }
.row-total.muted { color: var(--label-3); }
.chev { color: var(--label-3); display: inline-flex; }
a.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- Semana: gráfico -------------------------------------------- */
.chart { display: flex; flex-direction: column; gap: 3px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; }
.bar { display: flex; flex-direction: column; align-items: center; color: inherit; }
.bar-lbl { font-size: 10px; font-weight: 600; height: 14px; font-variant-numeric: tabular-nums; color: var(--label-2); }
.bar-lbl.pos { color: var(--green-t); }
.bar-lbl.neg { color: var(--red-t); }
.bar-pos { height: 100px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--sep); }
.bar-pos i { display: block; width: 70%; max-width: 26px; background: var(--green); border-radius: 6px 6px 2px 2px; }
.bar.fut .bar-pos i { background: var(--fill-2); }
.bar-neg { height: 38px; width: 100%; display: flex; align-items: flex-start; justify-content: center; }
.bar-neg i { display: block; width: 70%; max-width: 26px; background: var(--red); border-radius: 2px 2px 6px 6px; }
.bar-day { font-size: 12px; font-weight: 500; color: var(--label-2); }
.bar.today .bar-day { color: var(--label); font-weight: 700; }

/* ---------- Mês -------------------------------------------------------- */
.page.wide { max-width: 1040px; }
@media (min-width: 1024px) {
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
}
.saldo { display: flex; flex-direction: column; gap: 14px; }
.saldo-top { display: flex; align-items: center; gap: 10px; }
.saldo-nome { font-size: 17px; font-weight: 600; flex: 1; }
.kid-dot.lg { width: 30px; height: 30px; font-size: 14px; }
.big.xl { font-size: 40px; letter-spacing: -1px; }
.boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box { background: var(--fill); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.box.green { background: var(--green-soft); }
.box-k { font-size: 12px; font-weight: 600; color: var(--label-2); }
.box-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.box.green .box-v { color: var(--green-t); }
.box-v.sm { font-size: 16px; line-height: 1.3; }
.box-note { font-size: 12px; color: var(--orange-t); }
.aviso-neg { margin: 0; font-size: 13px; color: var(--red-t); line-height: 1.4; }
.acts { display: flex; flex-direction: column; gap: 10px; margin: 14px 16px 0; }
@media (min-width: 1024px) { .acts { margin-left: 0; margin-right: 0; flex-direction: row; } .acts .pill { flex: 1; } }

.cal-t { display: block; font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-h { font-size: 11px; font-weight: 600; color: var(--label-2); text-align: center; }
.cal-c {
  position: relative; height: 50px; border-radius: 10px; padding: 5px 7px; color: inherit;
  display: flex; flex-direction: column; justify-content: space-between; border: 1px solid transparent;
}
a.cal-c:hover { outline: 2px solid var(--fill-2); }
.cal-c.vazio { visibility: hidden; }
.cal-c.fut { border: 1px dashed var(--sep); }
.cal-c.fut .cal-n { color: var(--label-3); }
.cal-c.today { border: 2px solid var(--blue); }
.cal-n { font-size: 12px; font-weight: 600; }
.cal-v { font-size: 11px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cal-v.pos { color: var(--green-t); }
.cal-v.neg { color: var(--red-t); }
.cal-p { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
@media (max-width: 400px) { .cal-c { height: 44px; padding: 4px 5px; } .cal-v { font-size: 10px; } }

/* ---------- Formulários (estilo Definições do iOS) ---------------------- */
.fgroup { background: var(--card); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.frow {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 16px;
  border-bottom: .5px solid var(--sep); font-size: 16px;
}
.frow:last-child { border-bottom: none; }
.frow .flbl { flex: 1; min-width: 0; }
.frow.col { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 16px; }
.frow.col .flbl { font-size: 13px; color: var(--label-2); }
.finp, .fsel {
  border: none; outline: none; background: transparent; color: var(--label); font: inherit; font-size: 16px;
  text-align: right; min-width: 0; flex: 1; padding: 6px 0;
}
.frow.col .finp { text-align: left; }
.finp::placeholder, .fta::placeholder { color: var(--label-3); }
.fsel { text-align: right; text-align-last: right; cursor: pointer; appearance: none; -webkit-appearance: none; color: var(--label-2); }
.fsel option { color: #000; }
.fta { border: none; outline: none; background: transparent; color: var(--label); font: inherit; font-size: 16px; min-height: 72px; resize: vertical; }
.fhelp { margin: 0 16px 16px; font-size: 13px; color: var(--label-2); line-height: 1.4; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; cursor: pointer;
  width: 51px; height: 31px; border-radius: 999px; background: var(--fill-2); position: relative; transition: background .2s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .2s;
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: default; }

/* Seletor de nível (Sem / Ver / Editar) */
.lvl { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); flex: none; }
.lvl button {
  border: none; background: transparent; height: 28px; padding: 0 10px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--label-2); cursor: pointer;
}
.lvl button.on { background: var(--card); color: var(--label); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.lvl button.on.l0 { color: var(--red-t); }
.lvl button.on.l2 { color: var(--green-t); }
.lvl button:disabled { cursor: default; }

/* ---------- Definições: menu e subpáginas ------------------------------ */
.menu-ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.row .row-side { font-size: 16px; color: var(--label-2); white-space: nowrap; }
.back {
  display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px 12px; padding: 4px 6px;
  background: none; border: none; color: var(--blue); font-size: 17px; cursor: pointer;
}
@media (min-width: 1024px) { .back { margin-left: -6px; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 16px 0; }
@media (min-width: 1024px) { .toolbar { margin-left: 0; margin-right: 0; } }
.mini { display: flex; flex-direction: column; gap: 2px; flex: none; }
.mini button {
  width: 30px; height: 22px; border: none; border-radius: 6px; background: var(--fill);
  color: var(--label-2); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mini button:disabled { opacity: .3; cursor: default; }
.row.dim { opacity: .5; }
.cores { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.cor { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.cor.on { border-color: var(--card); box-shadow: 0 0 0 2px var(--label); }
.prev { width: 100%; border-collapse: collapse; font-size: 13px; }
.prev td { padding: 6px 8px; border-bottom: .5px solid var(--sep); }
.prev tr.err td { color: var(--red-t); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Poupança -------------------------------------------------- */
.big.orange { color: var(--orange-t); }
.segs { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 14px; }
.segs i { display: block; height: 8px; border-radius: 4px; background: var(--fill-2); }
.segs i.on { background: var(--orange); }
.segs i.cur { background: rgba(255,149,0,.45); }
.segs span { font-size: 10px; font-weight: 600; text-align: center; color: var(--label-3); }
.segs span.on { color: var(--label-2); }
.goal { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-bottom: .5px solid var(--sep); cursor: pointer; }
.goal:last-child { border-bottom: none; }
.goal-top { display: flex; align-items: baseline; gap: 8px; }
.goal-nome { flex: 1; font-size: 16px; font-weight: 600; }
.goal-v { font-size: 14px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.goal-bar { height: 8px; border-radius: 4px; background: var(--fill-2); overflow: hidden; }
.goal-bar i { display: block; height: 100%; background: var(--orange); border-radius: 4px; transition: width .3s; }
.goal.done .goal-bar i { background: var(--green); }
.goal-sub { font-size: 13px; color: var(--label-2); }
.goal.done .goal-sub { color: var(--green-t); font-weight: 600; }

/* ---------- Aviso (pendentes) ---------------------------------------- */
.banner {
  margin: 14px 16px 0; padding: 12px 14px 12px 16px; border-radius: 16px;
  background: var(--orange-soft); display: flex; align-items: center; gap: 12px;
}
.banner p { flex: 1; margin: 0; font-size: 14px; line-height: 1.35; color: var(--label-1); }
.banner b { color: var(--orange-t); }
@media (min-width: 1024px) { .banner { margin-left: 0; margin-right: 0; } }

/* ---------- Folha inferior (sheet) ----------------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .35);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
.sheet {
  width: 100%; max-width: 560px; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 20px);
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
  max-height: 90vh; overflow: auto;
}
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 22px; padding-bottom: 20px; }
}
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 10px; }
.sheet h3 { margin: 4px 4px 2px; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.sheet .sub { margin: 0 4px 14px; font-size: 14px; color: var(--label-2); }
.sheet .group { background: var(--card); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.sheet .kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: .5px solid var(--sep); font-size: 15px; }
.sheet .kv:last-child { border-bottom: none; }
.sheet .kv span:first-child { color: var(--label-2); }
.sheet textarea {
  width: 100%; min-height: 96px; resize: vertical; border: none; outline: none;
  padding: 12px 16px; font: inherit; font-size: 16px; background: var(--card); color: var(--label);
}
.sheet .btns { display: flex; flex-direction: column; gap: 10px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(30, 30, 32, .92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; transition: transform .2s, opacity .2s; max-width: 90vw; text-align: center;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: var(--red); }
@media (min-width: 1024px) { .toast { bottom: 32px; } }

/* ---------- Estados vazios / carregamento ----------------------------- */
.empty { padding: 60px 24px; text-align: center; color: var(--label-2); font-size: 15px; line-height: 1.5; }
.empty h2 { color: var(--label); font-size: 22px; margin: 0 0 6px; }
.skeleton { height: 62px; margin: 0 16px 1px; background: var(--card); opacity: .6; }
.ribbon {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 4px; background: #FFCC00;
}
.ribbon::after {
  content: attr(data-label); position: fixed; top: 4px; right: 12px;
  background: #FFCC00; color: #000; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 0 0 6px 6px;
}

/* ---------- Login ---------------------------------------------------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 28px;
  padding: 36px 28px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.login-card .brand-logo { width: 84px; height: 84px; margin-bottom: 8px; }
.login-card h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.4px; }
.login-card p { margin: 0 0 14px; color: var(--label-2); font-size: 15px; line-height: 1.45; }
.login-msg { min-height: 20px; font-size: 14px; color: var(--red-t); margin-top: 6px; }
#gbtn { min-height: 44px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
