html, body {
    margin: 0;
}

/* Mobile Foundation */
.topbar-workspace-pill--interactive {
    border: 0;
    text-align: left;
    cursor: pointer;
}

.topbar-workspace-pill--interactive:disabled {
    cursor: default;
}

.topbar-workspace-pill__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--workspace-color) 12%, transparent);
    color: color-mix(in srgb, var(--text-strong) 88%, var(--workspace-color) 12%);
    flex: 0 0 auto;
}

.page-header-card__copy,
.page-header-card__actions {
    min-width: 0;
}

.page-header-card__copy {
    display: grid;
    gap: .3rem;
}

.page-header-card__actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.modal-shell__handle {
    display: none;
    width: 3rem;
    height: .32rem;
    margin: .2rem auto 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 50%, transparent);
}

@media (max-width: 980px) {
    .main-frame {
        padding: var(--page-gutter-mobile) var(--page-gutter-mobile) calc(var(--safe-bottom) + 1rem);
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 35;
        margin: calc(-1 * var(--page-gutter-mobile)) calc(-1 * var(--page-gutter-mobile)) 1rem;
        padding: .75rem var(--page-gutter-mobile);
        min-height: var(--topbar-height-mobile);
        border: 0;
        border-bottom: 1px solid var(--line-soft);
        border-radius: 0 0 26px 26px;
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 96%, transparent), color-mix(in srgb, var(--panel) 88%, transparent));
        box-shadow: 0 18px 40px rgba(8, 16, 28, .14);
        backdrop-filter: blur(20px);
    }

    .topbar-context {
        flex: 1 1 auto;
        min-width: 0;
        gap: .65rem;
    }

    .topbar-actions {
        margin-left: 0;
        flex: 0 0 auto;
        gap: .55rem;
    }

    .topbar-workspace-pill {
        flex: 1 1 auto;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        min-height: var(--touch-target);
        padding: .34rem .42rem;
        border-radius: 20px;
    }

    .topbar-workspace-pill__avatar {
        width: 2.15rem;
        height: 2.15rem;
        border-radius: .9rem;
    }

    .topbar-workspace-pill__body {
        flex: 1 1 auto;
    }

    .topbar-workspace-pill__body small {
        display: none;
    }

    .topbar-workspace-pill__body span {
        max-width: none;
        font-size: .94rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .user-menu__trigger {
        min-height: var(--touch-target);
        min-width: var(--touch-target);
        padding: .35rem .42rem;
        gap: .45rem;
        border-radius: 18px;
    }

    .user-menu__panel {
        position: fixed;
        top: calc(var(--topbar-height-mobile) + .5rem);
        left: var(--page-gutter-mobile);
        right: var(--page-gutter-mobile);
        width: auto;
        max-width: none;
        border-radius: 24px;
    }

    .page-body {
        gap: 1rem;
    }

    .hero-panel,
    .page-header-card,
    .panel-card,
    .auth-card,
    .listview-header,
    .listview-panel {
        border-radius: 28px;
    }

    .hero-panel,
    .page-header-card,
    .panel-card,
    .auth-card,
    .listview-header {
        padding: 1rem;
    }

    .page-header-card,
    .listview-header {
        gap: .8rem;
    }

    .page-header-card h1,
    .listview-header__title-group h1,
    .family-hero h1,
    .dashboard-hero h2 {
        font-size: clamp(1.7rem, 7vw, 2.3rem);
        line-height: 1.02;
        letter-spacing: -.04em;
    }

    .page-header-card p,
    .listview-header__copy p,
    .family-hero p,
    .dashboard-hero p {
        max-width: 30ch;
        font-size: .92rem;
        line-height: 1.45;
    }

    .listview-toolbar {
        gap: .65rem;
    }

    .listview-toolbar__row {
        gap: .55rem;
        align-items: stretch;
    }

    .listview-toolbar__primary,
    .listview-toolbar__secondary,
    .listview-toolbar__filter {
        min-height: var(--touch-target);
        border-radius: 16px;
    }

    .dashboard-session-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

    .dashboard-session-nav__item {
        padding: .82rem .86rem;
        border-radius: 18px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
    }

    .kpi-card {
        min-height: 8.25rem;
        padding: .95rem;
    }

    .kpi-card strong {
        font-size: 1.38rem;
        margin: .28rem 0;
    }

    .recent-list__item,
    .metric-row,
    .invoice-card {
        align-items: flex-start;
    }

    .metric-row,
    .recent-list__item {
        gap: .75rem;
    }

    .overlay-backdrop,
    .overlay-backdrop--drawer {
        align-items: flex-end;
        padding: 0;
    }

    .modal-shell,
    .filter-drawer {
        width: 100%;
        max-width: none;
        max-height: min(92dvh, 60rem);
        margin-top: auto;
        border-radius: 28px 28px 0 0;
    }

    .modal-shell__handle {
        display: block;
    }

    .modal-shell__header,
    .filter-drawer__header {
        padding-top: .45rem;
    }
}

/* Shared list filtering controls. Accounts is the visual reference; list pages use this single
   contract instead of duplicating page-scoped tab and sort styles. */
.list-manage-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: var(--surface-raised);
}

.list-manage-content {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.list-manage-content > .table-shell {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Shared page shell used by the primary financial workspaces. */
.unified-manage-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    min-width: 0;
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl, 24px);
    background: var(--surface-raised), var(--panel);
    box-shadow: var(--shadow);
}

.unified-manage-panel > .unified-manage-panel__header {
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.unified-manage-panel > .listview-header {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.unified-manage-panel__header h1 {
    margin: 0 0 .25rem;
    color: var(--text-strong);
    font-size: clamp(1.65rem, 2.5vw, 2rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.unified-manage-panel__header p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

.unified-manage-panel .unified-manage-panel__kpis {
    margin: 0;
}

.unified-manage-panel .unified-manage-panel__kpis .kpi-card {
    border-color: var(--line-soft);
    background: var(--surface-raised) !important;
    box-shadow: var(--shadow-soft);
}

.hero-panel:has(.dashboard-competency-picker) {
    position: relative;
    z-index: 100;
    overflow: visible;
}

.hero-panel:has(.dashboard-competency-picker)::after {
    content: none;
}

.panel-header-actions:has(.dashboard-competency-picker) {
    position: relative;
    z-index: 101;
}

@media (max-width: 640px) {
    .unified-manage-panel {
        padding: 1rem;
        border-radius: 16px;
    }
}

.list-filter-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .2rem;
    gap: .2rem;
    background: var(--surface-raised);
}

.list-filter-tabs__item {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    padding: .4rem .7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}

.list-filter-tabs__item:hover {
    color: var(--text-strong);
}

.list-filter-tabs__item--active {
    background: color-mix(in srgb, var(--brand-2, #3b6ef5) 14%, var(--surface-raised));
    color: var(--brand-2, #3b6ef5);
}

.list-sort-select {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: 0 .5rem 0 .85rem;
    height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}

.list-sort-select__input {
    border: 0;
    background: transparent;
    color: var(--text-strong);
    font-weight: 600;
    font-size: .82rem;
    padding: .3rem;
    cursor: pointer;
}

.list-sort-select__input:focus {
    outline: none;
}

@media (max-width: 640px) {
    .main-frame {
        padding: 0 0 calc(var(--safe-bottom) + 1rem);
    }

    .topbar {
        margin: 0 0 .85rem;
        padding: .72rem var(--page-gutter-mobile);
        border-radius: 0 0 24px 24px;
    }

    .page-body {
        gap: .85rem;
        padding: 0 .75rem;
    }

    .hero-panel,
    .page-header-card,
    .panel-card,
    .auth-card,
    .listview-header,
    .listview-panel {
        border: 1px solid var(--line);
        border-radius: 24px;
        box-shadow: var(--shadow-soft);
        background: var(--surface-raised), var(--panel);
    }

    .hero-panel,
    .page-header-card,
    .panel-card,
    .auth-card,
    .listview-header,
    .listview-panel__header,
    .listview-panel__content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-header-card {
        align-items: stretch;
    }

    .page-header-card p,
    .listview-header__copy p,
    .modal-shell__header p,
    .filter-drawer__header p {
        display: none;
    }

    .page-header-card__actions,
    .page-header-card__actions .btn {
        width: 100%;
    }

    .listview-toolbar__row {
        flex-wrap: wrap;
    }

    .listview-toolbar__primary,
    .listview-toolbar__secondary,
    .listview-toolbar__filter,
    .workspace-page__toolbar .btn {
        min-height: var(--touch-target);
    }

    .dashboard-session-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .user-menu__panel {
        left: .75rem;
        right: .75rem;
    }

    .user-menu__workspace {
        padding: .8rem;
        border-radius: 16px;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: .68rem .85rem;
    }

    .page-body {
        padding: 0 .65rem;
    }

    .topbar-workspace-pill__body span {
        font-size: .9rem;
    }

    .listview-toolbar__filter .listview-toolbar__label,
    .listview-toolbar__secondary .listview-toolbar__label {
        display: none;
    }

    .listview-toolbar__filter,
    .listview-toolbar__secondary {
        min-width: var(--touch-target);
        padding-inline: .85rem;
        justify-content: center;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

.topbar-actions {
    align-items: center;
}

.user-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: uppercase;
    line-height: 1;
}

.user-avatar span,
.user-avatar img {
    width: 100%;
    height: 100%;
}

.user-avatar span {
    display: grid;
    place-items: center;
    line-height: 1;
    text-align: center;
    font-weight: 700;
    transform: translateY(-.02em);
}

.user-avatar img {
    object-fit: cover;
    display: block;
}

.user-avatar--sm {
    width: 2rem;
    height: 2rem;
    font-size: .75rem;
}

.user-avatar--md {
    width: 2.35rem;
    height: 2.35rem;
    font-size: .76rem;
}

.user-avatar--lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1rem;
}

.user-avatar--xl {
    width: 5rem;
    height: 5rem;
    font-size: 1.35rem;
}

.user-menu {
    position: relative;
}

.user-menu__scrim {
    position: fixed;
    inset: 0;
    display: block;
    border: 0;
    background: transparent;
    z-index: 44;
}

.user-menu__trigger {
    min-height: 3rem;
    min-width: 3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    padding: .35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-menu__trigger--sidebar {
    width: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    border-radius: 12px;
    padding: .4rem .5rem;
    justify-content: flex-start;
    gap: .55rem;
}

.user-menu__trigger--sidebar:hover,
.user-menu__trigger--sidebar:focus-visible {
    background: var(--hover-fill-soft, rgba(255, 255, 255, .06));
}

.user-menu__trigger--sidebar .user-avatar {
    width: 1.9rem;
    height: 1.9rem;
    font-size: .68rem;
}

.user-menu__trigger-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}

.user-menu__trigger-name {
    font-size: .88rem;
    font-weight: 650;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu__trigger-email {
    font-size: .76rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu__summary strong,
.settings-card__header h2,
.theme-choice strong,
.settings-profile__identity strong {
    color: var(--text-strong);
}

.user-menu__summary strong {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .98rem;
    font-weight: 650;
}

.user-menu__summary small,
.user-menu__theme,
.settings-card__header p,
.settings-profile__identity span,
.settings-profile__identity small,
.theme-choice small {
    color: var(--muted);
}

.user-menu__summary small {
    font-size: .84rem;
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + .55rem);
    right: 0;
    width: min(21rem, calc(100vw - 2rem));
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    z-index: 45;
}

.user-menu--sidebar .user-menu__panel {
    top: auto;
    bottom: calc(100% + .55rem);
    left: 0;
    right: auto;
}

.user-menu__summary {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.user-menu__summary div,
.settings-card__header {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.user-menu__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 1rem 0;
    padding: .85rem 0;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.user-menu__actions,
.settings-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-menu__workspace {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .8rem;
    align-items: center;
    padding: .85rem;
    margin-bottom: .95rem;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel-muted);
}

.user-menu__workspace-avatar,
.topbar-workspace-pill__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .85rem;
    background: linear-gradient(135deg, var(--workspace-color), color-mix(in srgb, var(--workspace-color) 45%, black));
    color: #fff;
    font-weight: 700;
    letter-spacing: .03em;
}

.user-menu__workspace small {
    display: block;
    color: var(--muted);
    margin-bottom: .15rem;
}

.user-menu__workspace strong {
    color: var(--text-strong);
    font-size: .95rem;
}

.user-menu__action {
    width: 100%;
    min-height: 2.85rem;
    border: 0;
    border-radius: 16px;
    background: transparent;
    padding: .78rem .9rem;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    font-weight: 600;
    font-size: .94rem;
}

.settings-shell {
    gap: 1.25rem;
    width: 100%;
}

.settings-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem 1.05rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.settings-card--unified {
    display: grid;
    gap: 0;
}

.settings-section {
    padding: .15rem 0;
}

.settings-section + .settings-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}

.settings-section--last {
    margin-bottom: .1rem;
}

.settings-card--profile .settings-card__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
}

.settings-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .8rem;
    margin-top: .95rem;
    align-items: end;
}

.settings-profile__identity {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.settings-profile__identity strong {
    font-size: .96rem;
    font-weight: 650;
}

.settings-profile__identity span {
    font-size: .84rem;
}

.settings-profile__identity small {
    font-size: .77rem;
    line-height: 1.3;
}

.settings-profile__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.settings-profile-form {
    margin-top: .8rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: end;
}

.settings-profile-form label {
    display: inline-block;
    margin-bottom: .3rem;
    font-weight: 600;
    font-size: .83rem;
}

.settings-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.settings-upload-button {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.35rem;
    font-size: .84rem;
}

.avatar-cropper {
    display: grid;
    gap: 1rem;
}

.avatar-cropper__frame-wrap {
    position: relative;
    display: grid;
    place-items: center;
}

.avatar-cropper__canvas {
    width: min(100%, 360px);
    height: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #0b1220;
    touch-action: none;
    cursor: grab;
}

.avatar-cropper__canvas.is-dragging {
    cursor: grabbing;
}

.avatar-cropper__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 22px;
    border: 1px solid color-mix(in srgb, var(--text-strong) 16%, transparent);
    box-shadow: inset 0 0 0 999px color-mix(in srgb, #020617 30%, transparent);
}

.avatar-cropper__controls {
    display: grid;
    gap: .45rem;
}

.avatar-cropper__controls label {
    font-weight: 600;
}

.avatar-cropper__controls input[type="range"] {
    width: 100%;
}

.avatar-cropper__controls small {
    color: var(--muted);
}

.theme-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.theme-choice {
    width: 100%;
    padding: .85rem .9rem;
    text-align: left;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.theme-choice__icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: .2rem;
}

.theme-choice .app-icon {
    width: 1.15rem;
    height: 1.15rem;
}


.settings-card__header h2 {
    font-size: 1.03rem;
    line-height: 1.25;
}

.settings-card__header p {
    font-size: .82rem;
    line-height: 1.35;
}

.theme-choice strong {
    font-size: .9rem;
}

.theme-choice small {
    font-size: .78rem;
    line-height: 1.35;
}

.settings-inline-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: center;
}

.settings-inline-actions__button {
    white-space: nowrap;
}

@media (max-width: 980px) {
    /* Canonical mobile close area for avatar menu.
       This avoids side effects from legacy duplicated topbar/menu media rules in this file. */
    .user-menu__scrim {
        position: fixed;
        inset: 0;
        display: block;
        border: 0;
        background: transparent;
        z-index: 44;
    }

    .settings-profile,
    .settings-profile-form,
    .settings-inline-actions,
    .theme-choice-grid {
        grid-template-columns: 1fr;
    }

    .settings-profile__actions {
        justify-content: flex-start;
    }
}

@media (min-width: 981px) and (max-width: 1200px) {
    .listview-header--with-aside.listview-header--toolbarless {
        grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
        align-items: center;
    }

    .listview-header--with-aside.listview-header--toolbarless .listview-header__center {
        grid-column: 1 / -1;
        justify-content: center;
        padding-inline: 0;
    }

    .listview-header--with-aside.listview-header--toolbarless .listview-header__aside {
        justify-self: end;
    }
}

@media (max-width: 980px) {
    .topbar-workspace-pill {
        display: none;
    }

    .user-menu__trigger {
        min-width: 3rem;
        justify-content: center;
        padding-inline: .4rem;
        border-radius: 999px;
        gap: .35rem;
    }
}

@media (max-width: 640px) {
    .topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: .7rem .75rem;
        padding: .7rem .9rem .35rem;
    }

    .topbar-context {
        display: contents;
    }

    .topbar-toggle--mobile {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .topbar-workspace-pill__body span {
        max-width: none;
    }

    .topbar-actions {
        grid-column: 2;
        grid-row: 1;
        gap: .85rem;
        margin-left: 0;
        width: auto;
        justify-self: end;
    }

    .topbar-actions .status-badge {
        display: none;
    }

    .user-menu,
    .user-menu__trigger {
        width: auto;
    }

    .user-menu__trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 3rem;
        padding: .32rem;
    }

    .settings-card,
    .settings-card--profile .settings-card__header {
        gap: 1rem;
    }

    .settings-card--profile .settings-card__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .topbar {
        gap: .6rem;
        padding-inline: .75rem;
    }

    .user-menu__trigger {
        min-width: 2.85rem;
        min-height: 2.85rem;
    }

    .topbar-workspace-pill {
        padding: .46rem .62rem .46rem .46rem;
    }
}

.form-hint-box {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    border: 1px solid rgba(123, 162, 255, 0.18);
    border-radius: 16px;
    padding: 0.85rem 1rem;
    background: rgba(13, 24, 44, 0.82);
    color: rgba(217, 226, 241, 0.78);
    line-height: 1.4;
}

.entry-modal {
    display: grid;
    gap: 1.2rem;
}

.entry-modal__intro,
.entry-modal__hint,
.entry-modal__validation {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
}

.entry-modal__intro p,
.entry-modal__hint,
.entry-modal__validation {
    margin: 0;
}

.entry-field {
    display: grid;
    gap: .45rem;
}

.field-label-with-help {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.field-label-with-help label {
    margin-bottom: 0;
}

.field-help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    color: rgba(164, 187, 222, 0.86);
    cursor: help;
    outline: none;
}

.field-help-tooltip__icon {
    width: 1rem;
    height: 1rem;
}

.field-help-tooltip__content {
    position: absolute;
    left: 50%;
    bottom: calc(100% + .65rem);
    transform: translateX(-50%) translateY(.35rem);
    width: max-content;
    max-width: min(18rem, 70vw);
    padding: .7rem .8rem;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: var(--surface-raised), var(--panel-strong);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: .8rem;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    z-index: 20;
}

.field-help-tooltip__content::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: .7rem;
    height: .7rem;
    background: var(--panel-strong);
    border-right: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    transform: translateX(-50%) rotate(45deg);
}

.field-help-tooltip:hover .field-help-tooltip__content,
.field-help-tooltip:focus-visible .field-help-tooltip__content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    .field-help-tooltip__content {
        position: fixed;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        left: 1rem;
        width: auto;
        max-width: none;
        transform: translateY(.5rem);
        z-index: 1300;
    }

    .field-help-tooltip__content::after {
        display: none;
    }

    .field-help-tooltip:hover .field-help-tooltip__content,
    .field-help-tooltip:focus-visible .field-help-tooltip__content {
        transform: translateY(0);
    }
}

.entry-field--inline-gap {
    margin-top: .85rem;
}

.entry-field--muted .entry-static {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}

.entry-switch {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 50px;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 1.1rem;
    margin-top: 0;
    flex: 0 0 auto;
    border-radius: .3rem;
    border: 1px solid var(--line);
    background-color: var(--panel-soft);
    cursor: pointer;
}

.form-check-input:focus {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
    box-shadow: 0 0 0 .16rem color-mix(in srgb, var(--brand) 20%, transparent);
}

.form-check-input:checked {
    border-color: color-mix(in srgb, var(--brand) 74%, var(--line));
    background-color: color-mix(in srgb, var(--brand) 92%, #2f5dff);
}

.entry-switch .form-check-input {
    margin-top: 0;
}

.entry-switch span {
    line-height: 1.25;
}

.entry-type-selector {
    display: grid;
    gap: 1rem;
}

.entry-type-selector__copy {
    margin: 0;
    color: var(--muted);
}

.entry-type-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
    width: 100%;
    padding: 1.15rem 1.2rem;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.1);
    background:
        linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02)),
        rgba(8, 18, 31, .88);
    color: var(--text);
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.entry-type-card:hover {
    transform: translateY(-1px);
    border-color: rgba(121,212,255,.32);
    box-shadow: 0 18px 36px rgba(0,0,0,.18);
}

.entry-type-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.06);
}

.entry-type-card__icon .app-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.entry-type-card__content {
    display: grid;
    gap: .2rem;
}

.entry-type-card__content strong {
    font-size: 1.05rem;
}

.entry-type-card__content span {
    color: var(--muted);
    line-height: 1.45;
}

.entry-type-card--income {
    border-color: rgba(34, 197, 94, .18);
}

.entry-type-card--income .entry-type-card__icon {
    background: rgba(20, 83, 45, .42);
    color: #86efac;
}

.entry-type-card--expense {
    border-color: rgba(96, 165, 250, .18);
}

.entry-type-card--expense .entry-type-card__icon {
    background: rgba(30, 64, 175, .38);
    color: #93c5fd;
}

a {
    color: inherit;
}

.shell {
    min-height: 100vh;
    position: relative;
    --sidebar-w: 0px;
}

.shell:has(.sidebar:not(:empty)) {
    --sidebar-w: 320px;
}

.shell--sidebar-collapsed:has(.sidebar:not(:empty)) {
    --sidebar-w: 92px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(3, 8, 18, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 39;
}

.sidebar-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: rgba(4, 10, 20, 0.72);
    backdrop-filter: blur(16px);
    padding: 2rem 1.25rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w, 320px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: width .22s ease, padding .22s ease, transform .22s ease, box-shadow .22s ease;
    z-index: 40;
}

.sidebar > .nav-stack {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.sidebar__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    flex: 0 0 auto;
}

.sidebar__footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1rem -1.25rem -1.5rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--line-soft);
}

.sidebar-workspace-button {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .8rem;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tooltip-target {
    position: relative;
}

.tooltip-target::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + .45rem);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    white-space: nowrap;
    padding: .32rem .6rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-raised), var(--panel-strong);
    color: var(--text-strong);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .1s ease, transform .1s ease;
    transition-delay: 0s;
    z-index: 60;
}

.tooltip-target:hover::after,
.tooltip-target:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition-delay: .15s;
}

.tooltip-target--below::after {
    bottom: auto;
    top: calc(100% + .45rem);
    transform: translateX(-50%) translateY(-3px);
}

.tooltip-target--below:hover::after,
.tooltip-target--below:focus-visible::after {
    transform: translateX(-50%) translateY(0);
}

.sidebar__close {
    display: none;
}

.sidebar__header-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
}

.sidebar__collapse-toggle {
    display: inline-flex;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
}

.brand-block strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.1;
    white-space: nowrap;
}

.brand-block small {
    display: block;
    margin-top: .2rem;
    white-space: nowrap;
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
}

.brand-mark {
    width: 52px;
    height: 52px;
}

.brand-block small, .eyebrow, .page-header-card p, .kpi-card span, .kpi-card small {
    color: var(--muted);
}

.nav-stack {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.nav-group {
    display: grid;
    gap: .5rem;
    margin-bottom: .25rem;
}

.nav-group__trigger {
    width: 100%;
    padding: .1rem .7rem .1rem .2rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    text-align: left;
    cursor: pointer;
    transition: background-color .18s ease;
}

.nav-group__trigger:hover,
.nav-group__trigger:focus-visible {
    background: var(--hover-fill-soft, rgba(255, 255, 255, .06));
}

.nav-group__title {
    padding: 0 .85rem;
    color: rgba(164, 187, 222, 0.72);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-group__chevron {
    width: .95rem;
    height: .95rem;
    color: var(--muted);
    flex: 0 0 auto;
    transition: transform .18s ease;
}

.nav-group--expanded .nav-group__chevron {
    transform: rotate(180deg);
}

.nav-group__items {
    display: grid;
    gap: .35rem;
}

.nav-group__items a {
    margin-left: .4rem;
    padding: .72rem .9rem;
    font-size: .95rem;
}

.nav-link-with-icon {
    position: relative;
    color: rgba(238, 244, 251, .92);
    text-decoration: none;
    padding: .85rem 1rem;
    border-radius: 14px;
    transition: .2s ease;
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 48px;
}

.nav-link-with-icon.active::before {
    content: "";
    position: absolute;
    left: -.4rem;
    top: .35rem;
    bottom: .35rem;
    width: .2rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
}

.nav-link-with-icon__icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
}

.nav-link-with-icon__label {
    white-space: nowrap;
}

.nav-link-with-icon:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(127,173,255,.15);
    transform: translateX(2px);
}

.nav-link-with-icon.active {
    background: linear-gradient(135deg, rgba(63,114,255,.24), rgba(121,212,255,.12));
    border-color: rgba(127,173,255,.28);
    color: #fff;
}

.shell--sidebar-collapsed .sidebar {
    padding-inline: .9rem;
}

.shell--sidebar-collapsed .brand-copy,
.shell--sidebar-collapsed .nav-group__title,
.shell--sidebar-collapsed .nav-group__chevron,
.shell--sidebar-collapsed .nav-link-with-icon__label {
    display: none;
}

.shell--sidebar-collapsed .brand-block {
    justify-content: center;
}

.shell--sidebar-collapsed .nav-group__trigger {
    justify-content: center;
    padding-inline: 0;
}

.shell--sidebar-collapsed .nav-group__items a,
.shell--sidebar-collapsed .nav-link-with-icon {
    margin-left: 0;
    justify-content: center;
    padding-inline: .7rem;
}

.shell--sidebar-collapsed .user-menu__trigger-copy {
    display: none;
}

.shell--sidebar-collapsed .sidebar__footer {
    flex-direction: column;
    padding-inline: .5rem;
}

.shell--sidebar-collapsed .user-menu__trigger--sidebar {
    width: auto;
    justify-content: center;
    padding: .35rem;
}

.main-frame {
    padding: 1.25rem 1.25rem 1.5rem;
    min-width: 0;
    margin-left: var(--sidebar-w, 0px);
    transition: margin-left .22s ease;
}

@media (min-width: 981px) {
    .shell:has(.sidebar:not(:empty)) .topbar {
        display: none;
    }
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
    box-shadow: var(--shadow);
}

.topbar-context {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}

.topbar-workspace-pill {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    padding: .42rem .72rem .42rem .42rem;
    border-radius: 999px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--workspace-color) 14%, transparent), rgba(255,255,255,.02)),
        var(--panel-soft);
    border: 1px solid color-mix(in srgb, var(--workspace-color) 28%, var(--line-soft));
    color: var(--text-strong);
    font-size: .84rem;
    width: fit-content;
    max-width: 100%;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.topbar-workspace-pill--loading {
    --workspace-color: #64748b;
    opacity: .92;
}

.topbar-workspace-pill__avatar {
    width: 2rem;
    height: 2rem;
    border-radius: .8rem;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--workspace-color), color-mix(in srgb, var(--workspace-color) 42%, black));
    color: #fff;
    flex: 0 0 auto;
}

.topbar-workspace-pill__avatar .app-icon {
    width: 1rem;
    height: 1rem;
}

.topbar-workspace-pill--loading .topbar-workspace-pill__avatar {
    background: linear-gradient(135deg, #64748b, #334155);
}

.topbar-workspace-pill--loading .topbar-workspace-pill__body span {
    color: var(--muted);
}

.topbar-workspace-pill__body {
    display: grid;
    gap: .05rem;
    min-width: 0;
}

.topbar-workspace-pill__body small {
    color: var(--muted);
    font-size: .68rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.topbar-workspace-pill__body span {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.topbar-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-toggle--mobile {
    display: none;
}

.topbar-actions {
    display: flex;
    gap: .65rem;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

.topbar-mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.topbar-mobile-brand__logo {
    width: 2rem;
    height: 2rem;
    display: block;
}

.page-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-panel, .page-header-card, .panel-card, .auth-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.hero-panel, .page-header-card, .panel-card {
    padding: 1.4rem;
}

.page-header-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.page-header-card h1, .auth-card h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin: .35rem 0 .55rem;
}

h1[tabindex="-1"]:focus {
    outline: none;
}

h1[tabindex="-1"]:focus-visible {
    outline: 2px solid rgba(121, 212, 255, .45);
    outline-offset: .35rem;
    border-radius: 12px;
}

.hero-panel {
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(135deg, rgba(63,114,255,.18), rgba(110,231,216,.08)),
        var(--panel);
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -45% auto;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(121,212,255,.18), transparent 70%);
    pointer-events: none;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.dashboard-session-nav {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.dashboard-session-nav__toggle {
    display: none;
    align-items: center;
    gap: .5rem;
    width: fit-content;
}

.dashboard-session-nav__list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .8rem;
}

.dashboard-session-nav__item {
    display: grid;
    gap: .18rem;
    padding: .95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    color: rgba(238, 244, 251, .92);
    text-decoration: none;
    transition: .2s ease;
}

.dashboard-session-nav__item small {
    color: var(--muted);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.dashboard-session-nav__item strong {
    font-size: .98rem;
}

.dashboard-session-nav__item:hover {
    transform: translateY(-1px);
    border-color: rgba(127, 173, 255, .25);
}

.dashboard-session-nav__item.active {
    background: linear-gradient(135deg, rgba(63,114,255,.24), rgba(121,212,255,.12));
    border-color: rgba(127,173,255,.28);
}

.dashboard-section-shell {
    overflow: visible;
}

.kpi-grid, .content-grid, .form-grid {
    display: grid;
    gap: 1rem;
}

.kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-grid {
    grid-template-columns: 1.15fr .85fr;
}

.kpi-card, .invoice-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: var(--surface-soft), var(--panel);
}

.kpi-card {
    position: relative;
    overflow: visible;
    z-index: 1;
}

.kpi-card.kpi-card--loan {
    border-color: var(--line-soft);
    border-radius: 22px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
}

.kpi-card:hover,
.kpi-card:focus-within {
    z-index: 60;
}

.kpi-card strong {
    display: block;
    font-size: 1.7rem;
    margin: .4rem 0;
    letter-spacing: -.03em;
}

.kpi-card:has(.kpi-card__icon) {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card__head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding-right: 1.5rem;
}

.kpi-card__title {
    display: block;
}

.kpi-card__head .kpi-card__title {
    padding-right: 0;
}

.kpi-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--radius-full);
}

.kpi-card__icon .app-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.kpi-card__icon--brand {
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    color: color-mix(in srgb, var(--brand) 82%, var(--text-strong));
}

.kpi-card__icon--brand-3 {
    background: color-mix(in srgb, var(--brand-3) 16%, transparent);
    color: color-mix(in srgb, var(--brand-3) 82%, var(--text-strong));
}

.kpi-card__icon--positive {
    background: color-mix(in srgb, var(--positive) 16%, transparent);
    color: color-mix(in srgb, var(--positive) 82%, var(--text-strong));
}

.kpi-card__icon--warning {
    background: color-mix(in srgb, var(--warning) 18%, transparent);
    color: color-mix(in srgb, var(--warning) 84%, var(--text-strong));
}

.kpi-card__icon--negative {
    background: color-mix(in srgb, var(--negative) 16%, transparent);
    color: color-mix(in srgb, var(--negative) 82%, var(--text-strong));
}

.kpi-card__icon--purple {
    background: color-mix(in srgb, #7c3aed 16%, transparent);
    color: color-mix(in srgb, #7c3aed 82%, var(--text-strong));
}

.kpi-card__info {
    position: absolute;
    right: .65rem;
    bottom: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    opacity: 1;
    cursor: help;
    z-index: 61;
}

.kpi-card__info .app-icon {
    width: .85rem;
    height: .85rem;
}

.kpi-card__tooltip {
    position: absolute;
    right: .65rem;
    bottom: 2rem;
    left: .65rem;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: .65rem .75rem;
    border-radius: .65rem;
    border: 1px solid var(--line-strong);
    background: var(--surface-raised), var(--panel-strong);
    color: var(--text-strong);
    font-size: .75rem;
    line-height: 1.4;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(.3rem);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
    z-index: 999;
}

.kpi-card__info:hover + .kpi-card__tooltip,
.kpi-card__info:focus-visible + .kpi-card__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.kpi-card--positive-soft {
    border-color: rgba(20, 140, 92, .22);
    background: linear-gradient(180deg, rgba(20, 140, 92, .08), rgba(20, 140, 92, .03));
}

.kpi-card--positive-soft strong {
    color: #167a54;
}

.kpi-card--negative-soft {
    border-color: rgba(191, 60, 74, .24);
    background: linear-gradient(180deg, rgba(191, 60, 74, .08), rgba(191, 60, 74, .03));
}

.kpi-card--negative-soft strong {
    color: #b43d4d;
}

.invoice-card, .metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.recent-list__item:first-child {
    padding-top: 0;
}

.recent-list__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.recent-list__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .28rem;
}

.recent-list__title {
    display: block;
    min-width: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.recent-list__meta {
    display: block;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.4;
}

.recent-list__amount {
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

.metric-row {
    padding: .7rem 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.metric-row:last-child {
    border-bottom: 0;
}

.payment-chip, .status-badge {
    display: inline-flex;
    align-items: center;
    /* No-op when StatusBadge renders without an IconName (the vast majority of existing usages),
       but gives the optional leading AppIcon (Pessoas relationship/usage badges) consistent
       spacing from the label without needing a page-local override. */
    gap: .35rem;
    border-radius: 999px;
    padding: .28rem .72rem;
    font-size: .8rem;
    border: 1px solid var(--line);
}

.status-badge .app-icon {
    width: .8rem;
    height: .8rem;
    flex-shrink: 0;
}

.panel-card h3 {
    font-size: 1.02rem;
    margin: 0 0 .85rem;
}

.form-message, .empty-shell, .loading-block {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
}

.auth-shell {
    min-height: calc(100vh - 130px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1.35rem;
}

.auth-brand--compact {
    margin-bottom: 1rem;
}

.auth-brand__logo {
    width: 56px;
    height: 56px;
}

.auth-brand__copy strong,
.auth-brand__copy small {
    display: block;
}

.auth-brand__copy strong {
    font-size: 1.02rem;
    line-height: 1.05;
}

.auth-brand__copy small {
    margin-top: .22rem;
    color: var(--muted);
}

.auth-card {
    width: 100%;
    max-width: 540px;
    justify-self: center;
    padding: 1.65rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)),
        var(--panel-strong);
}

.auth-card.wide {
    width: min(100%, 1180px);
    max-width: 1180px;
}

.auth-card-header h2 {
    margin: .22rem 0 .42rem;
    font-size: 2.1rem;
    letter-spacing: -.04em;
}

.auth-card-header p {
    color: var(--muted);
    margin-bottom: 1rem;
}

.field-stack {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: .8rem;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: .05rem 0 .82rem;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted);
    font-size: .86rem;
    cursor: pointer;
}

.remember-me__input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--brand);
}

.auth-inline-link {
    color: var(--brand);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-inline-link:hover {
    color: var(--text-strong);
    text-decoration: underline;
}

.field-stack label {
    font-size: .88rem;
    color: #c5d2e2;
    font-weight: 600;
}

.finance-input {
    min-height: 50px;
    padding: .58rem .86rem;
    font-size: 1.01rem;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(6,14,25,.85);
    color: var(--text);
    box-shadow: none;
}

.finance-input:focus {
    background: rgba(8,18,31,.96);
    color: var(--text);
    border-color: rgba(121,212,255,.55);
    box-shadow: 0 0 0 .2rem rgba(63,114,255,.12);
}

.finance-input::placeholder {
    color: #6f84a0;
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-top: .9rem;
}

.auth-actions .btn {
    min-height: 46px;
    font-size: .95rem;
    border-radius: 14px;
}

.login-retry-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 10, 18, .72);
    backdrop-filter: blur(8px);
}

.login-retry-modal-backdrop[hidden] {
    display: none;
}

.login-retry-modal {
    width: min(100%, 28rem);
    border-radius: 26px;
    border: 1px solid rgba(126, 190, 255, .28);
    padding: 1.35rem 1.4rem;
    background:
        radial-gradient(circle at top right, rgba(121, 212, 255, .24), transparent 58%),
        linear-gradient(145deg, rgba(16, 30, 52, .96), rgba(8, 16, 28, .95));
    box-shadow: 0 24px 60px rgba(2, 8, 15, .45);
}

.login-retry-modal__pulse {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 2px solid rgba(121, 212, 255, .24);
    border-top-color: rgba(121, 212, 255, .92);
    animation: login-retry-spin .95s linear infinite;
}

.login-retry-modal__eyebrow {
    margin: .95rem 0 .25rem;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9fc8ff;
    font-weight: 700;
}

.login-retry-modal__title {
    margin: 0;
    font-size: 1.36rem;
    letter-spacing: -.02em;
    color: #f4f8fc;
}

.login-retry-modal__description {
    margin: .5rem 0 .85rem;
    color: #b8c3d1;
    line-height: 1.45;
}

.login-retry-modal__status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border-radius: 999px;
    border: 1px solid rgba(126, 190, 255, .35);
    background: rgba(14, 28, 48, .65);
    padding: .4rem .76rem;
    font-size: .86rem;
    color: #e6edf3;
}

.login-retry-modal__dot {
    width: .52rem;
    height: .52rem;
    border-radius: 50%;
    background: #79d4ff;
    box-shadow: 0 0 0 .24rem rgba(121, 212, 255, .22);
}

@keyframes login-retry-spin {
    to {
        transform: rotate(360deg);
    }
}

/*
 * Single source of truth for button sizing across the whole app.
 * Every .btn variant (primary/light/ghost/danger/sm) is sized here only —
 * do not add min-height/padding/border-radius overrides for .btn in any
 * other stylesheet or component-scoped .razor.css file.
 */
.btn.btn-primary,
.btn.btn-light,
.btn.btn-ghost,
.btn.btn-danger {
    min-height: 44px;
    border-radius: 14px;
    padding: .8rem 1rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.btn.btn-sm {
    min-height: 38px;
}

@media (min-width: 981px) {
    .btn.btn-primary,
    .btn.btn-light,
    .btn.btn-ghost,
    .btn.btn-danger {
        min-height: 38px;
        border-radius: 10px;
        padding: .5rem .8rem;
        font-size: .89rem;
    }

    .btn.btn-primary {
        box-shadow: 0 8px 22px rgba(63, 114, 255, .2);
    }

    .btn.btn-primary:hover {
        box-shadow: 0 10px 24px rgba(63, 114, 255, .24);
    }

    .btn.btn-sm {
        min-height: 32px;
        padding: .38rem .65rem;
        border-radius: 9px;
        font-size: .84rem;
    }

    .listview-toolbar__primary,
    .listview-toolbar__secondary,
    .listview-toolbar__filter {
        min-height: 38px;
    }

    .async-submit-button {
        gap: .45rem;
    }
}

.btn.btn-primary {
    border: 0;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    color: #04111d;
    box-shadow: 0 12px 30px rgba(63, 114, 255, .25);
}

.btn.btn-primary:hover {
    color: #04111d;
    background: linear-gradient(135deg, #5a8cff, #8bddff);
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(63, 114, 255, .32);
}

.btn.btn-ghost {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255,255,255,.03);
}

.btn.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(127,173,255,.24);
    background: rgba(255,255,255,.08);
}

.btn.btn-light {
    background: #e9f1fb;
    color: #06111c;
}

.btn.btn-light:hover {
    background: #ffffff;
    color: #06111c;
    transform: translateY(-1px);
}

.register-layout {
    margin-top: 1.25rem;
}

.register-surface {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--surface-soft), var(--panel-soft);
    overflow: hidden;
}

.register-form-pane,
.register-security-pane {
    padding: 1.35rem;
}

.register-form-pane {
    min-width: 0;
    min-inline-size: 0;
}

.register-form-pane .form-control,
.register-form-pane .finance-input {
    width: 100%;
}

.register-form-pane {
    border-right: 1px solid var(--line);
}

.register-form-pane .field-stack {
    margin-bottom: 1rem;
}

.register-form-pane__last {
    margin-bottom: .55rem;
}

.register-form-pane__submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
}

.register-form-pane__actions {
    margin-top: .15rem;
}

.register-form-pane__login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.register-form-pane__submit:disabled {
    opacity: .92;
    cursor: wait;
}

.async-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
}

.async-submit-button .button-progress,
.async-submit-button__loading {
    display: none;
}

.async-submit-button:disabled {
    opacity: .92;
    cursor: wait;
}

.async-form[data-submitting='true'] .async-submit-button {
    opacity: .92;
    cursor: wait;
    pointer-events: none;
}

.async-form[data-submitting='true'] .async-submit-button .button-progress,
.async-form[data-submitting='true'] .async-submit-button__loading {
    display: inline-flex;
}

.async-form[data-submitting='true'] .async-submit-button__label {
    display: none;
}

.button-progress {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid rgba(4, 17, 29, .22);
    border-top-color: rgba(4, 17, 29, .72);
    animation: button-spin .8s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.password-panel__eyebrow {
    display: inline-block;
    margin-bottom: .35rem;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.password-panel__header {
    margin-bottom: .9rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
}

.password-panel__status {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: .3rem .68rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.password-panel__status.is-ready {
    border-color: color-mix(in srgb, var(--accent-green) 34%, var(--line));
    background: color-mix(in srgb, var(--accent-green) 16%, var(--panel));
    color: var(--accent-green);
}

.password-criteria {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.password-criteria__item {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    gap: .6rem;
    align-items: center;
    padding: .78rem 0;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background: transparent;
    min-height: 0;
}

.auth-password-criteria {
    margin: .25rem 0 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-soft), var(--panel-soft);
    padding: 0 1rem;
}

.password-criteria__icon,
.password-confirmation__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 800;
}

.password-criteria__text {
    color: var(--text);
    font-size: .95rem;
    line-height: 1.25;
}

.password-criteria__item small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.password-criteria__item.is-met .password-criteria__icon,
.password-confirmation.is-met .password-confirmation__icon {
    color: var(--accent-green);
}

.password-criteria__item.is-met small {
    color: var(--accent-green);
}

.password-confirmation {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-top: .75rem;
    padding-top: .9rem;
}

.password-confirmation__content {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.password-confirmation__content strong {
    color: var(--text);
    font-size: .88rem;
}

.password-confirmation__content span {
    color: var(--muted);
    font-size: .84rem;
}

.password-confirmation.is-met .password-confirmation__content span {
    color: var(--accent-green);
}

.registration-success {
    display: grid;
    gap: .35rem;
    margin-top: 1.25rem;
}

.registration-success strong {
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.registration-success span {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
}

.registration-success small {
    color: var(--muted);
    font-size: .88rem;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(360px, .92fr) minmax(0, 1.08fr);
    gap: 1rem;
}

.workspace-grid--wide {
    grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h3,
.section-heading h4 {
    margin: 0;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid--2,
.filter-grid,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.stack-form label {
    display: inline-block;
    margin-bottom: .4rem;
    font-size: .88rem;
    font-weight: 600;
    color: #c5d2e2;
}

.form-control,
.form-select {
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: rgba(6, 14, 25, .84);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background: rgba(8, 18, 31, .96);
    color: var(--text);
    border-color: rgba(121,212,255,.55);
    box-shadow: 0 0 0 .2rem rgba(63,114,255,.12);
}

.form-control::placeholder {
    color: #70839b;
}

html[data-theme="dark"] .modal-shell .form-control[readonly],
html[data-theme="dark"] .modal-shell .form-control:disabled,
html[data-theme="dark"] .modal-shell .form-select:disabled,
html[data-theme="dark"] .modal-shell input.form-control[readonly],
html[data-theme="dark"] .modal-shell input.form-control:disabled,
html[data-theme="dark"] .modal-shell select.form-select:disabled {
    background: #17293d !important;
    border-color: #3a5879 !important;
    color: #dbe8f6 !important;
    -webkit-text-fill-color: #dbe8f6 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .modal-shell .form-control[readonly]::placeholder,
html[data-theme="dark"] .modal-shell .form-control:disabled::placeholder {
    color: #9db4cc !important;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.table-shell {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: .95rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
}

.table-meta {
    margin-top: .25rem;
    color: var(--muted);
    font-size: .84rem;
}

.actions-cell {
    white-space: nowrap;
    text-align: right;
}

.actions-cell .btn {
    margin-left: .45rem;
}

.btn.btn-danger {
    color: #ffe8e2;
    border: 1px solid rgba(255, 139, 116, .22);
    background: rgba(136, 31, 22, .22);
}

.amount-cell {
    font-weight: 700;
    white-space: nowrap;
}

.entry-mobile-list {
    display: none;
}

.entry-mobile-card {
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface-raised);
}

.entry-mobile-card + .entry-mobile-card {
    margin-top: .85rem;
}

.entry-mobile-card__header,
.entry-mobile-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
}

.entry-mobile-card__header {
    margin-bottom: .85rem;
}

.entry-mobile-card__title-block {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.entry-mobile-card__title-block strong {
    color: var(--text-strong);
    font-size: 1rem;
    line-height: 1.3;
}

.entry-mobile-card__title-block span,
.entry-mobile-card__meta span,
.entry-mobile-card__select span {
    color: var(--muted);
}

.entry-mobile-card__meta {
    display: grid;
    gap: .4rem;
    margin-bottom: .95rem;
    font-size: .92rem;
}

.entry-mobile-card__amount {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1;
}

.entry-mobile-card__select {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: .92rem;
}

.entry-mobile-card__actions {
    margin-top: .95rem;
}

.invoice-list-item {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: .75rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.03);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.invoice-list-item::before {
    content: "";
    position: absolute;
    inset: 12px auto 12px 12px;
    width: 3px;
    height: auto;
    border-radius: 999px;
    background: transparent;
    transform: none;
    transition: background .18s ease, opacity .18s ease, box-shadow .18s ease;
    opacity: 0;
}

.invoice-list-item:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: var(--hover-fill-soft);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.invoice-list-item--active {
    border-color: color-mix(in srgb, var(--brand) 26%, var(--line-stronger));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand-2) 10%, transparent), transparent 58%),
        var(--surface-soft),
        var(--panel);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.16),
        0 0 0 1px color-mix(in srgb, var(--brand) 10%, transparent),
        0 16px 32px rgba(15, 23, 42, .10);
}

.invoice-list-item--active::before {
    opacity: 1;
    background: linear-gradient(180deg, var(--brand-2), var(--brand));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 10%, transparent);
}

.invoice-list-item--active strong,
.invoice-list-item--active .table-meta {
    color: var(--text-strong);
}

.invoice-list-item > div:first-child {
    padding-left: 1rem;
}

.invoice-list-item__aside {
    align-items: flex-end;
    text-align: right;
}

.invoice-list-item__aside,
.detail-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.detail-card {
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.025);
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

.app-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.toast-stack {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .9rem;
    align-items: start;
    padding: 1rem 1rem 1rem .95rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(8, 18, 31, .94);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 48px rgba(0,0,0,.3);
    pointer-events: auto;
}

.toast-card__icon {
    width: 2.35rem;
    height: 2.35rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
}

.toast-card__icon .app-icon,
.toast-card__close .app-icon,
.action-icon-button .app-icon,
.listview-toolbar__primary .app-icon,
.listview-toolbar__filter .app-icon,
.listview-toolbar__secondary .app-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.toast-card__content {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.toast-card__content strong {
    font-size: .95rem;
}

.toast-card__content span {
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.45;
}

.toast-card__close,
.modal-shell__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.toast-card__close:hover,
.modal-shell__close:hover {
    color: var(--text);
    background: rgba(255,255,255,.06);
}

.toast-card--success {
    border-color: rgba(48,208,139,.26);
}

.toast-card--success .toast-card__icon {
    color: var(--positive);
    background: rgba(33, 118, 83, .22);
}

.toast-card--error {
    border-color: rgba(255,139,116,.28);
}

.toast-card--error .toast-card__icon {
    color: var(--negative);
    background: rgba(136, 31, 22, .24);
}

.toast-card--warning {
    border-color: rgba(255, 196, 108, .28);
}

.toast-card--warning .toast-card__icon {
    color: #ffc46c;
    background: rgba(110, 74, 12, .24);
}

.toast-card--info .toast-card__icon {
    color: var(--brand);
    background: rgba(63,114,255,.18);
}

.listview-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem 1.5rem;
    align-items: end;
    padding: 1.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(145deg, rgba(63,114,255,.14), rgba(255,255,255,.03) 45%, rgba(110,231,216,.08)),
        var(--panel);
    box-shadow: var(--shadow);
}

.listview-header--with-center {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.listview-header--with-aside.listview-header--toolbarless {
    grid-template-columns: minmax(0, 1.15fr) auto minmax(220px, .85fr);
    align-items: center;
}

.listview-header--with-aside.listview-header--toolbarless:not(.listview-header--with-center) {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
}

.listview-header--with-center.listview-header--with-aside.listview-header--with-toolbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(220px, 1fr) auto;
    align-items: center;
}

.listview-header__copy {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-width: 0;
}

.listview-header__content {
    margin-top: .2rem;
}

.listview-header__center {
    display: flex;
    justify-content: center;
    padding-inline: .5rem;
}

.listview-header__aside {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    min-width: 0;
}

.listview-header__title-group h1 {
    margin: .35rem 0 0;
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    letter-spacing: -.04em;
}

.listview-header__copy p,
.modal-shell__header p,
.filter-drawer__header p {
    margin: 0;
    max-width: 70ch;
    color: var(--muted);
    line-height: 1.55;
}

.listview-toolbar {
    display: grid;
    gap: .75rem;
    justify-content: flex-end;
}

.listview-toolbar__row {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.listview-toolbar__row--secondary {
    justify-content: flex-end;
}

.accounts-listview-header {
    gap: .8rem 1rem;
    padding: 1rem 1.15rem;
    align-items: center;
}

.accounts-listview-header .listview-header__copy {
    gap: .3rem;
}

.accounts-listview-header .listview-header__title-group h1 {
    margin: .1rem 0 0;
    font-size: clamp(1.5rem, 2.7vw, 2.05rem);
}

.accounts-listview-header .listview-header__copy p {
    line-height: 1.35;
}

.accounts-listview-header .listview-toolbar {
    gap: .5rem;
}

.accounts-listview-header .listview-toolbar__row {
    gap: .55rem;
}

.accounts-listview-header .listview-search {
    min-width: min(300px, 100%);
    padding: .68rem .88rem;
    border-radius: 15px;
}

.accounts-listview-header .listview-toolbar__primary,
.accounts-listview-header .listview-toolbar__secondary,
.accounts-listview-header .listview-toolbar__filter {
    min-height: 42px;
    border-radius: 14px;
    padding: .55rem .9rem;
}

.listview-search {
    min-width: min(360px, 100%);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: rgba(6, 14, 25, .84);
}

.entry-competency-nav {
    display: grid;
    grid-template-columns: auto minmax(190px, 1fr) auto;
    align-items: center;
    gap: .55rem;
    margin-top: .85rem;
    padding: .38rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft), var(--panel-soft);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 14px 28px rgba(15, 23, 42, .08);
    backdrop-filter: blur(10px);
}

.entry-competency-nav--inline {
    width: fit-content;
    min-width: min(100%, 392px);
    margin: 0 auto;
}

.entry-competency-nav__button {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    justify-content: center;
    min-height: 38px;
    padding: 0 .82rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.entry-competency-nav__button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: var(--hover-fill-soft);
}

.listview-search__icon {
    color: var(--muted);
    display: inline-flex;
}

.listview-search__input {
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--text);
    outline: none;
    box-shadow: none;
    padding: 0;
}

.listview-search__input:focus {
    background: transparent;
    color: var(--text);
    box-shadow: none;
}

.listview-toolbar__primary,
.listview-toolbar__filter,
.listview-toolbar__secondary,
.filter-drawer__footer .btn,
.modal-shell__footer .btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

.listview-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.listview-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.2rem 1.35rem 0;
}

.listview-panel__header-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
}

.listview-panel__header h3,
.listview-panel__header h2 {
    margin: 0;
}

.listview-panel__header p {
    margin: .3rem 0 0;
    color: var(--muted);
}

.entry-list-search {
    flex: 1 1 320px;
    min-width: min(340px, 100%);
    max-width: 520px;
    margin-left: auto;
}

.entry-list-search .listview-search {
    min-width: 0;
}

.entry-filter-totals--header {
    justify-content: flex-end;
}

.listview-panel__content {
    padding: 1rem 1.35rem 1.35rem;
}

.panel-support-copy {
    max-width: 46rem;
}

.budget-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
    gap: 1.15rem;
}

.budget-dashboard-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    align-items: start;
}

.budget-dashboard-panel {
    min-width: 0;
    display: grid;
    gap: .9rem;
    align-content: start;
}

.budget-dashboard-stack {
    display: grid;
    gap: .9rem;
}

.budget-dashboard-stack__header {
    display: grid;
    gap: .2rem;
    padding: .2rem .2rem 0;
}

.budget-dashboard-stack__header span {
    color: var(--muted);
    font-size: .92rem;
}

.budget-dashboard-card {
    --budget-category-color: rgba(121, 212, 255, .42);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--budget-category-color) 10%, rgba(255,255,255,.03)), rgba(255,255,255,.025)),
        rgba(255,255,255,.03);
    padding: 1.25rem 1.2rem 1.15rem;
    display: grid;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
}

.budget-dashboard-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--budget-category-color);
    opacity: .85;
}

.budget-dashboard-card--interactive {
    appearance: none;
    width: 100%;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.budget-dashboard-card--interactive:hover {
    transform: translateY(-2px);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--budget-category-color) 14%, rgba(255,255,255,.045)), rgba(255,255,255,.03)),
        rgba(255,255,255,.045);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
}

.budget-dashboard-card--interactive:focus-visible {
    outline: 2px solid rgba(121, 212, 255, .65);
    outline-offset: 3px;
}

.budget-dashboard-card--positive {
    border-color: rgba(48, 208, 139, .26);
}

.budget-dashboard-card--warning {
    border-color: rgba(255, 181, 72, .32);
}

.budget-dashboard-card--negative {
    border-color: rgba(255, 139, 116, .34);
}

.budget-dashboard-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.budget-dashboard-card__header strong,
.budget-dashboard-card__metrics strong,
.budget-progress-shell__label strong {
    display: block;
}

.budget-dashboard-card__header strong {
    font-size: 1.08rem;
    line-height: 1.25;
    margin-bottom: .3rem;
}

.budget-dashboard-card__drag {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255,255,255,.05);
    color: var(--muted);
    flex: 0 0 auto;
}

.budget-dashboard-card__header span,
.budget-dashboard-card__metrics span,
.budget-progress-shell__label span,
.entry-static {
    color: var(--muted);
}

.budget-dashboard-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.budget-dashboard-card__metrics > div {
    display: grid;
    gap: .3rem;
}

.budget-dashboard-card__metrics strong {
    font-size: 1.02rem;
    line-height: 1.35;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.budget-dashboard-card__single-metric {
    display: grid;
    gap: .35rem;
    padding: .1rem 0;
}

.budget-dashboard-card__single-metric span {
    color: var(--muted);
}

.budget-dashboard-card__single-metric strong {
    font-size: 1.45rem;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.budget-dashboard-card--sortable {
    cursor: grab;
}

.budget-dashboard-card--sortable:active {
    cursor: grabbing;
}

.budget-progress-shell {
    display: grid;
    gap: .55rem;
}

.budget-progress-shell__label {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
}

.budget-progress-shell__track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}

.budget-progress-shell__fill {
    height: 100%;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
}

.account-cashflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.35rem;
}

.accounts-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .9rem 1.1rem;
    padding: 1rem 1.2rem;
}

.accounts-hero-panel::after {
    width: 250px;
    height: 250px;
    inset: auto -9% -62% auto;
    opacity: .7;
}

.accounts-hero-panel__copy h2 {
    margin: .15rem 0 .3rem;
    line-height: 1.1;
}

.accounts-hero-panel__copy p {
    margin: 0;
    color: var(--text);
    opacity: .9;
}

.accounts-hero-panel__actions {
    align-self: end;
}

.account-cashflow-card {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025)),
        rgba(255,255,255,.03);
    padding: 1.55rem;
    display: grid;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    min-height: 250px;
}

.account-cashflow-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    opacity: .9;
}

.account-cashflow-card--checking::before {
    background: linear-gradient(180deg, rgba(91, 141, 255, .95), rgba(114, 203, 255, .9));
}

.account-cashflow-card--savings::before {
    background: linear-gradient(180deg, rgba(47, 206, 149, .95), rgba(138, 239, 206, .85));
}

.account-cashflow-card--wallet::before {
    background: linear-gradient(180deg, rgba(255, 177, 74, .95), rgba(255, 214, 122, .85));
}

.account-cashflow-card--investment::before {
    background: linear-gradient(180deg, rgba(161, 101, 255, .95), rgba(115, 70, 224, .9));
}

.account-cashflow-card__header,
.account-cashflow-card__metrics,
.account-cashflow-card__details {
    display: grid;
    gap: 1rem;
}

.account-cashflow-card__header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.account-cashflow-card__header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}

.account-cashflow-card__diagnostic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-strong);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.account-cashflow-card__diagnostic-button:hover {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(30, 41, 59, 0.7);
}

.account-cashflow-card__diagnostic-button:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.9);
    outline-offset: 2px;
}

.account-cashflow-card__header strong,
.account-cashflow-card__metrics strong,
.account-cashflow-card__details strong {
    display: block;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
}

.account-cashflow-card__header strong {
    font-size: 1.08rem;
    margin-bottom: .25rem;
}

.account-cashflow-card__header span,
.account-cashflow-card__metrics span,
.account-cashflow-card__details span {
    color: var(--muted);
    white-space: nowrap;
}

.account-cashflow-card__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .95rem;
}

.account-cashflow-card__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.account-cashflow-card__detail {
    min-width: 0;
}

.account-diagnostics-modal {
    display: grid;
    gap: 1rem;
}

.account-diagnostics-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: .9rem;
}

.account-diagnostics-modal__header strong {
    display: block;
    margin-bottom: .2rem;
}

.account-diagnostics-modal__header span {
    color: var(--muted);
}

.account-diagnostics-modal__competency {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    padding: .25rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
}

.account-diagnostics-modal__kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.account-diagnostics-modal__kpi {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.38);
    padding: .7rem .8rem;
}

.account-diagnostics-modal__kpi span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    margin-bottom: .35rem;
}

.account-diagnostics-modal__kpi strong {
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
}

.account-diagnostics-modal__result {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    background: rgba(14, 116, 144, 0.14);
    padding: .75rem .85rem;
}

.account-diagnostics-modal__result span {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: .25rem;
}

.account-diagnostics-modal__result strong {
    font-variant-numeric: tabular-nums;
}

.account-diagnostics-modal__table {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    overflow: hidden;
}

.account-diagnostics-modal__table > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .62rem .8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.account-diagnostics-modal__table > div:last-child {
    border-bottom: 0;
}

.account-diagnostics-modal__table span {
    color: var(--muted);
    font-size: .83rem;
}

.account-diagnostics-modal__table strong {
    font-variant-numeric: tabular-nums;
}

.metric-row--stacked {
    align-items: flex-start;
}

.segmented-choice {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.segmented-choice__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.78);
    cursor: pointer;
}

.loan-due-meta {
    display: grid;
    gap: .15rem;
    text-align: right;
}

.loan-due-meta span {
    color: var(--muted);
}

.notification-inline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    padding: .85rem 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.notification-inline:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.notification-inline .app-icon {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: .15rem;
}

.loan-detail-overview {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.loan-detail-overview__hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.loan-detail-overview__hero h3 {
    margin: .3rem 0;
    font-size: 1.45rem;
}

.loan-detail-overview__hero p {
    margin: 0;
    color: var(--muted);
}

.loan-detail-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}

.loan-detail-kpis > div {
    display: grid;
    gap: .3rem;
}

.loan-detail-kpis span {
    color: var(--muted);
}

.loan-detail-kpis strong {
    display: block;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.budget-progress-shell__fill--positive {
    background: linear-gradient(90deg, #22c55e, #10b981);
}

.budget-progress-shell__fill--warning {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.budget-progress-shell__fill--negative {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.budget-progress-shell__fill--neutral {
    background: linear-gradient(90deg, #64748b, #94a3b8);
}

.listview-table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.listview-table tbody tr:hover {
    background: rgba(255,255,255,.03);
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;
    flex-wrap: wrap;
}

.action-icon-button {
    min-width: 2.45rem;
    min-height: 2.45rem;
    padding: .55rem .8rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: .18s ease;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.action-icon-button:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.08);
}

.action-icon-button--danger {
    color: #ffd3ca;
    border-color: rgba(255,139,116,.18);
    background: rgba(136, 31, 22, .16);
}

.action-icon-button--positive {
    color: #d8ffe8;
    border-color: rgba(84, 214, 140, .24);
    background: rgba(17, 88, 49, .22);
}

.selection-cell {
    width: 2.75rem;
    text-align: center;
}

.entry-selection-checkbox {
    inline-size: 1.05rem;
    block-size: 1.05rem;
    accent-color: #67d5ff;
}

.listview-bulkbar {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(2, 8, 15, .62);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.workspace-transition-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(6, 12, 22, 0.24);
    backdrop-filter: blur(10px);
    z-index: 5000;
}

.workspace-transitioning .workspace-transition-overlay {
    display: flex;
}

.workspace-transitioning .shell {
    opacity: 0.28;
    filter: saturate(0.85);
    pointer-events: none;
}

.workspace-transition-overlay__content {
    min-width: min(92vw, 360px);
    display: grid;
    justify-items: center;
    gap: 0.55rem;
    padding: 1.35rem 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.workspace-transition-overlay__content strong {
    font-size: 1.05rem;
}

.workspace-transition-overlay__content span:last-child {
    color: var(--muted);
    font-size: 0.92rem;
}

.workspace-transition-overlay__spinner {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    border: 3px solid rgba(96, 165, 250, 0.22);
    border-top-color: #60a5fa;
    animation: workspace-transition-spin .85s linear infinite;
}

@keyframes workspace-transition-spin {
    to {
        transform: rotate(360deg);
    }
}

.overlay-backdrop--drawer {
    justify-content: flex-end;
}

.modal-shell,
.filter-drawer {
    border: 1px solid rgba(255,255,255,.12);
    background:
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
        rgba(6, 14, 25, .96);
    box-shadow: 0 32px 84px rgba(0,0,0,.38);
}

.modal-shell {
    width: min(760px, 100%);
    max-height: min(88vh, 980px);
    overflow: auto;
    border-radius: 28px;
    outline: none;
}

.modal-shell--sm {
    width: min(520px, 100%);
}

.modal-shell--lg {
    width: min(920px, 100%);
}

.modal-shell--xl {
    width: min(1320px, 100%);
}

.modal-shell.loan-create-modal-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: min(88dvh, 980px);
    overflow: hidden;
}

.loan-create-modal-shell > .modal-shell__header,
.loan-create-modal-shell > .modal-shell__footer {
    position: static;
}

.loan-create-modal-shell > .modal-shell__body {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.modal-shell--xl > .modal-shell__footer {
    position: sticky;
    bottom: 0;
    z-index: 6;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    backdrop-filter: blur(16px);
}

.modal-shell__header,
.filter-drawer__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    padding: 1.35rem 1.35rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.modal-shell__header {
    position: sticky;
    top: 0;
    z-index: 6;
}

.modal-shell__title-row {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    min-width: 0;
}

.modal-shell__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand-2) 16%, var(--surface-raised));
    color: var(--brand-2);
}

.modal-shell__icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.modal-shell__heading {
    min-width: 0;
}

.modal-shell__header-end {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.modal-shell__header-end > .modal-shell__close {
    flex: 0 0 auto;
}

.modal-shell__header h2,
.filter-drawer__header h2 {
    margin: .3rem 0 .35rem;
    font-size: 1.4rem;
}

.modal-shell__body {
    padding: 1.25rem 1.35rem;
}

.modal-shell__footer,
.filter-drawer__footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.35rem 1.35rem;
    border-top: 1px solid rgba(255,255,255,.07);
}

@media (max-width: 720px) {
    .modal-shell__header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .modal-shell__header-end {
        display: contents;
    }

    .modal-shell__header-end > .modal-shell__close {
        grid-column: 2;
        grid-row: 1;
    }

    .modal-shell__header-end > :not(.modal-shell__close) {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 980px) {
    .modal-shell.loan-create-modal-shell {
        display: block;
        height: auto;
        overflow: auto;
    }

    .loan-create-modal-shell > .modal-shell__header {
        position: sticky;
    }

    .loan-create-modal-shell > .modal-shell__footer {
        position: sticky;
    }

    .loan-create-modal-shell > .modal-shell__body {
        display: block;
        overflow: visible;
    }
}

/* ==========================================================================
   Generic "multi-section form modal" layout — numbered sections in the main
   column plus a fixed summary aside. Introduced for the fund loan create
   modal (FundLoans.razor) and promoted here so other modals (e.g. the
   recurring income modal in Recurrences.razor) can reuse the exact same
   rules instead of duplicating them per page.
   ========================================================================== */
.loan-create-modal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
    gap: 1.4rem;
    align-items: stretch;
    height: 100%;
    min-height: 0;
}

.loan-create-main {
    display: grid;
    gap: 1rem;
    align-content: start;
    min-width: 0;
}

.loan-create-section {
    display: grid;
    gap: .8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.loan-create-section--notes {
    padding-bottom: 0;
    border-bottom: 0;
}

.loan-create-section--notes textarea {
    min-height: 72px;
    resize: vertical;
}

.loan-create-section h3 {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    color: var(--text-strong);
    font-size: .98rem;
}

.loan-create-section h3 > span {
    display: grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand-2) 14%, var(--surface-raised));
    color: var(--brand-2);
    font-size: .78rem;
}

.loan-create-grid {
    display: grid;
    gap: .8rem 1rem;
}

.loan-create-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loan-create-field--wide {
    grid-column: 1 / -1;
}

.required-mark {
    margin-left: .35rem;
    color: var(--brand-2);
    font-size: .72rem;
    font-weight: 600;
}

.loan-create-hint {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
}

.loan-create-hint svg {
    width: 1rem;
    height: 1rem;
    color: var(--brand-2);
}

.loan-create-summary {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    align-content: start;
    min-height: 0;
    overflow: hidden;
}

.loan-create-summary-pane,
.loan-create-summary-card {
    display: grid;
    gap: 1rem;
    align-content: start;
    min-height: 0;
}

.loan-create-summary-card,
.loan-create-summary-panel {
    min-height: 0;
    padding: .75rem .9rem 1rem;
    background: var(--surface-raised);
}

.loan-create-summary-card {
    border-radius: 12px;
}

.loan-create-summary dl {
    display: grid;
    margin: 0;
}

.loan-create-summary dl > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}

.loan-create-summary dl > div:first-child {
    padding-top: .35rem;
}

.loan-create-summary dt {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
}

.loan-create-summary dt svg {
    width: 1rem;
    height: 1rem;
}

.loan-create-summary dd {
    min-width: 0;
    margin: 0;
    color: var(--text-strong);
    font-weight: 600;
    text-align: right;
}

.loan-create-summary__total dd {
    color: var(--brand-2);
}

.loan-create-summary__info {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .85rem;
    border: 1px solid color-mix(in srgb, var(--brand-2) 45%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand-2) 8%, var(--surface-raised));
    color: var(--muted);
    font-size: .82rem;
}

.loan-create-summary__info svg {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    color: var(--brand-2);
}

@media (max-width: 980px) {
    .loan-create-modal {
        grid-template-columns: 1fr;
        height: auto;
    }

    .loan-create-summary {
        grid-template-rows: auto auto;
        overflow: visible;
    }
}

@media (max-width: 620px) {
    .loan-create-grid--2 {
        grid-template-columns: 1fr;
    }

    .loan-create-field--wide {
        grid-column: auto;
    }

    .loan-create-summary dl > div {
        align-items: flex-start;
    }
}

/* ==========================================================================
   Switch-styled checkbox row ("toggle" look, checkmark box with border and
   background). Originally introduced in FinancialEntryWorkspace.razor and
   promoted here so it can be reused by other forms (e.g. the recurring
   income modal) without duplicating CSS. Named "form-toggle-switch" (not
   "entry-switch") because ".entry-switch" is already a distinct, simpler
   selector used across several other pages (CardReconciliationWizard,
   CategoryBudgets, FamilyEntryImportWorkspace, Projects, FamilyWorkspace,
   RecurringExpenses) — reusing that name here would have leaked this
   variant's border/background/padding into all of them.
   ========================================================================== */
.form-toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.15rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft), var(--panel-soft);
    cursor: pointer;
    margin: 0;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.form-toggle-switch:hover {
    border-color: color-mix(in srgb, var(--brand-2) 38%, var(--line));
}

.form-toggle-switch:has(.form-toggle-switch__control:checked) {
    border-color: color-mix(in srgb, var(--brand-2) 52%, var(--line));
    background: color-mix(in srgb, var(--brand-2) 12%, var(--panel-soft));
}

.form-toggle-switch:has(.form-toggle-switch__control:focus-visible) {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 22%, transparent);
}

.form-toggle-switch__control {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    border: 1.5px solid color-mix(in srgb, var(--muted) 45%, var(--line));
    border-radius: 0.35rem;
    background: var(--panel);
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid;
    place-content: center;
    flex-shrink: 0;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.form-toggle-switch__control::after {
    content: "";
    width: 0.62rem;
    height: 0.62rem;
    transform: scale(0);
    transition: transform 0.14s ease;
    clip-path: polygon(14% 44%, 0 58%, 43% 100%, 100% 20%, 84% 6%, 40% 69%);
    background: white;
}

.form-toggle-switch__control:checked {
    border-color: color-mix(in srgb, var(--brand-2) 60%, #2d5bff);
    background: color-mix(in srgb, var(--brand-2) 76%, #2d5bff);
}

.form-toggle-switch__control:checked::after {
    transform: scale(1);
}

.form-toggle-switch__label {
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.25;
}

/* Novo lançamento: skin isolado pelo ShellClass para reproduzir o mock sem
   alterar os demais modais nem duplicar os componentes-base do projeto. */
.overlay-backdrop:has(.entry-create-shell) {
    padding: 14px;
    background: rgba(35, 48, 73, .34);
    backdrop-filter: blur(3px);
}

.modal-shell.entry-create-shell {
    --text: #14213d;
    --text-strong: #10214a;
    --muted: #65728d;
    --muted-strong: #4d5c79;
    --panel: #ffffff;
    --panel-soft: #f8faff;
    --surface-soft: #ffffff;
    --line: #dce4f1;
    --line-strong: #ccd7e8;
    --input-bg: #ffffff;
    --input-placeholder: #8b97ad;
    --brand: #2452ee;
    --brand-2: #2b5cff;
    width: min(1180px, calc(100vw - 28px));
    height: min(920px, calc(100dvh - 28px));
    max-height: calc(100dvh - 28px);
    display: grid;
    grid-template-areas:
        "header"
        "body"
        "footer";
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid #dce3ef;
    border-radius: 20px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(22, 34, 58, .24);
}

.entry-create-shell > .modal-shell__header {
    grid-area: header;
    position: relative;
    min-height: 104px;
    padding: 25px 32px 12px;
    border-bottom: 0;
    background: #fff;
}

.entry-create-shell .modal-shell__header h2 {
    margin: 7px 0 5px;
    color: #10214a;
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.entry-create-shell .modal-shell__heading p {
    margin: 0;
    color: #65728d;
    font-size: 12px;
    line-height: 1.4;
}

.entry-create-shell .modal-shell__close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f4f6fb;
    color: #53617c;
}

.entry-create-shell .modal-shell__close .app-icon {
    width: 16px;
    height: 16px;
}

.entry-create-shell > .modal-shell__body {
    grid-area: body;
    min-height: 0;
    overflow: auto;
    padding: 0 32px 20px;
    background: #fff;
}

.entry-create-shell .entry-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 18px 28px;
    align-items: start;
}

.entry-create-shell .entry-create-form__lead,
.entry-create-shell .entry-create-form > .entry-modal,
.entry-create-shell .entry-create-form > .entry-modal--income {
    grid-column: 1;
}

.entry-create-shell .entry-create-form__lead {
    display: grid;
    gap: 16px;
    min-width: 0;
    position: relative;
    z-index: 0;
}

.entry-create-shell .entry-kind-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 16px;
    background: transparent;
}

.entry-create-shell .entry-kind-tabs__item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    min-height: 72px;
    padding: 12px 20px;
    border: 1px solid #d5deec;
    border-radius: 14px;
    background: #fff;
    color: #17213a;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.entry-create-shell .entry-kind-tabs__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
}

.entry-create-shell .entry-kind-tabs__icon--income {
    background: #4bb36b;
}

.entry-create-shell .entry-kind-tabs__icon--expense {
    background: #3470f5;
}

.entry-create-shell .entry-kind-tabs__icon .app-icon {
    width: 18px;
    height: 18px;
}

.entry-create-shell .entry-kind-tabs__copy {
    display: grid;
    gap: 4px;
    text-align: left;
}

.entry-create-shell .entry-kind-tabs__copy strong {
    font-size: 15px;
}

.entry-create-shell .entry-kind-tabs__copy small {
    color: #69758e;
    font-size: 12px;
    font-weight: 500;
}

.entry-create-shell .entry-kind-tabs__item--active {
    border-color: #2b5cff;
    background: #fbfcff;
    color: #2458ed;
    box-shadow: 0 0 0 1px rgba(43, 92, 255, .08);
}

.entry-create-shell .entry-kind-tabs__item:disabled {
    cursor: not-allowed;
}

.entry-create-shell .modal-shell__heading h2:first-child {
    margin-top: 0;
}

.entry-create-shell .entry-create-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid #cadbff;
    border-radius: 10px;
    background: #eef4ff;
    color: #2458ed;
    font-size: 12px;
}

.entry-create-shell .entry-create-notice .app-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.entry-create-shell .entry-modal {
    display: grid;
    gap: 14px;
}

.entry-create-shell .entry-modal__intro {
    display: none;
}

.entry-create-shell .entry-modal .form-grid {
    gap: 16px 28px;
}

.entry-create-shell .entry-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    color: #10214a;
    font-size: 13px;
}

.entry-create-shell .entry-field,
.entry-create-shell .form-field {
    display: grid;
    gap: 7px;
}

.entry-create-shell .entry-field label,
.entry-create-shell .form-field > label {
    margin: 0;
    color: #17254a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.entry-create-shell .form-field--required > label::after {
    color: #ef334e;
}

.entry-create-shell .entry-label-required::after {
    content: " *";
    color: #ef334e;
}

.entry-create-shell .form-control,
.entry-create-shell .form-select,
.entry-create-shell input:where([type="text"], [type="number"], [type="date"]),
.entry-create-shell select,
.entry-create-shell textarea {
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #d6dfed;
    border-radius: 8px;
    background-color: #fff;
    color: #243452;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(18, 32, 60, .02);
}

.entry-create-shell .form-select,
.entry-create-shell select {
    padding-right: 34px;
    background-position: right 12px center;
}

.entry-create-shell .entry-control-icon {
    position: relative;
}

.entry-create-shell .entry-control-icon > .app-icon {
    position: absolute;
    z-index: 1;
    left: 12px;
    top: 50%;
    width: 15px;
    height: 15px;
    color: #2b5cff;
    pointer-events: none;
    transform: translateY(-50%);
}

.entry-create-shell .entry-control-icon > .form-select {
    padding-left: 38px;
}

.entry-create-shell .entry-payment-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-height: 42px;
}

.entry-create-shell .entry-field--payment-tabs {
    grid-column: 1 / -1;
}

.entry-create-shell .entry-payment-tabs__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 42px;
    width: 100%;
}

.entry-create-shell .entry-payment-tabs__item .app-icon {
    width: 15px;
    height: 15px;
}

.entry-create-shell .entry-payment-tabs__item .pix-brand-icon {
    display: block;
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.entry-create-shell .entry-field--dynamic {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.entry-create-shell .entry-payment-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 13px 16px;
    border: 1px solid #d6dfed;
    border-radius: 9px;
    background: #fff;
}

.entry-create-shell .entry-payment-details__title {
    grid-column: 1 / -1;
    margin-bottom: -4px;
    color: #213661;
    font-size: 12px;
    font-weight: 700;
}

.entry-create-shell .entry-payment-details__notice {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #d6e1fb;
    border-radius: 8px;
    background: #f5f8ff;
    color: #3560c8;
    font-size: 11px;
}

.entry-create-shell .entry-payment-details__notice .app-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.entry-create-shell .entry-optional-label {
    color: #78859c;
    font-weight: 500;
}

.entry-create-shell .entry-notes {
    min-height: 66px;
    resize: none;
}

.entry-create-shell .entry-field:has(.entry-notes) {
    position: relative;
}

.entry-create-shell .entry-notes-counter {
    position: absolute;
    right: 11px;
    bottom: 8px;
    color: #8390a8;
    font-size: 10px;
}

.entry-create-shell .entry-create-sidebar {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    gap: 22px;
    position: sticky;
    top: 0;
}

.entry-create-shell .entry-create-card {
    display: grid;
    gap: 17px;
    padding: 18px;
    border: 1px solid #d9e1ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(25, 40, 72, .035);
}

.entry-create-shell .entry-create-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #153063;
    font-size: 13px;
}

.entry-create-shell .entry-create-card__icon {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #2b5cff;
    color: #fff;
}

.entry-create-shell .entry-create-card__icon .app-icon {
    width: 13px;
    height: 13px;
}

.entry-create-shell .entry-summary-list {
    display: grid;
    gap: 17px;
    margin: 0;
}

.entry-create-shell .entry-summary-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.entry-create-shell .entry-summary-list dt {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #4f5d77;
    font-size: 12px;
}

.entry-create-shell .entry-summary-list dt .app-icon {
    width: 15px;
    height: 15px;
    color: #14264c;
}

.entry-create-shell .entry-summary-list dd {
    margin: 0;
    max-width: 140px;
    overflow: hidden;
    color: #14213d;
    font-size: 12px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-create-shell .entry-summary-list__amount {
    color: #1753f2 !important;
    font-size: 14px !important;
    font-weight: 800;
}

.entry-create-shell .entry-summary-list__status {
    color: #2458ed;
    font-weight: 700;
}

.entry-create-shell .entry-launch-tips {
    display: grid;
    gap: 18px;
}

.entry-create-shell .entry-launch-tips > div {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.entry-create-shell .entry-launch-tips > div > span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dce6fb;
    border-radius: 10px;
    background: #f5f8ff;
    color: #2b5cff;
}

.entry-create-shell .entry-launch-tips .app-icon {
    width: 18px;
    height: 18px;
}

.entry-create-shell .entry-launch-tips p {
    margin: 0;
    color: #59667f;
    font-size: 11px;
    line-height: 1.45;
}

.entry-create-shell > .modal-shell__footer {
    grid-area: footer;
    position: static;
    z-index: 2;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #e0e6ef;
    background: #fff;
}

.entry-create-shell > .modal-shell__footer .btn {
    min-height: 42px;
    padding: 0 22px;
    border-radius: 9px;
    font-size: 12px;
}

.entry-create-shell > .modal-shell__footer .btn-ghost {
    border: 1px solid #d6dfed;
    background: #f7f9fd;
    color: #25334f;
}

.entry-create-shell > .modal-shell__footer .btn-light {
    border: 1px solid #d6dfed;
    background: #fff;
    color: #25334f;
}

.entry-create-shell > .modal-shell__footer .btn-primary {
    min-width: 190px;
    background: linear-gradient(135deg, #315eff, #1e4ee9);
    color: #fff;
}

@media (max-width: 900px) {
    .modal-shell.entry-create-shell {
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
        width: calc(100vw - 16px);
        border-radius: 16px;
    }

    .entry-create-shell > .modal-shell__header {
        min-height: auto;
        padding: 20px 20px 14px;
    }

    .entry-create-shell > .modal-shell__body {
        padding: 0 20px 20px;
    }

    .entry-create-shell .entry-create-form {
        grid-template-columns: 1fr;
    }

    .entry-create-shell .entry-create-form__lead,
    .entry-create-shell .entry-create-form > .entry-modal,
    .entry-create-shell .entry-create-form > .entry-modal--income,
    .entry-create-shell .entry-create-sidebar {
        grid-column: 1;
    }

    .entry-create-shell .entry-create-form__lead {
        margin-top: 0;
    }

    .entry-create-shell .entry-kind-tabs {
        position: static;
        width: 100%;
        transform: none;
    }

    .entry-create-shell .entry-create-sidebar {
        grid-row: auto;
        position: static;
    }
}

@media (max-width: 640px) {
    .modal-shell.entry-create-shell {
        grid-template-areas:
            "header"
            "body"
            "footer";
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .entry-create-shell > .modal-shell__header {
        position: relative;
        z-index: 2;
        min-height: 0;
        padding: 16px 16px 12px;
        background: #fff;
    }

    .entry-create-shell .modal-shell__title-row,
    .entry-create-shell .modal-shell__heading {
        width: 100%;
        min-width: 0;
    }

    .entry-create-shell .modal-shell__heading {
        padding-right: 44px;
    }

    .entry-create-shell .modal-shell__header h2 {
        margin: 0 0 4px;
        font-size: 24px;
        line-height: 1.1;
    }

    .entry-create-shell .modal-shell__heading p {
        font-size: 11px;
        line-height: 1.35;
    }

    .entry-create-shell .modal-shell__header-end {
        position: absolute;
        top: 14px;
        right: 14px;
    }

    .entry-create-shell > .modal-shell__body {
        position: relative;
        z-index: 1;
        padding: 8px 16px 18px;
    }

    .entry-create-shell .entry-create-form {
        gap: 16px;
    }

    .entry-create-shell .entry-create-form__lead {
        position: static;
        grid-row: auto;
        min-width: 0;
        gap: 12px;
    }

    .entry-create-shell .entry-kind-tabs {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        min-width: 0;
        transform: none;
    }

    .entry-create-shell .entry-kind-tabs__item {
        gap: 9px;
        min-width: 0;
        min-height: 62px;
        padding: 9px 10px;
        border-radius: 11px;
        overflow: hidden;
    }

    .entry-create-shell .entry-kind-tabs__icon {
        width: 29px;
        height: 29px;
    }

    .entry-create-shell .entry-kind-tabs__icon .app-icon {
        width: 15px;
        height: 15px;
    }

    .entry-create-shell .entry-kind-tabs__copy {
        min-width: 0;
        gap: 2px;
    }

    .entry-create-shell .entry-kind-tabs__copy strong {
        font-size: 13px;
    }

    .entry-create-shell .entry-kind-tabs__copy small {
        font-size: 10px;
        line-height: 1.2;
    }

    .entry-create-shell .entry-payment-details {
        grid-template-columns: 1fr;
    }

    .entry-create-shell .entry-payment-details__title {
        grid-column: 1;
    }

    .entry-create-shell .entry-payment-details__notice {
        grid-column: 1;
    }

    .entry-create-shell > .modal-shell__footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .entry-create-shell > .modal-shell__footer .btn-primary {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

.filter-drawer {
    width: min(460px, 100%);
    height: 100%;
    border-radius: 28px 0 0 28px;
    display: flex;
    flex-direction: column;
}

.filter-drawer__body {
    flex: 1;
    overflow: auto;
    padding: 1.2rem 1.35rem;
}

.filter-group {
    display: grid;
    gap: .95rem;
}

.filter-group + .filter-group {
    margin-top: 1.1rem;
}

.filter-group__title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.confirm-dialog__warning {
    display: flex;
    gap: .7rem;
    align-items: start;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255,196,108,.18);
    background: rgba(110, 74, 12, .16);
    color: #ffd99c;
}

.list-summary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted);
}

.list-summary strong {
    color: var(--text);
}

.entry-filter-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: .75rem;
    width: min(100%, 420px);
}

.entry-filter-totals--single {
    grid-template-columns: minmax(180px, 1fr);
    width: fit-content;
    max-width: 100%;
}

.entry-filter-totals__card {
    display: grid;
    gap: .28rem;
    padding: .9rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft), var(--panel);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        0 12px 26px rgba(15, 23, 42, .08);
}

.entry-filter-totals__card span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.entry-filter-totals__card strong {
    font-size: 1.15rem;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--text-strong);
}

.entry-filter-totals__card--income {
    border-color: color-mix(in srgb, var(--positive) 26%, var(--line));
}

.entry-filter-totals__card--income strong {
    color: color-mix(in srgb, var(--positive) 82%, var(--text-strong));
}

.entry-filter-totals__card--expense {
    border-color: color-mix(in srgb, var(--negative) 24%, var(--line));
}

.entry-filter-totals__card--expense strong {
    color: color-mix(in srgb, var(--negative) 82%, var(--text-strong));
}

.panel-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .9rem;
    flex-wrap: nowrap;
}


.picker-grid {
    display: grid;
    gap: .65rem;
}

.picker-grid--colors {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.picker-grid--icons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.color-picker,
.icon-picker {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    transition: .18s ease;
}

.color-picker {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.03)),
        var(--picker-color);
}

.color-picker::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 28% 24%, rgba(255,255,255,.28), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0));
    pointer-events: none;
}

.color-picker:hover,
.icon-picker:hover {
    transform: translateY(-1px);
    border-color: rgba(121,212,255,.28);
}

.color-picker--active,
.icon-picker--active {
    border-color: rgba(121,212,255,.48);
    box-shadow: 0 0 0 2px rgba(63,114,255,.15);
}

.color-picker--active::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 11px;
    border: 2px solid rgba(255,255,255,.72);
    pointer-events: none;
}

.icon-picker {
    min-height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--text);
}

.icon-picker .app-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.category-preview-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 72px;
    padding: .9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--category-preview-color) 24%, transparent), rgba(255,255,255,.02)),
        rgba(6, 14, 25, .84);
}

.category-preview-card__icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--category-preview-color) 24%, rgba(255,255,255,.04));
    color: var(--text);
}

.category-preview-card__icon .app-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.category-preview-card__content {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.category-preview-card__content span {
    color: var(--muted);
    font-size: .9rem;
}

@media (max-width: 980px) {
    .shell,
    .shell--sidebar-collapsed {
        --sidebar-w: 0px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(86vw, 320px);
        height: 100dvh;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        transform: translateX(calc(-100% - 1rem));
        box-shadow: 0 24px 64px rgba(3, 8, 18, 0.38);
    }

    .main-frame {
        margin-left: 0 !important;
    }

    .shell--sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar__close {
        display: inline-flex;
    }

    .sidebar__collapse-toggle {
        display: none;
    }

    .shell--sidebar-collapsed .brand-copy,
    .shell--sidebar-collapsed .nav-group__title,
    .shell--sidebar-collapsed .nav-group__chevron,
    .shell--sidebar-collapsed .nav-link-with-icon__label,
    .shell--sidebar-collapsed .user-menu__trigger-copy {
        display: revert;
    }

    .shell--sidebar-collapsed .brand-block {
        justify-content: flex-start;
    }

    .shell--sidebar-collapsed .nav-group__trigger {
        justify-content: space-between;
        padding-inline: .7rem .2rem;
    }

    .shell--sidebar-collapsed .nav-group__items a,
    .shell--sidebar-collapsed .nav-link-with-icon {
        margin-left: .4rem;
        justify-content: flex-start;
        padding-inline: .9rem;
    }

    .shell--sidebar-collapsed .sidebar__footer {
        flex-direction: row;
        padding-inline: 1.25rem;
    }

    .shell--sidebar-collapsed .user-menu__trigger--sidebar {
        width: 100%;
        justify-content: flex-start;
        padding: .5rem .6rem;
    }

    .topbar-toggle--mobile {
        display: inline-flex;
    }

    .kpi-grid, .content-grid, .workspace-grid, .workspace-grid--wide, .form-grid--2, .filter-grid, .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Dashboards on mobile: keep list-style cards in a single vertical column. */
    .budget-dashboard-layout,
    .budget-dashboard-grid,
    .project-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .topbar-workspace-pill {
        max-width: 100%;
    }

    .register-surface,
    .password-criteria {
        grid-template-columns: 1fr;
    }

    .register-form-pane {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

    .password-panel__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .entry-filter-totals {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .topbar {
        position: sticky;
        top: .75rem;
        z-index: 30;
    }

    .topbar-context,
    .topbar-actions {
        width: 100%;
    }

    .topbar-context {
        justify-content: flex-start;
    }

    .page-body {
        overflow-x: clip;
    }

    .listview-header--with-center {
        grid-template-columns: 1fr;
    }

    .listview-header--with-aside.listview-header--toolbarless,
    .listview-header--with-center.listview-header--with-aside.listview-header--with-toolbar {
        grid-template-columns: 1fr;
    }

    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) {
        grid-template-columns: 1fr;
    }

    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-toolbar {
        justify-content: stretch;
    }

    .listview-header__center {
        justify-content: stretch;
        padding-inline: 0;
    }

    .listview-header__aside {
        justify-content: stretch;
    }

    .account-cashflow-card__metrics,
    .account-cashflow-card__details {
        grid-template-columns: 1fr;
    }

    .account-cashflow-card__header-actions {
        justify-content: flex-start;
    }

    .accounts-hero-panel {
        grid-template-columns: 1fr;
        align-items: start;
        gap: .8rem;
    }

    .accounts-hero-panel__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .accounts-listview-header {
        padding: .85rem 1rem;
    }

    .accounts-listview-header .listview-header__copy p {
        display: none;
    }

    .accounts-listview-header .listview-toolbar__row {
        justify-content: stretch;
    }

    .accounts-listview-header .listview-search,
    .accounts-listview-header .listview-toolbar__primary,
    .accounts-listview-header .listview-toolbar__filter {
        width: 100%;
    }

    .account-diagnostics-modal__header {
        flex-direction: column;
    }

    .account-diagnostics-modal__kpis,
    .account-diagnostics-modal__result {
        grid-template-columns: 1fr;
    }

    .account-diagnostics-modal__table > div {
        align-items: flex-start;
        flex-direction: column;
    }

    .entry-competency-nav {
        grid-template-columns: 1fr;
    }

    .entry-competency-nav__button {
        width: 100%;
    }

    .entry-competency-nav__button {
        justify-content: center;
    }

    .loan-detail-overview__hero {
        flex-direction: column;
    }

    .loan-detail-kpis {
        grid-template-columns: 1fr;
    }

    .listview-toolbar,
    .listview-toolbar__row,
    .listview-search,
    .listview-toolbar__primary,
    .listview-toolbar__filter,
    .listview-toolbar__secondary {
        width: 100%;
    }

    .modal-shell,
    .filter-drawer {
        width: 100%;
        max-height: 100dvh;
        border-radius: 24px;
    }

    .overlay-backdrop--drawer {
        align-items: stretch;
    }

    .filter-drawer {
        border-radius: 24px 24px 0 0;
        margin-top: auto;
        height: auto;
        max-height: min(88dvh, 960px);
    }

    .toast-stack {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        width: auto;
    }

    .auth-card {
        justify-self: stretch;
        max-width: none;
    }

    .auth-actions {
        grid-template-columns: 1fr;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .actions-cell {
        white-space: normal;
        text-align: left;
    }

    .actions-cell .btn,
    .row-actions {
        margin: .35rem .35rem 0 0;
    }

    .table-shell {
        display: none;
    }

    .entry-mobile-list {
        display: block;
    }

    .entry-mobile-card__actions .actions-cell {
        width: 100%;
    }

    .panel-header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .dashboard-hero {
        flex-direction: column;
    }

    .dashboard-session-nav__toggle {
        display: inline-flex;
        width: calc(100% - 1rem);
        margin-inline: .5rem;
        justify-content: flex-start;
        padding-inline: .85rem;
    }

    .dashboard-session-nav__list {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-session-nav.is-open .dashboard-session-nav__list {
        display: grid;
    }

    .budget-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .picker-grid--colors {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .picker-grid--icons {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .main-frame {
        padding: 0;
    }

    .topbar {
        top: 0;
        margin-bottom: 0;
        padding: .8rem 1rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .page-body {
        gap: .9rem;
        padding: 0;
    }

    .hero-panel,
    .page-header-card,
    .panel-card,
    .auth-card,
    .listview-header,
    .listview-panel {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .hero-panel,
    .page-header-card,
    .panel-card,
    .auth-card,
    .listview-header,
    .listview-panel__header,
    .listview-panel__content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Canonical avatar menu overrides (EOF, precedence guard) */
.user-menu__panel {
    min-width: 18rem;
    max-width: min(21rem, calc(100vw - 1rem));
    color: var(--text-strong);
}

@media (max-width: 1100px) {
    .content-grid--dashboard-mobile-stack {
        grid-template-columns: 1fr !important;
    }
}

/*
 * Between ~981px and ~1180px the sidebar is still docked (desktop layout),
 * so the content column is narrow even though the viewport itself is wide
 * enough to skip the full mobile breakpoint below. Without this, the
 * listview header's title and its search/filter/primary toolbar overlap.
 */
@media (max-width: 1180px) and (min-width: 981px) {
    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) {
        grid-template-columns: 1fr;
    }

    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-toolbar {
        justify-content: stretch;
    }

    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-toolbar__row,
    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-search,
    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-toolbar__primary,
    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-toolbar__filter,
    .listview-header--with-toolbar:not(.listview-header--with-center):not(.listview-header--with-aside) .listview-toolbar__secondary {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .topbar,
    .topbar-actions,
    .user-menu {
        overflow: visible !important;
    }

    .user-menu__scrim {
        background: rgba(2, 8, 15, .48) !important;
        z-index: 1200 !important;
    }

    .user-menu__panel {
        position: fixed !important;
        top: calc(var(--topbar-height-mobile) + .5rem) !important;
        bottom: auto !important;
        left: max(.75rem, env(safe-area-inset-left)) !important;
        right: max(.75rem, env(safe-area-inset-right)) !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: min(74dvh, 34rem) !important;
        overflow: auto !important;
        border-radius: 24px !important;
        z-index: 1201 !important;
    }

    .user-menu__action {
        color: var(--text-strong) !important;
    }

    .user-menu__action.user-menu__action--danger {
        color: var(--negative) !important;
    }
}

/* ============================================================
   Recorrentes (receitas e despesas) — layout compartilhado
   ============================================================ */
.recurring-manage-panel.recurring-manage-panel {
    display: grid;
    gap: 1rem;
}

.recurring-header.recurring-header {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.recurring-header.recurring-header h1 {
    margin: 0;
    font-size: clamp(1.55rem, 2vw, 2rem);
    letter-spacing: -.035em;
}

.recurring-header .panel-header-actions .btn,
.recurring-pending-banner .btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.recurring-toolbar.recurring-toolbar {
    position: relative;
    z-index: 80;
    overflow: visible;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.recurring-toolbar__row {
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(320px, 1.55fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
}

.recurring-competency-control {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-raised);
}

.recurring-month-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-strong);
    cursor: pointer;
}

.recurring-month-nav:hover {
    color: var(--brand);
}

.recurring-month-nav .app-icon {
    width: 1rem;
    height: 1rem;
}

.recurring-competency-control.recurring-competency-control .dashboard-competency-picker,
.recurring-competency-control.recurring-competency-control .dashboard-competency-picker__field,
.recurring-competency-control.recurring-competency-control .accounts-competency-box {
    width: 100%;
}

.recurring-competency-control.recurring-competency-control .accounts-competency-box__trigger {
    width: 100%;
    min-height: 2.45rem;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.recurring-competency-control.recurring-competency-control .accounts-competency-box__trigger .app-icon:last-child {
    display: none;
}

.recurring-search,
.recurring-search.recurring-search .listview-search {
    width: 100%;
    min-width: 0;
}

.recurring-quick-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
}

.recurring-quick-filter {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2rem;
    padding: .35rem .75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--muted);
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.recurring-quick-filter span {
    width: .38rem;
    height: .38rem;
    border-radius: 999px;
    background: currentColor;
}

.recurring-quick-filter--active {
    color: var(--positive);
    background: color-mix(in srgb, var(--positive) 7%, var(--surface-raised));
}

.recurring-quick-filter--pending {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 7%, var(--surface-raised));
}

.recurring-quick-filter--generated {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 7%, var(--surface-raised));
}

.recurring-quick-filter--adjusted {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 7%, var(--surface-raised));
}

.recurring-quick-filter--selected {
    border-color: currentColor;
    box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 12%, transparent);
}

.kpi-grid.recurring-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-grid.recurring-kpi-grid .kpi-card {
    min-height: 86px;
    padding: .85rem 1rem;
    border-radius: 14px;
}

.kpi-grid.recurring-kpi-grid .kpi-card__head {
    padding-right: 0;
}

.kpi-grid.recurring-kpi-grid .kpi-card > strong {
    margin: .18rem 0 .08rem 3rem;
    font-size: 1.35rem;
}

.kpi-grid.recurring-kpi-grid .kpi-card > small {
    margin-left: 3rem;
}

.recurring-tabs {
    display: flex;
    align-items: flex-end;
    gap: .2rem;
    min-width: 0;
    border-bottom: 1px solid var(--line);
}

.recurring-tab {
    position: relative;
    padding: .65rem 1.15rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
}

.recurring-tab--active {
    color: var(--brand);
}

.recurring-tab--active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--brand);
    content: "";
}

.recurring-pending-banner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .85rem;
    padding: .75rem 1rem;
    border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--warning) 6%, var(--panel));
}

.recurring-pending-banner__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    background: color-mix(in srgb, var(--warning) 13%, transparent);
    color: var(--warning);
}

.recurring-pending-banner strong,
.recurring-pending-banner small {
    display: block;
}

.recurring-pending-banner small {
    margin-top: .16rem;
    color: var(--muted);
    font-size: .75rem;
}

.recurring-pending-banner__action {
    text-align: center;
}

.recurring-list-panel.recurring-list-panel,
.recurring-audit-panel.recurring-audit-panel {
    border-radius: 14px;
}

.recurring-list-panel .listview-panel__content {
    padding: 0;
}

.recurring-rules-table.recurring-rules-table th,
.recurring-rules-table.recurring-rules-table td,
.recurring-audit-table.recurring-audit-table th,
.recurring-audit-table.recurring-audit-table td {
    padding-block: .7rem;
    font-size: .8rem;
}

.recurring-entity-cell,
.recurring-audit-heading {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.recurring-entity-icon,
.recurring-audit-heading > span {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
}

.recurring-entity-icon .app-icon,
.recurring-audit-heading .app-icon {
    width: 1rem;
    height: 1rem;
}

.recurring-entity-icon--brand,
.recurring-audit-heading > span {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.recurring-entity-icon--positive {
    color: var(--positive);
    background: color-mix(in srgb, var(--positive) 12%, transparent);
}

.recurring-entity-icon--warning {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.recurring-entity-icon--negative {
    color: var(--negative);
    background: color-mix(in srgb, var(--negative) 12%, transparent);
}

.recurring-entity-icon--purple {
    color: #7c3aed;
    background: color-mix(in srgb, #7c3aed 12%, transparent);
}

.recurring-entity-icon--neutral {
    color: var(--muted);
    background: var(--surface-soft);
}

.recurring-rules-table.recurring-rules-table .status-badge,
.recurring-audit-table.recurring-audit-table .status-badge {
    padding: .2rem .55rem;
    font-size: .7rem;
}

.recurring-rules-table.recurring-rules-table .row-actions-menu__trigger {
    border-radius: 8px;
}

.recurring-audit-panel .listview-panel__header {
    padding-bottom: .25rem;
}

.recurring-audit-heading h2 {
    font-size: 1rem;
}

.recurring-audit-heading p {
    margin-top: .15rem;
    font-size: .75rem;
}

.recurring-audit-panel .listview-panel__header .btn .app-icon {
    width: .85rem;
    height: .85rem;
}

.recurring-income-summary__title {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--text-strong);
    font-weight: 700;
}

.recurring-income-summary__title .app-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--brand-2);
}

.recurring-income-more {
    border-top: 1px solid var(--line);
    padding-top: .85rem;
}

.recurring-income-more summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    color: var(--text-strong);
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    list-style: none;
}

.recurring-income-more summary::-webkit-details-marker {
    display: none;
}

.recurring-income-more summary .app-icon {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
    transition: transform .18s ease;
}

.recurring-income-more[open] summary .app-icon {
    transform: rotate(180deg);
}

.recurring-income-more__content {
    display: grid;
    gap: .8rem;
    margin-top: .85rem;
}

/* Ajustes próprios do modal de despesa; estrutura, campos, botões e cartões
   continuam usando o layout compartilhado de formulários em seções. */
.recurring-expense-modal {
    align-items: start;
}

.recurring-expense-summary {
    grid-template-rows: auto auto;
    gap: 1rem;
    overflow: visible;
}

.recurring-expense-summary-card,
.recurring-expense-more {
    border: 1px solid var(--line);
}

.recurring-expense-summary .recurring-income-summary__title {
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--line);
}

.recurring-expense-summary dl {
    gap: .65rem;
}

.recurring-expense-summary dl > div {
    display: grid;
    justify-content: stretch;
    gap: .12rem;
    padding: 0;
    border: 0;
}

.recurring-expense-summary dt {
    font-size: .72rem;
    font-weight: 600;
}

.recurring-expense-summary dd {
    text-align: left;
}

.recurring-expense-summary__amount {
    color: var(--brand-2) !important;
    font-size: 1.15rem;
}

.recurring-expense-payment-hint {
    padding: .65rem .8rem;
    border: 1px solid color-mix(in srgb, var(--brand-2) 28%, var(--line));
    border-radius: 9px;
    background: color-mix(in srgb, var(--brand-2) 7%, var(--surface-raised));
}

.recurring-expense-period-grid {
    align-items: start;
}

.recurring-expense-period-end {
    display: grid;
    gap: .75rem;
    align-content: start;
}

.recurring-expense-end-toggle {
    margin: .15rem 0 0;
}

.recurring-expense-end-competency.is-disabled {
    opacity: .55;
}

.recurring-expense-period-note {
    margin: -.15rem 0 0;
    color: var(--muted);
    font-size: .72rem;
}

.recurring-expense-more {
    align-self: start;
}

.recurring-expense-notes textarea {
    min-height: 88px;
    resize: vertical;
}

.recurring-expense-notes small {
    display: block;
    margin-top: .25rem;
    color: var(--muted);
    font-size: .68rem;
    text-align: right;
}

@media (max-width: 1100px) {
    .recurring-toolbar__row {
        grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr);
    }

    .recurring-quick-filters {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .kpi-grid.recurring-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .recurring-header.recurring-header {
        align-items: flex-start;
    }

    .recurring-header .panel-header-actions {
        width: 100%;
    }

    .recurring-header .panel-header-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .recurring-toolbar__row {
        grid-template-columns: 1fr;
    }

    .recurring-quick-filters {
        grid-column: auto;
        overflow-x: auto;
    }

    .kpi-grid.recurring-kpi-grid {
        grid-template-columns: 1fr;
    }

    .recurring-tabs {
        overflow-x: auto;
    }

    .recurring-tab {
        flex: 0 0 auto;
    }

    .recurring-pending-banner {
        grid-template-columns: auto 1fr;
    }

    .recurring-pending-banner__action {
        grid-column: 1 / -1;
    }

    .recurring-pending-banner__action .btn {
        width: 100%;
        justify-content: center;
    }

    .recurring-audit-panel .listview-panel__header {
        align-items: stretch;
        flex-direction: column;
    }

}
