/* Finanças DG v2.3.0 */
:root {
    --brand: #0d6efd;
    --brand-dark: #0a58ca;
    --nav-hover: rgba(255, 255, 255, .12);
    --nav-active: rgba(255, 255, 255, .20);
    --nav-border: rgba(255, 255, 255, .16);
}

body {
    background: #f4f6f9;
    color: #2b2f36;
}

.card {
    border: none;
    border-radius: .7rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(16, 24, 40, .10);
    transition: box-shadow .2s ease;
}

/* Navbar horizontal compacta: ícone e texto na mesma linha */
.navbar,
.app-navbar {
    min-height: 64px;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand)) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .10);
}

.app-navbar .navbar-brand {
    flex: 0 0 auto;
    margin-right: 1rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.app-navbar .navbar-brand .bi {
    font-size: 1.25rem;
}

.app-nav-menu {
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.app-nav-menu .nav-link {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    min-height: 42px;
    padding: .55rem .58rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    color: rgba(255, 255, 255, .88);
    font-size: .86rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.app-nav-menu .nav-link:hover,
.app-nav-menu .nav-link:focus-visible {
    color: #fff;
    background: var(--nav-hover);
    border-color: var(--nav-border);
}

.app-nav-menu .nav-link.active {
    color: #fff;
    background: var(--nav-active);
    border-color: var(--nav-border);
    font-weight: 600;
}

.app-nav-menu .nav-link .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.05rem;
    width: 1.05rem;
    font-size: 1rem;
    line-height: 1;
}

.app-nav-menu .nav-label {
    display: inline-block;
    line-height: 1;
}

.app-nav-actions {
    flex: 0 0 auto;
    padding-left: .35rem;
    border-left: 1px solid var(--nav-border);
}

.nav-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: .4rem;
    color: #fff;
    text-decoration: none;
}

.nav-action:hover,
.nav-action:focus {
    color: #fff;
    background: var(--nav-hover);
}

.nav-action .badge {
    position: absolute;
    top: 1px;
    right: -1px;
    font-size: .62rem;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    max-width: 12rem;
    color: #fff;
    font-size: .86rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-user .bi {
    flex: 0 0 auto;
    font-size: 1.1rem;
}

.nav-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-logout {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.app-alert-menu {
    min-width: 19rem;
    max-width: min(24rem, 90vw);
}

.app-main {
    max-width: 1600px;
}

.app-footer {
    background: #fff;
}

.table > :not(caption) > * > * {
    padding: .65rem .8rem;
}

.badge {
    font-weight: 600;
}

.progress {
    border-radius: 999px;
    background: #e9edf3;
}

.stat-card {
    border-left: 4px solid var(--brand);
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-wrap {
    display: flex;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, #dbe7ff 0, transparent 55%),
        radial-gradient(1000px 500px at 110% 10%, #e6fff2 0, transparent 50%),
        #f4f6f9;
}

.auth-card {
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(13, 110, 253, .12);
}

.auth-logo {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), #4dabf7);
    color: #fff;
    font-size: 1.8rem;
}

.chip {
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.chip-danger { background: #fde8e8; color: #b42318; }
.chip-warning { background: #fff4e5; color: #b54708; }
.chip-success { background: #e7f6ec; color: #027a48; }

/* Desktop intermediário: mantém uma linha com rolagem horizontal discreta */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .app-navbar .navbar-collapse {
        min-width: 0;
    }

    .app-nav-menu {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }

    .app-nav-menu .nav-link {
        padding-inline: .48rem;
        font-size: .82rem;
    }
}

/* Menu recolhido em tablet/celular */
@media (max-width: 1199.98px) {
    .app-navbar .navbar-collapse {
        padding: .75rem 0 .35rem;
    }

    .app-nav-menu {
        align-items: stretch;
        gap: .2rem;
    }

    .app-nav-menu .nav-link {
        justify-content: flex-start;
        width: 100%;
        padding: .7rem .8rem;
    }

    .app-nav-actions {
        justify-content: flex-start;
        width: 100%;
        margin-top: .55rem;
        padding: .7rem 0 0;
        border-top: 1px solid var(--nav-border);
        border-left: 0;
    }
}

@media (max-width: 768px) {
    .btn { min-height: 40px; }
    .form-control,
    .form-select { min-height: 42px; }
    .nav-user { max-width: 9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .app-nav-menu .nav-link,
    .card {
        transition: none;
    }
}

/* ==========================================================
   Finanças DG v2.3.0-r2
   Menu em duas linhas no desktop, sem barra de rolagem
   ========================================================== */
@media (min-width: 1200px) {
    .app-navbar {
        min-height: 88px;
    }

    .app-navbar .container-fluid {
        align-items: flex-start;
        padding-top: .45rem;
        padding-bottom: .45rem;
    }

    .app-navbar .navbar-brand {
        align-self: center;
    }

    .app-navbar .navbar-collapse {
        display: flex !important;
        align-items: flex-start;
        min-width: 0;
    }

    .app-nav-menu {
        display: flex;
        flex: 1 1 auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: center;
        align-items: center;
        gap: .18rem .12rem;
        min-width: 0;
        max-height: 86px;
        overflow: visible;
        padding: 0;
        scrollbar-width: none;
    }

    .app-nav-menu::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .app-nav-menu .nav-item {
        flex: 0 0 auto;
    }

    .app-nav-menu .nav-link {
        min-height: 36px;
        padding: .45rem .56rem;
        font-size: .83rem;
    }

    .app-nav-actions {
        align-self: center;
        margin-left: .5rem;
    }
}

/* Em telas muito largas, mantém as duas linhas com espaçamento confortável. */
@media (min-width: 1600px) {
    .app-nav-menu {
        max-width: 1040px;
    }
}
