/* LMS / Service SOP portal toggle — matches CRM data portal segmented control */
.lw-portal-switch {
    display: inline-flex;
    align-items: stretch;
    gap: 2px;
    padding: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border: 1px solid rgba(203, 213, 225, 0.75);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 0 rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.lw-portal-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 11px 0 9px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 12.8px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    line-height: 1;
}

.lw-portal-switch-btn:hover {
    color: #0f172a;
    text-decoration: none;
}

.lw-portal-switch-btn:active {
    transform: scale(0.98);
}

.lw-portal-switch-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.lw-portal-switch-btn--lms .lw-portal-switch-icon {
    color: #6366f1;
}

.lw-portal-switch-btn--sop .lw-portal-switch-icon {
    color: #059669;
}

.lw-portal-switch-btn.is-active {
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.lw-portal-switch-btn--lms.is-active {
    background: linear-gradient(180deg, #fff4cc 0%, #fde047 100%);
    border: 1px solid rgba(250, 204, 21, 0.55);
    color: #713f12;
}

.lw-portal-switch-btn--sop.is-active {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid rgba(110, 231, 183, 0.65);
    color: #065f46;
}

.lw-portal-switch-btn:not(.is-active) {
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
}

.lw-portal-switch-btn:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.88);
    color: #334155;
    border-color: rgba(226, 232, 240, 0.9);
}

.lw-portal-switch-label {
    font-weight: 700;
    line-height: 1;
    font-size: 12.8px;
}

.topnav-actions .lw-portal-switch--header {
    margin-left: 0;
    flex-wrap: nowrap;
}

.topnav-actions .lw-portal-switch {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.topnav-actions .lw-portal-switch-btn {
    min-height: 28px;
    padding: 0 9px 0 7px;
    font-size: 12.8px;
    gap: 4px;
}

.topnav-actions .lw-portal-switch-icon {
    width: 15px;
    height: 15px;
}

.topnav-actions .lw-portal-switch-icon svg {
    width: 13px;
    height: 13px;
}

.mobile-sidebar-portal-switch {
    padding: 0.65rem 0.75rem 0;
}

@media (max-width: 992px) {
    .topnav-actions .lw-portal-switch-icon {
        display: none;
    }

    .topnav-actions .lw-portal-switch-btn {
        min-height: 28px;
        padding: 0 8px;
        font-size: 12px;
        gap: 3px;
    }

    .topnav-actions .lw-portal-switch-label {
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .topnav-actions .lw-portal-switch {
        padding: 2px;
        gap: 1px;
    }

    .topnav-actions .lw-portal-switch-btn {
        min-height: 28px;
        padding: 0 7px;
        font-size: 11px;
    }

    .topnav-actions .lw-portal-switch-label {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .lw-portal-switch-btn--sop .lw-portal-switch-label {
        font-size: 10px;
    }
}
