@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");



* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    --bg: #f5f7fa;
    --surface: #fff;
    --text: #202b3c;
    --muted: #7b8798;
    --line: #e7ebf1;
    --hover: #f0f4f9;
    --nav: #17263b;
    --nav2: #1d304a;
    min-height: 100vh;
    display: flex;
    background: var(--bg);
    color: var(--text);
    transition: background 0.2s;
}

.theme-dark {
    --bg: #101722;
    --surface: #172130;
    --text: #e8edf5;
    --muted: #9ba8bb;
    --line: #273447;
    --hover: #202d3e;
}



.sidebar-collapsed .sidebar {
    width: 76px;
    padding-inline: 10px;
}



.brand-symbol,
.login-brand-mark,
.boot-mark {
    height: 36px;
    width: 36px;
    border-radius: 11px;
    background: #2e5b91;
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -1px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px #ffffff20;
}





.brand-copy strong span {
    color: #7fb4ee;
}



.brand-copy small {
    font-size: 11px;
    color: #8496ae;
    margin-top: 3px;
}



.toggle-glyph {
    font-size: 22px;
    line-height: 1;
}



.nav-menu {
    flex: 1;
}



.mobile-nav-caption {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #a8bfdc;
    padding: 0 12px 10px;
    height: 20px;
    margin-top: 20px;
    margin-bottom: 5px;
}

.nav-item {
    width: 100%;
    height: 42px;
    border: 0;
    background: transparent;
    color: #aebbd0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    margin: 3px 0;
    transition: all 0.15s;
}

    .nav-item:hover {
        background: #ffffff0b;
        color: #fff;
    }

    .nav-item.active {
        background: #2c4b70;
        color: #fff;
        box-shadow: inset 3px 0 #72a9e6;
    }

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 23px;
    flex-shrink: 0;
    color: #91a9c7;
}

.nav-item.active .nav-icon {
    color: #9bc8fa;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
}



.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0;
}



.nav-subitem {
    border: 0;
    background: transparent;
    color: #91a2ba;
    text-align: left;
    padding: 9px 4px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 5px;
}

    .nav-subitem:hover {
        color: #fff;
    }

    .nav-subitem.selected {
        color: #fff;
        font-weight: 600;
        position: relative;
    }

        .nav-subitem.selected:before {
            content: "";
            position: absolute;
            left: -13px;
            top: 7px;
            bottom: 7px;
            width: 2px;
            border-radius: 2px;
            background: #78b2ed;
        }

.nav-coming {
    font-size: 10px;
    color: #6f829c;
    padding: 8px 0;
}



.theme-button {
    margin-bottom: 12px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    color: #d5deea;
}

.avatar,
.profile-button {
    background: #304a68;
    color: #cde4fb;
    border: 1px solid #48617d;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-mini div {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.user-mini strong {
    font-size: 11px;
    font-weight: 600;
}

.user-mini small {
    font-size: 10px;
    color: #8194ad;
    margin-top: 3px;
}

.sidebar-collapsed .user-mini {
    justify-content: center;
}

.main-area {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 66px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted);
}

.top-separator {
    padding: 0 10px;
    color: #b8c1ce;
}



.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 10px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #45b88b;
    border-radius: 50%;
}

.profile-button {
    margin-left: 10px;
    cursor: pointer;
}

.content-area {
    padding: 34px 38px;
    flex: 1;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    padding: 17px 38px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.eyebrow {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #668bb5;
}

.page-heading h1 {
    font-size: 25px;
    letter-spacing: -0.8px;
    margin: 9px 0 7px;
    font-weight: 700;
    color: var(--text);
}

.page-heading p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.pill {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 7px 11px;
    color: var(--muted);
    font-size: 10px;
    background: var(--surface);
}

.welcome-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 25px 27px;
    display: flex;
    gap: 19px;
    align-items: flex-start;
    box-shadow: 0 4px 18px #15243a05;
}

.welcome-icon {
    width: 42px;
    height: 42px;
    background: #eaf2fb;
    color: #386fa9;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 20px;
    flex-shrink: 0;
}

.welcome-card h2 {
    font-size: 16px;
    margin: 1px 0 8px;
    letter-spacing: -0.3px;
}

.welcome-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
    margin: 0 0 15px;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #234d7c;
    color: #fff;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
}

    .primary-link:hover {
        background: #2d6098;
    }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 29px 0 13px;
}

    .section-title h2 {
        font-size: 14px;
        margin: 0;
    }

    .section-title span {
        font-size: 10px;
        color: var(--muted);
    }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.feature-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 18px 17px;
    min-height: 165px;
    transition: transform 0.15s, border-color 0.15s;
}

    .feature-card:not(.muted):hover {
        transform: translateY(-2px);
        border-color: #b8cce2;
    }

.feature-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--hover);
    color: #8b9bb0;
    font-size: 16px;
}

    .feature-icon.blue {
        background: #eaf2fb;
        color: #467caf;
    }

.feature-card h3 {
    font-size: 14px;
    margin: 14px 0 7px;
}

.feature-card p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
    max-width: 220px;
}

.card-arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;
    color: #6b9ac8;
}

.coming-label {
    display: inline-block;
    margin-top: 13px;
    color: #9aa5b5;
    font-size: 9px;
    background: var(--hover);
    padding: 5px 7px;
    border-radius: 4px;
}

.placeholder-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 48px 24px;
    text-align: center;
    max-width: 680px;
    margin: 50px auto;
}

.placeholder-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #eaf2fb;
    color: #4d83b7;
    display: grid;
    place-items: center;
    font-size: 24px;
    margin: 0 auto 17px;
}

.placeholder-card h2 {
    font-size: 17px;
    margin: 0 0 10px;
}

.placeholder-card p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.8;
    max-width: 450px;
    margin: 0 auto 22px;
}

.login-shell {
    min-height: 100vh;
    background: #f5f7fa;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(400px, 1fr);
    position: relative;
    color: #253044;
}

.login-decoration {
    background: #17263b;
    color: white;
    padding: 12vh 10%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .login-decoration:after {
        content: "";
        position: absolute;
        width: 520px;
        height: 520px;
        border: 1px solid #ffffff0d;
        border-radius: 50%;
        right: -230px;
        bottom: -210px;
        box-shadow: 0 0 0 50px #ffffff04, 0 0 0 100px #ffffff03;
    }

.login-brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    font-size: 17px;
    margin-bottom: 26px;
}

.login-decoration h2 {
    font-size: 35px;
    letter-spacing: -1.5px;
    margin: 0;
}

    .login-decoration h2 span {
        color: #83b7ee;
    }

.login-decoration p {
    font-size: 15px;
    color: #b5c5d9;
    margin: 14px 0 26px;
}

.decor-line {
    height: 2px;
    width: 40px;
    background: #6199d3;
    margin-bottom: 24px;
}

.login-decoration small {
    font-size: 12px;
    color: #8398b4;
    max-width: 280px;
    line-height: 1.7;
}

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 30px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 36px;
    border: 1px solid #e7ebf1;
    border-radius: 14px;
    box-shadow: 0 15px 50px #14243a0b;
}

    .login-card-heading h1,
    .login-card h1 {
        font-size: 25px;
        letter-spacing: -0.8px;
        margin: 10px 0 8px;
        color: #202b3c;
    }

    .login-card-heading p,
    .login-card > p {
        font-size: 13px;
        color: #7b8798;
        margin: 0 0 28px;
    }

.field {
    margin-bottom: 17px;
}

    .field label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #39465a;
        margin-bottom: 8px;
    }

    .field input {
        width: 100%;
        height: 44px;
        border: 1px solid #dfe5ed;
        border-radius: 7px;
        padding: 0 12px;
        font-size: 12px;
        color: #263449;
        outline: none;
        background: #fff;
    }

        .field input:focus {
            border-color: #6b9dce;
            box-shadow: 0 0 0 3px #5a94ce16;
        }

        .field input::placeholder {
            color: #aab4c2;
        }

.password-wrap {
    position: relative;
}

    .password-wrap input {
        padding-right: 76px;
    }

.show-password {
    position: absolute;
    right: 9px;
    top: 0;
    height: 44px;
    border: 0;
    background: transparent;
    color: #477cae;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.captcha-placeholder {
    height: 66px;
    border: 1px solid #dfe5ed;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    margin: 22px 0;
    color: #536174;
    font-size: 11px;
}

.captcha-check {
    width: 20px;
    height: 20px;
    border: 1px solid #bdc8d6;
    border-radius: 3px;
    display: grid;
    place-items: center;
    color: #fff;
}

.captcha-placeholder small {
    display: block;
    color: #9aa5b4;
    font-size: 9px;
    margin-top: 4px;
}

.captcha-brand {
    margin-left: auto;
    color: #9ba9ba;
    font-size: 17px;
}

.login-submit {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 7px;
    background: #234d7c;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

    .login-submit:hover {
        background: #2d6098;
    }

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 19px;
}

    .login-links a {
        font-size: 10px;
        color: #477cae;
    }

        .login-links a:hover {
            text-decoration: underline;
        }

.login-note {
    text-align: center;
    border-top: 1px solid #edf0f4;
    margin-top: 25px;
    padding-top: 17px;
    color: #a0aab8;
    font-size: 9px;
}

.login-message {
    font-size: 11px;
    color: #8a5c22;
    background: #fff7e9;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.login-footer {
    position: absolute;
    bottom: 18px;
    right: 0;
    width: 50%;
    text-align: center;
    color: #a2adbb;
    font-size: 9px;
}

.boot-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #8290a3;
    font-size: 12px;
}

.boot-mark {
    width: 46px;
    height: 46px;
    font-size: 15px;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #fff4ce;
    padding: 12px 20px;
    color: #333;
    z-index: 1000;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-area {
        padding: 28px 25px;
    }

    .topbar {
        padding: 0 25px;
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: 68px;
        padding: 18px 8px;
    }

    .brand {
        padding: 0 7px 22px;
    }

    .brand-copy,
    .sidebar-toggle span:not(.toggle-glyph),
    .nav-label,
    .nav-chevron,
    .nav-caption,
    .user-mini div {
        display: none;
    }

    .sidebar-toggle {
        justify-content: center;
        padding: 0;
    }

    .nav-item {
        justify-content: center;
        padding: 0;
    }

    .nav-submenu {
        display: none;
    }

    .sidebar-expanded .sidebar {
        width: 68px;
    }

    .main-area {
        width: calc(100% - 68px);
    }

    .topbar {
        height: 56px;
        padding: 0 15px;
    }

    .top-actions > span:not(.status-dot) {
        display: none;
    }

    .content-area {
        padding: 25px 16px;
    }

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

    .page-heading h1 {
        font-size: 21px;
    }

    .app-footer {
        padding: 14px 16px;
    }

    .login-shell {
        display: block;
        padding: 25px 15px 55px;
    }

    .login-decoration {
        display: none;
    }

    .login-main {
        padding: 20px 0;
    }

    .login-card {
        padding: 27px 22px;
    }

    .login-footer {
        width: 100%;
        bottom: 17px;
    }
}


/* =========================================================
   IDENTIDADE VISUAL E AJUSTES FINAIS DA SIDEBAR
   ========================================================= */

/* Logotipo e marca */
.brand-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 9px 27px;
    min-height: 48px;
    width: 100%;
    min-height: 72px;
    align-items: center;
    gap: 15px;
    padding: 0 0 22px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    white-space: normal;
}

    .brand-copy strong {
        font-size: 16px;
        color: #fff;
        letter-spacing: -0.5px;
        font-size: 22px;
        line-height: 1.08;
        letter-spacing: -0.55px;
    }

    .brand-copy .brand-second {
        font-size: 13px;
        color: #9db9d8;
        margin-top: 2px;
        display: block;
        color: #fff;
        font-size: 17px;
        line-height: 1.1;
        margin-top: 2px;
        white-space: nowrap;
    }

        .brand-copy .brand-second span {
            color: #9db9d8;
            color: #3E8EBD;
            font-size: 28px;
            vertical-align: top;
            line-height: 1;
        }

/* Sidebar recolhida */
.sidebar-collapsed .brand {
    justify-content: center;
    width: 100%;
    padding: 0 0 22px;
}

.sidebar-collapsed .brand-logo {
    width: 51px;
    height: 51px;
}

/* Botão de recolher/expandir */
.sidebar-toggle {
    height: 35px;
    border: 1px solid #ffffff12;
    background: #ffffff08;
    color: #aebdd0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    margin: 0 2px 20px;
    cursor: pointer;
    font-size: 11px;
    width: 100%;
    height: 38px;
    display: flex;
    justify-content: flex-start;
    gap: 11px;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0 10px;
    margin-bottom: 0;
    color: #aebdd0;
}

    .sidebar-toggle:hover {
        background: transparent;
        color: #fff;
    }

.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
    padding: 0;
    justify-content: center;
    padding: 0;
}

/* Separadores e espaçamentos */
.sidebar-separator {
    height: 1px;
    /*background: #43536a;*/
    background: #ffffff30;
    margin: 15px 4px 0;
    flex-shrink: 0;
}

.toggle-separator {
    height: 1px;
    background: #52647c;
    margin: 17px 4px 21px;
}

.sidebar-collapsed .toggle-separator {
    margin-left: 2px;
    margin-right: 2px;
}

.sidebar-bottom {
    border-top: 1px solid #ffffff12;
    padding-top: 13px;
    margin-top: auto;
    border-top: 0;
    padding-top: 0;
}

    .sidebar-bottom .sidebar-separator {
        height: 1px;
        background: #52647c;
        margin: 12px 4px 15px;
    }

    .sidebar-bottom .theme-button {
        margin: 0;
    }

.nav-caption {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #a8bfdc;
    padding: 0 12px 10px;
    height: 20px;
    padding: 0 12px 12px;
    height: auto;
    min-height: 20px;
}

/* =========================================================
   SUBMENU FLUTUANTE - SIDEBAR RECOLHIDA
   ========================================================= */

.sidebar {
    width: 252px;
    background: var(--nav);
    color: #c5cfdd;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 22px 13px 14px;
    transition: width 0.2s;
    flex-shrink: 0;
    overflow: visible;
}

.nav-group {
    position: relative;
}



.nav-flyout-header {
    padding: 15px 16px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid #ffffff12;
}

.nav-flyout-items {
    display: flex;
    flex-direction: column;
    padding: 7px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.nav-flyout-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #b9c8da;
    text-align: left;
    padding: 10px 11px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .nav-flyout-item:hover {
        background: #ffffff0d;
        color: #fff;
    }

    .nav-flyout-item.selected {
        background: #2c4b70;
        color: #fff;
        font-weight: 600;
    }

@keyframes flyout-enter {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Camada transparente para fechar o flyout ao clicar fora */
.flyout-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 999;
}

/* O submenu fica acima da camada de fechamento */
.sidebar-collapsed .nav-flyout {
    position: absolute;
    left: calc(100% + 12px);
    top: 0;
    width: 230px;
    background: var(--nav2);
    border: 1px solid #344b68;
    border-radius: 10px;
    box-shadow: 0 12px 35px #00000035;
    z-index: 1000;
    overflow: hidden;
    animation: flyout-enter 0.15s ease-out;
    z-index: 1000;
}










.nav-tree-chevron {
    width: 12px;
    flex-shrink: 0;
    text-align: center;
    opacity: .7;
}



/* =========================================================
   ESTADOS DA ÁRVORE DE NAVEGAÇÃO
   ========================================================= */

/* Hover: apenas interação temporária */


/* Grupo expandido: não representa seleção */
.nav-tree-item.expanded {
    background: transparent;
    color: #c5cfdd;
}

/* Grupo de primeiro nível: destaque forte de contexto */
.nav-tree-item.top-ancestor-selected {
    background: rgba(59, 130, 246, .14);
    color: #9bc8fa;
    font-weight: 600;
}

/* Grupos intermediários: indicação discreta do caminho */
.nav-tree-item.intermediate-ancestor-selected {
    background: rgba(59, 130, 246, .045);
    color: #aabbd0;
    font-weight: 500;
}

/* Página atual: único item efetivamente selecionado */


.nav-tree-item.selected:hover {
    background: rgba(59, 130, 246, .30);
    color: #ffffff;
}


/* Nova árvore de navegação */
.nav-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-tree-node {
    width: 100%;
    width: 100%;
}

.nav-tree-line {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 2px;
}

.nav-tree-arrow {
    flex: 0 0 22px;
    width: 22px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #91a9c7;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 16px;
}

    .nav-tree-arrow:hover {
        background: #ffffff12;
        color: #fff;
    }

.nav-tree-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    gap: 4px;
    padding-right: 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: background .15s ease;
    flex: 1;
    min-width: 0;
    min-height: 32px;
    padding: 5px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #91a2ba;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
}

    .nav-tree-item:hover {
        background: var(--sidebar-hover);
        color: var(--text-primary);
        background: rgba(59, 130, 246, .12);
        color: #ffffff;
        background: #ffffff0d;
        color: #fff;
    }

    .nav-tree-item.ancestor-selected {
        color: #9bc8fa;
        font-weight: 600;
    }

    .nav-tree-item.selected {
        background: rgba(59, 130, 246, .24);
        color: #ffffff;
        font-weight: 700;
        background: rgba(59,130,246,.24);
        color: #fff;
        font-weight: 700;
    }

.nav-tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-submenu {
    padding: 3px 0 8px 43px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 3px 0 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-collapsed .nav-tree-line {
    padding-left: 0 !important;
}


/* Correção: seta do menu principal possui ação independente do título */
.nav-main-line {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 2px;
}



.nav-main-arrow {
    flex: 0 0 26px;
    width: 26px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #91a2ba);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 17px;
}

    .nav-main-arrow:hover {
        background: var(--sidebar-hover, #ffffff12);
        color: var(--text-primary, #fff);
    }

/* Menu: a seta e o nome formam um único botão de alternância */
.nav-main-line > .nav-item {
    flex: 1;
    min-width: 0;
    width: auto;
    display: flex;
    align-items: center;
}

.nav-chevron {
    font-size: 17px;
    color: #71839b;
    margin-left: auto;
    flex: 0 0 18px;
    text-align: center;
    color: var(--text-secondary,#91a2ba);
    font-size: 17px;
}

.nav-tree-line > .nav-tree-group {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
}

.nav-tree-group .nav-tree-chevron {
    flex: 0 0 14px;
    width: 14px;
    text-align: center;
    color: #91a9c7;
    font-size: 15px;
}

.nav-tree-group .nav-tree-label {
    flex: 1;
    min-width: 0;
}

/* Breadcrumb hierárquico e clicável */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: min(72vw, 900px);
    overflow: hidden;
    white-space: nowrap;
}

.breadcrumb-link {
    flex: 0 0 auto;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    padding: 5px 7px;
    font-size: 12px;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

    .breadcrumb-link:hover {
        border-color: var(--line);
        background: var(--hover);
        color: var(--text);
    }

.breadcrumb-root {
    color: var(--muted);
}

.breadcrumb-separator {
    flex: 0 0 auto;
    color: #aab5c4;
    font-size: 12px;
    padding: 0 1px;
}

.breadcrumb-current {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 0 0 auto;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--line);
    background: var(--hover);
    color: var(--text);
    border-radius: 6px;
    padding: 5px 7px;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .topbar {
        padding: 0 16px;
    }

    .breadcrumb-nav {
        max-width: 58vw;
    }

    .top-actions span:not(.status-dot) {
        display: none;
    }
}

/* ===== Layout mobile dedicado (desktop preservado) ===== */
.mobile-shell {
    display: none;
}

@media (max-width: 767px) {
    .app-shell {
        display: block;
        min-height: 100vh;
    }

        .app-shell > .sidebar,
        .app-shell > .flyout-backdrop {
            display: none !important;
        }

    .mobile-shell {
        display: block;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 1200;
        height: 62px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }

    .mobile-menu-button {
        border: 0;
        background: transparent;
        color: #172f50;
        cursor: pointer;
        width: 38px;
        height: 42px;
        flex: 0 0 38px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        padding: 5px;
    }

        .mobile-menu-button span {
            display: block;
            width: 27px;
            height: 3.5px;
            border-radius: 3px;
            background: #172f50;
        }

    /* Botão do menu mobile no tema escuro */
    .theme-dark .mobile-menu-button span {
        background: #E8EDF5;
    }



    .mobile-breadcrumb {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 3px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

        .mobile-breadcrumb::-webkit-scrollbar {
            display: none;
        }

    .mobile-breadcrumb-link {
        flex: 0 0 auto;
        border: 1px solid transparent;
        background: transparent;
        color: var(--muted);
        border-radius: 6px;
        padding: 5px 4px;
        font-size: 13px;
        line-height: 1.3;
        cursor: pointer;
    }

        .mobile-breadcrumb-link:active {
            background: var(--hover);
        }

    .mobile-breadcrumb-root {
        color: #315f91;
        font-weight: 600;
    }

    .mobile-breadcrumb-separator {
        flex: 0 0 auto;
        color: #aab5c4;
        font-size: 13px;
    }

    .mobile-breadcrumb-current {
        color: var(--text);
        font-weight: 600;
    }

    .mobile-profile {
        width: 36px;
        height: 36px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .main-area {
        width: 100% !important;
        min-width: 0;
        min-height: calc(100vh - 62px);
    }

    .topbar {
        display: none !important;
    }

    .content-area {
        padding: 22px 16px !important;
        min-width: 0;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .app-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1300;
        background: #07142680;
    }

    .mobile-drawer {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1301;
        width: min(86vw, 340px);
        overflow-y: auto;
        background: var(--nav);
        color: #c5cfdd;
        padding: 16px 12px 24px;
        box-shadow: 12px 0 35px #0003;
        animation: mobileDrawerIn .18s ease-out;
    }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 8px 18px;
        border-bottom: 1px solid #52647c;
        margin-bottom: 12px;
    }

    .mobile-drawer-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
    }

        .mobile-drawer-brand .mobile-drawer-logo {
            width: 74px;
            height: 74px;
            object-fit: contain;
            flex: 0 0 auto;
        }

    .mobile-drawer-brand-copy {
        display: flex;
        flex-direction: column;
        white-space: nowrap;
    }

        .mobile-drawer-brand-copy strong {
            color: #fff;
            font-size: 22px;
            line-height: 1.08;
            letter-spacing: -0.55px;
        }

        .mobile-drawer-brand-copy .mobile-drawer-brand-second {
            color: #fff;
            font-size: 17px;
            line-height: 1.1;
            margin-top: 2px;
            white-space: nowrap;
        }

    .mobile-drawer-brand-second span {
        color: #3E8EBD;
        font-size: 28px;
        vertical-align: top;
        line-height: 1;
    }

    .mobile-close-button {
        border: 0;
        background: transparent;
        color: var(--text);
        cursor: pointer;
        font-size: 25px;
        width: 36px;
        height: 40px;
        display: grid;
        place-items: center;
        color: #d5dfed;
        font-size: 30px;
    }

    .mobile-nav-item {
        width: 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #c5cfdd;
        text-align: left;
        cursor: pointer;
        font-size: 14px;
    }

        .mobile-nav-item .nav-icon {
            width: 24px;
            flex: 0 0 24px;
            text-align: center;
            font-size: 20px;
            color: #91afd1;
        }

        .mobile-nav-item.active {
            background: #2b4c73;
            color: #fff;
            box-shadow: inset 4px 0 #79b2ed;
        }

    .mobile-chevron {
        margin-left: auto;
        font-size: 20px;
    }

    .mobile-drawer .nav-tree {
        padding: 2px 0 8px 8px;
    }

    .mobile-drawer .nav-tree-item {
        color: #c5cfdd;
        min-height: 42px;
    }

        .mobile-drawer .nav-tree-item.selected {
            background: rgba(59,130,246,.24);
            color: #fff;
            font-weight: 700;
        }

        .mobile-drawer .nav-tree-item.top-ancestor-selected {
            background: rgba(59,130,246,.14);
            color: #9bc8fa;
            font-weight: 600;
        }

    .mobile-drawer .nav-tree-chevron {
        color: #91afd1;
    }

    .mobile-drawer-divider {
        height: 1px;
        background: #52647c;
        margin: 14px 8px;
    }
}

@keyframes mobileDrawerIn {
    from {
        transform: translateX(-12px);
        opacity: .7;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* =========================================================
   SPLASH SCREEN - responsiva e percentual do Blazor
   ========================================================= */
:root {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #253044;
    background: #f5f7fa;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --splash-accent: #3e8ebd;
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #ffffff;
    font-family: inherit;
}

.splash-card {
    /* Mantém o cartão quadrado e adapta o tamanho à tela */
    width: min(340px, calc(100vw - 40px), calc(100vh - 40px));
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    padding: clamp(18px, 6%, 24px);
    border-radius: clamp(28px, 10%, 36px);
    background: linear-gradient(145deg, #192a40 0%, #1b2c42 68%, #20334a 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
}

.splash-logo {
    transform: translateY(-10px);
    width: 52.5%;
    height: 52.5%;
    object-fit: contain;
    flex: 0 0 auto;
}

.splash-brand {
    text-align: center;
    margin-top: 1%;
    line-height: 1.08;
    transform: translateY(-10px);
}

    .splash-brand strong {
        display: block;
        color: #fff;
        font-size: clamp(22.5px, 8.125%, 28.75px);
        letter-spacing: -0.5px;
    }

.splash-brand-second {
    color: #fff;
    font-size: clamp(17.5px, 6.25%, 22.5px);
    font-weight: 600;
    margin-top: 3px;
    line-height: 1.1;
}

    .splash-brand-second span {
        color: var(--splash-accent, #3e8ebd);
        font-size: 1.45em;
        font-weight: 700;
        vertical-align: top;
        line-height: 1;
    }

.splash-message {
    margin-top: 24px;
    margin-bottom: 10px;
    transform: translateY(5px);
    text-align: center;
    font-size: clamp(10px, 3.7%, 13px);
    line-height: 1.25;
}

.splash-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(5px);
    position: relative;
}

.splash-progress-track {
    flex: 1;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #ffffff33;
}

.splash-progress-bar {
    width: var(--blazor-load-percentage, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--splash-accent, #3e8ebd);
    transition: width .15s ease-out;
}

.splash-progress-percent {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    min-width: 0;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.55);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.splash-dots {
    display: flex;
    gap: 5px;
    margin-top: 12px;
    height: 8px;
    align-items: center;
    transform: translateY(5px);
}

    .splash-dots span {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #fff;
        opacity: .25;
        animation: splash-dot 1.2s infinite ease-in-out;
    }

        .splash-dots span:nth-child(2) {
            animation-delay: .2s;
        }

        .splash-dots span:nth-child(3) {
            animation-delay: .4s;
        }

@keyframes splash-dot {
    0%,60%,100% {
        opacity: .25;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}


/* Ajuste de seleção: somente o grupo raiz e a página atual ficam em evidência.
   Os grupos intermediários continuam expandindo normalmente, sem destaque visual. */
.nav-tree-item.intermediate-ancestor-selected,
.nav-tree-item.ancestor-selected {
    background: transparent !important;
    color: #91a2ba !important;
    font-weight: 400 !important;
}

.mobile-drawer .nav-tree-item.intermediate-ancestor-selected,
.mobile-drawer .nav-tree-item.ancestor-selected {
    background: transparent !important;
    color: #c5cfdd !important;
    font-weight: 400 !important;
}
