/* CONTRIX · Menú de empresa/usuario premium
   Presentación inspirada en una ficha empresarial, conservando el lenguaje visual de CONTRIX. */

.cx-user-dropdown .dropdown-menu.cx-user-menu[data-cx-company-menu="ready"] {
    width: min(390px, calc(100vw - 24px)) !important;
    min-width: min(390px, calc(100vw - 24px)) !important;
    max-width: 390px;
    margin-top: 12px !important;
    padding: 0 0 10px !important;
    overflow: hidden;
    border: 1px solid #dce6f4 !important;
    border-radius: 22px !important;
    background: #fff !important;
    box-shadow: 0 28px 72px rgba(7, 28, 61, .24) !important;
}

.cx-company-menu-hero {
    position: relative;
    min-height: 188px;
    padding: 22px 24px 20px;
    overflow: hidden;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at 16% 8%, rgba(56, 151, 255, .28), transparent 34%),
        radial-gradient(circle at 92% 0%, rgba(22, 190, 170, .15), transparent 28%),
        linear-gradient(145deg, #071d42 0%, #0c3267 55%, #124d8b 100%);
}

.cx-company-menu-hero::before,
.cx-company-menu-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .045);
    pointer-events: none;
}

.cx-company-menu-hero::before {
    width: 150px;
    height: 150px;
    left: -64px;
    top: -82px;
}

.cx-company-menu-hero::after {
    width: 190px;
    height: 190px;
    right: -92px;
    bottom: -116px;
}

.cx-company-menu-logo {
    position: relative;
    z-index: 1;
    width: 118px;
    height: 74px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
}

.cx-company-menu-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border: 0;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18));
}

.cx-company-menu-logo-fallback {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 18px;
    background: linear-gradient(135deg, #18b8a4, #286ef0);
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.cx-company-menu-kicker {
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
    color: rgba(226, 238, 255, .72);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.cx-company-menu-name {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fff;
    font-size: 1.22rem;
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.cx-company-menu-branch {
    position: relative;
    z-index: 1;
    margin-top: 4px;
    color: rgba(232, 241, 255, .86);
    font-size: .80rem;
    font-weight: 600;
}

.cx-company-menu-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 13px;
}

.cx-company-menu-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.085);
    color: #eef5ff;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .015em;
}

.cx-company-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e7edf6;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.cx-company-menu-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border: 1px solid #dce7f5;
    border-radius: 15px;
    background: linear-gradient(145deg, #edf4ff, #e0ebfb);
    color: #486386;
    font-weight: 900;
}

.cx-company-menu-user-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.cx-company-menu-user-copy strong,
.cx-company-menu-user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-company-menu-user-copy strong {
    color: #15233d;
    font-size: .94rem;
    font-weight: 850;
}

.cx-company-menu-user-copy .cx-company-menu-email {
    margin-top: 2px;
    color: #7a8ca8;
    font-size: .76rem;
}

.cx-company-menu-role {
    display: inline-flex !important;
    width: fit-content;
    margin-top: 6px !important;
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf4ff;
    color: #235cc7 !important;
    font-size: .67rem !important;
    font-weight: 850;
}

/* Oculta la ficha de usuario antigua porque la sustituimos por una más completa. */
.cx-user-menu[data-cx-company-menu="ready"] > .cx-user-menu-profile {
    display: none !important;
}

.cx-user-menu[data-cx-company-menu="ready"] .dropdown-divider {
    margin: 5px 15px !important;
    border-color: #e8eef6 !important;
}

.cx-user-menu[data-cx-company-menu="ready"] .dropdown-item,
.cx-user-menu[data-cx-company-menu="ready"] form .dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: calc(100% - 20px);
    min-height: 44px;
    margin: 2px 10px;
    padding: 10px 13px !important;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #34445f !important;
    font-size: .87rem;
    font-weight: 650;
    text-align: left;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.cx-user-menu[data-cx-company-menu="ready"] .dropdown-item:hover,
.cx-user-menu[data-cx-company-menu="ready"] form .dropdown-item:hover {
    background: #f0f6ff !important;
    color: #1559cf !important;
    transform: translateX(2px);
}

.cx-company-menu-item-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #edf4ff;
    color: #2361d2;
    font-size: .86rem;
    font-weight: 900;
}

.cx-user-menu[data-cx-company-menu="ready"] .dropdown-item.text-danger,
.cx-user-menu[data-cx-company-menu="ready"] form .dropdown-item.text-danger {
    color: #d93648 !important;
}

.cx-user-menu[data-cx-company-menu="ready"] .dropdown-item.text-danger .cx-company-menu-item-icon,
.cx-user-menu[data-cx-company-menu="ready"] form .dropdown-item.text-danger .cx-company-menu-item-icon {
    background: #fff0f2;
    color: #d93648;
}

.cx-user-menu[data-cx-company-menu="ready"] .dropdown-item.text-danger:hover,
.cx-user-menu[data-cx-company-menu="ready"] form .dropdown-item.text-danger:hover {
    background: #fff1f3 !important;
    color: #c6293b !important;
}

@media (max-width: 575.98px) {
    .cx-user-dropdown .dropdown-menu.cx-user-menu[data-cx-company-menu="ready"] {
        width: calc(100vw - 20px) !important;
        min-width: calc(100vw - 20px) !important;
        max-width: none;
        max-height: min(82vh, 650px);
        overflow-y: auto;
    }

    .cx-company-menu-hero {
        min-height: 174px;
        padding: 19px 18px 17px;
    }

    .cx-company-menu-logo {
        width: 100px;
        height: 64px;
    }
}
