body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    background: #e1e9ff;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #1e293b;
    color: white;
    height: 100vh;
    padding: 20px;
    transition: 0.3s;
}

/* Sidebar collapse */
.sidebar.closed {
    width: 70px;
    padding: 20px 10px;
}

/* Hide title */
.sidebar.closed h2 {
    display: none;
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Center header when collapsed */
.sidebar.closed .sidebar-header {
    justify-content: center;
}

/* Toggle button */
#menuBtn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Sidebar list */
.sidebar ul {
    list-style: none;
    padding: 0;
}

/* IMPORTANT: Flex layout for icon + text */
.sidebar li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
}

/* Hover + active */
.sidebar li:hover, .active {
    background: #334155;
}

/* 🔥 MAIN FIX: Hide text when collapsed */
.sidebar.closed li span {
    display: none;
}

/* Center only icons */
.sidebar.closed li {
    justify-content: center;
}

/* Main */
.main {
    flex: 1;
    padding: 20px;
    overflow-x: hidden;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.topbar input {
    padding: 10px;
    width: 300px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* Filters */
.filters select {
    padding: 8px;
    margin-right: 10px;
    border-radius: 6px;
}

/* Section spacing */
.section {
    margin-top: 25px;
}

/* SUBJECT SCROLL */
.subject-container {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

.subject-container::-webkit-scrollbar {
    display: none;
}

.subject-scroll {
    display: flex;
    gap: 15px;
    min-width: max-content;
}

.subject-card {
    min-width: 130px;
    background: rgb(247, 203, 116);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.subject-card:hover {
    background: #3b82f6;
    color: white;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Limit recent */
.limited .extra {
    display: none;
}

.card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card h3 {
    margin: 0;
}

.card p {
    font-size: 14px;
    color: gray;
}

/* Buttons */
.card button {
    margin-top: 10px;
    margin-right: 5px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: #3b82f6;
    color: white;
    cursor: pointer;
}

.card button:hover {
    background: #2563eb;
}

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-all {
    color: #3b82f6;
    cursor: pointer;
    font-size: 14px;
}