:root {
    --app-primary: #08162f;
    --app-primary-dark: #08162f;
    --app-primary-light: #f5f7fb;

    --app-success: #15803d;
    --app-warning: #b45309;
    --app-danger: #b91c1c;

    --app-background: #f5f7fb;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-border: #e5e7eb;

    --app-text: #000000;
    --app-text-muted: #000000;

    --app-radius: 0.875rem;
    --app-radius-large: 1.25rem;

    --app-sidebar-width: 16.5rem;
    --app-layout-space: 1.5rem;

    --app-shadow:
        0 0.25rem 1.25rem rgb(15 23 42 / 6%);
}

/* Base. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;

    background-color: var(--app-background);
    color: var(--app-text);

    font-family: 'Montserrat', sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--app-primary);
}

a:hover {
    color: var(--app-primary-dark);
}

.min-w-0 {
    min-width: 0;
}

.bi {
    line-height: 1;
}

/* Estrutura e espaçamento externo. */
.app-shell {
    display: flex;
    align-items: flex-start;
    gap: var(--app-layout-space);

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--app-layout-space);
}

.app-content {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.app-content > .container.app-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Marca. */
.app-brand,
.app-sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;

    min-width: 0;

    color: var(--app-text);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.app-brand:hover,
.app-sidebar-brand:hover {
    color: var(--app-text);
}

.app-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;

    background-color: var(--app-primary);
    color: #ffffff;

    font-size: 1rem;
    font-weight: 700;
}

/* Menu lateral. */
.app-sidebar {
    --bs-offcanvas-width: var(--app-sidebar-width);
    --bs-offcanvas-bg: var(--app-surface);

    color: var(--app-text);
}

.app-sidebar-body {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 100%;
    padding: 1.25rem;
}

.app-sidebar-identity {
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    margin-bottom: 2rem;
}

.app-sidebar-brand {
    margin: 0;
    padding: 0;
}

.app-sidebar-navigation {
    width: 100%;
}

.app-sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    min-width: 0;
    min-height: 2.875rem;
    padding: 0.7rem 0.75rem;

    border: 1px solid transparent;
    border-radius: 0.75rem;

    color: var(--app-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.app-sidebar-link:hover {
    background-color: var(--app-surface-soft);
    border-color: var(--app-border);
    color: var(--app-text);
}

.app-sidebar-link.active {
    background-color: var(--app-primary-light);
    border-color: #dbeafe;
    color: var(--app-primary);
}

.app-sidebar-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 1.5rem;
    height: 1.5rem;
}

/* Usuário no menu. */
.app-sidebar-user {
    margin-top: auto;
    padding-top: 2rem;
}

.app-sidebar-user-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    padding: 0.875rem;

    border: 1px solid var(--app-border);
    border-radius: 0.875rem 0.875rem 0 0;

    background-color: var(--app-surface-soft);
}

.app-sidebar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;

    background-color: var(--app-primary);
    color: #ffffff;

    font-size: 0.9rem;
    font-weight: 700;
}

.app-sidebar-user-name {
    margin: 0;
    color: var(--app-text);
    font-size: 0.875rem;
    font-weight: 700;
}

.app-sidebar-user-caption {
    margin: 0.2rem 0 0;
    color: var(--app-text-muted);
    font-size: 0.72rem;
}

.app-sidebar-user-actions {
    overflow: hidden;

    border: 1px solid var(--app-border);
    border-top: 0;
    border-radius: 0 0 0.875rem 0.875rem;

    background-color: var(--app-surface);
}

.app-sidebar-user-link {
    display: block;

    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 0;

    background-color: transparent;
    color: var(--app-text-muted);

    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;

    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.app-sidebar-user-link + .app-sidebar-user-link,
.app-sidebar-user-actions form {
    border-top: 1px solid var(--app-border);
}

.app-sidebar-user-link:hover {
    background-color: var(--app-surface-soft);
    color: var(--app-primary);
}

.app-sidebar-logout {
    cursor: pointer;
}

.app-sidebar-logout:hover {
    color: var(--app-danger);
}

/* Cabeçalho mobile. */
.app-mobile-header {
    position: sticky;
    top: 0;
    z-index: 1020;

    display: flex;
    align-items: center;
    gap: 0.875rem;

    min-height: 4.25rem;
    padding: 0.75rem 1rem;

    border-bottom: 1px solid var(--app-border);
    background-color: rgb(255 255 255 / 96%);

    backdrop-filter: blur(0.75rem);
}

/* Área externa de login e cadastro. */
.container.app-auth {
    display: flex;
    align-items: center;

    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;

    margin: 0;
    padding: 2rem;
}

/* Botões gerais: permanecem com o padrão do sistema. */
.btn {
    border-radius: 0.625rem;
    font-weight: 600;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-dark);
    --bs-btn-hover-border-color: var(--app-primary-dark);
    --bs-btn-active-bg: var(--app-primary-dark);
    --bs-btn-active-border-color: var(--app-primary-dark);
}

/* Campos. */
.form-label {
    margin-bottom: 0.45rem;
    color: var(--app-text);
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 2.75rem;
    border-color: var(--app-border);
    border-radius: 0.625rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #93b4f5;
    box-shadow: 0 0 0 0.25rem rgb(37 99 235 / 14%);
}

.form-text {
    margin-top: 0.45rem;
    color: var(--app-text-muted);
    line-height: 1.5;
}

textarea.form-control {
    min-height: 7rem;
    resize: vertical;
}

/* Elementos básicos compartilhados. */
.app-text-muted {
    color: var(--app-text-muted);
}

.alert {
    border: 0;
    border-radius: 0.75rem;
}

.app-card {
    min-width: 0;

    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);

    background-color: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.app-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--app-border);
}

.app-card-body {
    padding: 1.5rem;
}

.app-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

/* Estados sem registros. */
.app-empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.app-empty-state-title {
    margin: 0 0 0.65rem;

    color: var(--app-text);
    font-size: 1rem;
    font-weight: 700;
}

.app-empty-state-text {
    max-width: 28rem;
    margin: 0 auto;

    color: var(--app-text-muted);
    font-size: 0.85rem;
    line-height: 1.65;
}

/* Banners compartilhados. */
.app-page-banner {
    position: relative;
    isolation: isolate;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;

    width: 100%;
    min-width: 0;
    min-height: 5rem;
    margin-bottom: 1.5rem;
    padding: 2rem;

    border-radius: var(--app-radius-large);

    background:
        radial-gradient(
            circle at 100% 0%,
            rgb(255 255 255 / 7%) 0 8rem,
            transparent 8.1rem
        ),
        radial-gradient(
            circle at 72% 115%,
            rgb(255 255 255 / 6%) 0 7rem,
            transparent 7.1rem
        ),
        linear-gradient(
            135deg,
            #172554,
            var(--app-primary-dark) 55%,
            #3b82f6
        );

    color: #ffffff;
    box-shadow: 0 1rem 2.5rem rgb(15 23 42 / 10%);
}

.app-page-banner-content {
    position: relative;
    z-index: 1;

    min-width: 0;
    max-width: 48rem;
}

.app-page-banner-eyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;

    margin-bottom: 0.75rem;

    color: inherit;
    opacity: 0.8;

    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-page-banner-eyebrow span + span::before {
    margin-right: 0.5rem;
    content: "•";
}

.app-page-banner-title {
    margin: 0;
    color: inherit;

    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.app-page-banner-description {
    max-width: 42rem;
    margin: 0.75rem 0 0;

    color: inherit;
    opacity: 0.85;

    font-size: 0.95rem;
    line-height: 1.65;
}

/* Cor do banner conforme o perfil ativo. */
.app-has-profile-theme .app-page-banner {
    background:
        radial-gradient(
            circle at 100% 0%,
            color-mix(
                in srgb,
                var(--app-profile-banner-text) 7%,
                transparent
            ) 0 8rem,
            transparent 8.1rem
        ),
        radial-gradient(
            circle at 72% 115%,
            color-mix(
                in srgb,
                var(--app-profile-banner-text) 6%,
                transparent
            ) 0 7rem,
            transparent 7.1rem
        ),
        var(--app-profile-banner-bg);

    color: var(--app-profile-banner-text);
}

/*
 * Compatibilidade com páginas cujas ações
 * ainda não foram movidas para fora do banner.
 */
.app-page-banner-actions {
    position: relative;
    z-index: 10;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;

    max-width: 100%;
}

.app-page-banner-actions > div {
    max-width: 100%;
}

.app-page-banner-actions form {
    margin: 0;
}

.app-page-banner .btn-light {
    color: var(--app-primary-dark);
}

.app-page-banner .dropdown-menu {
    z-index: 20;
    padding: 0.5rem 0;

    border-color: var(--app-border);
    border-radius: 0.875rem;
}

.app-page-banner .dropdown-item,
.app-page-banner .dropdown-item-text {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
}

.app-page-banner .dropdown-header {
    font-size: 0.75rem;
}

/* Faixa de ações abaixo do banner. */
.app-page-toolbar {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;

    width: 100%;
    min-width: 0;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;

    border: 1px solid var(--app-border);
    border-radius: 1rem;

    background-color: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--app-shadow);
}

.app-page-banner + .app-page-toolbar {
    margin-top: -0.5rem;
}

.app-page-toolbar-caption {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    min-width: 0;
}

.app-page-toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 2.5rem;
    height: 2.5rem;

    border-radius: 0.75rem;

    background-color: var(--app-primary-light);
    color: var(--app-primary);
}

.app-page-toolbar-caption strong {
    display: block;

    font-size: 0.875rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.app-page-toolbar-caption small {
    display: block;
    margin-top: 0.2rem;

    color: var(--app-text-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.app-page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;

    min-width: 0;
    max-width: 100%;
    margin-left: auto;
}

.app-page-actions form {
    margin: 0;
}

/* Botões da faixa de ações. */
.app-banner-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;

    min-height: 2.875rem;
    max-width: 100%;
    padding: 0.75rem 1rem;

    border: 1px solid var(--app-border);
    border-radius: 0.75rem;

    background-color: #f5f7fb;
    color: #08162f;

    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.app-banner-action:hover,
.app-banner-action:active {
    border-color: #cbd5e1;
    background-color: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

.app-banner-action:focus-visible {
    outline: 3px solid #93b4f5;
    outline-offset: 3px;
}

.app-banner-action .bi {
    flex: 0 0 auto;
    font-size: 1rem;
}

.app-banner-action.is-primary {
    --app-action-background: var(--app-primary);
    --app-action-text: #ffffff;
    --app-action-hover: var(--app-primary-dark);

    border-color: transparent;
    background-color: var(--app-action-background);
    color: var(--app-action-text);
}

.app-banner-action.is-primary:hover,
.app-banner-action.is-primary:active {
    border-color: transparent;
    background-color: var(--app-action-hover);
    color: var(--app-action-text);
}


/* Apenas a ação principal recebe a cor do perfil. */
.app-has-profile-theme .app-banner-action.is-primary {
    --app-action-background: var(--app-profile-banner-bg);
    --app-action-text: var(--app-profile-banner-text);

    --app-action-hover: color-mix(
        in srgb,
        var(--app-profile-banner-bg) 92%,
        var(--app-profile-banner-text) 8%
    );
}

/* Dropdown de perfis na faixa de ações. */
.app-page-actions .dropdown {
    min-width: 0;
    max-width: 100%;
}

.app-page-actions .dropdown-menu {
    min-width: 15rem;
    max-width: calc(100vw - 3rem);
    padding: 0.5rem;

    border-color: var(--app-border);
    border-radius: 0.875rem;
    box-shadow: var(--app-shadow);
}

.app-page-actions .dropdown-item {
    padding: 0.75rem;
    border-radius: 0.625rem;

    font-size: 0.85rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Resumos financeiros compartilhados. */
.app-financial-overview {
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;

    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-large);

    background-color: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.app-financial-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;

    margin: 0;
    padding: 1.25rem 1.5rem;

    border-bottom: 1px solid var(--app-border);
}

.app-financial-overview-header h2,
.app-financial-overview-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.app-financial-overview > .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;

    margin: 0;
    padding: 1rem;
}

.app-financial-overview > .row > * {
    min-width: 0;
}

.app-financial-summary {
    height: 100%;
    min-width: 0;
    overflow: hidden;

    border: 0;
    border-radius: 0.875rem;

    background-color: var(--app-surface);
    box-shadow: 0 0.25rem 1rem rgb(15 23 42 / 7%);
}

.app-financial-summary-header {
    padding: 1rem 1rem 0.25rem;
}

.app-financial-summary-title {
    margin: 0;
    color: var(--app-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.app-financial-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;

    padding: 1rem;
}

.app-financial-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;

    min-width: 0;
    min-height: 4rem;
    padding: 0.75rem;

    border-radius: 0.875rem;
}

.app-financial-summary-result {
    grid-column: auto;
}

.app-financial-summary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    min-width: 0;

    color: var(--app-text);
    font-size: 0.78rem;
    font-weight: 700;
}

.app-financial-summary-label > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-financial-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 2rem;
    height: 2rem;

    border-radius: 50%;
    background-color: rgb(255 255 255 / 64%);
}

.app-financial-summary-icon svg {
    flex: 0 0 auto;
}

.app-financial-summary-value {
    min-width: 0;
    color: inherit;

    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: right;
    overflow-wrap: anywhere;
}

.app-financial-summary-result .app-financial-summary-value {
    font-size: 0.95rem;
}

/* Desktop. */
@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: var(--app-layout-space);

        flex: 0 0 var(--app-sidebar-width);

        width: var(--app-sidebar-width);
        height: calc(100vh - var(--app-layout-space) * 2);
        height: calc(100dvh - var(--app-layout-space) * 2);

        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-large);

        background-color: var(--app-surface) !important;
        box-shadow: var(--app-shadow);
    }

    .app-sidebar .app-sidebar-body {
        height: 100%;
        padding: 1.5rem;
        overflow-y: auto;
    }
}

/* Compatibilidade durante a adaptação dos banners. */
@media (max-width: 1399.98px) {
    .app-page-banner {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.5rem;
    }

    .app-page-banner-actions {
        align-items: flex-start !important;
    }
}

/* Tablet e celular. */
@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        padding: 0;
    }

    .app-content > .container.app-main {
        padding: 1.25rem;
    }

    .app-sidebar {
        height: 100vh;
        height: 100dvh;

        overflow: hidden;
    }

    .app-sidebar > .offcanvas-header {
        flex-shrink: 0;
    }

    .app-sidebar .app-sidebar-body {
        flex: 1 1 auto;

        min-height: 0;

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior-y: contain;

        padding-bottom:
            calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    .app-sidebar-body > * {
        flex-shrink: 0;
    }
}

@media (max-width: 767.98px) {
    .app-page-banner {
        min-height: auto;
        padding: 1.5rem;
    }

    .app-page-banner-title {
        font-size: 1.75rem;
    }

    .app-page-banner-description {
        font-size: 0.875rem;
    }

    .app-page-banner-eyebrow {
        font-size: 0.65rem;
    }

    .app-page-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .app-page-actions {
        width: 100%;
        margin-left: 0;
    }

    .app-page-actions > * {
        flex: 1 1 auto;
    }

    .app-page-actions .dropdown > button,
    .app-page-actions form > .app-banner-action {
        width: 100%;
    }

    .app-financial-overview-header {
        padding: 1.25rem;
    }

    .app-financial-overview > .row {
        padding: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .container.app-auth {
        padding: 1rem;
    }

    .app-content > .container.app-main {
        padding: 1rem;
    }

    .app-card-header,
    .app-card-body {
        padding: 1.25rem;
    }

    .app-page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .app-page-actions > *,
    .app-page-actions .app-banner-action {
        width: 100%;
    }

    .app-page-banner-actions {
        width: 100%;
    }

    .app-page-banner-actions > .app-banner-action {
        width: 100%;
    }
}

/* Cards financeiros individuais. */
.app-financial-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;

    width: 100%;
    max-width: 100%;
}

.app-financial-entity-card {
    --app-entity-color: var(--app-primary);

    display: flex;
    flex-direction: column;

    min-width: 0;
    max-width: 100%;
    padding: 1.35rem;
    overflow: hidden;

    border: 2px solid var(--app-entity-color);
    border-radius: 1.25rem;

    background-color: var(--app-surface);
    box-shadow: 0 0.75rem 2.5rem rgb(15 23 42 / 8%);
}

.app-financial-entity-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    min-width: 0;
    margin-bottom: 1.5rem;
}

.app-financial-entity-heading {
    min-width: 0;
}

.app-financial-entity-heading h2 {
    margin: 0;
    overflow-wrap: anywhere;

    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 700;
}

.app-financial-entity-heading p {
    margin: 0.25rem 0 0;
    overflow-wrap: anywhere;

    color: var(--app-text-muted);
    font-size: 0.825rem;
}

.app-financial-entity-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
}

.app-financial-entity-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 2.35rem;
    height: 2.35rem;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background-color: var(--app-background);
    color: var(--app-text-muted);
    text-decoration: none;

    transition:
        color 160ms ease,
        background-color 160ms ease,
        transform 160ms ease;
}

.app-financial-entity-action:hover {
    background-color: color-mix(
        in srgb,
        var(--app-entity-color) 12%,
        var(--app-surface)
    );

    color: var(--app-entity-color);
    transform: translateY(-1px);
}

.app-financial-entity-action.is-primary {
    background-color: var(--app-entity-color);
    color: #ffffff;
}

.app-financial-entity-action.is-primary:hover {
    background-color: color-mix(
        in srgb,
        var(--app-entity-color) 86%,
        #000000
    );

    color: #ffffff;
}

.app-financial-entity-action:focus-visible {
    outline: 2px solid var(--app-entity-color);
    outline-offset: 3px;
}

.app-financial-entity-action .bi {
    font-size: 1.1rem;
}

.app-financial-entity-content {
    display: grid;
    grid-template-columns:
        minmax(9.5rem, 0.85fr)
        minmax(0, 1.15fr);
    align-items: center;
    gap: 1.5rem;

    min-width: 0;
}

/* Gráfico circular. */
.app-financial-donut-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;

    min-width: 0;
}

.app-financial-donut {
    --app-financial-used-angle: 0deg;

    position: relative;

    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 9.75rem;
    height: 9.75rem;
    border-radius: 50%;

    background: conic-gradient(
        from -90deg,
        var(--app-danger)
            0deg
            var(--app-financial-used-angle),
        #bbf7d0
            var(--app-financial-used-angle)
            360deg
    );
}

.app-financial-donut.is-empty {
    background: var(--app-border);
}

.app-financial-donut.is-exceeded {
    background: var(--app-danger);
}

.app-financial-donut::before {
    position: absolute;

    width: 7.85rem;
    height: 7.85rem;
    border-radius: 50%;

    background-color: var(--app-surface);
    content: "";
}

.app-financial-donut-center {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    max-width: 7rem;
    text-align: center;
}

.app-financial-donut-center small {
    margin-bottom: 0.15rem;

    color: var(--app-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.app-financial-donut-center strong {
    max-width: 100%;
    overflow: hidden;

    color: var(--app-text);
    font-size: 1.05rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-financial-donut-center.is-exceeded small,
.app-financial-donut-center.is-exceeded strong {
    color: var(--app-danger);
}

.app-financial-donut-percentage {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    max-width: 100%;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;

    background-color: var(--app-background);
    color: var(--app-text-muted);

    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.app-financial-donut-percentage.is-exceeded {
    background-color: #fef2f2;
    color: var(--app-danger);
}

/* Valores de entrada e saída. */
.app-financial-entity-values {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    min-width: 0;
}

.app-financial-entity-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;

    min-width: 0;
    padding: 0.9rem 1rem;
    overflow: hidden;

    border-radius: 0.9rem;
}

.app-financial-entity-value.is-entry {
    background-color: #ecfdf3;
}

.app-financial-entity-value.is-exit {
    background-color: #fef2f2;
}

.app-financial-entity-value-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;

    min-width: 0;
}

.app-financial-entity-value-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
}

.app-financial-entity-value.is-entry
.app-financial-entity-value-icon {
    background-color: rgb(22 163 74 / 12%);
    color: var(--app-success);
}

.app-financial-entity-value.is-exit
.app-financial-entity-value-icon {
    background-color: rgb(185 28 28 / 12%);
    color: var(--app-danger);
}

.app-financial-entity-value-label span:last-child {
    overflow: hidden;

    color: var(--app-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-financial-entity-value strong {
    flex: 0 1 auto;

    min-width: 0;
    max-width: 58%;
    overflow: hidden;

    color: var(--app-text);
    font-size: 0.9rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Variação das metas. */
.app-financial-donut.is-progress {
    background: conic-gradient(
        from -90deg,
        var(--app-entity-color)
            0deg
            var(--app-financial-used-angle),
        color-mix(
            in srgb,
            var(--app-entity-color) 18%,
            var(--app-surface)
        )
            var(--app-financial-used-angle)
            360deg
    );
}

.app-financial-donut.is-progress.is-empty {
    background: var(--app-border);
}

.app-financial-donut.is-progress.is-completed {
    background: var(--app-entity-color);
}

.app-financial-donut-center.is-completed small,
.app-financial-donut-center.is-completed strong {
    color: var(--app-entity-color);
}

.app-financial-donut-percentage.is-completed {
    background-color: color-mix(
        in srgb,
        var(--app-entity-color) 12%,
        var(--app-surface)
    );

    color: var(--app-entity-color);
}

.app-financial-entity-value.is-progress {
    background-color: color-mix(
        in srgb,
        var(--app-entity-color) 10%,
        var(--app-surface)
    );
}

.app-financial-entity-value.is-progress
.app-financial-entity-value-icon {
    background-color: color-mix(
        in srgb,
        var(--app-entity-color) 16%,
        var(--app-surface)
    );

    color: var(--app-entity-color);
}

/* Responsividade exclusiva dos cards. */
@media (max-width: 1199.98px) {
    .app-financial-cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .app-financial-entity-card {
        padding: 1.15rem;
    }

    .app-financial-entity-header {
        gap: 0.75rem;
    }

    .app-financial-entity-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .app-financial-entity-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-financial-entity-values {
        width: 100%;
    }

    .app-financial-donut {
        width: 10rem;
        height: 10rem;
    }

    .app-financial-donut::before {
        width: 8rem;
        height: 8rem;
    }
}

@media (max-width: 359.98px) {
    .app-financial-entity-header {
        flex-direction: column;
    }

    .app-financial-entity-actions {
        justify-content: flex-start;
    }
}

/* Resumo de um único módulo: indicadores lado a lado. */
/* Resumo individual: acompanha a quantidade de indicadores. */
.app-financial-overview-single
.app-financial-summary-grid {
    grid-template-columns:
        repeat(
            var(--app-summary-columns, 3),
            minmax(0, 1fr)
        );
}

/* Referência do ciclo no cabeçalho. */
.app-financial-overview-reference {
    margin: 0;

    color: var(--app-text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* No celular, indicadores empilhados. */
@media (max-width: 767.98px) {
    .app-financial-overview-single
    .app-financial-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/*
 * Confirmação de exclusão.
 */
#modal-confirmacao .modal-dialog {
    width: calc(100% - 2rem);
    max-width: 32rem;

    margin-right: auto;
    margin-left: auto;
}

#modal-confirmacao .modal-content {
    overflow: hidden;

    border: 1px solid var(--app-border, #e5e7eb) !important;
    border-radius: 1.25rem !important;

    background-color: var(--app-surface, #fff);
    color: var(--app-text, #1f2937);

    box-shadow:
        0 1rem 3rem rgb(15 23 42 / 12%) !important;
}

/*
 * Identificação do que será excluído.
 */
#modal-confirmacao .modal-header {
    align-items: flex-start;
    gap: 1rem;

    padding: 1.5rem 1.5rem 1rem !important;
    border: 0;
}

#confirmacao-titulo {
    min-width: 0;
    margin: 0;

    color: var(--app-text, #1f2937);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

#modal-confirmacao .btn-close {
    flex-shrink: 0;

    margin: .2rem 0 0 !important;
    padding: .5rem;

    opacity: .5;
}

#modal-confirmacao .btn-close:hover {
    opacity: .85;
}

/*
 * Mensagem contextualizada.
 *
 * Fundo suave e texto escuro, sem um segundo aviso.
 */
#modal-confirmacao .modal-body {
    padding: 0 1.5rem 1.25rem !important;
}

#confirmacao-mensagem {
    margin: 0;
    padding: 1.125rem;

    border-radius: .875rem;
    background-color: var(--app-background, #f5f7fb);
    color: var(--app-text, #1f2937) !important;

    font-size: 1rem;
    font-weight: 450;
    line-height: 1.6 !important;
}

/*
 * Ações.
 */
#modal-confirmacao .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem !important;

    padding: 0 1.5rem 1.5rem !important;
    border: 0;
}

#modal-confirmacao .app-banner-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;

    min-height: 44px;
    margin: 0 !important;
    padding: .7rem 1rem;

    border: 1px solid transparent;
    border-radius: .75rem;

    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;

    transition:
        background-color .15s ease,
        color .15s ease,
        border-color .15s ease;
}

#modal-confirmacao .app-banner-action[data-bs-dismiss] {
    border-color: var(--app-border, #e5e7eb);
    background-color: var(--app-surface, #fff);
    color: var(--app-text, #1f2937);
}

#modal-confirmacao .app-banner-action[data-bs-dismiss]:hover {
    background-color: var(--app-background, #f5f7fb);
    border-color: #cbd5e1;
}

#confirmacao-confirmar {
    border-color: transparent !important;
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
}

#confirmacao-confirmar:hover:not(:disabled) {
    background-color: #b91c1c !important;
    color: #fff !important;
}

#confirmacao-confirmar:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/*
 * Foco visível.
 */
#modal-confirmacao .app-banner-action:focus-visible,
#modal-confirmacao .btn-close:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
    box-shadow: none;
}

/*
 * Mobile.
 */
@media (max-width: 575.98px) {
    #modal-confirmacao .modal-header {
        padding: 1.25rem 1.25rem .875rem !important;
    }

    #confirmacao-titulo {
        font-size: 1.05rem;
    }

    #modal-confirmacao .modal-body {
        padding: 0 1.25rem 1rem !important;
    }

    #confirmacao-mensagem {
        padding: 1rem;
        font-size: .875rem;
    }

    #modal-confirmacao .modal-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        padding: 0 1.25rem 1.25rem !important;
    }

    #modal-confirmacao .app-banner-action {
        width: 100%;
        padding: .7rem .5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #modal-confirmacao .app-banner-action {
        transition: none;
    }
}


/*
 * Botão de recolher e expandir o menu.
 */
.app-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 2rem;
    height: 2rem;
    padding: 0;

    border: 1px solid var(--app-border);
    border-radius: 0.625rem;

    background-color: var(--app-surface-soft);
    color: var(--app-text-muted);

    font-family: inherit;
    font-size: 1rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease;
}

.app-sidebar-toggle:hover {
    border-color: #cbd5e1;
    background-color: var(--app-primary-light);
    color: var(--app-primary);
}

.app-sidebar-toggle:focus-visible,
.app-sidebar-link:focus-visible,
.app-sidebar-user-link:focus-visible {
    outline: 3px solid #93b4f5;
    outline-offset: 2px;
}

/*
 * Ícones das ações do usuário.
 */
.app-sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.app-sidebar-user-link > .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 1.25rem;

    font-size: 1rem;
}

/*
 * Desktop: menu expandido.
 */
@media (min-width: 992px) {
    .app-sidebar-identity {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;

        margin-bottom: 1.5rem;
    }

    .app-sidebar-brand {
        flex: 1;
        min-width: 0;
    }

    .app-sidebar-brand-text {
        min-width: 0;

        font-size: 0.9375rem;
        line-height: 1.4;

        overflow-wrap: anywhere;
    }

    .app-sidebar .app-sidebar-body {
        overflow-x: hidden;
    }

    /*
     * A largura menor é herdada pelo menu.
     * O conteúdo ocupa automaticamente o espaço liberado.
     */
    html.app-sidebar-collapsed .app-shell {
        --app-sidebar-width: 5.5rem;
    }

    html.app-sidebar-collapsed
    .app-sidebar .app-sidebar-body {
        padding: 1.25rem 0.75rem;
    }

    html.app-sidebar-collapsed .app-sidebar-identity {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;

        margin-bottom: 1.25rem;
    }

    html.app-sidebar-collapsed .app-sidebar-brand {
        flex: 0 0 auto;
        justify-content: center;
    }

    html.app-sidebar-collapsed .app-sidebar-brand-text,
    html.app-sidebar-collapsed .app-sidebar-link-text,
    html.app-sidebar-collapsed .app-sidebar-user-details,
    html.app-sidebar-collapsed .app-sidebar-user-action-text {
        display: none;
    }

    /*
     * Navegação apenas com ícones.
     */
    html.app-sidebar-collapsed .app-sidebar-link {
        justify-content: center;
        gap: 0;

        min-height: 2.875rem;
        padding: 0.7rem 0;
    }

    html.app-sidebar-collapsed .app-sidebar-link-icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    /*
     * Usuário e ações no menu recolhido.
     */
    html.app-sidebar-collapsed .app-sidebar-user {
        padding-top: 1.25rem;
    }

    html.app-sidebar-collapsed .app-sidebar-user-header {
        justify-content: center;
        gap: 0;

        padding: 0.625rem 0.25rem;
    }

    html.app-sidebar-collapsed .app-sidebar-user-link {
        justify-content: center;
        gap: 0;

        min-height: 2.75rem;
        padding: 0.75rem 0;
    }

    html.app-sidebar-collapsed .app-sidebar-user-link > .bi {
        font-size: 1.125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar-toggle {
        transition: none;
    }
}




/* Logo completo: menu expandido. */
.app-brand-logo {
    display: block;
    flex-shrink: 0;

    width: 160px;
    height: 80px;

    object-fit: contain;
}

/* Logo curto: tamanho usado no menu recolhido. */
.app-sidebar-brand .app-brand-logo-curto {
    display: none;

    width: 120px;
    height: 60px;
}

/* Alternância dos logos no desktop. */
@media (min-width: 992px) {
    html.app-sidebar-collapsed
    .app-sidebar-brand .app-brand-logo-completo {
        display: none;
    }

    html.app-sidebar-collapsed
    .app-sidebar-brand .app-brand-logo-curto {
        display: block;
    }
}

/* Logo no celular: mantém o tamanho atual. */
@media (max-width: 991.98px) {
    .app-mobile-header .app-brand-logo {
        width: 80px;
        height: 40px;
    }
}

/* Data em formato de calendário. */
time.app-date-calendar {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 0.125rem;

    width: 2.25rem;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem;

    border: 1px solid var(--app-border, #e5e7eb);
    border-radius: 0.75rem;

    background-color: var(--app-background, #f5f7fb);

    text-align: center;
    font-variant-numeric: tabular-nums;
}

.app-date-calendar .app-date-calendar-day {
    color: var(--app-text, #1f2937);

    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.app-date-calendar .app-date-calendar-month {
    color: var(--app-text-muted, #6b7280);

    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* Calendário à esquerda das informações. */
.review-information-calendar {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    align-items: center;
    gap: 0.875rem;
}

.review-information-content {
    grid-column: 2;
    min-width: 0;
}

.review-information-calendar .app-date-calendar {
    grid-column: 1;
    grid-row: 1;
}

.review-information-calendar .review-information-content {
    grid-row: 1;
}

@media (max-width: 575.98px) {
    .review-information-calendar {
        gap: 0.625rem;
    }
}

/* Ações lado a lado no mobile. */
@media (max-width: 767.98px) {
    .app-page-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;

        width: 100%;
        min-width: 0;
    }

    .app-page-actions > .app-banner-action {
        flex: 1 1 calc(50% - 0.5rem);

        width: auto;
        min-width: 0;
        padding: 0.75rem 0.625rem;

        white-space: normal;
        overflow-wrap: anywhere;
    }
}