body {
    display: grid;
    grid-template-rows: var(--header-height) calc(100vh - var(--header-height));
    grid-template-areas: "header" "main";

    header {
        grid-area: header;
        position: sticky;
        top: 0;

        background-color: rgb(22, 22, 22);
        padding: 0rem 1rem;
        display: flex;
        align-items: center;
        gap: 2rem;
        z-index: 100;

        /* Branding */
        #header-name {
            display: flex;
            gap: 0.25rem;
            font-size: 0.875rem;
            #company-name {
                font-weight: 300;
                color: var(--color-gray-01);
            }
            #platform-name {
                font-weight: 400;
                color: var(--color-gray-01);
            }
            /* &::after {
                content: "|";
                margin-left: 1rem;
                color: lightgray;
                font-weight: 200;
            } */
        }
        /* Navigation */
        .header-links {
            height: 100%;
            display: flex;
            align-items: center;
            /* gap: 1rem; */
            margin: 0;
            margin-right: auto;
            padding: 0;
            .header-link {
                font-size: 0.875rem;
                font-weight: 400;
                color: var(--color-gray-01);
                
                display: flex;
                align-items: center;
                height: 100%;
                padding: 0 1.5rem;
                &:hover {
                    background-color: #393939;
                    /* text-decoration: underline; */
                }
            }
        }
        /* Buttons */
        .toolbar {
            height: 100%;
            display: flex;
            align-items: center;
            gap: 1rem;

            /* --- Tenant Badge (Carbon Style) --- */
            .tenant-badge {
                color: var(--color-gray-01);
                font-size: 0.875rem;
                font-weight: 400;
                display: flex;
                align-items: center;
                user-select: none;
                pointer-events: none;
                user-select: none;
            }


            /* Icons (Feather) */
            #button-global-help {
                height: 100%;
                display: flex;
                align-items: center;
                border-radius: 0;
                padding: 1rem;
                &:hover {
                    pointer-events: all;
                    background-color: #393939;
                }
                .button-icon {
                width: 20px;
                height: 20px;
                color: var(--color-gray-01);
                stroke-width: 1.5;
                pointer-events: none;
            }
            }
            
            /* User Menu Content */
            .user-menu-container {
                gap: 0.75rem;
                padding-right: 1.5rem; /* Extra padding on the far right edge */
            }

            .user-name {
                color: var(--color-gray-01);
                font-size: 0.875rem;
                font-weight: 400;
            }

            /* Avatar */
            .user-avatar {
                width: 28px;
                height: 28px;
                border-radius: 50%;
                object-fit: cover;
                background-color: var(--interaction-active);
            }

            .user-avatar.fallback {
                background-color: var(--accent-blue);
                color: white;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 0.75rem;
                font-weight: 600;
            }
            /* --- User Menu Container (The Trigger) --- */
            .user-menu-container {
                display: flex;
                align-items: center;
                gap: 0.75rem;
                padding: 0 1rem;
                height: 100%;
                cursor: pointer;
                position: relative; /* Anchor for dropdown */
                outline: none;
                transition: background-color 0.1s;
            }

            .user-menu-container:hover,
            .user-menu-container:focus {
                background-color: #393939;
            }

            /* --- The Micro-Dropdown --- */
            .user-dropdown {
                display: none; /* Hidden by default */
                position: absolute;
                top: 100%; /* Snap to bottom of header */
                right: 0;
                width: 250px; /* Compact width */
                
                background-color: #393939;
                border: 1px solid var(--dropdown-border);
                border-top: none; /* Merge with header */
                box-shadow: 0 12px 10px rgba(0,0,0,0.5);
                z-index: 1001;
            }

            /* Show on Hover or Focus (Click) */
            .user-menu-container:hover .user-dropdown,
            .user-menu-container:focus .user-dropdown,
            .user-menu-container:focus-within .user-dropdown {
                display: block;
            }

            /* --- Dropdown Content --- */
            .dropdown-info {
                padding: 1rem;
                border-bottom: 1px solid var(--dropdown-border);
                cursor: default;
            }

            .dropdown-info .label {
                display: block;
                color: var(--color-gray-01);
                font-size: 0.875rem;
                font-weight: 400;
                text-transform: uppercase;
                margin-bottom: 4px;
            }

            .dropdown-info .email {
                display: block;
                color: var(--color-gray-01);
                font-size: 0.875rem;
                font-weight: 400;
                word-break: break-all;
            }

            /* --- Dropdown Actions --- */
            .dropdown-action {
                display: flex;
                align-items: center;
                gap: 0.75rem;
                width: 100%;
                padding: 12px 16px;
                background: transparent;
                border: none;
                color: var(--color-gray-01);
                font-size: 0.875rem;
                font-weight: 400;
                cursor: pointer;
                text-align: left;
                transition: background 0.1s;
            }

            .dropdown-action:hover {
                background-color: var(--interaction-active);
            }
        }
    }
    
    main {
        grid-area: main;
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;

        /* background-color: antiquewhite; */

        .page-header {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 2rem;
            padding: 2rem 2rem 2rem 2rem;
            background-color: lightblue;
            background-color: rgb(250, 252, 254);
            .page-header-toolbar {
                align-self: end;
                display: flex;
                align-items: center;
                justify-content: end;
                gap: 1rem;
            }
            .page-title {
                color: var(--color-title);
                font-weight: 500;
            }
        }

        .tab-bar {
            padding: 0 2rem;
        
            border-bottom: 1px solid lightgray;
            flex-shrink: 0;      /* Don't shrink */
            display: flex;
            gap: 0.25rem;
         
            background-color: rgb(250, 252, 254);
            .tab-bar-item {
                padding: 0.5rem;
                background-color: inherit;
                border: none;
                border-block-end: 3px solid var(--color-gray-03);
                &:hover {
                    border-block-end: 3px solid var(--color-gray-05);
                }
                &.active {
                    border-block-end: 3px solid var(--color-blue-06);
                    .tab-label {
                        font-weight: 500;
                    }
                }
                .tab-label {
                    font-size: 1rem;
                    font-weight: 400;
                    pointer-events: none;
                }
            }
        }

        /* 3. Container (Fluid Height) */
        .tab-container {
            flex: 1;             /* Fill ALL remaining space */
            position: relative;  /* Anchor for children */
            overflow: hidden;    /* Manage inner scrolls */

            /* background-color: aquamarine; */

            .tab {
                height: 100%;
                width: 100%;
                padding: 1rem;
                overflow: hidden;
                display: flex;
                gap: 1rem;
            }
        }
    }
}


.splitview {

    display: grid;
    grid-template-columns: 1fr 3fr;
    height: 100%;
    overflow: hidden;
    padding: 0;

    .splitview-list {

        /* padding: 2rem 2rem 10rem 2rem; */
        overflow-y: scroll;
        border-right: 1px solid lightgray;
        padding: 1rem 0rem 5rem 0rem;
    
        .splitview-list-item {
            
            padding: 0.75rem 1rem;
            font-size: 0.875rem;
            font-weight: 400;
        
            
            &.active {
                background-color: var(--color-gray-03);
                border-left: 3px solid var(--color-blue-06);
                font-weight: 500;
            }

            &:not(.active):hover {
                background-color: var(--color-gray-02);
            }

            .item-name {
                pointer-events: none;
            }
            
        }        

    }

    .splitview-detail {

        padding: 2rem 2rem 8rem 2rem;
        overflow-y: scroll;
        background-color: rgb(250, 252, 254);
        display: flex;
        flex-direction: column;
        gap: 2rem;

        .detail-toolbar {
            display: flex;
            justify-content: end;
            gap: 1rem;
        }

        .detail-heading {
            font-size: 1.125rem;
            font-weight: 500;
        }


    }
}


#catalog h2, #my-courses h2 {
    font-size: 3.6rem;
    font-weight: 600;
    letter-spacing: -0.021em;
    line-height: 1.4;
    margin-top: 0;
}

.search-courses {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 4rem;
}

#search-course {
    border-radius: 1rem;
    border: 1px solid gray;
    padding: 1rem;
    font-size: 1.6rem;
}

#search-course-button {
    border: none;
    background-color: transparent;
}

.search-icon {
    text-align: right;
    margin-left: auto;
    align-self: center;
    width: 1.6rem;
    height: 1.6rem;
    /* stroke: #0895C9; */
    stroke: #3578F6;
    pointer-events: none;
}

#courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 2rem;
    margin-bottom: 2rem;
}

/* .course {
    padding: 2rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    background-color: #ffffff;
    box-shadow: 0px 1px 5px #cccccc;
} */

/* .course-header {
    font-size: 1.2rem;
    font-weight: 400;
} */

/* .course-name a {
    color: #111;
} */

/* .course-name a:hover {
    text-decoration: underline;
} */

.course-subject {
    font-size: 1.8rem;
    font-weight: 600;
}

.course-instructors {
    font-size: 1.4rem;
    font-weight: 400;
    display: flex;
    gap: 0.5rem;
}

.course-instructor {
    color: rgb(2, 112, 112);
    padding: 0.6rem;
    background-color:  rgba(0, 128, 128, .15);
    border-radius: 0.5rem;
    display: block;
    width: fit-content;
}

/* .course-schedule {
    font-size: 1.2rem;
    font-weight: 400;
} */

.course-footer {
    display: flex;
    justify-content: end;
}

.course-footer {
    display: flex;
    justify-content: end;
    align-items: center;
    margin-bottom: 2rem;
}

.course-footer button {
    color: #3578F6;
    font-size: 1.6rem;
    font-weight: 400;
    border: 0;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: transparent;
    height: fit-content;
    justify-self: flex-end;
}

.course-footer button:hover {
    background-color: #EEE;
    cursor: default;
}

.course-footer button:active {
    background-color: #DDDDDD;
    cursor: default;
}


.select-course-button img.selected {
    fill: #3578F6 !important;
}

/* 


.subject-section {
    padding: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.subject-section h3 {
    font-size: 2.4rem;
    font-weight: 500;
    letter-spacing: -0.019em;
    line-height: 1.4;
    margin-top: 0;
}

.subject-section span {
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: -0.011em;
    line-height: 1.4;
    margin-top: 0;
} */