/* Identidade do habittos: índigo como cor principal, superfícies claras e navegação em azul profundo. */
:root {
    --bg: #f5f6fb;
    --ink: #252642;
    --muted: #73758c;
    --primary: #2921b8;
    --primary-hover: #211994;
    --purple: var(--primary);
    --line: #e7e8f2;
    --green: #22866c;
    --soft: #eeedfc;
    --accent: #d7dcff;
    --sidebar: #1d1b4b;
}

[x-cloak] {
    display: none !important;
}
button:disabled {
    cursor: wait;
    opacity: 0.55;
}
.sidebar {
    background: var(--sidebar);
    border: 0;
    width: 268px;
    padding: 34px 22px 22px;
    z-index: 20;
}
.main {
    margin-left: 268px;
}
.sidebar .brand {
    color: #f8f9ff;
    font-size: 30px;
    margin-bottom: 38px;
    gap: 11px;
}
.brand-icon {
    display: block;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.brand-logo {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
}
.auth-intro .brand:has(.brand-logo) {
    margin-bottom: 24px;
    width: fit-content;
}
.sidebar .brand-mark {
    background: var(--accent);
    color: #1d1b4b;
    border-radius: 13px 13px 13px 3px;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 32px;
    line-height: 40px;
    padding: 0 13px;
}
.sidebar .brand-dot {
    color: var(--accent);
}
.sidebar .nav-label {
    color: #807fa1;
    font-size: 9px;
    letter-spacing: 1.7px;
    margin: 0 14px 16px;
}
.sidebar nav {
    gap: 7px;
}
.sidebar nav > a {
    color: #b8b8c4;
    padding: 14px 15px;
    font-size: 12px;
    gap: 12px;
    border-radius: 10px;
    transition:
        background 0.15s,
        color 0.15s;
}
.sidebar nav > a.active {
    background: var(--accent);
    color: #29216e;
    font-weight: 600;
}
.sidebar nav > a:hover:not(.active) {
    background: #ffffff0c;
    color: #fff;
}
.sidebar-note {
    color: #bdbdcb;
    font-size: 12px;
    padding-left: 14px;
}
.sidebar-note p {
    color: #7d7c9e;
    font-size: 11px;
    line-height: 1.9;
}
.tiny-dot {
    background: #6c6ab3;
}
.profile {
    border-color: #ffffff15;
    color: #deddec;
    padding-left: 10px;
}
.profile .avatar {
    background: #6b698f30;
    color: var(--accent);
}
.profile .text-button {
    color: #8e8daa;
}
.topbar {
    background: transparent;
    border-color: #d9d9e9;
    height: 78px;
    color: #4d4c66;
    font-size: 11px;
}
.breadcrumb-divider {
    margin: 0 12px;
    color: #b6b6c2;
}
.topbar-tag {
    color: #7c7b9e;
    font-size: 10px;
}
.content {
    padding-top: 44px;
}
h1 {
    font-weight: 550;
    font-size: 35px;
    letter-spacing: -1.5px;
    line-height: 1.15;
}
h2 {
    font-weight: 600;
}
.page-heading {
    margin-bottom: 33px;
}
.page-heading .eyebrow {
    font-size: 9px;
    letter-spacing: 1.8px;
    color: #636285;
}
.page-heading p {
    font-size: 12px;
    color: #717095;
}
.heading-dot {
    color: #575599;
}
.button {
    border-radius: 9px;
    background: var(--primary);
    border-color: var(--primary);
    min-height: 42px;
    padding: 12px 18px;
    font-weight: 500;
    box-shadow: none;
    transition:
        background 0.15s,
        transform 0.15s;
}
.button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}
.button.secondary {
    background: #f7f7fb;
    color: #595877;
    border-color: #d9d9e5;
}
.button.secondary:hover {
    background: #e8e8f3;
    border-color: #cccbdc;
}
.panel {
    border: 0;
    border-radius: 16px;
    padding: 27px;
    box-shadow: 0 3px 18px #21203b03;
}
.metrics {
    gap: 15px;
}
.metric {
    border: 0;
    border-radius: 15px;
    background: #ffffff;
    padding: 24px;
    min-height: 158px;
}
.metric.balance {
    background: var(--primary);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.metric.balance::after {
    content: "";
    width: 100px;
    height: 100px;
    position: absolute;
    bottom: -56px;
    right: -20px;
    border: 18px solid #d7dcff12;
    border-radius: 50%;
    pointer-events: none;
}
.metric-label {
    color: #666588;
    margin-bottom: 23px;
}
.metric.balance .metric-label {
    color: #d8dcff;
}
.metric.balance strong {
    color: #ffffff;
}
.metric.balance small {
    color: #c5cbff;
}
.metric strong {
    font-size: 27px;
    font-weight: 500;
    letter-spacing: -1px;
}
.metric small {
    font-size: 10px;
    color: #7c7b9e;
}
.month-navigation {
    padding: 19px 24px;
    background: #e9ecfa;
    border: 0;
    border-radius: 13px;
}
.month-navigation .eyebrow {
    color: #6c6a90;
    font-size: 8px;
    letter-spacing: 1.7px;
}
.month-navigation h2 {
    font-size: 18px;
    font-weight: 550;
}
.month-navigation > small {
    color: #737297;
    font-size: 10px;
}
.cycle-dates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
    color: #656482;
    font-size: 11px;
}
.cycle-dates .indicator-pencil {
    width: 25px;
    height: 25px;
}
.cycle-editor {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    flex-basis: 100%;
    order: 2;
    padding: 18px 0 3px;
    border-top: 1px solid #d8dbee;
}
.cycle-editor label {
    display: grid;
    gap: 8px;
    font-size: 11px;
    color: var(--ink);
}
.cycle-editor > small {
    flex-basis: 100%;
    max-width: 720px;
    line-height: 1.8;
    color: #656482;
    font-size: 11px;
}
.month-navigation > small {
    order: 3;
}
.month-step.button {
    background: #f0f0f8;
    border-color: transparent;
    padding: 10px 13px;
    min-height: 37px;
    font-size: 11px;
}
.week-bar-track {
    background: #f1f1fa;
    border-radius: 8px;
    max-width: 45px;
}
.week-bar {
    background: #7776d8;
    border-radius: 8px 8px 2px 2px;
    transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.week-bar.over {
    background: #d9ad90;
}
.week strong {
    color: #545371;
}
.weekly-limits {
    column-gap: 24px;
    row-gap: 12px;
}
.weekly-limits > span {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px;
}
.weekly-limits small {
    font-size: 10px;
}
.weekly-limits .current-week-remaining {
    font-size: 10px;
}
.weekly-limits .weekly-limits-note {
    flex-basis: 100%;
    margin-left: 0;
}
.projection {
    font-size: 34px;
    color: #39329e;
    font-weight: 500;
}
.round-icon {
    background: #e4e4f2;
    color: #666488;
}
.tag {
    border-radius: 6px;
    background: #eae9f3;
    color: #6c6b91;
    font-size: 10px;
}
.tag.settled {
    background: #edf2e6;
    color: #6e8e4e;
}
.tag.pending {
    background: #f8efe3;
    color: #ae8552;
}
.status-toggle {
    border: 0;
}
.status-toggle:hover {
    box-shadow: 0 0 0 2px #b3b2d6;
}
.section-heading .eyebrow {
    font-size: 8px;
    color: #79779b;
}
.section-heading h2 {
    font-size: 18px;
    font-weight: 550;
}
progress,
progress::-webkit-progress-bar {
    background: #e8e8f2;
}
progress::-webkit-progress-value {
    background: #7776d8;
}
progress::-moz-progress-bar {
    background: #7776d8;
}
.count {
    background: #e9e9f3;
    color: #6c6a90;
}
th {
    background: #f3f3f9;
    color: #7b7a9c;
    font-size: 10px;
    padding: 15px 10px;
}
td {
    padding: 18px 10px;
    border-color: #eaeaf3;
}
input:not([type="checkbox"]),
select,
textarea {
    border-color: #dad9ea;
    border-radius: 8px;
    padding: 13px 14px;
    background: #f8f8fd;
}
input:focus,
select:focus,
textarea:focus {
    border-color: #7771db;
    box-shadow: 0 0 0 3px #6664ab16;
}
.checkbox input {
    accent-color: #2921b8;
}
.check-group {
    background: #efeff7;
}
.notice {
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.notice button {
    background: none;
    border: 0;
    color: inherit;
    font-size: 20px;
}
.notice.error {
    display: block;
}
.notice.success {
    background: #e5eddb;
    color: #5a7548;
}

/* Seletor de ambiente: busca, teclado, estado selecionado e criação no mesmo lugar. */
.space-control {
    position: relative;
    margin-bottom: 38px;
}
.space-control-row {
    display: flex;
    align-items: center;
    gap: 7px;
}
.space-trigger {
    border: 1px solid #ffffff16;
    background: #ffffff07;
    color: #e7e7f1;
    padding: 10px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    text-align: left;
    min-height: 61px;
}
.space-trigger:hover,
.space-trigger[aria-expanded="true"] {
    background: #ffffff0f;
    border-color: #ffffff30;
}
.space-trigger-label {
    min-width: 0;
    flex: 1;
}
.space-trigger-label small {
    display: block;
    font-size: 7px;
    letter-spacing: 1.1px;
    color: #7c7b9d;
    margin-bottom: 6px;
    white-space: nowrap;
}
.space-trigger-label strong {
    display: block;
    font-size: 11px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.space-monogram {
    display: grid;
    place-items: center;
    min-width: 29px;
    height: 31px;
    background: #d7dcff18;
    color: #b5b3e5;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}
.chevron {
    color: #807fa0;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.chevron.rotated {
    transform: rotate(180deg);
}
.create-space {
    width: 31px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid #ffffff20;
    border-radius: 9px;
    background: none;
    color: #9e9db7;
}
.create-space:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #323143;
}
.space-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 9px);
    width: 100%;
    background: #ffffff;
    color: var(--ink);
    border: 1px solid #d9d9e7;
    box-shadow: 0 16px 48px #152a3040;
    border-radius: 14px;
    z-index: 40;
    overflow: hidden;
}
.space-search {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    gap: 9px;
    border-bottom: 1px solid #e4e3f0;
    color: #7d7c9e;
}
.space-search input {
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 10px 0;
    box-shadow: none !important;
    font-size: 11px;
}
.space-options {
    padding: 7px;
    max-height: 264px;
    overflow-y: auto;
}
.space-options [role="option"] {
    border: 0;
    border-radius: 8px;
    background: none;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 9px;
    text-align: left;
    color: #403f56;
}
.space-options [role="option"]:hover,
.space-options [role="option"]:focus-visible {
    background: #e6e6f3;
    outline: none;
}
.space-options [aria-selected="true"] {
    background: #e6e6f4;
}
.space-options .space-monogram {
    flex-shrink: 0;
    background: #dcdbed;
    color: #4c4a82;
}
.space-options [role="option"] > span:nth-child(2) {
    min-width: 0;
}
.space-options strong {
    font-size: 12px;
    font-weight: 500;
    display: block;
    overflow-wrap: anywhere;
}
.space-options small {
    display: block;
    font-size: 9px;
    margin-top: 5px;
    color: #7e7d9f;
}
.selection-check {
    margin-left: auto;
    color: #54528b;
}
.space-search-empty {
    font-size: 11px;
    color: #727196;
    padding: 18px 12px;
    margin: 0;
}
.space-popover-footer {
    background: #f2f2f9;
    color: #7b7a9c;
    padding: 12px 14px;
    font-size: 8px;
}
.space-loading {
    font-size: 9px;
    color: var(--accent);
    position: absolute;
    top: calc(100% + 8px);
}

/* Dialogs com foco e Escape gerenciados pelo navegador. */
.app-dialog {
    padding: 0;
    border: 1px solid #e5e5f0;
    border-radius: 20px;
    background: #ffffff;
    color: var(--ink);
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    box-shadow: 0 30px 100px #14132930;
}
.app-dialog::backdrop {
    background: #16152865;
    backdrop-filter: blur(5px);
}
.entry-dialog {
    width: min(680px, calc(100vw - 32px));
}
.dialog-content {
    padding: 32px;
}
.dialog-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.icon-close {
    border: 0;
    background: #e8e8f2;
    border-radius: 50%;
    width: 29px;
    height: 29px;
    font-size: 20px;
    color: #6e6c93;
}
.dialog-content h2 {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.8px;
    margin: 5px 0 10px;
}
.dialog-content p {
    font-size: 12px;
    color: #7c7b9d;
    margin: 0;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}
.field-error {
    color: #b1695c !important;
    font-size: 11px !important;
}
.settings-page {
    max-width: 1060px;
}
.settings-section {
    display: grid;
    grid-template-columns: 1fr 1.7fr;
    gap: 42px;
    padding: 30px 0;
    border-top: 1px solid #d6d5e5;
}
.settings-description {
    padding-top: 4px;
}
.settings-description h2 {
    margin: 12px 0;
    font-size: 21px;
    font-weight: 500;
}
.settings-description p {
    font-size: 12px;
    color: #78779a;
    max-width: 230px;
}
.settings-number {
    font-size: 10px;
    color: #8483a4;
    letter-spacing: 2px;
}
.settings-link h2 {
    margin-bottom: 8px;
}
.settings-link p,
.danger-panel p {
    font-size: 12px;
}
.settings-link .button {
    margin-top: 10px;
}
.danger-panel {
    background: #f5ede5;
}
.danger-panel h2 {
    color: #9d7561;
}
.danger-panel p {
    color: #aa9181;
}
.button.danger-button {
    color: #a26651;
    background: #fff9f3;
    border-color: #e4cbbb;
}
.button.danger-button:hover {
    background: #f9e3d9;
    border-color: #dbb6a6;
}
.welcome-page {
    padding: 40px 15px;
    max-width: 690px;
}
.welcome-page h1 {
    font-size: clamp(37px, 4vw, 60px);
    line-height: 1.08;
    letter-spacing: -2px;
    margin: 28px 0 22px;
}
.welcome-page > p {
    color: #6f6e93;
    max-width: 420px;
}
.welcome-page > .muted {
    font-size: 12px;
    margin-top: 36px;
}
.welcome-illustration {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 45px;
}
.welcome-illustration span {
    padding: 18px 25px;
    font-size: 20px;
    border-radius: 18px;
    font-family: Georgia, serif;
    font-style: italic;
    background: #e3e7ff;
    color: #5155a7;
    transform: rotate(-5deg);
}
.welcome-illustration span:nth-child(2) {
    background: #eae6ff;
    color: #7563ab;
    transform: rotate(3deg) translateY(7px);
}
.welcome-illustration span:nth-child(3) {
    background: #e0effb;
    color: #4b80a6;
    transform: rotate(-2deg);
}
.auth-intro {
    background: #1d1b4b;
    color: #f1f3ff;
}
.auth-intro .brand {
    color: #f1f3ff;
}
.auth-intro .brand-dot {
    color: #c5ceff;
}
.auth-intro > .eyebrow {
    color: #8483a3;
}
.auth-intro > p {
    color: #8c8ba9;
}
.auth-art span {
    border-color: #59587860;
    color: #8a89b8;
}
.auth-content {
    background: #ffffff;
}
.auth-card .eyebrow {
    color: #7b7a9c;
}
.auth-card h1 {
    font-weight: 500;
}
.page-enter {
    animation: page-enter 0.22s ease-out;
}
@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
@media (max-width: 1200px) {
    .sidebar {
        width: 244px;
        padding: 30px 18px 20px;
    }
    .main {
        margin-left: 244px;
    }
    .metric strong {
        font-size: 23px;
    }
    .metric {
        padding: 21px 16px;
    }
}
@media (max-width: 950px) {
    .settings-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .settings-description p {
        max-width: none;
    }
}
@media (max-width: 650px) {
    .sidebar {
        position: relative;
        width: auto;
        padding: 20px 18px 15px;
    }
    .sidebar .brand {
        font-size: 26px;
        margin-bottom: 23px;
    }
    .sidebar .brand-mark {
        font-size: 26px;
        line-height: 34px;
        padding: 0 11px;
    }
    .sidebar .nav-label {
        display: none;
    }
    .sidebar nav {
        gap: 4px;
    }
    .sidebar nav > a {
        font-size: 10px;
        padding: 10px;
        gap: 7px;
    }
    .sidebar nav svg {
        width: 16px;
        height: 16px;
    }
    .main {
        margin-left: 0;
    }
    .space-control {
        margin-bottom: 18px;
    }
    .space-trigger {
        min-height: 55px;
    }
    .space-trigger-label strong {
        font-size: 12px;
    }
    .create-space {
        width: 42px;
        height: 42px;
    }
    .profile {
        top: 22px;
        right: 20px;
    }
    .content {
        padding: 30px 18px 40px;
    }
    .topbar {
        height: 50px;
    }
    h1 {
        font-size: 30px;
    }
    .metric {
        padding: 20px 15px;
        min-height: 145px;
    }
    .metric strong {
        font-size: 21px;
    }
    .metric-label {
        margin-bottom: 18px;
        font-size: 10px;
    }
    .panel {
        padding: 22px;
    }
    .dialog-content {
        padding: 25px;
    }
    .dialog-actions {
        flex-wrap: wrap;
    }
    .settings-section {
        padding: 25px 0;
    }
    .welcome-page {
        padding: 10px 0;
    }
    .welcome-illustration span {
        padding: 14px 18px;
        font-size: 17px;
    }
}

.entry-types {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: #ebebf4;
    border-radius: 10px;
}
.form-actions {
    flex-wrap: wrap;
}
.entry-types label {
    flex: 1;
    position: relative;
    cursor: pointer;
    text-align: center;
}
.entry-types input {
    position: absolute;
    opacity: 0;
    width: 1px;
}
.entry-types span {
    display: block;
    padding: 12px;
    border-radius: 7px;
    color: #6d6c92;
    font-size: 12px;
    transition:
        background 0.15s,
        color 0.15s;
}
.entry-types input:checked + span {
    background: #ffffff;
    color: #2921b8;
    box-shadow: 0 2px 5px #28274e10;
}
.entry-types input:focus-visible + span {
    outline: 2px solid #6c6ab0;
    outline-offset: 2px;
}

.fixed-cashflow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}
.fixed-cashflow {
    min-width: 0;
}
.fixed-expense-list {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #b7b5dc transparent;
    overscroll-behavior-y: contain;
}
.fixed-expense-list:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 4px;
}
.fixed-cashflow > p {
    font-size: 11px;
    color: #757398;
}
.fixed-cashflow .section-heading {
    flex-wrap: wrap;
}
.fixed-cashflow-total {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.6px;
}
.fixed-income .fixed-cashflow-total {
    color: #6f8d48;
}
.fixed-outgoing .fixed-cashflow-total {
    color: #aa825f;
}
.fixed-cashflow .fixed-expense {
    flex-wrap: wrap;
    gap: 12px;
}
.fixed-cashflow .fixed-expense > div {
    flex-basis: 35%;
    min-width: 100px;
}
.fixed-cashflow .fixed-expense > div > strong {
    overflow-wrap: anywhere;
}
.fixed-cashflow .fixed-expense a {
    font-size: 10px;
}
.fixed-empty {
    padding: 25px 0 12px;
}
.fixed-empty > span {
    font-size: 24px;
    color: #8786a6;
}
.fixed-empty p {
    margin: 12px 0 6px;
    font-size: 12px;
    color: #626083;
}
.fixed-empty small {
    line-height: 1.8;
    display: block;
}
.planning-indicators .section-heading {
    margin-bottom: 8px;
}
.planning-indicator {
    border-top: 1px solid var(--line);
    padding: 18px 0;
}
.planning-indicator:last-child {
    padding-bottom: 0;
}
.planning-indicator-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 25px;
    font-size: 11px;
    color: #5e5d7d;
}
.planning-indicator-value {
    display: block;
    margin: 5px 0 8px;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.7px;
    color: #39329e;
}
.planning-indicator-value.not-set {
    font-size: 20px;
    color: #8584a4;
    font-weight: 400;
}
.planning-indicator > small {
    display: block;
    color: #7f7e9f;
    font-size: 10px;
    line-height: 1.7;
}
.indicator-pencil {
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    width: 29px;
    height: 29px;
    flex-shrink: 0;
    background: #e9e9f4;
    color: #6a698e;
    transition: background 0.15s;
}
.indicator-pencil svg {
    width: 14px;
    height: 14px;
}
.indicator-pencil:hover {
    background: #d0cfec;
    color: #2921b8;
}
.indicator-editor {
    display: grid;
    gap: 10px;
    margin: 9px 0;
}
.indicator-input {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #9492c1;
    border-radius: 9px;
    padding: 0 12px;
    background: #f8f8fd;
}
.indicator-input:focus-within {
    box-shadow: 0 0 0 3px #6664ab16;
}
.indicator-input > span {
    font-size: 12px;
    color: #79779b;
}
.indicator-input input {
    border: 0;
    padding: 12px 0;
    background: transparent;
    width: 100%;
    box-shadow: none;
}
.indicator-input input:focus {
    box-shadow: none;
}
.indicator-edit-actions {
    display: flex;
    align-items: center;
    gap: 17px;
}
.indicator-edit-actions .button {
    min-height: 33px;
    padding: 8px 15px;
    font-size: 11px;
}

.entry-advanced {
    margin-top: 3px;
    padding-top: 0;
    border: 1px solid #deddec;
    border-radius: 10px;
    background: #f7f7fc;
}
.entry-advanced > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    list-style: none;
    color: #48448b;
    font-size: 12px;
}
.entry-advanced > summary::-webkit-details-marker {
    display: none;
}
.entry-advanced > summary > small {
    font-size: 10px;
    color: #8483a4;
}
.advanced-chevron {
    margin-left: auto;
    transition: transform 0.15s;
    font-size: 18px;
}
.entry-advanced[open] .advanced-chevron {
    transform: rotate(180deg);
}
.entry-advanced-fields {
    padding: 2px 18px 20px;
}
@media (max-width: 650px) {
    .entry-advanced > summary > small {
        order: 3;
        flex-basis: 100%;
        line-height: 1.5;
    }
}

/* As seções financeiras compartilham navegação e os mesmos componentes. */
.sidebar nav {
    overflow-y: auto;
    min-height: 100px;
    scrollbar-width: thin;
}
.sidebar > .space-control,
.sidebar .brand,
.sidebar > .nav-label,
.sidebar-note,
.profile {
    flex-shrink: 0;
}
@media (min-width: 651px) {
    .sidebar {
        overflow: hidden;
    }
    .sidebar nav {
        flex: 1;
        min-height: 0;
        align-content: start;
        padding-bottom: 16px;
    }
    .sidebar > .profile {
        margin-top: auto;
    }
}
.finance-nav {
    margin: 0;
    padding: 0;
    border: 0;
}
.finance-nav-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 10px;
    color: #b8b8c4;
    font-size: 12px;
    list-style: none;
}
.finance-nav-trigger::-webkit-details-marker {
    display: none;
}
.finance-nav-trigger.active {
    background: var(--accent);
    color: #29216e;
    font-weight: 600;
}
.finance-nav-trigger:hover:not(.active) {
    background: #ffffff0c;
    color: #fff;
}
.finance-nav-chevron {
    margin-left: auto;
    transition: transform 0.15s;
}
.finance-nav[open] .finance-nav-chevron {
    transform: rotate(180deg);
}
.finance-submenu {
    display: grid;
    gap: 3px;
    margin: 8px 0 8px 24px;
    padding-left: 12px;
    border-left: 1px solid #ffffff20;
}
.finance-submenu a {
    padding: 9px 10px;
    color: #b8b8c4;
    font-size: 11px;
    border-radius: 7px;
}
.finance-submenu a:hover,
.finance-submenu a.active {
    background: #ffffff12;
    color: #f1f3ff;
    text-decoration: none;
}
.finance-submenu a.active {
    color: var(--accent);
    font-weight: 600;
}
.entry-category-filter {
    position: relative;
    width: min(100%, 260px);
    margin: 0;
    padding: 0;
    border: 0;
}
.entry-balance-note {
    font-size: 12px;
    line-height: 1.6;
    margin: 0 0 16px;
}
.onboarding-header {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.onboarding-header .brand {
    margin: 0;
}
.onboarding-main {
    margin-left: 0;
}
.onboarding-main > .content {
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}
.onboarding-panel {
    padding: clamp(24px, 5vw, 48px);
}
.onboarding-panel h1 {
    font-size: clamp(28px, 4vw, 38px);
    margin: 12px 0;
}
.onboarding-panel > p {
    line-height: 1.7;
    margin-bottom: 28px;
}
.entry-category-filter > summary {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 12px;
}
.entry-category-filter > summary span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}
.entry-category-options {
    position: absolute;
    right: 0;
    z-index: 10;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    box-shadow: 0 4px 16px #0003;
}
.entry-category-options fieldset {
    padding: 0;
    margin: 0;
    border: 0;
    min-width: 0;
}
.entry-category-options .checkbox {
    overflow-wrap: anywhere;
}
.entry-category-options input {
    flex-shrink: 0;
}
.category-distribution {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.5fr);
    align-items: center;
    gap: 40px;
}
.category-chart {
    margin: 10px 0;
    text-align: center;
}
.category-pie {
    position: relative;
    width: min(100%, 250px);
    aspect-ratio: 1;
    border-radius: 50%;
    margin: 0 auto 20px;
}
.category-tooltip {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 65%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    box-shadow: 0 4px 16px #0003;
    pointer-events: none;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.category-tooltip-name {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}
.category-tooltip small {
    margin-left: 8px;
    color: var(--muted);
}
.category-chart figcaption {
    color: var(--muted);
    font-size: 11px;
}
.category-chart figcaption strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 500;
    margin-top: 8px;
}
.category-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-legend li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
}
.category-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.category-legend-name {
    overflow-wrap: anywhere;
}
.category-legend-value {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}
.category-legend-value strong {
    font-weight: 500;
}
.category-legend-value small {
    display: block;
    margin-top: 5px;
}
@media (max-width: 650px) {
    .sidebar nav {
        overflow: visible;
        min-height: 0;
    }
    .finance-nav {
        flex-basis: 100%;
    }
    .finance-nav-trigger {
        padding: 10px;
        font-size: 11px;
    }
    .finance-submenu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-left: 10px;
    }
    .category-distribution {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.home-page {
    padding-top: 15px;
}
.home-page h1 {
    overflow-wrap: anywhere;
}
.home-metrics .metric-label {
    margin-top: 0;
    min-height: 32px;
    gap: 10px;
    line-height: 1.5;
    letter-spacing: 0;
    font-weight: 400;
}
.home-metrics .metric-placeholder {
    border: 1px dashed var(--line);
    box-shadow: none;
}
.home-metrics .metric-placeholder > strong {
    color: var(--muted);
}
.home-note {
    font-size: 12px;
    margin-top: 35px;
    max-width: 540px;
}

/* A capa ocupa toda a largura da área principal da Home. */
:root {
    --workspace-cover-height: clamp(70px, calc(24vw - 110px), 190px);
}
.content.home-content {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}
.content.home-content:has(.home-cover),
.home-page:has(> .home-cover) {
    padding-top: 0;
}
.home-container {
    max-width: 1600px;
    margin-inline: auto;
    padding-inline: 42px;
}
.home-cover {
    position: relative;
    width: 100%;
    height: var(--workspace-cover-height);
    margin: 0 0 36px;
    overflow: hidden;
}
.cover-preview-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}
.cover-preview-frame .workspace-cover-preview {
    position: absolute;
    inset: 0;
    height: 100%;
}
.cover-position-dialog {
    width: min(1100px, calc(100vw - 32px));
}
.cover-position-reference {
    display: none;
    height: var(--workspace-cover-height);
}
.cover-position-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: var(--line);
    cursor: grab;
    touch-action: none;
    user-select: none;
    outline-offset: 4px;
}
.cover-position-viewport.is-dragging {
    cursor: grabbing;
}
.cover-position-viewport img {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    pointer-events: none;
}
.home-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.workspace-cover-preview {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
}
@media (max-width: 1200px) {
    .home-container {
        padding-inline: 25px;
    }
}
@media (max-width: 650px) {
    .home-container {
        padding-inline: 18px;
    }
}
