.app-navigation {
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
}

.app-navigation__primary {
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 2px;
}

.app-navigation__item {
    min-height: 47px;
    padding: 0 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.app-navigation__item:hover:not(:disabled),
.app-navigation__item[aria-expanded="true"] {
    color: #17233c;
    border-bottom-color: #2f6fed;
}

.app-navigation__item--disabled,
.app-navigation__item:disabled {
    color: #9ca3af;
    cursor: default;
}

.app-navigation__chevron {
    margin-top: -2px;
    font-size: 12px;
    opacity: 0.72;
}

.app-navigation__group {
    position: relative;
}

.app-navigation__dropdown {
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    left: 0;
    width: 230px;
    padding: 7px;
    border: 1px solid #dfe4ec;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(23, 35, 60, 0.12);
}

.app-navigation__dropdown button,
.app-navigation__mobile-section button {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #374151;
    text-align: left;
    cursor: pointer;
}

.app-navigation__dropdown button:hover:not(:disabled),
.app-navigation__mobile-section button:hover:not(:disabled) {
    background: #f4f6f9;
}

.app-navigation__dropdown button:disabled,
.app-navigation__mobile-section button:disabled {
    color: #a0a7b2;
    cursor: default;
}

.app-navigation__divider,
.shell-account-menu__divider {
    height: 1px;
    margin: 6px 3px;
    background: #e5e9f0;
}

.app-navigation__submenu-label {
    padding: 9px 9px 4px;
    color: #8a94a3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-navigation__mobile-account {
    display: none;
}

.shell-company-control,
.shell-user-control {
    position: relative;
}

.shell-company,
.shell-user {
    cursor: pointer;
}

.shell-company__row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
}

.shell-company__chevron,
.shell-user__chevron {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.shell-account-menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    padding: 7px;
    border: 1px solid #dfe4ec;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(23, 35, 60, 0.14);
    color: #374151;
}

.shell-account-menu__header {
    padding: 7px 9px 5px;
    color: #8a94a3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.shell-account-menu button {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.shell-account-menu button:hover:not(:disabled) {
    background: #f4f6f9;
}

.shell-account-menu button:disabled {
    color: #a0a7b2;
    cursor: default;
}

.shell-account-menu__danger {
    color: #b42318 !important;
}

.shell-company-menu {
    min-width: 270px;
}

.shell-company-menu__list {
    max-height: 280px;
    overflow: auto;
}

.shell-company-menu__option {
    display: grid !important;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
}

.shell-company-menu__option[aria-current="true"] {
    background: #eef3ff;
    color: #244fa8;
    font-weight: 650;
}

.shell-company-menu__check {
    width: 20px;
    text-align: center;
}

.shell-company-menu__empty {
    display: block;
    padding: 10px 9px;
    color: #8a94a3;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .app-navigation__item {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 12px;
    }
}

@media (max-width: 900px) {
    .app-navigation__primary {
        gap: 0;
    }

    .app-navigation__item {
        padding-right: 6px;
        padding-left: 6px;
        font-size: 11.5px;
    }
}

@media (max-width: 680px) {
    .app-navigation {
        display: block;
    }

    .app-navigation__primary {
        width: 100%;
        display: block;
    }

    .app-navigation__item,
    .app-navigation__group > .app-navigation__item {
        width: 100%;
        min-height: 42px;
        padding: 8px 4px;
        border-bottom: 0;
        justify-content: space-between;
        font-size: 14px;
        text-align: left;
    }

    .app-navigation__group {
        width: 100%;
    }

    .app-navigation__dropdown {
        position: static;
        width: 100%;
        margin: 0 0 8px;
        padding: 2px 0 4px 14px;
        border: 0;
        border-left: 2px solid #e4e8ef;
        border-radius: 0;
        box-shadow: none;
    }

    .app-navigation__dropdown button {
        min-height: 38px;
        padding-left: 10px;
    }

    .app-navigation__mobile-account {
        display: block;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #e5e9f0;
    }

    .app-navigation__mobile-section + .app-navigation__mobile-section {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #e5e9f0;
    }

    .app-navigation__mobile-label {
        display: block;
        margin-bottom: 4px;
        color: #8a94a3;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .app-navigation__mobile-context {
        width: 100%;
        min-height: 40px;
        padding: 7px 0;
        border: 0;
        background: transparent;
        color: #17233c;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 650;
        text-align: left;
    }

    .shell-company-control {
        display: none;
    }

    .shell-account-menu {
        position: fixed;
        top: 68px;
        right: 12px;
        left: 12px;
        min-width: 0;
    }

    .shell-user__chevron {
        display: none;
    }

    .shell-navigation.is-mobile-open {
        max-height: calc(100vh - var(--shell-header-height));
        overflow-y: auto;
    }
}


.app-navigation__item.is-active,
.app-navigation__item.is-section-active,
.app-navigation__group.is-section-active > .app-navigation__item {
    color: #17233c;
    border-bottom-color: #2f6fed;
}

.app-navigation__dropdown [data-nav-home].is-active {
    background: #eef3ff;
    color: #244fa8;
    font-weight: 650;
}


/* CTB-02.4 — visual refinement layer */

.shell-navigation {
    box-shadow: 0 1px 0 rgba(20, 33, 54, 0.02);
}

.app-navigation__primary {
    gap: 4px;
}

.app-navigation__item {
    min-height: 44px;
    padding: 0 10px;
    border-bottom-width: 2px;
    color: #536071;
    font-size: 12.5px;
    font-weight: 610;
    text-decoration: none;
}

.app-navigation__item:hover:not(:disabled),
.app-navigation__item[aria-expanded="true"] {
    background: #f8fafc;
    color: #17233c;
}

.app-navigation__item.is-active,
.app-navigation__item.is-section-active,
.app-navigation__group.is-section-active > .app-navigation__item {
    background: #fbfcfe;
    color: #17233c;
}

.app-navigation__dropdown,
.shell-account-menu {
    padding: 6px;
    border-color: #dde3eb;
    border-radius: 9px;
    box-shadow: var(--ui-shadow-menu, 0 12px 30px rgba(18, 32, 55, 0.11));
}

.app-navigation__dropdown {
    top: calc(100% + 6px);
}

.app-navigation__dropdown button,
.shell-account-menu button {
    min-height: 34px;
    border-radius: 6px;
    color: #445062;
    font-size: 12.5px;
}

.app-navigation__dropdown button:hover:not(:disabled),
.shell-account-menu button:hover:not(:disabled) {
    background: #f5f7fa;
    color: #1f2a3a;
}

.app-navigation__dropdown button:focus-visible,
.shell-account-menu button:focus-visible,
.app-navigation__item:focus-visible {
    outline: 3px solid rgba(47, 111, 237, 0.18);
    outline-offset: 1px;
}

.app-navigation__dropdown button:disabled,
.shell-account-menu button:disabled,
.app-navigation__item:disabled {
    color: #a3abb6;
}

.app-navigation__submenu-label,
.shell-account-menu__header {
    color: #8c96a4;
}

.shell-company-menu__option[aria-current="true"] {
    background: #eef3ff;
    color: #244fa8;
}

.shell-user-menu {
    min-width: 250px;
}

.shell-account-menu__danger:hover {
    background: #fff2f0 !important;
}

@media (max-width: 680px) {
    .app-navigation__item,
    .app-navigation__group > .app-navigation__item {
        min-height: 40px;
        padding: 8px 2px;
        font-size: 13.5px;
    }

    .app-navigation__dropdown {
        padding-left: 12px;
    }
}


.shell-user-menu__identity {
    padding: 8px 9px 7px;
    display: grid;
    gap: 2px;
}

.shell-user-menu__identity strong {
    overflow: hidden;
    color: #263244;
    font-size: 12.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-user-menu__identity span {
    overflow: hidden;
    color: #7b8594;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* CTB-03.1 — user-scope account route */

.shell-account-menu > a,
.app-navigation__mobile-section > a {
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    background: transparent;
    color: #445062;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}

.shell-account-menu > a:hover,
.app-navigation__mobile-section > a:hover {
    background: #f5f7fa;
    color: #1f2a3a;
}

.shell-account-menu > a:focus-visible,
.app-navigation__mobile-section > a:focus-visible {
    outline: 3px solid rgba(47, 111, 237, 0.18);
    outline-offset: 1px;
}

.shell-account-menu > a.is-active,
.shell-account-menu > a.is-section-active,
.app-navigation__mobile-section > a.is-active,
.app-navigation__mobile-section > a.is-section-active {
    background: #eef3ff;
    color: #244fa8;
    font-weight: 650;
}

.app-navigation__mobile-section > a {
    min-height: 40px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 13.5px;
}


/* CTB-03.4 — multi-company selector */

.shell-company-control[data-switching] .shell-company {
    cursor: wait;
    opacity: 0.76;
}

.shell-company-menu {
    min-width: 310px;
}

.shell-company-menu__option {
    min-height: 48px !important;
    align-items: start;
}

.shell-company-menu__check {
    padding-top: 2px;
}

.shell-company-menu__content {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.shell-company-menu__name-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.shell-company-menu__name-row strong {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-company-menu__default {
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 999px;
    background: #edf2fb;
    color: #5a6d8e;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.shell-company-menu__meta {
    color: #8a94a3;
    font-size: 10.5px;
    font-weight: 500;
}

.shell-company-menu__option[aria-current="true"] .shell-company-menu__meta {
    color: #667ba5;
}

/* CTB-04.1.1 — Configuración remains a route and exposes its children as a submenu. */

.shell-user-menu__submenu {
    position: relative;
}

.shell-user-menu__submenu-parent,
.shell-user-menu__submenu-panel > a {
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    background: transparent;
    color: #445062;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}

.shell-user-menu__submenu-parent {
    justify-content: space-between;
}

.shell-user-menu__submenu-parent:hover,
.shell-user-menu__submenu-parent:focus-visible,
.shell-user-menu__submenu-panel > a:hover,
.shell-user-menu__submenu-panel > a:focus-visible {
    background: #f5f7fa;
    color: #1f2a3a;
}

.shell-user-menu__submenu-parent:focus-visible,
.shell-user-menu__submenu-panel > a:focus-visible {
    outline: 3px solid rgba(47, 111, 237, 0.18);
    outline-offset: 1px;
}

.shell-user-menu__submenu-parent.is-active,
.shell-user-menu__submenu-parent.is-section-active,
.shell-user-menu__submenu-panel > a.is-active,
.shell-user-menu__submenu-panel > a.is-section-active {
    background: #eef3ff;
    color: #244fa8;
    font-weight: 650;
}

.shell-user-menu__submenu-chevron {
    color: #8a94a3;
    font-size: 16px;
    line-height: 1;
}

.shell-user-menu__submenu-panel {
    position: absolute;
    z-index: 130;
    top: -6px;
    left: calc(100% + 4px);
    min-width: 220px;
    padding: 6px;
    border: 1px solid #dde3eb;
    border-radius: 9px;
    display: none;
    background: #ffffff;
    box-shadow: var(--ui-shadow-menu, 0 12px 30px rgba(18, 32, 55, 0.11));
}

.shell-user-menu__submenu:hover > .shell-user-menu__submenu-panel,
.shell-user-menu__submenu:focus-within > .shell-user-menu__submenu-panel {
    display: block;
}

.app-navigation__mobile-settings-links {
    display: grid;
    gap: 1px;
    margin: 0 0 4px 12px;
    padding-left: 10px;
    border-left: 2px solid #e5e9f0;
}

.app-navigation__mobile-settings-links > a {
    min-height: 34px;
    padding: 6px 4px;
    border-radius: 6px;
    color: #697586;
    font-size: 12.5px;
    text-decoration: none;
}

.app-navigation__mobile-settings-links > a:hover,
.app-navigation__mobile-settings-links > a:focus-visible {
    background: #f5f7fa;
    color: #1f2a3a;
}

.app-navigation__mobile-settings-links > a.is-active,
.app-navigation__mobile-settings-links > a.is-section-active {
    background: #eef3ff;
    color: #244fa8;
    font-weight: 650;
}

@media (max-width: 680px) {
    .shell-user-menu__submenu-panel {
        position: static;
        min-width: 0;
        margin: 2px 0 4px 12px;
        padding: 2px 0 2px 10px;
        border: 0;
        border-left: 2px solid #e5e9f0;
        border-radius: 0;
        display: block;
        box-shadow: none;
    }

    .shell-user-menu__submenu-chevron {
        transform: rotate(90deg);
    }
}

