/* Prumo — visual estilo Apple (iOS/macOS) com vidro translúcido */

/* Fonte Inter (arquivos locais, licença SIL OFL) */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f3f4f8;
  --bg-2: #eaebf1;
  --fg: #23252b;
  --fg-2: #3d4048;
  --muted: #747884;
  --faint: #b0b3bc;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-solid: #ffffff;
  --glass-stroke: rgba(255, 255, 255, 0.8);
  --hair: rgba(60, 64, 80, 0.1);
  --fill: rgba(120, 124, 140, 0.1);
  --fill-2: rgba(120, 124, 140, 0.18);
  /* cores suaves */
  --accent: #5a8bdc;
  --accent-soft: rgba(90, 139, 220, 0.13);
  --green: #4a9d76;
  --green-soft: rgba(74, 157, 118, 0.14);
  --red: #c9616c;
  --red-soft: rgba(201, 97, 108, 0.12);
  --orange: #d09650;
  --orange-soft: rgba(208, 150, 80, 0.15);
  --purple: #8c78cf;
  --purple-soft: rgba(140, 120, 207, 0.14);
  --blue-soft: rgba(90, 139, 220, 0.13);
  --shadow: 0 1px 2px rgba(30, 35, 60, 0.03), 0 8px 28px rgba(30, 35, 60, 0.06);
  --shadow-lg: 0 24px 60px rgba(30, 35, 60, 0.16);
  --blob-1: #9fcdf5;
  --blob-2: #d3c0f5;
  --blob-3: #a9e6d6;
  --blob-opacity: 0.55;
  --radius: 22px;
  --radius-sm: 14px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Inter Variable", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: var(--font);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0c10;
    --bg-2: #111218;
    --fg: #eceef3;
    --fg-2: #c9ccd4;
    --muted: #8e929c;
    --faint: #5d616b;
    --glass: rgba(34, 36, 44, 0.55);
    --glass-strong: rgba(40, 42, 50, 0.86);
    --glass-solid: #1b1c22;
    --glass-stroke: rgba(255, 255, 255, 0.08);
    --hair: rgba(255, 255, 255, 0.08);
    --fill: rgba(130, 134, 150, 0.18);
    --fill-2: rgba(130, 134, 150, 0.3);
    --accent: #7ba3e6;
    --accent-soft: rgba(123, 163, 230, 0.16);
    --green: #6cbf98;
    --green-soft: rgba(108, 191, 152, 0.15);
    --red: #e08a92;
    --red-soft: rgba(224, 138, 146, 0.15);
    --orange: #e0ac70;
    --orange-soft: rgba(224, 172, 112, 0.16);
    --purple: #a998e0;
    --purple-soft: rgba(169, 152, 224, 0.16);
    --blue-soft: rgba(123, 163, 230, 0.16);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --blob-1: #1d3f78;
    --blob-2: #3f2d72;
    --blob-3: #144d45;
    --blob-opacity: 0.55;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-2: #111218;
  --fg: #eceef3;
  --fg-2: #c9ccd4;
  --muted: #8e929c;
  --faint: #5d616b;
  --glass: rgba(34, 36, 44, 0.55);
  --glass-strong: rgba(40, 42, 50, 0.86);
  --glass-solid: #1b1c22;
  --glass-stroke: rgba(255, 255, 255, 0.08);
  --hair: rgba(255, 255, 255, 0.08);
  --fill: rgba(130, 134, 150, 0.18);
  --fill-2: rgba(130, 134, 150, 0.3);
  --accent: #7ba3e6;
  --accent-soft: rgba(123, 163, 230, 0.16);
  --green: #6cbf98;
  --green-soft: rgba(108, 191, 152, 0.15);
  --red: #e08a92;
  --red-soft: rgba(224, 138, 146, 0.15);
  --orange: #e0ac70;
  --orange-soft: rgba(224, 172, 112, 0.16);
  --purple: #a998e0;
  --purple-soft: rgba(169, 152, 224, 0.16);
  --blue-soft: rgba(123, 163, 230, 0.16);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --blob-1: #1d3f78;
  --blob-2: #3f2d72;
  --blob-3: #144d45;
  --blob-opacity: 0.55;
}


* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.green { color: var(--green); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.accent { color: var(--accent); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Fundo com manchas de cor, para o vidro ter o que refratar */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-opacity);
}
.backdrop i:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: var(--blob-1); }
.backdrop i:nth-child(2) { width: 50vmax; height: 50vmax; right: -18vmax; top: 10vh; background: var(--blob-2); }
.backdrop i:nth-child(3) { width: 45vmax; height: 45vmax; left: 10vw; bottom: -25vmax; background: var(--blob-3); }

/* Vidro */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .tabbar, .sidebar, .topbar, .sheet, .toast { background: var(--glass-solid) !important; }
}

/* ---------- Estrutura ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main {
  flex: 1;
  min-width: 0;
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--tabbar-h) + var(--safe-b) + 96px);
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -16px; padding: calc(var(--safe-t) + 6px) 16px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px;
  background: transparent;
  transition: background .2s, border-color .2s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom-color: var(--hair);
}
.topbar .small-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; }
.topbar.scrolled .small-title { opacity: 1; }
.topbar .actions { display: flex; gap: 6px; align-items: center; }

.large-title {
  font-size: 34px; font-weight: 600; letter-spacing: -0.022em; margin: 2px 0 2px; line-height: 1.1;
}
.subtitle { color: var(--muted); font-size: 15px; margin: 0 0 16px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--accent);
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--fill); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.filled { background: var(--fill); }

/* Barra de abas (celular) */
.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 40;
  height: var(--tabbar-h); border-radius: 26px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 4px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--shadow-lg);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; min-height: 44px; border-radius: 20px;
  transition: color .15s;
}
.tab svg { width: 25px; height: 25px; }
.tab.active { color: var(--accent); }
.tab .badge { position: absolute; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + 22px + var(--safe-b)); z-index: 39;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(90, 139, 220, 0.38), 0 2px 6px rgba(0,0,0,.1);
  transition: transform .15s;
}
.fab:active { transform: scale(.92); }
.fab svg { width: 28px; height: 28px; }

/* ---------- Computador ---------- */
@media (min-width: 900px) {
  .tabbar { display: none; }
  /* Barra flutuante só com ícones, centralizada na lateral */
  .app { padding-left: 104px; }
  .sidebar {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    position: fixed; z-index: 30; left: 22px; top: 50%; transform: translateY(-50%);
    width: 64px; padding: 12px 0;
    border-radius: 32px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    backdrop-filter: blur(30px) saturate(170%);
    border: 1px solid var(--glass-stroke);
    box-shadow: var(--shadow-lg);
  }
  .side-link {
    position: relative; width: 46px; height: 46px; border-radius: 16px;
    display: grid; place-items: center; color: var(--muted);
    transition: background .15s, color .15s;
  }
  .side-link svg { width: 21px; height: 21px; stroke-width: 1.6; }
  .side-link:hover { background: var(--fill); color: var(--fg-2); }
  .side-link.active { background: var(--accent-soft); color: var(--accent); }
  .side-sep { width: 32px; height: 1px; background: var(--hair); margin: 6px 0; }
  .side-tip {
    position: absolute; left: 58px; top: 50%; transform: translate(-4px, -50%);
    background: var(--glass-solid); color: var(--fg); box-shadow: var(--shadow-lg);
    padding: 6px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
  }
  .side-link:hover .side-tip, .side-link:focus-visible .side-tip { opacity: 1; transform: translate(0, -50%); }
  .topbar .gear-btn, .topbar > div:first-child .sync-dot { display: none; }
  .side-sync { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; }
  .main { max-width: 1180px; padding: 12px 40px 80px; }
  .topbar { margin: 0 -40px; padding: 10px 40px; }
  .fab { bottom: 32px; right: 32px; }
  .large-title { font-size: 38px; }
}

/* ---------- Cartões / grade ---------- */
.card {
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.card.tap { cursor: pointer; transition: transform .12s; }
.card.tap:active { transform: scale(.985); }
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px;
  text-transform: none;
}
.card-title svg { width: 16px; height: 16px; }
.big { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; font-family: var(--font-round); }
.mid { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-family: var(--font-round); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.section { margin-top: 26px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 4px 8px;
}
.section-head h2 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.015em; }
.section-head a, .section-head button { color: var(--accent); font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 900px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .cols > * > .section:first-child { margin-top: 0; }
}
@media (max-width: 899px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Hero */
.hero { padding: 20px; }
.hero .big { font-size: 40px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Listas (estilo Ajustes do iOS) ---------- */
.list { border-radius: var(--radius); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 16px;
  position: relative; width: 100%; text-align: left;
}
.item + .item::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--hair);
}
.item.with-lead + .item.with-lead::before { left: 62px; }
button.item:hover, .item.tap:hover { background: var(--fill); }
.item.tap { cursor: pointer; }
.item .main-col { flex: 1; min-width: 0; }
.item .t { font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex: 0 0 auto; }
.item .end .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.chev { color: var(--faint); flex: 0 0 auto; }
.chev svg { width: 15px; height: 15px; }
.ic { align-items: center; justify-content: center; }
.item.done .t { color: var(--muted); text-decoration: line-through; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--a1, #5ac8fa), var(--a2, #007aff));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.lead-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  display: grid; place-items: center; color: #fff;
}
.lead-icon svg { width: 19px; height: 19px; }

/* Pílulas de status */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.blue { background: var(--blue-soft); color: var(--accent); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }
.pill.gray { background: var(--fill); color: var(--muted); }

/* Estatísticas */
.stat { padding: 14px 16px; border-radius: var(--radius); }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: clamp(17px, 5.2vw, 24px); white-space: nowrap; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-family: var(--font-round); font-variant-numeric: tabular-nums; }
.stat .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; }
.dot.red { background: var(--red); } .dot.green { background: var(--green); } .dot.orange { background: var(--orange); } .dot.blue { background: var(--accent); } .dot.purple { background: var(--purple); } .dot.gray { background: var(--faint); }

.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.counter { background: var(--fill); border-radius: 14px; padding: 10px 12px; }
.counter b { display: block; font-size: 22px; font-family: var(--font-round); }
.counter span { font-size: 12px; color: var(--muted); font-weight: 600; }
.counter.red b { color: var(--red); } .counter.orange b { color: var(--orange); } .counter.green b { color: var(--green); }

/* Barras de progresso */
.bar { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s cubic-bezier(.2,.8,.2,1); }
.bar.green > i { background: var(--green); } .bar.orange > i { background: var(--orange); } .bar.red > i { background: var(--red); }

/* Segmented control */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--fill); border-radius: 12px; padding: 3px; margin: 0 0 16px; gap: 2px;
}
.segmented button {
  min-height: 36px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--fg-2);
  transition: background .2s, box-shadow .2s;
}
.segmented button.active { background: var(--glass-solid); box-shadow: 0 2px 8px rgba(0,0,0,.12); color: var(--fg); }
@media (min-width: 900px) { .segmented { max-width: 460px; } }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  font-weight: 600; font-size: 16px;
  background: var(--accent); color: #fff;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: var(--fill); color: var(--fg); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.green { background: var(--green); color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 0; }

/* Checkbox redondo */
.check {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  border: 2px solid var(--faint); display: grid; place-items: center;
  transition: background .18s, border-color .18s, transform .15s;
  position: relative;
}
.check::after { content: ""; position: absolute; inset: -7px; } /* área de toque 44px */
.check svg { width: 17px; height: 17px; color: #fff; opacity: 0; transform: scale(.5); transition: all .18s; }
.check.on { background: var(--green); border-color: var(--green); }
.check.on svg { opacity: 1; transform: scale(1); }
.check:active { transform: scale(.9); }
.check.small { width: 24px; height: 24px; flex-basis: 24px; }
.check.small::after { inset: -10px; }
.check.small svg { width: 14px; height: 14px; }

/* ---------- Folha (bottom sheet / diálogo) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.32);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: up .32s cubic-bezier(.2, .9, .25, 1);
  border: 1px solid var(--glass-stroke); border-bottom: 0;
}
.sheet.closing { animation: down .22s ease forwards; }
.overlay.closing { animation: fadeout .22s ease forwards; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 7px auto 0; flex: 0 0 auto; }
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 4px 8px; min-height: 52px; flex: 0 0 auto;
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.sheet-head .l { justify-self: start; }
.sheet-head .r { justify-self: end; }
.sheet-head .txt-btn { min-height: 44px; padding: 0 10px; color: var(--accent); font-size: 17px; }
.sheet-head .txt-btn.bold { font-weight: 600; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 16px calc(24px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 24px; max-height: 86vh; border-bottom: 1px solid var(--glass-stroke); animation: pop .28s cubic-bezier(.2, .9, .25, 1); }
  .sheet.closing { animation: popout .18s ease forwards; }
  .sheet-grip { display: none; }
  .sheet-body { padding-bottom: 24px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes popout { to { transform: scale(.96); opacity: 0; } }

/* Formulários */
.form-group { border-radius: 16px; background: var(--glass-solid); overflow: hidden; margin-bottom: 18px; box-shadow: 0 0 0 1px var(--hair); }
.form-label { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 4px 6px 16px; text-transform: uppercase; letter-spacing: .02em; }
.field {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; position: relative;
}
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--hair); }
.field > label { flex: 0 0 auto; min-width: 96px; font-size: 16px; color: var(--fg); }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  min-height: 48px; font-size: 16px; text-align: right; color: var(--fg);
}
.field select { text-align-last: right; appearance: none; -webkit-appearance: none; padding-right: 2px; cursor: pointer; }
.field select option { color: #000; }
.field textarea { text-align: left; padding: 12px 0; min-height: 80px; resize: vertical; }
.field.stacked { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.field.stacked > label { font-size: 13px; color: var(--muted); }
.field.stacked input, .field.stacked textarea { text-align: left; }
.field input::placeholder { color: var(--faint); }
.field input[type="date"], .field input[type="month"] { text-align: right; }
.field .unit { color: var(--muted); }
.field-hint { font-size: 13px; color: var(--muted); margin: -12px 16px 18px; }
.field.toggle { justify-content: space-between; }

.money-input {
  width: 100%; border: 0; outline: 0; background: transparent; text-align: center;
  font-size: 44px; font-weight: 600; font-family: var(--font-round); letter-spacing: -0.02em;
  padding: 8px 0; color: var(--fg); min-height: 64px;
}
.money-wrap { text-align: center; margin: 6px 0 18px; }
.money-wrap .cur { font-size: 15px; color: var(--muted); font-weight: 600; }

/* Switch iOS */
.switch { position: relative; width: 51px; height: 31px; flex: 0 0 51px; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--fill-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* Dias do mês */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 12px; }
.days button {
  min-height: 44px; border-radius: 12px; font-weight: 600; font-size: 15px; background: var(--fill);
  font-variant-numeric: tabular-nums;
}
.days button.on { background: var(--accent); color: #fff; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--fill); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--accent); color: #fff; }

/* Toast */
.toast {
  position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content;
  bottom: calc(var(--tabbar-h) + 26px + var(--safe-b)); z-index: 200;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--shadow-lg);
  border-radius: 999px; padding: 8px 8px 8px 18px; min-height: 48px;
  display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px;
  animation: toastin .3s cubic-bezier(.2,.9,.25,1);
  max-width: calc(100vw - 32px);
}
.toast.only { padding-right: 18px; }
.toast button { color: var(--accent); font-weight: 600; min-height: 36px; padding: 0 12px; border-radius: 99px; }
@keyframes toastin { from { transform: translateY(20px); opacity: 0; } }
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* Sincronização */
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.sync-dot.busy { background: var(--orange); animation: pulse 1s infinite; }
.sync-dot.off { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

/* Alertas */
.alert-row .lead-icon.red { background: var(--red); }
.alert-row .lead-icon.orange { background: var(--orange); }
.alert-row .lead-icon.blue { background: var(--accent); }
.alert-row .lead-icon.purple { background: var(--purple); }

/* Anel de progresso */
.ring { --p: 0; --c: var(--green); width: 64px; height: 64px; border-radius: 50%; flex: 0 0 64px;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--fill) 0);
  display: grid; place-items: center; }
.ring::before { content: ""; grid-area: 1/1; width: 50px; height: 50px; border-radius: 50%; background: var(--glass-solid); }
.ring span { grid-area: 1/1; z-index: 1; font-weight: 600; font-size: 15px; font-family: var(--font-round); }

/* Cartões de crédito (visual) */
.cc {
  border-radius: 20px; padding: 16px 18px; color: #fff; min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 12px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative; overflow: hidden; cursor: pointer; transition: transform .12s;
}
.cc:active { transform: scale(.98); }
.cc::after { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -90px; border-radius: 50%; background: rgba(255,255,255,.12); }
.cc .cc-name { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.cc .cc-meta { font-size: 12.5px; opacity: .85; }
.cc .cc-avail { font-size: 24px; font-weight: 600; font-family: var(--font-round); }
.cc .bar { background: rgba(255,255,255,.25); height: 6px; }
.cc .bar > i { background: #fff; }
.cc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.best {
  border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center;
}
.best .lead-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; background: linear-gradient(135deg, #6cbf98, #5fa8c4); }

/* Meses (planejamento) */
.month-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 64px; }
.month-row + .month-row { border-top: 1px solid var(--hair); }
.month-row .m { width: 88px; flex: 0 0 88px; font-weight: 600; }
.month-row .m small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.month-row .info { flex: 1; min-width: 0; }
.month-row .info .bar { margin-top: 6px; }

.target { padding: 20px; overflow: hidden; }
.target .big { font-size: 38px; }
.breakdown { margin-top: 14px; display: grid; gap: 2px; }
.breakdown .ln { display: flex; justify-content: space-between; font-size: 15px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.breakdown .ln.total { border-top: 1px solid var(--hair); margin-top: 4px; padding-top: 9px; font-weight: 600; }

/* Calendário */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px; border-radius: var(--radius); }
.cal .wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal .d {
  min-height: 54px; border-radius: 12px; padding: 5px 2px 4px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
  transition: background .15s;
}
.cal .d:hover { background: var(--fill); }
.cal .d .n { font-weight: 600; font-size: 15px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal .d.today .n { background: var(--red); color: #fff; }
.cal .d.sel { background: var(--accent-soft); }
.cal .d.past .n { color: var(--muted); }
.cal .d .dots { display: flex; gap: 3px; height: 6px; }
.cal .d .dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal .d .dots i.in { background: var(--green); }
.cal .d .dots i.out { background: var(--red); }
.cal .d .bal { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.02em; }
.cal .d .bal.neg { color: var(--red); }
.cal .d.empty { visibility: hidden; }
@media (min-width: 900px) {
  .cal .d { min-height: 92px; align-items: stretch; text-align: left; padding: 6px 8px; }
  .cal .d .n { margin-left: -4px; }
  .cal .d .dots { display: none; }
  .cal .d .amts { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .cal .d .bal { font-size: 11px; margin-top: auto; }
}
@media (max-width: 899px) { .cal .d .amts { display: none; } }

/* Checklist */
.check-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; min-height: 60px; }
.check-row + .check-row { border-top: 1px solid var(--hair); }
.check-row .who { flex: 1; min-width: 0; padding-top: 4px; }
.check-row .who .t { font-weight: 600; font-size: 16px; }
.check-row.done .who .t { color: var(--muted); }
.task { display: flex; gap: 10px; align-items: center; min-height: 40px; font-size: 15px; }
.task .txt { flex: 1; min-width: 0; }
.task .age { font-size: 12px; color: var(--orange); font-weight: 600; white-space: nowrap; }
.add-task { color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.add-task svg { width: 16px; height: 16px; }

/* Estado vazio */
.empty-state { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 8px; }
.empty-state p { margin: 0 0 14px; }

/* Login */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px;
}
.login-card { width: 100%; max-width: 380px; padding: 30px 24px 24px; border-radius: 28px; text-align: center; }
.login-card img { width: 76px; height: 76px; border-radius: 20px; box-shadow: var(--shadow-lg); margin-bottom: 14px; }
.login-card h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card .form-group { text-align: left; }
.login-card .field input { text-align: left; }
.login-err { color: var(--red); font-size: 14px; min-height: 20px; margin: -8px 0 10px; }

/* Menu de ações rápidas */
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick button {
  border-radius: 18px; padding: 16px; min-height: 96px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  background: var(--glass-solid); box-shadow: 0 0 0 1px var(--hair);
  font-weight: 600; font-size: 15px;
}
.quick button .lead-icon { width: 36px; height: 36px; }
.quick button:active { transform: scale(.97); }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--hair); }
.kv span:first-child { color: var(--muted); }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 14px; }
.month-nav h3 { margin: 0; font-size: 19px; font-weight: 600; text-transform: capitalize; }

.note { font-size: 13px; color: var(--muted); padding: 8px 16px 0; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }

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