.mbi-portal {
    --mbi-blue: #285ba8;
    --mbi-blue-dark: #173f7d;
    --mbi-blue-soft: #eaf1fb;
    --mbi-border: #dce3ed;
    --mbi-surface: #f4f7fb;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 290px);
    width: 100%;
    min-height: 85vh;
    overflow: hidden;
    border: 1px solid var(--mbi-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(23, 63, 125, 0.1);
}

.mbi-content {
    min-width: 0;
    padding: 14px;
    background: var(--mbi-surface);
}

.mbi-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 16px;
    color: #fff;
    background: var(--mbi-blue-dark);
}

.mbi-sidebar-heading {
    margin: 0 8px 4px;
    color: #d7e5f9;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mbi-report-list {
    display: grid;
    gap: 8px;
}

.mbi-report-button {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-radius: 9px;
    color: #e9f1fc;
    background: transparent;
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.mbi-report-button small {
    color: #a9c3e8;
    font-size: 11px;
    font-weight: 500;
}

.mbi-report-button:hover,
.mbi-report-button:focus-visible,
.mbi-report-button.is-active {
    color: #fff;
    outline: none;
    background: var(--mbi-blue);
}

.mbi-report-button.is-active small {
    color: #fff;
}

.mbi-navigation-group {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
}

.mbi-navigation-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 13px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.mbi-navigation-group > summary::-webkit-details-marker {
    display: none;
}

.mbi-navigation-group > summary::before {
    content: "+";
    width: 18px;
    color: #a9c3e8;
}

.mbi-navigation-group[open] > summary::before {
    content: "−";
}

.mbi-group-count {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    text-align: center;
}

.mbi-subitems {
    display: grid;
    gap: 4px;
    padding: 0 7px 7px 18px;
}

.mbi-report-panel,
.mbi-report-panel iframe {
    width: 100%;
    height: 100%;
    min-height: 83vh;
}

.mbi-report-panel iframe {
    display: block;
    border: 0;
    border-radius: 9px;
    background: #fff;
}

.mbi-report-panel.is-loading {
    position: relative;
}

.mbi-report-panel.is-loading::before {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--mbi-blue-dark);
    background: rgba(255, 255, 255, 0.92);
    content: "Carregando painel...";
    font-weight: 700;
}

.mbi-load-error {
    margin: 20px;
    padding: 14px;
    border-radius: 8px;
    color: #8a1f17;
    background: #fbe9e7;
}

.mbi-more-access {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mbi-more-access summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.mbi-password-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.mbi-password-form label {
    display: grid;
    gap: 6px;
    text-align: left;
}

.mbi-password-form label span {
    font-size: 13px;
    font-weight: 700;
}

.mbi-password-form input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd6e5;
    border-radius: 8px;
    color: #17243a;
    background: #fff;
}

.mbi-password-form button,
.mbi-lock-button {
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.mbi-password-form button {
    color: #fff;
    background: var(--mbi-blue);
}

.mbi-lock-form {
    margin: 0;
}

.mbi-lock-button {
    width: 100%;
    min-height: 34px;
    padding: 7px 12px;
    color: #d7e5f9;
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
}

.mbi-gate {
    max-width: 480px;
    margin: 48px auto;
    padding: 32px;
    border: 1px solid var(--mbi-border, #dce3ed);
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: 0 14px 40px rgba(23, 63, 125, 0.1);
}

.mbi-gate h2 {
    margin: 0 0 8px;
}

.mbi-gate .mbi-password-form {
    max-width: 340px;
    margin: 24px auto 0;
}

.mbi-gate .mbi-password-form button {
    background: #285ba8;
}

.mbi-error {
    padding: 10px 12px;
    border-radius: 8px;
    color: #8a1f17;
    background: #fbe9e7;
}

@media (max-width: 760px) {
    .mbi-portal {
        grid-template-columns: 1fr;
    }

    .mbi-sidebar {
        padding: 14px;
    }

    .mbi-report-panel,
    .mbi-report-panel iframe {
        min-height: 78vh;
    }
}
