/* ===================== Tokens ===================== */
:root {
    color-scheme: dark;
    --bg: #0b1120;
    --bg-glow: radial-gradient(1200px 600px at 50% -200px, rgba(16, 185, 129, 0.14), transparent 70%);
    --surface: #121a2c;
    --surface-2: #19233a;
    --surface-3: #222e48;
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.28);
    --text: #eaf0fa;
    --text-2: #9aa8c1;
    --text-3: #6b7a95;
    --brand: #10b981;
    --brand-strong: #059669;
    --brand-soft: rgba(16, 185, 129, 0.14);
    --brand-text: #34d399;
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --on-brand: #04130d;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --radius: 18px;
    --radius-sm: 12px;
    --nav-h: 68px;
    --safe-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)); /* app Android: o Capacitor injeta --safe-area-inset-* */
    --safe-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f3f5fa;
        --bg-glow: radial-gradient(1200px 600px at 50% -200px, rgba(16, 185, 129, 0.12), transparent 70%);
        --surface: #ffffff;
        --surface-2: #f1f4f9;
        --surface-3: #e5eaf2;
        --border: rgba(15, 23, 42, 0.08);
        --border-strong: rgba(15, 23, 42, 0.18);
        --text: #0f172a;
        --text-2: #51607a;
        --text-3: #8391a8;
        --brand: #059669;
        --brand-strong: #047857;
        --brand-soft: rgba(5, 150, 105, 0.1);
        --brand-text: #047857;
        --info: #2563eb;
        --info-soft: rgba(37, 99, 235, 0.1);
        --warn: #b45309;
        --warn-soft: rgba(217, 119, 6, 0.12);
        --danger: #dc2626;
        --danger-soft: rgba(220, 38, 38, 0.1);
        --on-brand: #ffffff;
        --shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.25);
    }
}

/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-glow), var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100dvh;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
[hidden] { display: none !important; }

h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; font-weight: 600; }

.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.neg { color: var(--danger); }
.pos { color: var(--brand-text); }

.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; border: 0 !important; opacity: 0;
    overflow: hidden; pointer-events: none; bottom: 0; left: 50%;
}

.ico {
    width: 20px; height: 20px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===================== Layout ===================== */
#app {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + var(--ad-h, 0px) + 24px);
}

body:not(.has-nav) #app { padding-bottom: calc(24px + var(--safe-b)); }

.screen { display: none; }
.screen.active { display: block; animation: enter 0.28s ease both; }
.screen-center.active {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: calc(100dvh - 48px); gap: 16px; text-align: center;
}

@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

.page-head { margin: 8px 0 16px; }
.page-head p { margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid-3 .suffix { padding-right: 10px; font-size: 0.78rem; }
.grid-3 .input-wrap input { padding-left: 10px; padding-right: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

@media (max-width: 460px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-3 > :first-child { grid-column: span 2; }
}

/* ===================== App bar ===================== */
.appbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    max-width: 560px; margin: 0 auto;
    padding: calc(10px + var(--safe-t)) 16px 10px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { border-radius: 9px; }

.sync-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 0.78rem; font-weight: 500; color: var(--text-2);
    transition: background 0.2s, color 0.2s;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.sync-pill[data-state="pending"] .sync-dot,
.sync-pill[data-state="saving"] .sync-dot { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
.sync-pill[data-state="error"], .sync-pill[data-state="offline"] { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.sync-pill[data-state="error"] .sync-dot, .sync-pill[data-state="offline"] .sync-dot { background: var(--danger); }
.sync-pill[data-state="auth"] { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.sync-pill[data-state="auth"] .sync-dot { background: var(--warn); }
.sync-pill[data-state="stale"] { color: var(--info); }
.sync-pill[data-state="stale"] .sync-dot { background: var(--info); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ===================== Cards ===================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .card-title { margin-bottom: 0; }
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px; }
.card-total { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.subhead { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin: 18px 0 10px; }
.eyebrow { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }
.hint { font-size: 0.8rem; color: var(--text-3); margin-top: 10px; }

/* ===================== Forms ===================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field-label { font-size: 0.82rem; font-weight: 500; color: var(--text-2); }

.input-wrap {
    display: flex; align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}
.input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.prefix, .suffix { color: var(--text-3); font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.prefix { padding-left: 12px; }
.suffix { padding-right: 12px; }

input[type="text"], input[type="date"] {
    width: 100%; min-width: 0;
    padding: 13px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="date"]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-wrap input[type="text"] {
    background: transparent; border: none; box-shadow: none;
    padding-left: 8px; font-variant-numeric: tabular-nums; font-weight: 500;
}
.input-wrap input:first-child { padding-left: 12px; }
input::placeholder, textarea::placeholder { color: var(--text-3); font-weight: 400; }
textarea {
    width: 100%; min-width: 0; resize: vertical; min-height: 64px;
    padding: 12px; font: inherit; font-size: 1rem; color: inherit;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field-opt { color: var(--text-3); font-weight: 400; }

.field-list { display: flex; flex-direction: column; gap: 8px; }
.field-inline {
    display: grid; grid-template-columns: 1fr minmax(130px, 46%); align-items: center;
    gap: 10px; margin: 0;
}
.field-inline .field-label { font-size: 0.95rem; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--c, var(--brand)); }

.add-row { display: flex; gap: 8px; margin-top: 14px; }
.add-row input { flex: 1; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn { flex: 1; }

.preview {
    background: var(--surface-2); border-radius: var(--radius-sm);
    padding: 12px 14px; margin-top: 4px; font-size: 0.88rem;
    display: grid; gap: 6px;
}
.preview-row { display: flex; justify-content: space-between; gap: 10px; }
.preview-row span:first-child { color: var(--text-2); }
.preview-row strong { font-variant-numeric: tabular-nums; }
.preview.warn { background: var(--danger-soft); color: var(--danger); }

/* ===================== Buttons ===================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: 1rem;
    transition: transform 0.1s, background 0.15s, opacity 0.15s;
    width: 100%;
}
a.btn, a.list-item { text-decoration: none; color: inherit; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-soft { background: var(--brand-soft); color: var(--brand-text); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; width: auto; border-radius: 10px; }
.btn-sm .ico { width: 16px; height: 16px; }
.add-row .btn { width: auto; }
.btn-icon-text { white-space: nowrap; }

.btn-google {
    background: #fff; color: #1f2937; border: 1px solid #dadce0;
    max-width: 340px; font-weight: 600;
}
.btn-google:hover { background: #f8fafc; }

.icon-btn {
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-2); flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { color: var(--brand-text); font-weight: 600; font-size: 0.88rem; padding: 4px 8px; }

/* ===================== Chips ===================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 9px 14px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 0.92rem; font-weight: 500; color: var(--text-2);
    transition: all 0.15s;
}
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.chip[aria-pressed="true"]::before { content: '✓ '; }
.chips-sm { margin-bottom: 14px; }
.chips-sm .chip { padding: 6px 12px; font-size: 0.85rem; }
.chips-static { margin-top: 14px; }
.chips-static .chip { cursor: default; }

/* ===================== Segmented & date nav ===================== */
.seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 4px; margin-bottom: 12px;
}
.seg-btn { padding: 9px 6px; border-radius: 10px; font-weight: 600; font-size: 0.92rem; color: var(--text-2); transition: all 0.15s; }
.seg-btn.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.15); }

.date-nav { display: flex; align-items: center; gap: 4px; }
.date-label {
    flex: 1; position: relative;
    display: flex; flex-direction: column; align-items: center;
    padding: 6px; border-radius: 12px;
}
.date-label:hover { background: var(--surface-2); }
.date-title { font-weight: 700; font-size: 1.1rem; }
.date-sub { font-size: 0.82rem; color: var(--text-2); }
.today-row { display: flex; justify-content: center; min-height: 8px; margin-bottom: 6px; }

/* ===================== Hero ===================== */
.hero { position: relative; overflow: hidden; }
.hero::after {
    content: ''; position: absolute; inset: auto -40% -60% auto; width: 260px; height: 260px;
    background: radial-gradient(circle, var(--hero-glow, var(--brand-soft)), transparent 70%);
    pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge {
    font-size: 0.78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    background: var(--surface-2); color: var(--text-2); font-variant-numeric: tabular-nums;
}
.hero-value {
    font-size: clamp(2.2rem, 11vw, 3.1rem); font-weight: 800; letter-spacing: -0.03em;
    line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.hero-sub { color: var(--text-2); font-size: 0.92rem; min-height: 1.3em; }
.hero-title { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.info-btn {
    width: 32px; height: 32px; margin: -8px 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-3); flex-shrink: 0;
}
.info-btn .ico { width: 18px; height: 18px; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--info); background: var(--info-soft); }
.hero-info {
    margin-top: 14px; padding: 10px 12px 10px 28px; border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text-2); font-size: 0.85rem;
    display: grid; gap: 6px;
}
.hero-tip {
    margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--info-soft); color: var(--info); font-size: 0.88rem; font-weight: 500;
}
.hero-foot { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-2); }
.hero-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }
.hero #hero-fix { margin-top: 14px; }

.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 16px 0 10px; }
.progress-fill {
    height: 100%; width: 0; border-radius: inherit;
    background: linear-gradient(90deg, var(--info), var(--brand));
    transition: width 0.5s cubic-bezier(.2,.8,.2,1);
}

.hero[data-state="progress"] .hero-value { color: var(--text); }
.hero[data-state="done"] { --hero-glow: rgba(16,185,129,0.3); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.hero[data-state="done"] .hero-value { color: var(--brand-text); }
.hero[data-state="done"] .badge { background: var(--brand-soft); color: var(--brand-text); }
.hero[data-state="missed"] .hero-value { color: var(--warn); }
.hero[data-state="error"] .hero-value { color: var(--danger); font-size: 1.6rem; }

/* ===================== Stats ===================== */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0;
}
.stat-label { font-size: 0.78rem; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { font-size: 0.75rem; color: var(--text-3); }
.stat-grid-flat { margin: 16px 0 0; }
.stat-grid-flat .stat { background: var(--surface-2); border-color: transparent; }
.stat-btn:hover { background: var(--surface-3) !important; }

/* ===================== Lists ===================== */
.list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 8px; border-radius: 12px; min-height: 52px;
}
.list-item + .list-item { border-top: 1px solid var(--border); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
button.item-main { padding: 0; }
.item-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 0.8rem; color: var(--text-3); }
.item-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.item-value small { display: block; font-weight: 500; font-size: 0.78rem; color: var(--text-3); }
.list-item .icon-btn { width: 36px; height: 36px; color: var(--text-3); }
.list-item .icon-btn:hover { color: var(--danger); background: var(--danger-soft); }
.list .empty { color: var(--text-3); font-size: 0.9rem; text-align: center; padding: 14px 0; }

.list-select > li + li > .list-item { border-top: 1px solid var(--border); }
.list-select .list-item { width: 100%; text-align: left; }
.list-select button.list-item { cursor: pointer; transition: background 0.15s; }
.list-select button.list-item:hover { background: var(--surface-2); }
.list-select .list-item.selected { background: var(--brand-soft); }
.list-select > li:has(> .selected) + li > .list-item,
.list-select > li + li > .list-item.selected { border-top-color: transparent; }

/* ===================== Horizontal bars ===================== */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar-head { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; gap: 10px; }
.hbar-head span:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-head span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbar-head small { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.hbar-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: inherit; background: var(--c, var(--brand)); transition: width 0.5s ease; }

/* ===================== Reports ===================== */
.range-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.range-form .field { margin: 0; }
.range-form .btn { grid-column: span 2; }

.empty-state { text-align: center; padding: 48px 16px; }
.empty-ico { font-size: 2.4rem; color: var(--text-3); margin-bottom: 8px; }
.empty-state p + p { margin-top: 6px; }

/* ===================== Profile ===================== */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; font-size: 0.92rem; }
.kv dt { color: var(--text-2); }
.kv dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
/* Ajustes: grupos em lista */
#profile-screen .page-head + .subhead { margin-top: 4px; }
.set-card { padding: 6px; }
.set-row { color: inherit; }
.set-row .item-value { font-weight: 600; color: var(--text-2); max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.set-chev { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.set-danger .item-title { color: var(--danger); }
.set-note { margin: -6px 4px 0; }
.set-howto summary { cursor: pointer; font-weight: 600; }
.set-howto .howto { margin-top: 12px; }
.set-install { padding: 6px 18px; }
.set-install .set-howto { padding: 12px 0; }
.set-install .set-howto + .set-howto { border-top: 1px solid var(--border); }
.set-install .hint { margin-bottom: 2px; }
.howto { padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); font-size: 0.92rem; }
.version { text-align: center; color: var(--text-3); font-size: 0.8rem; margin-top: 8px; }
.made-by {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    color: var(--text-2); font-size: 0.85rem; font-weight: 600; margin-top: 22px;
}
/* símbolo da Covem pintado com a cor do texto (funciona no tema claro e escuro) */
.covem-mark {
    width: 32px; height: 20px; flex-shrink: 0; background: currentColor;
    -webkit-mask: url(covem.svg) no-repeat center / contain;
    mask: url(covem.svg) no-repeat center / contain;
}

/* ===================== Login ===================== */
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-logo { border-radius: 24px; box-shadow: 0 20px 50px -20px rgba(16,185,129,0.6); }
.login-title { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.login-tagline { color: var(--text-2); max-width: 320px; font-size: 1.05rem; }
.feature-list { list-style: none; display: grid; gap: 10px; text-align: left; max-width: 340px; margin: 8px 0 12px; }
.feature-list li { display: flex; gap: 12px; align-items: center; color: var(--text-2); font-size: 0.95rem; }
.feature-ico {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text);
}
.fine-print { font-size: 0.8rem; color: var(--text-3); max-width: 320px; }

.spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid var(--surface-3); border-top-color: var(--brand);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Bottom nav ===================== */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; justify-content: center; gap: 4px;
    padding: 8px 12px calc(8px + var(--safe-b));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
}
.nav-item {
    flex: 1; max-width: 160px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; color: var(--text-3);
    transition: color 0.15s;
}
.nav-item.active { color: var(--brand-text); }
.nav-item .ico { width: 52px; height: 28px; padding: 3px 14px; border-radius: 999px; transition: background 0.15s; }
.nav-item.active .ico { background: var(--brand-soft); }

/* ===================== Dialogs ===================== */
dialog.sheet {
    border: none; padding: 0; background: transparent; color: var(--text);
    max-width: 100%; max-height: 100%;
    width: 100%; margin: auto auto 0;
}
dialog.sheet::backdrop { background: rgba(2, 6, 23, 0.6); backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: sheet-up 0.25s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.dialog-body {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    padding: 22px 18px calc(18px + var(--safe-b));
    max-width: 560px; margin: 0 auto;
    max-height: 88dvh; overflow-y: auto;
}
.dialog-body h2 { margin-bottom: 14px; font-size: 1.2rem; }
.dialog-actions { display: flex; gap: 10px; margin-top: 16px; }
.dialog-actions .btn { flex: 1; }
#report-expenses-list { max-height: 50dvh; overflow-y: auto; }

@media (min-width: 640px) {
    dialog.sheet { margin: auto; max-width: 440px; }
    .dialog-body { border-radius: 22px; padding-bottom: 18px; }
}

/* ===================== Toast ===================== */
.toast {
    position: fixed; left: 50%; z-index: 100;
    bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    display: flex; align-items: center; gap: 14px;
    max-width: calc(100% - 32px); width: max-content;
    padding: 12px 16px; border-radius: 14px;
    background: var(--text); color: var(--bg);
    font-size: 0.92rem; font-weight: 500;
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.5);
    transition: opacity 0.2s, transform 0.2s;
}
body:not(.has-nav) .toast { bottom: calc(24px + var(--safe-b)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast[data-type="error"] { background: var(--danger); color: #fff; }
.toast-action { color: var(--brand); font-weight: 700; text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.04em; }
@media (prefers-color-scheme: light) { .toast-action { color: #34d399; } }

/* ===================== Metas ===================== */
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.goal-widget .card-head { margin-bottom: 10px; }
.goal-widget .progress { margin: 10px 0 8px; height: 8px; }
.goal-empty-text { color: var(--text-2); font-size: 0.92rem; }
.goal-mini + .goal-mini { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.goal-mini-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal-mini-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-mini-pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 0.88rem; }
.goal-mini-line { font-size: 0.86rem; color: var(--text-2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.goal-mini-line strong { color: var(--text); font-variant-numeric: tabular-nums; }
.goal-today {
    margin-top: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
    background: var(--info-soft); color: var(--info); font-size: 0.88rem; font-weight: 500;
}
.goal-today.ok { background: var(--brand-soft); color: var(--brand-text); }
.goal-more { display: flex; justify-content: center; margin-top: 10px; }

.goal-card .goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal-card .goal-name { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.goal-card .goal-dates { font-size: 0.82rem; color: var(--text-3); margin-top: 2px; }
.goal-card .goal-amounts { margin-top: 12px; font-size: 0.92rem; color: var(--text-2); }
.goal-card .goal-amounts strong { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-right: 4px; }
.goal-card .progress { margin: 10px 0 12px; }
.goal-card .stat-grid { margin: 12px 0 0; }
.goal-card .stat { background: var(--surface-2); border-color: transparent; }
.goal-card .stat-value.big { color: var(--brand-text); }
.goal-status {
    margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500; background: var(--surface-2); color: var(--text-2);
}
.goal-card[data-status="done"] { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.goal-card[data-status="done"] .goal-status { background: var(--brand-soft); color: var(--brand-text); }
.goal-card[data-status="done"] .badge { background: var(--brand-soft); color: var(--brand-text); }
.goal-card[data-status="expired"] .goal-status { background: var(--warn-soft); color: var(--warn); }
.goal-card[data-status="expired"] .progress-fill { background: var(--warn); }
.goal-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.goal-card .goal-head-main { flex: 1; min-width: 0; }
.goal-order { display: flex; flex-direction: column; align-items: center; margin: -6px 0 -6px -8px; }
.goal-order .icon-btn { width: 36px; height: 30px; border-radius: 8px; }
.goal-order .icon-btn:disabled { opacity: 0.25; pointer-events: none; }
.goal-rank { font-size: 0.78rem; font-weight: 700; color: var(--brand-text); font-variant-numeric: tabular-nums; line-height: 1; }
.goal-order-note {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    font-size: 0.84rem; color: var(--text-2); margin: 0 2px 12px;
}

.goal-total { display: grid; gap: 4px; }
.goal-total-label { font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.goal-total-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.goal-total-value small { font-size: 0.9rem; font-weight: 600; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.goal-total.compact .goal-total-value { font-size: 1.5rem; }
.goal-total-card { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.goal-total + .goal-mini { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.goal-actions .btn-danger-ghost { width: auto; }
.goals-section-title { margin: 22px 0 10px; }

.chips-days { gap: 6px; margin-bottom: 0; }
.chips-days .chip { padding: 7px 0; width: calc((100% - 36px) / 7); text-align: center; font-size: 0.82rem; }
.chips-days .chip[aria-pressed="true"]::before { content: none; }

.bottom-nav .nav-item .ico { width: 48px; padding: 3px 12px; }

/* ===================== Planos e anúncios ===================== */
.badge-brand { background: var(--brand-soft); color: var(--brand-text); }
.seg-save { font-size: 0.72rem; color: var(--brand-text); margin-left: 4px; }
.plans-reason {
    background: var(--info-soft); color: var(--text); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 0.9rem; margin-bottom: 12px;
}
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-item {
    border: 1px solid var(--border); border-radius: 14px; padding: 14px;
    background: var(--surface-2);
}
.plan-item.is-current { border-color: var(--brand); }
.plan-item.is-highlight { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-head h3 { font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-pricing { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.plan-price { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-price small { font-weight: 500; font-size: 0.78rem; color: var(--text-2); margin-left: 2px; }
.plan-eq { font-size: 0.75rem; color: var(--text-3); }
.plan-features { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--text-2); }
.plan-features li::before { content: '✓'; color: var(--brand-text); font-weight: 700; margin-right: 8px; }
.plan-action { display: flex; justify-content: flex-end; margin-top: 12px; }
.reward-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reward-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface-2);
}
.reward-item.is-highlight { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.reward-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reward-main strong { font-size: 0.95rem; }
.reward-status { font-size: 0.78rem; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.reward-status.is-on { color: var(--brand-text); }
.reward-item .btn { flex-shrink: 0; width: auto; }
.locked-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.locked-box .btn { width: auto; flex-shrink: 0; }
.seg-btn.is-locked::after { content: '🔒'; font-size: 0.7em; margin-left: 4px; opacity: 0.7; }
.ad-reward { display: block; margin: 8px auto 0; font-size: 0.82rem; }
.ad-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.ad-slot { padding: 12px 14px; }
.ad-label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 6px; }
.ad-house { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ad-house strong { display: block; font-size: 0.95rem; }
.ad-house .btn { flex-shrink: 0; }
.ad-remove { display: block; margin: 6px 0 0 auto; }

/* ===================== Gestão na Pista ===================== */
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.mode-switch {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand-text);
    font-size: 0.78rem; font-weight: 700; white-space: nowrap;
    transition: background 0.15s;
}
.mode-switch .ico { width: 16px; height: 16px; }
.mode-switch:hover { background: color-mix(in srgb, var(--brand) 22%, transparent); }

select {
    width: 100%; min-width: 0;
    padding: 13px 36px 13px 12px;
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238391a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: inherit; font-size: 1rem; color: inherit;
    appearance: none; -webkit-appearance: none; outline: none;
}
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select option { background: var(--surface); color: var(--text); }

.check { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-2); margin-bottom: 4px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.date-label.is-static { cursor: default; }
.date-label.is-static:hover { background: none; }

.fab {
    position: fixed; z-index: 61;
    right: max(16px, calc(50% - 280px + 16px));
    bottom: calc(var(--nav-h) + var(--safe-b) + var(--ad-h, 0px) + 16px);
    width: 58px; height: 58px; border-radius: 18px;
    display: grid; place-items: center;
    background: var(--brand); color: var(--on-brand);
    box-shadow: 0 14px 30px -10px rgba(16, 185, 129, 0.7);
    transition: transform 0.1s, background 0.15s;
}
.fab:hover { background: var(--brand-strong); }
.fab:active { transform: scale(0.95); }
.fab .ico { width: 26px; height: 26px; stroke-width: 2.4; }
body.mode-gestao #app { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 96px); }
body.mode-gestao .toast { bottom: calc(var(--nav-h) + var(--safe-b) + 86px); }

.fin-hero .hero-sub strong { color: var(--text); font-variant-numeric: tabular-nums; }
.fin-hero .hero-value.neg { color: var(--danger); }
.fin-day-hint {
    margin-top: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
    background: var(--brand-soft); color: var(--brand-text); font-size: 0.85rem; font-weight: 500;
}

.cat-dot {
    width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
    background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c);
}
.tag {
    display: inline-block; vertical-align: 1px;
    font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
    background: var(--surface-3); color: var(--text-2); letter-spacing: 0.02em;
}
.tag-brand { background: var(--brand-soft); color: var(--brand-text); }
.tag-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

.fin-row .item-title { white-space: normal; overflow-wrap: anywhere; }
.fin-row.is-future .item-value { opacity: 0.7; }
.where { display: inline-flex; align-items: center; gap: 4px; }
.where .ico { width: 13px; height: 13px; }
.fin-list .day-head {
    display: flex; justify-content: space-between; gap: 10px;
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-3); padding: 14px 8px 4px;
}
.fin-list .day-head:first-child { padding-top: 0; }
.fin-list .day-head span:last-child { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.fin-list .day-bal { color: var(--text-2); text-transform: none; }
.fin-list .day-bal small { font-size: 0.7rem; font-weight: 600; color: var(--text-3); margin-right: 2px; }
.fin-list .day-bal.neg, .fin-list .day-bal.neg small { color: var(--danger, #e5484d); }
.fin-list > li.day-head + li > .list-item { border-top-color: transparent; }
.card-list { padding: 12px 10px; }
.fin-totals {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    font-size: 0.78rem; color: var(--text-2); margin: 0 4px 12px;
}
.fin-totals span { display: flex; flex-direction: column; min-width: 0; }
.fin-totals span:nth-child(2) { text-align: center; }
.fin-totals span:last-child { text-align: right; }
.fin-totals strong { font-size: 0.98rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-foot {
    display: flex; justify-content: space-between; padding: 12px 8px 0; margin-top: 4px;
    border-top: 1px solid var(--border-strong); font-size: 0.92rem;
}
.list-foot strong { font-variant-numeric: tabular-nums; }

/* cartões */
.cc-chip {
    width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--cc) 22%, transparent); color: var(--cc);
}
.cc-chip .ico { width: 19px; height: 19px; }
.cc-card { border-top: 4px solid var(--cc); }
.cc-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cc-title .card-title { margin: 0; }
.cc-limit .hero-value { font-size: clamp(1.9rem, 9vw, 2.5rem); }
.cc-selector { margin-bottom: 12px; }
.cc-selector .chip[aria-pressed="true"]::before { content: none; }
.limit-bar {
    display: flex; height: 12px; border-radius: 999px; overflow: hidden;
    background: var(--surface-3); margin: 14px 0 12px;
}
.limit-bar span { height: 100%; transition: width 0.5s ease; }
.limit-used { background: var(--cc, var(--info)); }
.limit-fixed { background: repeating-linear-gradient(135deg, var(--warn) 0 5px, color-mix(in srgb, var(--warn) 45%, transparent) 5px 10px); }
.legend { display: grid; gap: 6px; font-size: 0.88rem; }
.legend-row { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.legend-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.legend-sub { font-size: 0.78rem; color: var(--text-3); padding-left: 18px; margin-top: -4px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.legend-free { background: var(--surface-3); border: 1px solid var(--border-strong); }
.invoice-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 4px 4px; }
.invoice-total strong { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.proj-list .item-value small.neg { color: var(--danger); }
.proj-row.selected > .list-item { background: var(--brand-soft); }

/* formulários */
.input-big input[type="text"] { font-size: 1.35rem; font-weight: 700; padding-top: 12px; padding-bottom: 12px; }
.seg-type .seg-btn[data-entry-type="expense"].active { color: var(--danger); }
.seg-type .seg-btn[data-entry-type="income"].active { color: var(--brand-text); }
.seg-rec { margin-bottom: 10px; }
.seg-rec .seg-btn { font-size: 0.86rem; }
.cat-chips { margin-bottom: 0; }
.cat-chips .chip[aria-pressed="true"]::before { content: none; }
.btn-fit { width: auto; flex: 0 0 auto !important; padding: 12px 14px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
    width: 34px; height: 34px; border-radius: 50%; background: var(--c);
    border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border);
}
.color-swatch[aria-pressed="true"] { border-color: var(--surface); box-shadow: 0 0 0 2px var(--c); }

.option-cards { display: grid; gap: 10px; }
.option-card {
    text-align: left; padding: 14px; border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: grid; gap: 4px; transition: border-color 0.15s, background 0.15s;
}
.option-card strong { font-size: 1rem; }
.option-card span { color: var(--text-2); font-size: 0.88rem; }
.option-card[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.option-card[aria-pressed="true"] strong::after { content: ' ✓'; color: var(--brand-text); }
#choice-options .btn { width: 100%; }
.brand { min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mode-gestao .brand { gap: 8px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-sub { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.brand-sub[hidden] { display: none; }
@media (max-width: 400px) { body.mode-gestao .brand img { width: 26px; height: 26px; } .appbar-actions { gap: 6px; } }

/* pagamentos de fatura e transferências */
.move-dot { --c: var(--text-2); }
.move-dot .ico { width: 18px; height: 18px; }
.move-value { color: var(--text-2); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fin-alert {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; background: var(--warn-soft); border-color: transparent; box-shadow: none;
}
.fin-alert[data-state="overdue"] { background: var(--danger-soft); }
.fin-alert div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fin-alert strong { font-size: 0.95rem; }
.fin-alert span { font-size: 0.84rem; color: var(--text-2); }
.fin-alert .btn { flex-shrink: 0; }
.fin-alert.inline { border-radius: var(--radius-sm); margin-top: 14px; }
.invoice-paid {
    display: flex; justify-content: space-between; gap: 10px; margin: 4px 4px 0;
    font-size: 0.88rem; color: var(--text-2);
}
.invoice-paid strong { color: var(--text); font-variant-numeric: tabular-nums; }
.invoice-payments { margin-top: 6px; }
.fin-pay-info { display: block; line-height: 1.5; margin-top: 0; }
.transfer-accounts { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: end; }
.transfer-accounts .icon-btn { margin-bottom: 14px; }
.seg-type .seg-btn { font-size: 0.86rem; padding-left: 2px; padding-right: 2px; }

/* instalar o app */
.install-card { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.install-link { margin-top: -4px; }
.install-steps { margin-bottom: 4px; }
.install-steps strong { color: var(--text); }

/* calculadora do campo de valor */
.calc-btn {
    width: 42px; height: 42px; margin-right: 4px; flex-shrink: 0;
    display: grid; place-items: center; border-radius: 10px; color: var(--brand-text);
}
.calc-btn:hover, .calc-btn:focus-visible { background: var(--brand-soft); }
.calc-display {
    background: var(--surface-2); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-bottom: 12px; text-align: right; min-height: 92px;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.calc-expr { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.calc-result { font-size: 0.95rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.calc-result.neg { color: var(--danger); }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-key {
    min-height: 54px; border-radius: 14px; background: var(--surface-2);
    font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums;
    transition: background 0.12s, transform 0.08s;
}
.calc-key:hover { background: var(--surface-3); }
.calc-key:active { transform: scale(0.96); }
.calc-key.op { background: var(--brand-soft); color: var(--brand-text); }
.calc-key.fn { background: var(--surface-3); color: var(--text-2); font-size: 1.1rem; }
.calc-key.eq { grid-row: span 2; background: var(--surface-3); color: var(--brand-text); }

/* ── Gestão: previsão com metas ── */
.fin-forecast { padding: 14px 16px; }
.fin-forecast.is-on { border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.switch-text strong { font-size: 0.95rem; }
.switch-text span { font-size: 0.8rem; color: var(--text-3); line-height: 1.35; }
.switch {
    appearance: none; -webkit-appearance: none; flex: none; margin: 0;
    width: 46px; height: 28px; border-radius: 999px; position: relative; cursor: pointer;
    background: var(--surface-3); border: 1px solid var(--border, transparent); transition: background .18s;
}
.switch::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: transform .18s;
}
.switch:checked { background: var(--info); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.fin-row.is-forecast { opacity: 0.78; }
.fin-row.is-forecast .cat-dot { outline: 1.5px dashed var(--info); outline-offset: 1px; }
.fin-forecast-note { font-size: 0.78rem; color: var(--text-3); margin: 0 4px 10px; }

/* tags, observação e filtros dos lançamentos */
.tag-suggest { margin-top: -4px; }
.tag-suggest .chip::before { content: '+ '; }
.fin-tags { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }
.fin-tag { color: var(--brand-text); font-weight: 500; }
.note-ico { width: 13px; height: 13px; vertical-align: -1px; color: var(--text-3); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; }
.filter-bar .chip { padding: 6px 10px; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 6px; }
.filter-bar .chip .ico { width: 14px; height: 14px; }
.filter-bar .chip-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.filter-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: var(--on-brand, #fff); font-size: 0.72rem; font-weight: 700; display: inline-grid; place-items: center; }
.filter-clear { font-size: 0.82rem; font-weight: 600; color: var(--text-2); padding: 6px 4px; text-decoration: underline; }
.filter-group { display: block; font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); margin: 4px 0 6px; }
#fin-filter-cats .cat-chips { margin-bottom: 10px; }
.goal-daily-field { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.goal-daily { color: var(--info); }
.meta-var { margin-top: 4px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); gap: 0; }
.meta-var-opts { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.meta-var-opts .switch-text strong { font-size: 0.9rem; }
.ad-links .ad-remove { margin: 6px 0 0; }
.fine-print a { color: var(--brand-text); }
