.portal-theme {
    min-height: 100vh;
    background-color: #f3f4f6 !important;
    background-image:
        linear-gradient(rgba(243, 244, 246, 0.78), rgba(243, 244, 246, 0.88)),
        url("images/hero-bg-2.png") !important;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.portal-theme-dark {
    background-color: #0b1120 !important;
    background-image:
        linear-gradient(125deg, rgba(8, 17, 31, 0.9), rgba(20, 18, 43, 0.8)),
        url("images/hero-bg-2.png") !important;
}

.portal-theme-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px max(16px, calc((100% - 1280px) / 2));
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 1px solid #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    color: #f1f5f9;
}

.portal-theme-left,
.portal-theme-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-theme-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    margin-right: 4px;
}

.portal-theme-brand img {
    display: block;
    width: auto;
    height: 44px;
    max-height: 44px;
    max-width: 160px;
    object-fit: contain;
    object-position: left center;
}

.portal-theme-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #1e293b;
    color: #e2e8f0;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.portal-theme-button.dashboard {
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(56, 189, 248, 0.5);
    color: #7dd3fc;
    font-weight: 700;
}

.portal-theme-header nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    color: #e2e8f0;
}

.portal-theme-header nav a {
    color: #e2e8f0;
}

.portal-theme-header nav a:hover {
    color: #7dd3fc;
}

.portal-theme-header .nav-profile {
    color: #e2e8f0;
}

.portal-theme-header .btn-return-home {
    border: 1px solid #475569;
    background: #1e293b;
    color: #e2e8f0;
}

.portal-theme-header .btn-return-home:hover {
    border-color: #38bdf8;
    background: #24364d;
    color: #7dd3fc;
}

.portal-theme-header .brand-badge {
    border-color: #475569;
    background: #1e293b;
    color: #e2e8f0;
}

.portal-theme-header .course-title-nav {
    color: #f1f5f9;
}

.portal-theme-header .btn-back {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

.portal-theme-header .btn-back.dashboard {
    background: rgba(2, 132, 199, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #7dd3fc !important;
}

.portal-theme-header .progress-pill {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}

.portal-theme-header .badge-enrollment {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}

.portal-theme-header.mgmt-nav {
    justify-content: space-between;
}

.portal-theme .mgmt-nav {
    min-height: 64px;
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 1px solid #334155;
    color: #e2e8f0;
}

.portal-theme .mgmt-nav .nav-btn {
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
}

.portal-theme-has-global-header .mgmt-nav .mgmt-brand img {
    display: none;
}

.portal-theme-header.mgmt-nav .nav-links-group {
    justify-content: flex-end;
}

.portal-theme-header.mgmt-nav .nav-btn {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #e2e8f0 !important;
}

.portal-theme-header.mgmt-nav .nav-btn[style*="59,130,246"] {
    background: rgba(2, 132, 199, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #7dd3fc !important;
}

.portal-theme .sidebar-brand img {
    width: auto !important;
    height: 44px !important;
    max-width: 160px !important;
    object-fit: contain;
}

.portal-theme-admin-subpage .sidebar-brand {
    display: none !important;
}

.portal-theme-admin-subpage .sidebar-nav {
    margin-top: 0.5rem;
}

.portal-theme-admin-subpage .admin-global-topbar .admin-top-nav-actions {
    display: none;
}

.portal-theme .admin-global-topbar {
    background: rgba(15, 23, 42, 0.94) !important;
    border: 1px solid #334155 !important;
    border-radius: 10px;
}

.portal-theme .admin-global-topbar > div:last-child {
    color: #e2e8f0 !important;
}

.portal-theme .admin-global-topbar .btn-top-dashboard,
.portal-theme .admin-global-topbar .btn-top-back {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #e2e8f0 !important;
}

.portal-theme .admin-global-topbar .btn-top-dashboard {
    background: rgba(2, 132, 199, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #7dd3fc !important;
}

@media (max-width: 700px) {
    .portal-theme-header {
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    .portal-theme-brand img {
        height: 38px;
        max-height: 38px;
        max-width: 140px;
    }

    .portal-theme-header nav {
        gap: 9px;
    }

    .portal-theme-button {
        min-height: 34px;
        padding: 5px 8px;
        font-size: 0.78rem;
    }
}

@media print {
    .portal-theme {
        background: #fff !important;
    }
}
