/* Overlay, perfil, idioma, estados de carga */
.roadex-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    pointer-events: all;
}

.roadex-loading-overlay[hidden] {
    display: none !important;
}

.roadex-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: roadex-spin 0.75s linear infinite;
}

@keyframes roadex-spin {
    to { transform: rotate(360deg); }
}

.topbar-actions {
    position: relative;
}

.topbar-lang-wrap {
    position: relative;
}

.topbar-lang-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 6px;
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.topbar-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 6px 0;
    z-index: 50;
}

.topbar-lang-menu[hidden] {
    display: none !important;
}

.topbar-lang-menu button {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 10px 14px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
}

.topbar-lang-menu button:hover,
.topbar-lang-menu button.active {
    background: #f1f5f9;
    color: var(--roadex-navy);
    font-weight: 600;
}

.topbar-profile-wrap {
    position: relative;
}

.topbar-user {
    border: none;
    cursor: pointer;
    padding: 0;
}

.topbar-user:disabled {
    opacity: 0.7;
    cursor: wait;
}

.topbar-profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 50;
}

.topbar-profile-menu[hidden] {
    display: none !important;
}

.profile-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.profile-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--roadex-navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-menu-info {
    min-width: 0;
}

.profile-menu-name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu-user {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu-divider {
    height: 1px;
    background: #e5e7eb;
}

.profile-menu-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.profile-menu-logout:hover {
    background: #f9fafb;
    color: var(--roadex-navy);
}

.is-loading {
    pointer-events: none;
    opacity: 0.72;
}

button:disabled,
.btn-roadex-primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

.topbar-icon-btn.is-spinning i {
    animation: roadex-spin 0.75s linear infinite;
}
