/* Tema escuro (padrão) */
:root,
[data-theme="dark"] {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface2: #243044;
    --text: #e8edf4;
    --muted: #8b9cb3;
    --border: #2d3a4f;
    --accent: #3b82f6;
    --receita: #22c55e;
    --despesa: #ef4444;
    --saldo: #f59e0b;
    --status-pago-bg: rgba(34, 197, 94, 0.22);
    --status-pago-border: #22c55e;
    --status-pago-text: #86efac;
    --status-pendente-bg: rgba(234, 179, 8, 0.22);
    --status-pendente-border: #eab308;
    --status-pendente-text: #fde047;
    --status-atrasado-bg: rgba(239, 68, 68, 0.22);
    --status-atrasado-border: #ef4444;
    --status-atrasado-text: #fca5a5;
    --radius: 10px;
    --font: 'Segoe UI', system-ui, sans-serif;
}

/* Tema claro */
[data-theme="light"] {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface2: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --border: #cbd5e1;
    --accent: #2563eb;
    --receita: #16a34a;
    --despesa: #dc2626;
    --saldo: #d97706;
    --status-pago-bg: rgba(22, 163, 74, 0.15);
    --status-pago-border: #16a34a;
    --status-pago-text: #15803d;
    --status-pendente-bg: rgba(202, 138, 4, 0.18);
    --status-pendente-border: #ca8a04;
    --status-pendente-text: #a16207;
    --status-atrasado-bg: rgba(220, 38, 38, 0.15);
    --status-atrasado-border: #dc2626;
    --status-atrasado-text: #b91c1c;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background .2s, color .2s;
}

.app-body {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    align-items: stretch;
}
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: auto;
    z-index: 40;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.sidebar-brand small { display: block; color: var(--muted); font-size: .75rem; }
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: .7rem .65rem 1.25rem;
    gap: .15rem;
}
.sidebar-label {
    margin: .85rem .55rem .3rem;
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.sidebar-label:first-child { margin-top: .2rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
    text-decoration: none;
    padding: .52rem .65rem;
    border-radius: 8px;
    font-size: .92rem;
}
.sidebar-nav a svg { flex-shrink: 0; opacity: .9; }
.sidebar-nav a:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav a.active {
    background: color-mix(in srgb, var(--accent) 22%, var(--surface2));
    color: var(--text);
    font-weight: 600;
}
.sidebar-toggle {
    display: none;
    border: none;
    background: var(--surface2);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    place-items: center;
    padding: 0;
}
.sidebar-toggle:hover { background: var(--accent); color: #fff; }
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 35;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.topbar-page {
    flex: 1;
    min-width: 0;
}
.topbar-page strong {
    display: block;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: transparent;
    display: grid; place-items: center; flex-shrink: 0;
    color: #fff;
    overflow: hidden;
}
.brand-icon svg { display: block; }
.brand-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.brand small { display: block; color: var(--muted); }

.nav { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; justify-content: center; }
.nav a {
    color: var(--muted); text-decoration: none; padding: .5rem .9rem;
    border-radius: 8px; font-size: .92rem;
}
.nav a:hover, .nav a.active { background: var(--surface2); color: var(--text); }

.theme-switch {
    display: flex; gap: .25rem; background: var(--surface2);
    border-radius: 999px; padding: .2rem;
}
.theme-btn {
    border: none; background: transparent; cursor: pointer;
    padding: .35rem .55rem; border-radius: 999px; font-size: 1rem; line-height: 1;
    color: var(--muted); display: grid; place-items: center;
}
.theme-btn:hover { background: var(--bg); color: var(--text); }
.theme-btn.active { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: #fff; }
.theme-btn svg { display: block; }

.container { max-width: 100%; margin: 0 auto; padding: .85rem 1rem; flex: 1; overflow: auto; }

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.toolbar h1 { margin: 0; font-size: 1.35rem; }

.legend {
    display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.legend-item {
    font-size: .78rem; padding: .25rem .55rem; border-radius: 6px;
    border: 1px solid transparent;
}

.cards-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 1.25rem;
}
.dashboard-alerts-root { margin-bottom: 1.25rem; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.1rem;
}
.stat-card span { color: var(--muted); font-size: .85rem; }
.stat-card strong { display: block; font-size: 1.4rem; margin-top: .25rem; }
.stat-card.receita strong { color: var(--receita); }
.stat-card.despesa strong { color: var(--despesa); }
.stat-card.saldo strong.pos { color: var(--receita); }
.stat-card.saldo strong.neg { color: var(--despesa); }

.year-hero-card {
    margin-bottom: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.year-hero-card.is-positive {
    border-color: color-mix(in srgb, var(--receita) 55%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--receita) 18%, var(--surface)), var(--surface));
    box-shadow: 0 12px 32px color-mix(in srgb, var(--receita) 12%, transparent);
}
.year-hero-card.is-negative {
    border-color: color-mix(in srgb, var(--despesa) 55%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--despesa) 18%, var(--surface)), var(--surface));
    box-shadow: 0 12px 32px color-mix(in srgb, var(--despesa) 12%, transparent);
}
.year-hero-kicker {
    margin: 0 0 .35rem;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.year-hero-title {
    margin: 0;
    font-size: clamp(1.15rem, 2.5vw, 1.65rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}
.year-hero-card.is-positive .year-hero-title strong { color: var(--receita); }
.year-hero-card.is-negative .year-hero-title strong { color: var(--despesa); }

.dashboard-page .legend-status .legend-item {
    font-size: .88rem;
    font-weight: 700;
    padding: .45rem .85rem;
    border-width: 2px;
    border-style: solid;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.dashboard-page .legend-item.cell-pago {
    background: color-mix(in srgb, var(--status-pago-border) 26%, var(--surface)) !important;
    border-color: var(--status-pago-border) !important;
    color: var(--status-pago-text) !important;
}
.dashboard-page .legend-item.cell-pendente {
    background: color-mix(in srgb, var(--status-pendente-border) 26%, var(--surface)) !important;
    border-color: var(--status-pendente-border) !important;
    color: var(--status-pendente-text) !important;
}
.dashboard-page .legend-item.cell-atrasado {
    background: color-mix(in srgb, var(--status-atrasado-border) 26%, var(--surface)) !important;
    border-color: var(--status-atrasado-border) !important;
    color: var(--status-atrasado-text) !important;
}
.dashboard-page .cell-edit.cell-pago {
    background: color-mix(in srgb, var(--status-pago-border) 22%, var(--surface)) !important;
    border-left: 4px solid var(--status-pago-border) !important;
    color: var(--status-pago-text) !important;
}
.dashboard-page .cell-edit.cell-pendente {
    background: color-mix(in srgb, var(--status-pendente-border) 22%, var(--surface)) !important;
    border-left: 4px solid var(--status-pendente-border) !important;
    color: var(--status-pendente-text) !important;
}
.dashboard-page .cell-edit.cell-atrasado {
    background: color-mix(in srgb, var(--status-atrasado-border) 22%, var(--surface)) !important;
    border-left: 4px solid var(--status-atrasado-border) !important;
    color: var(--status-atrasado-text) !important;
}
.dashboard-page .cell-edit.cell-pago .input-cell,
.dashboard-page .cell-edit.cell-pendente .input-cell,
.dashboard-page .cell-edit.cell-atrasado .input-cell {
    color: var(--text) !important;
    font-weight: 700;
}
.dashboard-page .cell-edit.cell-pago .input-cell::placeholder,
.dashboard-page .cell-edit.cell-pendente .input-cell::placeholder,
.dashboard-page .cell-edit.cell-atrasado .input-cell::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}
.dashboard-page .cell-edit.cell-pago .input-cell:focus,
.dashboard-page .cell-edit.cell-pendente .input-cell:focus,
.dashboard-page .cell-edit.cell-atrasado .input-cell:focus,
.dashboard-page .cell-edit.cell-pago .input-cell:hover,
.dashboard-page .cell-edit.cell-pendente .input-cell:hover,
.dashboard-page .cell-edit.cell-atrasado .input-cell:hover {
    color: var(--text) !important;
    background: var(--bg) !important;
}
.dashboard-page .btn-pago.is-pago {
    background: var(--status-pago-border);
    border-color: var(--status-pago-border);
    color: #fff;
    font-weight: 700;
}
[data-theme="dark"] .dashboard-page .legend-item.cell-pago,
[data-theme="dark"] .dashboard-page .cell-edit.cell-pago {
    background: color-mix(in srgb, var(--status-pago-border) 32%, var(--surface)) !important;
}
[data-theme="dark"] .dashboard-page .legend-item.cell-pendente,
[data-theme="dark"] .dashboard-page .cell-edit.cell-pendente {
    background: color-mix(in srgb, var(--status-pendente-border) 32%, var(--surface)) !important;
}
[data-theme="dark"] .dashboard-page .legend-item.cell-atrasado,
[data-theme="dark"] .dashboard-page .cell-edit.cell-atrasado {
    background: color-mix(in srgb, var(--status-atrasado-border) 32%, var(--surface)) !important;
}
[data-theme="light"] .dashboard-page .legend-item.cell-pago,
[data-theme="light"] .dashboard-page .cell-edit.cell-pago {
    background: color-mix(in srgb, var(--status-pago-border) 18%, #fff) !important;
}
[data-theme="light"] .dashboard-page .legend-item.cell-pendente,
[data-theme="light"] .dashboard-page .cell-edit.cell-pendente {
    background: color-mix(in srgb, var(--status-pendente-border) 20%, #fff) !important;
}
[data-theme="light"] .dashboard-page .legend-item.cell-atrasado,
[data-theme="light"] .dashboard-page .cell-edit.cell-atrasado {
    background: color-mix(in srgb, var(--status-atrasado-border) 18%, #fff) !important;
}

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
}
.table-wrap { overflow: auto; padding: 0; }
.table-fit { overflow-x: hidden; }

.sheet-resizable {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
.sheet-compact {
    font-size: .72rem;
}
.sheet-compact th,
.sheet-compact td {
    padding: .28rem .2rem;
}

.resizable-th {
    position: relative;
    overflow: hidden;
}
.resizable-th .th-text {
    display: block;
    padding-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 4;
    touch-action: none;
}
.col-resizer:hover,
.col-resizer.active {
    background: color-mix(in srgb, var(--accent) 55%, transparent);
}
body.col-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}
body.col-resizing * {
    cursor: col-resize !important;
}

table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--surface2); color: var(--muted); font-weight: 600; text-align: left; position: sticky; top: 0; z-index: 2; }
th.mes-vigente { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.pos { color: var(--receita); }
.neg { color: var(--despesa); }
.muted { color: var(--muted); }

.sheet .sticky-col {
    position: sticky; left: 0;
    min-width: 0; z-index: 1; border-right: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Linha de categoria — destaque em toda a largura */
.sheet .row-cat td {
    background: color-mix(in srgb, var(--cat-color) 20%, var(--surface)) !important;
    font-weight: 600;
    border-top: 2px solid color-mix(in srgb, var(--cat-color) 50%, var(--border));
    border-bottom: 1px solid color-mix(in srgb, var(--cat-color) 35%, var(--border));
    color: var(--text);
}
.sheet .row-cat .sticky-col {
    background: color-mix(in srgb, var(--cat-color) 20%, var(--surface)) !important;
    box-shadow: inset 4px 0 0 var(--cat-color);
}
.row-cat .dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--cat-color); margin-right: 6px;
}
.cat-edit-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}
.cat-edit-row .cat-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drag-handle-cat {
    color: color-mix(in srgb, var(--cat-color) 70%, var(--muted));
}

.task-edit-row {
    display: flex;
    align-items: center;
    gap: .15rem;
    min-width: 0;
}
.drag-handle {
    flex-shrink: 0;
    width: 16px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: grab;
    font-size: .65rem;
    letter-spacing: -1px;
    line-height: 1;
    display: grid;
    place-items: center;
}
.drag-handle:hover {
    background: var(--surface2);
    color: var(--text);
}
.drag-handle:active,
.row-task.is-dragging .drag-handle {
    cursor: grabbing;
}
.row-task.is-dragging,
.row-grupo.is-dragging {
    opacity: .55;
}
.row-task.drag-over,
.row-cat.drag-over,
.row-grupo.drag-over {
    box-shadow: inset 0 2px 0 var(--accent);
}
.task-rename-form {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.input-task-name {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    padding: .15rem .25rem;
    border-radius: 4px;
}
.input-task-name:hover,
.input-task-name:focus {
    border-color: var(--accent);
    background: var(--bg);
    outline: none;
}
.task-dia {
    flex-shrink: 0;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 500;
    white-space: nowrap;
    padding-right: .1rem;
}
.task-dia-form {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    margin: 0;
    flex-shrink: 0;
}
.task-dia-label {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 500;
}
.input-task-dia {
    width: 2.2rem;
    min-width: 0;
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    font: inherit;
    font-size: .68rem;
    font-weight: 600;
    padding: .1rem .15rem;
    border-radius: 4px;
    text-align: center;
    -moz-appearance: textfield;
}
.input-task-dia::-webkit-outer-spin-button,
.input-task-dia::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input-task-dia:hover,
.input-task-dia:focus {
    border-color: var(--accent);
    background: var(--bg);
    outline: none;
}
.task-del-form { margin: 0; flex-shrink: 0; }
.btn-del-x {
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: .95rem;
    line-height: 1;
    display: grid;
    place-items: center;
}
.btn-del-x:hover {
    background: var(--status-atrasado-bg);
    color: var(--status-atrasado-text);
}

/* Atividades — recuo visual dentro da categoria */
.sheet .row-task .sticky-col {
    background: var(--surface);
    padding-left: 1.1rem;
    border-left: 3px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.sheet .row-task .task-name {
    position: relative;
}
.sheet .row-task .task-name::before {
    content: '';
}
.row-task td:not(.sticky-col) {
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.row-total td { background: var(--surface2); font-weight: 700; }

/* Cores de status nas células */
.cell-pago,
.legend-item.cell-pago {
    background: var(--status-pago-bg) !important;
    border-color: var(--status-pago-border) !important;
    color: var(--status-pago-text);
}
.cell-pendente,
.legend-item.cell-pendente {
    background: var(--status-pendente-bg) !important;
    border-color: var(--status-pendente-border) !important;
    color: var(--status-pendente-text);
}
.cell-atrasado,
.legend-item.cell-atrasado {
    background: var(--status-atrasado-bg) !important;
    border-color: var(--status-atrasado-border) !important;
    color: var(--status-atrasado-text);
}
.cell-edit.cell-pago,
.cell-edit.cell-pendente,
.cell-edit.cell-atrasado {
    border-left: 3px solid var(--status-pago-border);
}
.cell-edit.cell-pendente { border-left-color: var(--status-pendente-border); }
.cell-edit.cell-atrasado { border-left-color: var(--status-atrasado-border); }
.cell-neutro,
.cell-edit.cell-neutro {
    background: transparent !important;
    border-left-color: transparent !important;
    color: inherit;
}
.mes-vigente-col { outline: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); }

.cell-wrap {
    display: flex; align-items: center; justify-content: flex-end; gap: .15rem;
}
.cell-form { margin: 0; flex: 1; }
.cell-toggle { margin: 0; }

.input-cell {
    width: 100%; min-width: 0; background: transparent; border: 1px solid transparent;
    color: inherit; text-align: right; padding: .12rem .15rem; border-radius: 3px;
    font-size: .7rem;
}
.input-cell::placeholder {
    color: var(--muted);
    opacity: 1;
    text-align: center;
}
.input-cell:placeholder-shown {
    text-align: center;
    color: var(--muted);
}
.input-cell:hover, .input-cell:focus { border-color: var(--accent); background: var(--bg); outline: none; color: var(--text); text-align: right; }
form.is-saving { opacity: .7; pointer-events: none; }

.btn-pago {
    border: 1px solid var(--border); background: var(--surface2); color: var(--muted);
    width: 16px; height: 16px; border-radius: 3px; cursor: pointer; font-size: .6rem;
    padding: 0; line-height: 1; flex-shrink: 0;
}
.btn-pago:hover { border-color: var(--accent); color: var(--text); }
.btn-pago.is-pago {
    background: var(--status-pago-border); color: #fff; border-color: var(--status-pago-border);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff; border: none; border-radius: 8px;
    padding: .55rem 1rem; font-size: .9rem; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); color: #fff; }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-ghost { background: var(--surface2); color: var(--text); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: #b91c1c; color: #fff; }
.inline-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.input-sm { width: 90px; padding: .35rem .5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }

.filters { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters a {
    padding: .4rem .8rem; border-radius: 999px; text-decoration: none;
    color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.filters a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.form-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
}
.form-grid label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: var(--muted); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
    padding: .55rem .65rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: .95rem;
}
.form-actions { margin-top: .5rem; }

.pill {
    display: inline-block; padding: .15rem .5rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600;
}
.badge-dia {
    display: inline-grid; place-items: center; width: 32px; height: 32px;
    border-radius: 8px; background: var(--surface2); font-weight: 700;
}
.badge-pago { background: var(--status-pago-bg); color: var(--status-pago-text); border: 1px solid var(--status-pago-border); }
.badge-pendente { background: var(--status-pendente-bg); color: var(--status-pendente-text); border: 1px solid var(--status-pendente-border); }
.badge-atrasado { background: var(--status-atrasado-bg); color: var(--status-atrasado-text); border: 1px solid var(--status-atrasado-border); }

.status-badge {
    display: inline-block; padding: .2rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 600;
}
.status-pago { background: var(--status-pago-bg); color: var(--status-pago-text); border: 1px solid var(--status-pago-border); }
.status-pendente { background: var(--status-pendente-bg); color: var(--status-pendente-text); border: 1px solid var(--status-pendente-border); }
.status-atrasado { background: var(--status-atrasado-bg); color: var(--status-atrasado-text); border: 1px solid var(--status-atrasado-border); }

.row-status.row-pago td { background: color-mix(in srgb, var(--status-pago-bg) 50%, var(--surface)); }
.row-status.row-pendente td { background: color-mix(in srgb, var(--status-pendente-bg) 50%, var(--surface)); }
.row-status.row-atrasado td { background: color-mix(in srgb, var(--status-atrasado-bg) 50%, var(--surface)); }

.actions { display: flex; gap: .35rem; align-items: center; }
.actions form { margin: 0; }

.bulk-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
    padding: .55rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.bulk-select-all {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    color: var(--muted);
    cursor: pointer;
}
.bulk-count { color: var(--muted); font-size: .85rem; margin-right: auto; }
.col-check { width: 36px; text-align: center; }
.col-check input { width: 16px; height: 16px; cursor: pointer; }
#btn-excluir-lote:disabled { opacity: .45; cursor: not-allowed; }
tr.inactive { opacity: .5; }
.color-swatch { display: inline-block; width: 20px; height: 20px; border-radius: 4px; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-ok { background: var(--status-pago-bg); color: var(--status-pago-text); border: 1px solid var(--status-pago-border); }
.alert-erro { background: var(--status-atrasado-bg); color: var(--status-atrasado-text); border: 1px solid var(--status-atrasado-border); }
.hint, .empty { color: var(--muted); font-size: .88rem; }
.hint-card h3 { margin-top: 0; }
.hint-card ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }

/* --- Dashboards por Ano --- */
.toolbar-sub { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; width: 100%; }
.section-title { margin: 0 0 .75rem; font-size: 1rem; }
.compare-table-wrap { margin-bottom: 1.25rem; overflow: auto; }
.row-current-year td { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pill-current {
    background: color-mix(in srgb, var(--accent) 20%, var(--surface));
    color: var(--accent);
    font-size: .7rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    margin-left: .35rem;
    font-weight: 600;
}

.years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.year-dashboard { padding: 1.1rem; }
.year-dashboard.year-current {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.year-dashboard-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: .75rem; margin-bottom: 1rem;
}
.year-dashboard-head h2 { margin: 0; font-size: 1.5rem; }

.year-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
    margin-bottom: 1rem;
}
.year-stat {
    background: var(--surface2); border-radius: 8px; padding: .55rem .65rem;
    text-align: center;
}
.year-stat span { display: block; font-size: .72rem; color: var(--muted); }
.year-stat strong { font-size: .95rem; }

.chart-block { margin-bottom: 1rem; }
.chart-block h3 { margin: 0 0 .5rem; font-size: .82rem; color: var(--muted); font-weight: 600; }

.bar-chart, .stack-chart {
    display: flex; align-items: flex-end; gap: 3px; height: 100px;
    padding: 0 .15rem;
}
.bar-col, .stack-col {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    min-width: 0;
}
.bar-col.bar-vigente .bar-track { outline: 1px dashed var(--accent); }
.bar-track {
    width: 100%; height: 80px; display: flex; align-items: flex-end;
    background: var(--surface2); border-radius: 4px 4px 0 0;
}
.bar-fill {
    width: 100%; border-radius: 3px 3px 0 0; min-height: 0;
    transition: height .2s;
}
.bar-fill.bar-pos { background: var(--receita); }
.bar-fill.bar-neg { background: var(--despesa); }

.stack-pair {
    width: 100%; height: 80px; display: flex; align-items: flex-end;
    gap: 1px; background: var(--surface2); border-radius: 4px 4px 0 0;
    padding: 0 1px;
}
.stack-bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 0; }
.stack-bar.stack-rec { background: var(--receita); opacity: .85; }
.stack-bar.stack-des { background: var(--despesa); opacity: .85; }

.bar-label { font-size: .62rem; color: var(--muted); margin-top: .2rem; }

.chart-legend-inline {
    display: flex; gap: 1rem; margin-top: .35rem; font-size: .75rem; color: var(--muted);
}
.chart-legend-inline span { display: inline-flex; align-items: center; gap: .3rem; }
.dot-rec, .dot-des {
    display: inline-block; width: 8px; height: 8px; border-radius: 2px;
}
.dot-rec { background: var(--receita); }
.dot-des { background: var(--despesa); }

.year-meta {
    border-top: 1px solid var(--border); padding-top: .75rem;
    display: flex; flex-direction: column; gap: .5rem;
}
.meta-item { display: flex; flex-wrap: wrap; gap: .35rem; }
.checkbox-label {
    flex-direction: row !important; align-items: center; gap: .5rem;
    color: var(--text) !important; cursor: pointer;
}
.checkbox-label input { width: auto; }
.code-block {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    padding: .75rem 1rem; font-size: .82rem; overflow-x: auto;
}
.hint-card a { color: var(--accent); }

.empty-state { text-align: center; padding: 2rem; }

.toast-area {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    pointer-events: none;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .55rem .85rem;
    border-radius: 8px;
    font-size: .85rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    animation: toast-in .18s ease-out;
}
.toast-ok { border-color: var(--status-pago-border); }
.toast-erro { border-color: var(--status-atrasado-border); color: var(--status-atrasado-text); }
.toast-out { opacity: 0; transform: translateY(-6px); transition: .2s; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

body.modal-open { overflow: hidden; }
.app-modal[hidden] { display: none !important; }
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, .62);
    backdrop-filter: blur(2px);
}
.app-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 96vw);
    max-height: min(90vh, 920px);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
    overflow: hidden;
}
.app-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.app-modal-head h2 {
    margin: 0;
    font-size: 1.05rem;
}
.app-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    display: grid;
    place-items: center;
    padding: 0;
}
.app-modal-close:hover { background: var(--accent); color: #fff; }
.app-modal-close svg { display: block; }
.app-modal-body {
    padding: 1rem;
    overflow: auto;
}
.embed-root .toolbar h1 { font-size: 1.15rem; }

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .sheet .sticky-col { min-width: 0; }
    .table-fit { overflow-x: auto; }
    .nav { order: 3; width: 100%; justify-content: flex-start; }
    .app-modal-dialog { width: 100%; max-height: 94vh; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 8px 0 28px rgba(0,0,0,.35);
    }
    .app-body.sidebar-open .sidebar { transform: none; }
    .app-body.sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-toggle { display: grid; }
    .topbar-page { display: none; }
}

/* ——— Landing / Auth / SaaS ——— */
.lp-body { min-height: 100vh; display: flex; flex-direction: column; }
.lp-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1rem 1.5rem; flex-wrap: wrap;
    background: rgba(26, 35, 50, 0.85); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.lp-logo { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.lp-nav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.lp-nav a { color: var(--muted); text-decoration: none; }
.lp-nav a:hover { color: var(--text); }
.lp-nav a.btn,
.lp-nav a.btn:hover { color: #fff; }

.lp-hero {
    padding: 4.5rem 1.5rem 3.5rem;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(59,130,246,.25), transparent),
        radial-gradient(ellipse 70% 50% at 80% 0%, rgba(34,197,94,.12), transparent),
        linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
.lp-hero-inner { max-width: 720px; margin: 0 auto; }
.lp-brand {
    font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent); margin: 0 0 .75rem; font-weight: 600;
}
.lp-hero h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem); line-height: 1.15;
    margin: 0 0 1rem; font-weight: 700;
}
.lp-lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.75rem; max-width: 36rem; }
.lp-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-lg { padding: .75rem 1.35rem; font-size: 1rem; }

.lp-section { padding: 3rem 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.lp-section h2 { margin: 0 0 .5rem; font-size: 1.6rem; }
.lp-section-lead { color: var(--muted); margin: 0 0 1.75rem; }
.lp-features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem;
}
.lp-features article {
    padding: 1.25rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
}
.lp-features h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.lp-features p { margin: 0; color: var(--muted); font-size: .95rem; }

.lp-plans { padding-bottom: 2rem; }
.lp-plan-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem;
}
.lp-plan {
    position: relative; padding: 1.5rem; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: .5rem;
}
.lp-plan.is-featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 12px 40px rgba(59,130,246,.15);
}
.lp-badge {
    position: absolute; top: .75rem; right: .75rem;
    font-size: .7rem; background: var(--accent); color: #fff;
    padding: .2rem .5rem; border-radius: 999px; font-weight: 600;
}
.lp-price { font-size: 1.75rem; font-weight: 700; margin: .25rem 0; }
.lp-plan ul { margin: .5rem 0 1rem; padding-left: 1.1rem; color: var(--muted); flex: 1; }
.lp-plan .btn { align-self: stretch; text-align: center; }

.lp-footer-cta { text-align: center; padding-bottom: 4rem; }
.lp-site-footer {
    margin-top: auto; padding: 1.5rem; text-align: center;
    color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border);
}

.register-tiktok-banner {
    margin: 0 0 1rem;
    padding: .75rem .85rem;
    border-radius: 10px;
    background: #fef08a;
    color: #713f12;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    border: 1px solid #facc15;
}

.register-trust-line {
    margin: .15rem 0 0;
    font-size: .72rem;
    line-height: 1.45;
    color: var(--muted);
    text-align: center;
}

.register-tiktok-comments {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.register-tiktok-comment {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
}

.register-tiktok-avatar {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 1rem;
    line-height: 1;
}

.register-tiktok-bubble {
    flex: 1;
    min-width: 0;
    padding: .55rem .7rem;
    border-radius: 0 12px 12px 12px;
    background: #dcf8c6;
    border: 1px solid #b8e0a8;
    color: #1a1a1a;
}

.register-tiktok-user {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    color: #128c7e;
    margin-bottom: .15rem;
}

.register-tiktok-bubble p {
    margin: 0;
    font-size: .82rem;
    line-height: 1.35;
}

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 20, 25, .72);
    backdrop-filter: blur(4px);
}

.onboarding-card {
    position: relative;
    width: min(420px, 100%);
    padding: 1.75rem 1.5rem;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0, 0, 0, .35);
    text-align: center;
}

.onboarding-kicker {
    margin: 0 0 .35rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.onboarding-card h2 {
    margin: 0 0 .65rem;
    font-size: 1.35rem;
    line-height: 1.3;
    color: var(--text);
}

.onboarding-text {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: .95rem;
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.onboarding-form {
    margin: 0;
}

.onboarding-btn {
    width: 100%;
    padding: .85rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
}

.onboarding-btn-aluguel { background: #3b82f6; color: #fff; }
.onboarding-btn-cartao { background: #8b5cf6; color: #fff; }
.onboarding-btn-salario { background: #22c55e; color: #fff; }

.onboarding-close {
    position: absolute;
    top: .65rem;
    right: .75rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .15rem .35rem;
}

.auth-card {
    max-width: 420px; margin: 2.5rem auto; padding: 1.75rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}

.auth-lang-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .75rem;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .15rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: .25rem .45rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--muted);
}

.lang-switch-btn.is-active,
.lang-switch-btn:hover {
    color: var(--text);
    background: var(--surface);
}

.topbar-right .lang-switch {
    margin-right: .15rem;
}

.lp-nav .lang-switch {
    margin-right: .35rem;
}

#lp-root .lang-switch {
    border-color: #2d3a4f;
    background: #1a2332;
}

#lp-root .lang-switch-btn {
    color: #8b9cb3;
}

#lp-root .lang-switch-btn.is-active,
#lp-root .lang-switch-btn:hover {
    color: #e8edf4;
    background: #243044;
}
.auth-card h1 { margin: 0 0 .35rem; font-size: 1.45rem; }
.stack-form { display: flex; flex-direction: column; gap: .85rem; margin-top: 1.25rem; }
.stack-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--muted); }
.stack-form .input, .input {
    padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font: inherit;
}

.password-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    vertical-align: middle;
}
.password-wrap.is-inline { width: auto; }
.password-wrap .input,
.password-wrap .input-sm {
    width: 100%;
    padding-right: 2.35rem;
    box-sizing: border-box;
}
.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 0;
}
.password-toggle:hover { color: var(--text); background: var(--surface2); }
.password-toggle svg { display: block; pointer-events: none; }
.auth-links { margin-top: 1.25rem; color: var(--muted); font-size: .9rem; }
.auth-links a { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.user-chip {
    font-size: .85rem; color: var(--muted); max-width: 140px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.admin-actions .inline-form { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

@media (max-width: 640px) {
    .lp-hero { padding: 3rem 1.25rem 2.5rem; }
    .admin-actions { font-size: .85rem; }
}

/* Landing product shots */
.lp-hero { display: flex; flex-direction: column; gap: 2.5rem; align-items: stretch; }
.lp-hero-visual {
    max-width: 1080px; width: 100%; margin: 0 auto; padding: 0 1.5rem 0.5rem;
}
.lp-hero-visual img {
    display: block; width: 100%; height: auto; border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.lp-showcase {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.25rem;
}
.lp-shot {
    margin: 0; display: flex; flex-direction: column; gap: .75rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden;
}
.lp-shot-wide { grid-column: 1 / -1; }
.lp-shot img {
    display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
    background: #0b1016;
}
.lp-shot figcaption {
    padding: 0 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem;
}
.lp-shot figcaption strong { font-size: 1.05rem; }
.lp-shot figcaption span { color: var(--muted); font-size: .92rem; }

@media (max-width: 800px) {
    .lp-showcase { grid-template-columns: 1fr; }
}
.lp-showcase-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .lp-showcase-2 { grid-template-columns: 1fr; } }
.auth-forgot { margin: -.35rem 0 0; text-align: right; font-size: .88rem; }
.auth-forgot a { color: var(--accent); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }

.lic-badge {
    display: inline-block; padding: .2rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.lic-badge.lic-ok { background: var(--status-pago-bg); color: var(--status-pago-text); border: 1px solid var(--status-pago-border); }
.lic-badge.lic-warn { background: var(--status-pendente-bg); color: var(--status-pendente-text); border: 1px solid var(--status-pendente-border); }
.lic-badge.lic-expired { background: var(--status-atrasado-bg); color: var(--status-atrasado-text); border: 1px solid var(--status-atrasado-border); }
.admin-cadastro-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.admin-cadastro-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }

/* Support chat */
.nav-badge, .chat-badge, .chat-fab-badge {
    display: inline-block; min-width: 1.1rem; padding: 0 .35rem;
    margin-left: .25rem; border-radius: 999px; font-size: .7rem; font-weight: 700;
    background: var(--despesa); color: #fff; line-height: 1.3; text-align: center;
}
.chat-fab {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
    width: 54px; height: 54px; border-radius: 50%;
    display: grid; place-items: center; text-decoration: none; font-size: 1.4rem;
    background: var(--accent); color: #fff;
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.chat-fab svg { display: block; }
.chat-fab:hover { filter: brightness(1.08); }
.chat-fab-badge {
    position: absolute; top: -2px; right: -2px; margin: 0;
}
.chat-card { display: flex; flex-direction: column; gap: .75rem; min-height: 420px; }
.support-email-alt { margin-bottom: .75rem; }
.chat-status { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: .9rem; }
.chat-messages {
    flex: 1; min-height: 280px; max-height: 55vh; overflow: auto;
    padding: 1rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: .65rem;
}
.chat-bubble {
    max-width: min(78%, 520px); padding: .65rem .85rem; border-radius: 12px;
    background: var(--surface2); border: 1px solid var(--border);
}
.chat-bubble.chat-cliente { align-self: flex-end; background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.35); }
.chat-bubble.chat-admin { align-self: flex-start; }
.chat-meta { display: flex; justify-content: space-between; gap: .75rem; font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-compose { display: flex; gap: .6rem; align-items: flex-end; }
.chat-compose textarea {
    flex: 1; resize: vertical; min-height: 52px; padding: .65rem .75rem;
    border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
.support-admin {
    display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start;
}
.support-list h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.support-thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-height: 70vh; overflow: auto; }
.support-thread-list a {
    display: block; padding: .7rem .75rem; border-radius: 10px; text-decoration: none;
    color: var(--text); border: 1px solid transparent;
}
.support-thread-list li.is-active a, .support-thread-list a:hover {
    background: var(--surface2); border-color: var(--border);
}
.support-thread-list small, .support-preview, .support-meta {
    display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem;
}
.support-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-panel-head { margin-bottom: .5rem; }
@media (max-width: 900px) {
    .support-admin { grid-template-columns: 1fr; }
    .support-thread-list { max-height: 220px; }
}

/* Admin tabs */
.admin-tabs {
    display: flex; flex-wrap: wrap; gap: .4rem;
    margin: 0 0 1.25rem; padding: .35rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.admin-tab {
    appearance: none; border: none; background: transparent; color: var(--muted);
    text-decoration: none; padding: .55rem .95rem; border-radius: 9px;
    font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
}
.admin-tab:hover { color: var(--text); background: var(--surface2); }
.admin-tab.is-active {
    color: #fff; background: var(--accent);
}
.admin-tab-panels > .card { margin-top: 0; }
.auth-form-error { margin-top: 1rem; }
.auth-card .alert-erro { border-width: 1px; }

/* Previsão — simulação de juros */
.previsao-app { display: flex; flex-direction: column; gap: 1rem; }
.previsao-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.previsao-taxa-field { display: flex; flex-direction: column; gap: .35rem; }
.previsao-taxa-row {
    display: flex;
    align-items: stretch;
    gap: .4rem;
    min-width: 0;
}
.previsao-taxa-row .input { flex: 1; min-width: 0; }
.previsao-taxa-row .previsao-period { flex-shrink: 0; align-self: stretch; }
.previsao-period {
    display: flex; gap: .25rem; background: var(--surface2);
    border-radius: 999px; padding: .2rem; width: fit-content;
    align-items: center;
}
.previsao-period-btn {
    appearance: none; border: none; background: transparent;
    color: var(--muted); cursor: pointer; font: inherit; font-weight: 600;
    font-size: .82rem; padding: .32rem .7rem; border-radius: 999px;
}
.previsao-period-btn:hover { color: var(--text); }
.previsao-period-btn.is-active {
    background: var(--accent); color: #fff;
}
.previsao-hint { margin: .85rem 0 0; font-size: .85rem; }
.previsao-table-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.previsao-table-head .section-title { margin: 0; }
.previsao-table-scroll { max-height: 420px; overflow: auto; }
.previsao-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.previsao-kpis .stat-card { margin: 0; }
.previsao-kpi-foot {
    margin: .55rem 0 0;
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--muted);
}
.previsao-results { display: flex; flex-direction: column; gap: .85rem; }
.previsao-motivation {
    margin: 0;
    padding: .85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--text);
    font-size: .92rem;
    font-weight: 600;
}
.previsao-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.previsao-compare { display: flex; flex-direction: column; gap: .85rem; }
.previsao-compare-intro { margin: 0; font-size: .88rem; }
.previsao-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.previsao-compare-col {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--surface2);
}
.previsao-compare-col-alt {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.previsao-compare-col h3 {
    margin: 0 0 .75rem;
    font-size: .95rem;
}
.previsao-compare-aporte-label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .75rem;
    font-size: .85rem;
    color: var(--muted);
}
.previsao-compare-metrics {
    display: grid;
    gap: .55rem;
    margin: 0;
}
.previsao-compare-metrics div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    font-size: .88rem;
}
.previsao-compare-metrics dt { margin: 0; color: var(--muted); }
.previsao-compare-metrics dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
    color: var(--text);
}
.previsao-compare-metrics dd.pos { color: var(--receita); }
.previsao-compare-diff {
    margin: 0;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--receita) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--receita) 35%, var(--border));
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
}
#prev-compare-toggle.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.previsao-chart-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap;
}
.previsao-chart-head .section-title { margin: 0; }
.previsao-legend {
    display: flex; gap: 1rem; flex-wrap: wrap;
    font-size: .82rem; color: var(--muted);
}
.previsao-legend i {
    display: inline-block; width: 14px; height: 3px; border-radius: 2px;
    margin-right: .35rem; vertical-align: middle;
}
.previsao-legend .lg-pat { background: var(--accent); height: 3px; }
.previsao-legend .lg-aportes { background: var(--muted); }
.previsao-legend .lg-meta { background: var(--saldo); }
.previsao-chart-wrap { position: relative; margin-top: .75rem; }
.previsao-chart-wrap svg { width: 100%; height: auto; display: block; }
.previsao-chart-wrap--js { height: 360px; }
.previsao-chart-wrap--js canvas { width: 100% !important; height: 100% !important; }
.previsao-tip {
    position: absolute; pointer-events: none;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: .4rem .6rem; font-size: .8rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; z-index: 3;
}
.previsao-table-card tbody tr.is-goal td { background: color-mix(in srgb, var(--saldo) 16%, transparent); }
.apos-real-grid { grid-template-columns: minmax(200px, 280px); }
.apos-inicial-form, .apos-cell-form { margin: 0; }
.sidebar-nav a { white-space: normal; }
#onboarding-overlay[hidden] { display: none !important; }
body.onboarding-open { overflow: hidden; }

/* Onboarding de impacto — aposentadoria em 30s */
body.onboarding-impact-open { overflow: hidden; }
body.onboarding-impact-open .sidebar,
body.onboarding-impact-open .topbar,
body.onboarding-impact-open .app-main > .container,
body.onboarding-impact-open .chat-fab {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}
.onboarding-impact {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(8px);
}
.onboarding-impact-shell {
    width: min(560px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
}
.onboarding-impact-card {
    background: linear-gradient(180deg, #1F2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: 20px;
    padding: 1.25rem 1.35rem 1.35rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.onboarding-impact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.onboarding-impact-skip {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    padding: .35rem .5rem;
}
.onboarding-impact-skip:hover { color: var(--text); }
.onboarding-impact-lead {
    margin: 0 0 .5rem;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #10B981;
}
.onboarding-impact-title {
    margin: 0 0 .35rem;
    text-align: center;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    line-height: 1.25;
    color: #fff;
}
.onboarding-impact-title .ob-highlight {
    color: #6EE7B7;
}
.onboarding-impact-sub {
    margin: 0 0 1.25rem;
    text-align: center;
    font-size: .88rem;
    color: var(--muted);
}
.onboarding-impact-body {
    min-height: 120px;
}
.ob-slider-block {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #374151;
    border-radius: 14px;
    padding: 1rem 1.1rem;
}
.ob-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .85rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
}
.ob-slider-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.ob-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #374151;
    outline: none;
    cursor: pointer;
}
.ob-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    cursor: grab;
}
.ob-result-banner {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.ob-result-banner p {
    margin: 0 0 .5rem;
    font-size: .88rem;
    color: var(--muted);
}
.ob-result-banner strong {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #6EE7B7;
    line-height: 1.15;
}
.ob-result-banner span {
    display: block;
    margin-top: .35rem;
    font-size: .82rem;
    color: var(--muted);
}
.ob-chart-wrap {
    height: 220px;
    border-radius: 12px;
    background: #151d28;
    border: 1px solid #374151;
    padding: .35rem;
    margin-bottom: .65rem;
}
.ob-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}
.ob-footnote {
    margin: 0;
    text-align: center;
    font-size: .78rem;
    color: var(--muted);
}
.onboarding-impact-dots {
    display: flex;
    justify-content: center;
    gap: .45rem;
    margin: 1.15rem 0 1rem;
}
.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #374151;
    transition: all .2s ease;
}
.onboarding-dot.is-active {
    width: 24px;
    background: #10B981;
}
.onboarding-impact-foot {
    display: flex;
    gap: .65rem;
    justify-content: stretch;
}
.onboarding-impact-foot .btn {
    flex: 1;
}
.onboarding-impact-next {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #022c22;
    border: none;
    font-weight: 800;
    padding: .85rem 1rem;
    border-radius: 12px;
}
.onboarding-impact-back {
    flex: 0 0 auto;
    min-width: 88px;
}
@media (max-width: 900px) {
    .previsao-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .previsao-compare-grid { grid-template-columns: 1fr; }
    .apos-real-grid { grid-template-columns: 1fr; }
}

/* Plano */
.plano-kpi span,
.plano-kpi strong { color: inherit; }
.plano-kpi-renda { color: #22a06b; }
.plano-kpi-gastos { color: #dc2626; }
.plano-kpi-saldo { color: var(--text); }

.plano-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.plano-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 1rem;
    align-items: start;
}
.plano-chart-card { background: #f8f9fb; }
.plano-chart-wrap {
    height: 420px;
    margin-top: .5rem;
    padding: 1rem 1.25rem .5rem;
    border-radius: var(--radius);
    background: #f3f4f6;
    position: relative;
}
.plano-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.plano-chart-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
}
.plano-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}
.plano-modo {
    display: inline-flex;
    gap: .35rem;
    padding: .15rem;
    border-radius: 999px;
    background: var(--surface2);
}
.plano-modo-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: .82rem;
    padding: .35rem .85rem;
    border-radius: 999px;
}
.plano-modo-btn.is-active {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.plano-refresh {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: .35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.plano-refresh:hover { color: var(--text); background: var(--surface2); }
.plano-banner {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
    font-size: .9rem;
}
.plano-cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.plano-cat-row { display: flex; align-items: center; gap: .5rem; }
.plano-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.plano-cat-nome { flex: 1; font-weight: 600; }
.plano-cat-valor { font-variant-numeric: tabular-nums; }
.plano-progress {
    position: relative;
    height: 8px;
    margin: .65rem 0 .5rem;
    background: var(--surface2);
    border-radius: 999px;
    overflow: visible;
    touch-action: none;
    cursor: default;
    pointer-events: none;
}
.plano-progress-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    pointer-events: none;
}
.plano-progress-meta {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #0a1a12;
    padding: 0;
    position: absolute;
    top: 50%;
    left: 0;
    width: 18px;
    height: 28px;
    margin: 0;
    background: #00E676;
    border-radius: 6px;
    box-shadow: none;
    /* 9px = metade da largura — centro do thumb no % da meta */
    transform: translate(-9px, -50%);
    cursor: ew-resize;
    z-index: 2;
    touch-action: none;
    pointer-events: auto;
}
.plano-progress-meta:hover,
.plano-progress-meta:focus-visible,
.plano-cat-item.is-dragging .plano-progress-meta,
.plano-progress-meta:active {
    background: #00E676;
    outline: none;
    cursor: ew-resize;
    transform: translate(-9px, -50%);
}
.plano-cat-item.is-dragging { user-select: none; }
body.plano-dragging-meta {
    user-select: none;
    cursor: ew-resize;
}
body.plano-dragging-meta .plano-progress-meta {
    cursor: ew-resize !important;
}
.js-plano-restante.is-hidden { display: none; }
.plano-cat-sub { margin: 0; font-size: .82rem; }
.plano-cat-hint { margin: .35rem 0 0; font-size: .8rem; }
.plano-cat-grupo { padding-bottom: .35rem; border-bottom: 1px solid var(--border); }
.plano-cat-grupo:last-child { border-bottom: none; }
.plano-cat-sublist {
    list-style: none;
    margin: .45rem 0 0 1.1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.plano-cat-sublist li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem;
    font-size: .88rem;
}
.plano-cat-subnome { flex: 1; color: var(--muted); }

/* Futuro */
.futuro-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1rem;
    margin-bottom: 1rem;
}
.futuro-sidebar { align-self: start; position: sticky; top: 5rem; }
.futuro-sidebar-tip {
    margin: 0 0 1rem;
    padding: .75rem;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--receita) 10%, var(--surface));
    font-size: .88rem;
}
.futuro-sliders { display: flex; flex-direction: column; gap: 1.15rem; }
.futuro-slider-label span:first-child { display: block; color: var(--muted); font-size: .85rem; margin-bottom: .2rem; }
.futuro-slider-value-wrap { margin-bottom: .45rem; min-height: 1.5rem; }
.futuro-slider-value {
    display: inline-block;
    font-size: 1rem;
    cursor: text;
    user-select: none;
}
.futuro-slider-edit {
    width: 100%;
    max-width: 180px;
    font-weight: 700;
}
.futuro-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: transparent;
    outline: none;
    cursor: pointer;
}
.futuro-range:focus { outline: none; }
.futuro-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--futuro-pct, 0%), var(--surface2) var(--futuro-pct, 0%), var(--surface2) 100%);
    cursor: pointer;
}
.futuro-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 28px;
    margin-top: -10px;
    background: #00E676;
    border: 2px solid #0a1a12;
    border-radius: 6px;
    cursor: ew-resize;
    position: relative;
    z-index: 2;
}
.futuro-range:active::-webkit-slider-thumb {
    cursor: ew-resize;
    transform: scale(1.05);
}
.futuro-range::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface2);
    cursor: pointer;
    border: none;
}
.futuro-range::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
}
.futuro-range::-moz-range-thumb {
    width: 18px;
    height: 28px;
    background: #00E676;
    border: 2px solid #0a1a12;
    border-radius: 6px;
    cursor: ew-resize;
}
.futuro-chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}
.futuro-chart-toolbar .section-title { margin: 0; }
.futuro-chart-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}
.futuro-negativos-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--muted);
    font-size: .85rem;
    cursor: pointer;
    user-select: none;
}
.futuro-negativos-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.futuro-negativos-switch {
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}
.futuro-negativos-switch::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}
.futuro-negativos-toggle input:checked + .futuro-negativos-switch {
    background: var(--accent);
    border-color: var(--accent);
}
.futuro-negativos-toggle input:checked + .futuro-negativos-switch::after {
    transform: translateX(14px);
}
.futuro-horizon {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem;
    border-radius: 999px;
    background: var(--surface2);
}
.futuro-horizon-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: .78rem;
    padding: .32rem .7rem;
    border-radius: 999px;
}
.futuro-horizon-btn.is-active {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.futuro-gear-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    margin-left: .15rem;
}
.futuro-gear-btn:hover {
    color: var(--text);
    background: var(--surface);
}
.futuro-chart-wrap {
    background: linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
    border-radius: 14px;
    padding: .65rem .5rem .35rem;
    height: 400px;
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.futuro-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .85rem 1.25rem;
    margin-top: .85rem;
    color: var(--muted);
    font-size: .82rem;
}
.futuro-lg {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: .35rem;
    vertical-align: middle;
}
.futuro-lg-total { background: #7db578; }
.futuro-lg-principal { background: #6a93c0; }
.futuro-lg-ideal { background: #e29b5d; }
.futuro-lg-aportes {
    background: linear-gradient(180deg, #6a93c0 0%, #a8c5e8 100%);
    border-radius: 3px;
    width: 14px;
    height: 9px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.futuro-lg-juros-simples {
    background: linear-gradient(180deg, #9b87f5 0%, #d4c9fd 100%);
    border-radius: 3px;
    width: 14px;
    height: 9px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.futuro-lg-juros-compostos {
    background: linear-gradient(180deg, #2d8a4e 0%, #7db578 100%);
    border-radius: 3px;
    width: 14px;
    height: 9px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.futuro-rampa-card {
    margin-top: 1rem;
    overflow: hidden;
    position: relative;
}
.futuro-rampa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6a93c0 0%, #9b87f5 45%, #2d8a4e 100%);
    border-radius: 16px 16px 0 0;
    opacity: .85;
}
.futuro-rampa-toolbar { align-items: flex-start; }
.futuro-rampa-head { min-width: 0; }
.futuro-rampa-title {
    background: linear-gradient(90deg, #1e3a5f 0%, #2d8a4e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.futuro-rampa-sub {
    margin: .3rem 0 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
}
.futuro-rampa-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: .85rem;
}
.futuro-rampa-stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .65rem .75rem;
    border-radius: 12px;
    background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
    min-width: 0;
}
.futuro-rampa-stat-label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.3;
}
.futuro-rampa-stat-value {
    color: var(--text);
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.futuro-rampa-stat--hero {
    background: linear-gradient(135deg, rgba(45, 138, 78, 0.12) 0%, rgba(125, 181, 120, 0.08) 100%);
    border-color: rgba(45, 138, 78, 0.22);
}
.futuro-rampa-stat--hero .futuro-rampa-stat-value {
    color: #1f6b3f;
    font-size: 1.05rem;
}
.futuro-rampa-stat--accent {
    background: linear-gradient(135deg, rgba(155, 135, 245, 0.1) 0%, rgba(196, 181, 253, 0.06) 100%);
    border-color: rgba(155, 135, 245, 0.22);
}
.futuro-rampa-stat--accent .futuro-rampa-stat-value {
    color: #5b45b5;
}
.futuro-rampa-wrap {
    height: 400px;
    background:
        radial-gradient(ellipse 80% 60% at 85% 15%, rgba(125, 181, 120, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 15% 85%, rgba(106, 147, 192, 0.12) 0%, transparent 50%),
        linear-gradient(180deg, #f9fafb 0%, #eef2f7 55%, #e8edf4 100%);
    border: 1px solid color-mix(in srgb, #2d8a4e 18%, var(--border));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.futuro-rampa-legend {
    margin-top: .85rem;
    gap: 1rem 1.5rem;
    font-weight: 600;
}
@media (max-width: 900px) {
    .futuro-rampa-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .futuro-rampa-stats { grid-template-columns: 1fr; }
    .futuro-rampa-wrap { height: 320px; }
}

.futuro-taxas-dialog {
    width: min(440px, calc(100vw - 2rem));
    padding: 0;
    border: none;
    border-radius: 16px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
}
.futuro-taxas-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.futuro-taxas-form { margin: 0; }
.futuro-taxas-head {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid #e8ecf1;
}
.futuro-taxas-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
}
.futuro-taxas-close {
    position: absolute;
    right: .65rem;
    top: 50%;
    transform: translateY(-50%);
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 999px;
}
.futuro-taxas-close:hover { background: #f1f5f9; color: #334155; }
.futuro-taxas-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
}
.futuro-taxas-body label {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    font-size: .9rem;
    color: #475569;
    font-weight: 500;
}
.futuro-taxas-body .input {
    background: #fff;
    border: 1px solid #d8dee8;
    color: #111827;
    border-radius: 10px;
    padding: .7rem .85rem;
}
.futuro-taxas-info {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    background: #e8f4fc;
    border-radius: 12px;
    padding: .85rem .9rem;
}
.futuro-taxas-info-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: .1rem;
}
.futuro-taxas-info p {
    margin: 0;
    font-size: .82rem;
    line-height: 1.45;
    color: #334155;
}
.futuro-taxas-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem 1.2rem;
    border-top: 1px solid #e8ecf1;
}
.futuro-taxas-reset {
    appearance: none;
    border: none;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    padding: .4rem .2rem;
}
.futuro-taxas-reset:hover { color: #334155; }
.futuro-taxas-save {
    background: #4a4e5a !important;
    border-color: #4a4e5a !important;
    color: #fff !important;
    border-radius: 10px;
    padding: .55rem 1rem;
}
.futuro-projetos-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.futuro-projetos-head .section-title { margin: 0; }
.futuro-projetos-tools {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.futuro-view-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.futuro-view-seg {
    display: inline-flex; background: var(--surface2); border-radius: 999px; padding: 3px; gap: 2px;
}
.futuro-view-btn {
    appearance: none; border: none; background: transparent;
    color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600;
    padding: .4rem .85rem; border-radius: 999px; cursor: pointer;
}
.futuro-view-btn.is-active {
    background: var(--surface); color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.futuro-add-proj {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font-size: 1.35rem; line-height: 1; cursor: pointer;
    display: grid; place-items: center;
}
.futuro-add-proj:hover { border-color: #94a3b8; background: #f8fafc; }
.futuro-projetos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.futuro-proj-col { min-width: 0; }
.futuro-proj-col.is-off .futuro-proj-card { opacity: .55; filter: grayscale(.35); }
.futuro-proj-col-card {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: .85rem 1rem; margin-bottom: .75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.futuro-proj-col-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.futuro-proj-col-meta h3 { margin: 0; font-size: .95rem; color: var(--text); }
.futuro-proj-col-total { font-size: .95rem; color: var(--text); font-weight: 700; }
.futuro-proj-cards { display: flex; flex-direction: column; gap: .65rem; }
.futuro-proj-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .85rem 1rem;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    color: var(--text);
    transition: opacity .2s, filter .2s;
}
.futuro-proj-card.is-off { opacity: .55; filter: grayscale(.4); }
.futuro-proj-card-top {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    margin-bottom: .55rem;
}
.futuro-proj-ico {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: #e8f8ef; font-size: 1.05rem;
}
.futuro-proj-date {
    display: block; font-size: .78rem; color: #94a3b8; margin-bottom: .15rem;
}
.futuro-proj-name {
    display: block; font-size: 1rem; color: var(--text); margin-bottom: .55rem;
}
.futuro-proj-progress {
    height: 4px; border-radius: 999px; background: #e8ecf1; overflow: hidden; margin-bottom: .55rem;
}
.futuro-proj-progress-fill {
    display: block; height: 100%; border-radius: inherit; background: #22c55e;
}
.futuro-proj-card.is-off .futuro-proj-progress-fill { background: #cbd5e1; }
.futuro-proj-alocado {
    margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); font-weight: 600;
}
.futuro-proj-empty { font-size: .85rem; margin: 0; }
.futuro-projetos-alt { margin-top: .25rem; }
.futuro-proj-table {
    width: 100%; border-collapse: collapse; font-size: .9rem;
}
.futuro-proj-table th, .futuro-proj-table td {
    text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--border); color: var(--text);
}
.futuro-proj-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.futuro-proj-table tr.is-off { opacity: .55; }
.futuro-proj-resumo-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.futuro-proj-resumo-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; color: var(--text);
}
.futuro-proj-resumo-card h3 { margin: 0 0 .35rem; font-size: .95rem; }
.futuro-proj-resumo-valor { margin: 0 0 .35rem; font-size: 1.15rem; font-weight: 700; }
.futuro-toggle { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.futuro-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.futuro-toggle span {
    width: 40px; height: 22px; background: #cbd5e1; border-radius: 999px; position: relative; transition: .2s;
}
.futuro-toggle span::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    background: #fff; border-radius: 50%; transition: .2s;
    box-shadow: 0 1px 2px rgba(15,23,42,.15);
}
.futuro-toggle input:checked + span { background: #22c55e; }
.futuro-toggle input:checked + span::after { transform: translateX(18px); }
.futuro-dialog {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); padding: 1.25rem; max-width: 420px; width: calc(100% - 2rem);
}
.futuro-dialog::backdrop { background: rgba(0,0,0,.55); }
.futuro-proj-form { display: flex; flex-direction: column; gap: .75rem; }
.futuro-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }

/* Modal Novo projeto */
.futuro-proj-dialog-new {
    max-width: 640px;
    width: calc(100% - 1.5rem);
    padding: 0;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    color: #334155;
}
.futuro-proj-dialog-new::backdrop { background: rgba(15, 23, 42, .45); }
.futuro-proj-form-new { margin: 0; display: flex; flex-direction: column; max-height: min(92vh, 900px); }
.futuro-proj-modal-head {
    display: flex; align-items: center; justify-content: center;
    position: relative; padding: 1.1rem 3rem 1rem; border-bottom: 1px solid var(--border);
}
.futuro-proj-modal-head h3 {
    margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text); text-align: center;
}
.futuro-proj-modal-head .futuro-taxas-close { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); }
.futuro-proj-modal-body {
    padding: 1.1rem 1.35rem 1rem;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 1.1rem;
}
.futuro-field { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.futuro-field-label {
    font-size: .82rem; font-weight: 600; color: var(--muted);
}
.futuro-seg {
    display: flex; gap: .4rem; flex-wrap: wrap;
}
.futuro-seg-btn {
    flex: 1; min-width: 0;
    appearance: none; background: var(--surface2); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px;
    padding: .55rem .75rem; font-size: .9rem; font-weight: 600;
    cursor: pointer; transition: .15s ease;
}
.futuro-seg-sm .futuro-seg-btn { flex: 0 1 auto; min-width: 4.5rem; padding: .5rem .9rem; }
.futuro-seg-btn.is-active {
    background: var(--bg); color: var(--text); border-color: var(--text);
}
.futuro-seg-btn:hover { border-color: #94a3b8; }
.futuro-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: .55rem .35rem;
}
.futuro-cat-btn {
    appearance: none; background: transparent; border: none;
    display: flex; flex-direction: column; align-items: center; gap: .35rem;
    padding: .15rem; cursor: pointer; color: var(--muted);
}
.futuro-cat-ico {
    width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.35rem; line-height: 1;
    border: 2px solid var(--border); background: var(--surface);
    transition: .15s ease;
}
.futuro-cat-lbl {
    font-size: .68rem; font-weight: 600; text-align: center; line-height: 1.15;
    max-width: 78px;
}
.futuro-cat-btn.is-active { color: #00c853; }
.futuro-cat-btn.is-active .futuro-cat-ico {
    border-color: #00c853; box-shadow: 0 0 0 1px #00c853;
}
.futuro-cat-btn:hover .futuro-cat-ico { border-color: #94a3b8; }
.futuro-proj-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem 1rem;
}
.futuro-input-light {
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--bg) !important;
    padding: .65rem .8rem !important;
    font-size: .92rem !important;
    color: var(--text) !important;
}
.futuro-input-light::placeholder { color: var(--muted); }
.futuro-proj-modal-foot {
    padding: .85rem 1.35rem 1.25rem;
    display: flex; justify-content: center;
    border-top: 1px solid #eef2f7;
}
.futuro-proj-create-btn {
    width: min(100%, 280px);
    border: none;
    border-radius: 10px;
    background: #475569;
    color: #fff;
    font-weight: 700;
    padding: .75rem 1.25rem;
}
.futuro-proj-create-btn:hover { background: #334155; }
@media (max-width: 640px) {
    .futuro-proj-grid2 { grid-template-columns: 1fr; }
    .futuro-cat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .plano-kpis { grid-template-columns: 1fr; }
    .plano-grid, .futuro-main-grid, .futuro-projetos-grid, .futuro-proj-resumo-grid { grid-template-columns: 1fr; }
    .futuro-sidebar, .patrim-side { position: static; }
    .patrim-bens-grid { grid-template-columns: 1fr; }
}

/* Patrimônio — Bens e Dívidas (tema dark/light) */
.patrim-bens-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.patrim-side {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-width: 0;
}
.patrim-card {
    padding: 1.05rem 1.15rem 1.1rem;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-width: 0;
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.patrim-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; margin-bottom: .85rem;
}
.patrim-card-head .section-title {
    margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text);
}
.patrim-add-btn {
    appearance: none; border: none; background: transparent;
    color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer; padding: .25rem .15rem;
    display: inline-flex; align-items: center; gap: .35rem;
}
.patrim-add-btn:hover { color: var(--text); }
.patrim-add-plus {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid currentColor;
    display: inline-grid; place-items: center;
    font-size: .85rem; line-height: 1; font-weight: 700;
}
.patrim-list { display: flex; flex-direction: column; gap: .65rem; flex: 1; }
.patrim-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .5rem; padding: 2rem 1rem; text-align: center; color: var(--muted); min-height: 140px;
}
.patrim-empty-ico { font-size: 1.75rem; opacity: .7; }
.patrim-empty p { margin: 0; font-size: .9rem; max-width: 16rem; }
.patrim-item {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: .85rem; padding: .7rem .15rem .75rem;
    border-bottom: 1px solid var(--border);
}
.patrim-item:last-child { border-bottom: none; }
.patrim-item-left { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.patrim-item-ico {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface2); font-size: 1.1rem; flex-shrink: 0;
}
.patrim-item-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.patrim-item-text strong {
    font-size: .95rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.patrim-item-right {
    display: flex; flex-direction: column; align-items: flex-end; gap: .1rem;
    position: relative; min-width: 6.5rem; flex-shrink: 0;
}
.patrim-item-actions {
    display: flex; gap: .15rem; margin-bottom: .1rem;
}
.patrim-ico-btn {
    appearance: none; border: none; background: transparent;
    cursor: pointer; font-size: .8rem; line-height: 1;
    padding: .1rem .2rem; opacity: .55; color: var(--muted);
}
.patrim-ico-btn:hover { opacity: 1; color: var(--text); }
.patrim-item-valor { font-size: .95rem; color: var(--text); }
.patrim-item-hint { font-size: .75rem; text-align: right; color: var(--muted); }
.patrim-card-foot {
    display: flex; justify-content: flex-end;
    margin-top: auto; padding-top: .75rem;
    border-top: 1px solid var(--border);
    font-size: .88rem; color: var(--muted);
}
.patrim-card-foot-inner {
    display: flex; flex-direction: column; align-items: flex-end; gap: .2rem;
}
.patrim-card-foot strong { color: var(--text); }
.patrim-summary {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    color: var(--text);
}
.patrim-summary h3 {
    margin: 0 0 .45rem; font-size: .95rem; color: var(--text); font-weight: 700;
}
.patrim-summary p {
    margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.45;
}
.patrim-summary--ativos strong { color: #60a5fa; }
.patrim-summary--fin strong { color: #fb923c; }
.patrim-summary--emp strong { color: #f87171; }
[data-theme="light"] .patrim-summary--ativos strong { color: #2563eb; }
[data-theme="light"] .patrim-summary--fin strong { color: #ea580c; }
[data-theme="light"] .patrim-summary--emp strong { color: #dc2626; }
.patrim-dialog {
    max-width: 460px; width: calc(100% - 1.5rem);
    padding: 0; border: none; border-radius: 16px; overflow: hidden;
    background: var(--surface); color: var(--text);
}
.patrim-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.patrim-form { margin: 0; }
.patrim-form-body { gap: .85rem; }

.patrim-section-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.patrim-resumo { margin-top: 2rem; }
.patrim-resumo-top {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(240px, 280px);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}
.patrim-chart-card {
    padding: 1.1rem 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text);
}
.patrim-chart-title {
    margin: 0 0 .75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    align-self: flex-start;
}
.patrim-doughnut-wrap {
    position: relative;
    width: min(100%, 260px);
    aspect-ratio: 1;
    margin: 0 auto .75rem;
}
.patrim-doughnut-wrap canvas { width: 100% !important; height: 100% !important; }
.patrim-doughnut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}
.patrim-doughnut-center span {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 600;
}
.patrim-doughnut-center strong {
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 700;
}
.patrim-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.1rem;
    justify-content: center;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 600;
}
.patrim-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: .35rem;
    vertical-align: middle;
}
.patrim-dot--gerador { background: #1e4d8c; }
.patrim-dot--uso { background: #7eb6e8; }
.patrim-dot--emp { background: #8b4513; }
.patrim-dot--fin { background: #e8a87c; }
.patrim-resumo-cards {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.patrim-insight {
    padding: 1rem 1.1rem;
    color: var(--text);
}
.patrim-insight h3 {
    margin: 0 0 .45rem;
    font-size: .95rem;
    color: var(--text);
}
.patrim-insight p {
    margin: 0;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.45;
}
.patrim-c-blue { color: #60a5fa; }
.patrim-c-orange { color: #fb923c; }
.patrim-c-gold { color: #fbbf24; }
[data-theme="light"] .patrim-c-blue { color: #2563eb; }
[data-theme="light"] .patrim-c-orange { color: #ea580c; }
[data-theme="light"] .patrim-c-gold { color: #ca8a04; }
.patrim-btn-futuro {
    display: inline-flex;
    margin-top: .85rem;
    background: #64748b !important;
    border-color: #64748b !important;
    color: #fff !important;
    font-size: .78rem !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    padding: .55rem .9rem !important;
    border-radius: 8px !important;
}
.patrim-btn-futuro:hover { background: #475569 !important; }
.patrim-bar-card {
    padding: 1.1rem 1.15rem 1.25rem;
    color: var(--text);
}
.patrim-bar-wrap {
    height: 280px;
    position: relative;
}
@media (max-width: 1100px) {
    .patrim-resumo-top { grid-template-columns: 1fr 1fr; }
    .patrim-resumo-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .patrim-resumo-top { grid-template-columns: 1fr; }
    .patrim-resumo-cards { grid-template-columns: 1fr; }
}

/* Investimentos — cores via tema */
.inv-app { display: flex; flex-direction: column; gap: 1rem; color: var(--text); }
.inv-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 1rem;
    align-items: stretch;
}
.inv-kpis { display: flex; flex-direction: column; gap: 1rem; justify-content: center; padding: .25rem 0; }
.inv-kpi-label { display: block; font-size: .88rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.inv-kpi-value { display: block; font-size: 1.35rem; color: var(--text); font-weight: 800; }
.inv-kpi-value--teal { color: #2dd4bf; }
[data-theme="light"] .inv-kpi-value--teal { color: #0d9488; }
.inv-link {
    appearance: none; border: none; background: transparent;
    color: #2dd4bf; font: inherit; font-size: .85rem; font-weight: 700;
    cursor: pointer; padding: 0; margin-top: .25rem; text-decoration: none;
    display: inline-block;
}
[data-theme="light"] .inv-link { color: #0d9488; }
.inv-link:hover { color: #5eead4; text-decoration: underline; }
[data-theme="light"] .inv-link:hover { color: #0f766e; }
.inv-mes-card { padding: 1rem 1.15rem; color: var(--text); }
.inv-mes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.inv-mes-head h3 { margin: 0; font-size: .95rem; color: var(--text); }
.inv-ico-edit {
    appearance: none; border: none; background: transparent; cursor: pointer;
    opacity: .55; font-size: .9rem; padding: .15rem; color: var(--muted);
}
.inv-ico-edit:hover { opacity: 1; color: var(--text); }
.inv-mes-valor { display: block; font-size: 1.35rem; color: var(--text); margin-bottom: .55rem; }
.inv-progress {
    height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; margin-bottom: .45rem;
}
.inv-progress-fill {
    display: block; height: 100%; border-radius: inherit; background: #14b8a6;
}
.inv-mes-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .82rem; color: var(--muted); font-weight: 600;
}
.inv-pct-badge { color: #2dd4bf; font-weight: 800; }
[data-theme="light"] .inv-pct-badge { color: #0d9488; }
.inv-mes-falta { margin: .35rem 0 0; font-size: .82rem; color: var(--muted); }
.inv-banner {
    background: color-mix(in srgb, #14b8a6 16%, var(--surface));
    border: 1px solid color-mix(in srgb, #14b8a6 35%, var(--border));
    color: var(--text);
    border-radius: 12px;
    padding: .85rem 1rem;
    font-size: .9rem;
    line-height: 1.4;
}
.inv-banner strong { color: var(--text); }
.inv-objetivos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}
.inv-obj-card {
    padding: 1.05rem 1.15rem 1rem;
    display: flex; flex-direction: column; min-width: 0;
    border-radius: 14px;
    color: var(--text);
}
.inv-obj-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
    margin-bottom: .85rem;
}
.inv-obj-title { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.inv-obj-title h3 { margin: 0 0 .15rem; font-size: .95rem; color: var(--text); }
.inv-obj-title strong { font-size: 1.15rem; color: var(--text); }
.inv-obj-ico {
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: color-mix(in srgb, #14b8a6 28%, var(--surface2)); font-size: 1.2rem; flex-shrink: 0;
}
.inv-chart-block {
    display: flex; flex-direction: column; align-items: center; gap: .45rem;
    flex: 1; justify-content: center; min-height: 180px;
}
.inv-chart-block--3 {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem; width: 100%; align-items: end;
}
.inv-chart-caption { font-size: .8rem; color: var(--muted); font-weight: 600; }
.inv-vbar-wrap { height: 150px; display: flex; align-items: stretch; }
.inv-vbar-wrap--wide { width: 72px; }
.inv-vbar {
    width: 56px; height: 100%; border-radius: 8px; overflow: hidden;
    display: flex; flex-direction: column; position: relative; background: var(--surface2);
}
.inv-vbar--full { width: 72px; }
.inv-vbar-top { background: color-mix(in srgb, var(--muted) 45%, var(--surface2)); display: block; }
.inv-vbar-bot { background: #14b8a6; display: block; }
.inv-vbar-lbl {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: .72rem; font-weight: 800; color: #fff;
    text-shadow: 0 1px 2px rgba(15,23,42,.45);
}
.inv-vbar-lbl--top { top: 18%; }
.inv-vbar-lbl--bot { bottom: 10%; }
.inv-vbar-lbl--mid { top: 45%; }
.inv-prazo-col { display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 0; }
.inv-prazo-bar-track {
    width: 100%; max-width: 52px; height: 120px;
    background: var(--surface2); border-radius: 8px;
    display: flex; align-items: flex-end; justify-content: center;
    position: relative; overflow: hidden;
}
.inv-prazo-bar {
    width: 100%; background: color-mix(in srgb, var(--muted) 50%, var(--surface2)); border-radius: 8px 8px 0 0; min-height: 4px;
}
.inv-prazo-pct {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    font-size: .68rem; font-weight: 800; color: var(--text);
}
.inv-prazo-val { font-size: .72rem; color: var(--text); text-align: center; line-height: 1.2; }
.inv-prazo-name { font-size: .72rem; font-weight: 700; color: var(--text); text-align: center; }
.inv-prazo-sub { font-size: .68rem; text-align: center; color: var(--muted); }
.inv-obj-foot {
    display: grid; grid-template-columns: 1fr 1fr auto;
    gap: .65rem; align-items: end;
    margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--border);
}
.inv-obj-foot .muted { display: block; font-size: .75rem; margin-bottom: .15rem; color: var(--muted); }
.inv-obj-foot strong { font-size: .9rem; color: var(--text); }
.inv-carteira { margin-top: .5rem; }
.inv-carteira-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem;
}
.inv-carteira-head .patrim-section-title { margin: 0; color: var(--text); }
.inv-carteira-tools { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.inv-table td, .inv-table th { vertical-align: middle; color: var(--text); }
.inv-table th { color: var(--muted); }
.inv-row-actions { white-space: nowrap; text-align: right; }
@media (max-width: 1100px) {
    .inv-objetivos-grid { grid-template-columns: 1fr; }
    .inv-top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .inv-obj-foot { grid-template-columns: 1fr 1fr; }
    .inv-obj-foot .inv-link { grid-column: 1 / -1; }
}