:root {
    --purple: #6C3FC5;
    --purple-light: #8B5CF6;
    --purple-dark: #4C2A99;
    --purple-bg: #EDE9FF;
    --purple-soft: #DDD6FE;
    --yellow: #F59E0B;
    --green: #059669;
    --red: #DC2626;
    --blue: #0369A1;
    --bg: #EDEAF7;
    --white: #ffffff;
    --text: #1E1B3A;
    --text-muted: #6B6894;
    --border: #D4CAFF;
    --shadow: 0 4px 20px rgba(108, 63, 197, 0.14);
    --shadow-hover: 0 8px 30px rgba(108, 63, 197, 0.26);
    --radius: 18px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -120px; right: -120px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(108,63,197,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -100px; left: -100px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(6,214,160,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ── HEADER ── */
.main-header {
    background: var(--white);
    padding: 0.9rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    position: sticky; top: 0;
    z-index: 200;
    box-shadow: 0 2px 16px rgba(108,63,197,0.08);
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--purple);
}

.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(108,63,197,0.3);
    transition: transform 0.3s ease;
}

.logo-icon:hover { transform: scale(1.08); }

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-dashboard-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.2s, transform 0.2s;
}

.close-dashboard-btn:hover {
    opacity: 0.75;
    transform: scale(1.08);
}

/* ── DASHBOARD CONTAINER ── */
.dashboard-container {
    padding: 36px 5%;
    position: relative;
    z-index: 1;
}

/* ── WELCOME BANNER ── */
.dashboard-welcome {
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 60%, var(--purple-light) 100%);
    border-radius: var(--radius);
    box-shadow: 0 6px 28px rgba(108,63,197,0.32);
    padding: 32px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

/* decorative circle behind */
.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-welcome::after {
    content: '';
    position: absolute;
    bottom: -40px; right: 160px;
    width: 140px; height: 140px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.dashboard-welcome h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    line-height: 1.2;
}

.dashboard-welcome h1 span {
    color: #FFD97D;
}

.wave {
    font-size: 1.8rem;
    animation: wave 1.5s infinite;
    display: inline-block;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

.current-time {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── WELCOME TOP ROW ── */
.welcome-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* ── WELCOME RIGHT — edit button only ── */
.welcome-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* ── EDIT PROFILE BUTTON ── */
.welcome-edit-btn {
    background: rgba(255,255,255,0.95);
    color: var(--purple-dark);
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.welcome-edit-btn:hover {
    background: #FFD97D;
    color: var(--purple-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* ── PROFILE BAR — inline under greeting, shown after Google auth ── */
.welcome-profile-bar {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.welcome-profile-bar.visible { display: flex; }

.wpb-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
}

.wpb-google-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(66,133,244,0.2);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 12px 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(66,133,244,0.45);
    white-space: nowrap;
}

/* hide the old inline profile card */
.inline-profile-card { display: none !important; }

/* ── TABLE GRID ── */
.table-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ── CARDS ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 360px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1.5px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}

.card-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.card:hover .card-icon { transform: scale(1.1); }

.card-icon.purple { background: var(--purple-bg); }
.card-icon.yellow { background: #FFF3CD; }
.card-icon.green  { background: #D1FAE5; }
.card-icon.blue   { background: #DBEAFE; }

.card-header h3 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
}

.card-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 0;
}

.card-body::-webkit-scrollbar { width: 6px; }
.card-body::-webkit-scrollbar-track { background: transparent; }
.card-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.card-body::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* ── DAY SELECTOR ── */
.day-selector {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    border-bottom: 1.5px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
    justify-content: space-between;
}

.day-btn {
    flex: 1;
    padding: 3px 4px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-btn:hover {
    background: var(--purple-bg);
    color: var(--purple);
    border-color: var(--purple-light);
}

.day-btn.active {
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: white;
    border-color: var(--purple-dark);
    box-shadow: 0 3px 10px rgba(108,63,197,0.3);
}

/* today-marker: subtle underline dot when NOT active */
.day-btn.today-marker:not(.active) {
    border-color: var(--purple-light);
    color: var(--purple);
    position: relative;
}

/* tiny dot indicator below the day label */
.day-btn.today-marker:not(.active)::after {
    content: '';
    display: block;
    width: 5px; height: 5px;
    background: var(--purple);
    border-radius: 50%;
    margin: 2px auto 0;
}

/* when today IS the active/selected day — keep text white, add gold dot */
.day-btn.today-marker.active {
    color: white;
}

.day-btn.today-marker.active::after {
    content: '';
    display: block;
    width: 5px; height: 5px;
    background: #FFD97D;
    border-radius: 50%;
    margin: 2px auto 0;
}

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table thead th:first-child { width: auto; }
.data-table thead th:last-child  { width: 130px; text-align: center; }
.data-table td:last-child { width: 130px; text-align: center; }

.data-table thead th {
    text-align: left;
    padding: 7px 16px;
    background: var(--purple-soft);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--purple-dark);
    font-weight: 900;
    position: sticky; top: 0;
}

.data-table tbody tr {
    border-top: 1px solid var(--border);
    transition: all 0.15s;
}

.data-table tbody tr:hover { background: #F5F2FF; }

.data-table td {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.subject-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--purple-soft);
    color: var(--purple-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.2s;
}

.subject-pill:hover {
    background: var(--purple);
    color: white;
}

.time-chip {
    background: #DBEAFE;
    color: var(--blue);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
}

.status-badge:hover {
    opacity: 0.85;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.status-pending { background: #FEF3C7; color: #92400E; }
.status-done    { background: #D1FAE5; color: #065F46; }

/* ── ANNOTATIONS ── */
.accordion-list { padding: 8px; }

.lesson-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: all 0.2s;
}

.lesson-dropdown:hover {
    border-color: var(--purple-light);
    box-shadow: 0 2px 8px rgba(108,63,197,0.1);
}

.lesson-dropdown summary {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    user-select: none;
    font-weight: 700;
    font-size: 13px;
}

.lesson-dropdown summary::-webkit-details-marker { display: none; }
.lesson-dropdown summary:hover { background: var(--purple-bg); }

.lesson-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.lesson-title-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lesson-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-meta-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.subject-tag  { background: #DBEAFE; color: #1E40AF; }
.division-tag { background: #D1FAE5; color: #065F46; }
.class-tag    { background: var(--purple-soft); color: var(--purple-dark); }

.folder-icon { font-size: 18px; }

.chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

details[open] .chevron { transform: rotate(90deg); }

.count-tag {
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
}

.lesson-content {
    padding: 10px 16px 14px 44px;
    background: #FDFCFF;
}

.annotation-links { display: flex; flex-direction: column; gap: 8px; }

.anno-item {
    background: var(--white);
    border: 1.5px solid var(--border);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.anno-item:hover {
    border-color: var(--purple-light);
    background: var(--purple-bg);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(108,63,197,0.15);
}

.anno-text {
    flex-grow: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.file-icon { font-size: 16px; }
.anno-actions { display: flex; gap: 6px; }

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    opacity: 0.7;
}

.action-btn:hover {
    opacity: 1;
    background: var(--purple-soft);
}

.action-btn.delete:hover { background: #FFE8ED; }

/* ── QUICK LINKS ── */
.link-list {
    margin: 0;
    padding: 14px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}

.link-list li a:hover {
    background: var(--purple-bg);
    color: var(--purple-dark);
    border-color: var(--purple-light);
    transform: translateX(4px);
}

.link-emoji { font-size: 16px; }

/* ── MODAL ── */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(30, 27, 58, 0.5);
    backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding-top: 10px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.open { display: flex; }

.modal-content {
    background: var(--white);
    margin: 8% auto;
    border-radius: var(--radius);
    width: 50%;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(108,63,197,0.25);
    overflow: hidden;
    animation: zoomIn 0.25s ease;
    border: 1.5px solid var(--border);
}

@keyframes zoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.modal-controls { display: flex; align-items: center; gap: 12px; }

.modal-action-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.5);
    padding: 6px 14px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s;
}

.modal-action-btn:hover {
    background: white;
    color: var(--purple);
}

.close-btn {
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    transition: opacity 0.2s;
}

.close-btn:hover { opacity: 1; }

.modal-body {
    padding: 22px;
    line-height: 1.7;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    max-height: 60vh;
    overflow-y: auto;
}

[contenteditable="true"]:focus {
    outline: none;
    background: var(--purple-bg);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 0 0 2px var(--purple-light);
}

/* ── OTP ROW ── */
.otp-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.otp-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    transition: all 0.2s;
}

.otp-row input:focus {
    outline: none;
    border-color: var(--purple);
    background: white;
    box-shadow: 0 0 0 3px rgba(108,63,197,0.1);
}

.otp-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: white;
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(108,63,197,0.2);
}

.otp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108,63,197,0.3);
}

.otp-btn.verify { background: var(--green); }

/* ── EDIT PROFILE MODAL ── */
.edit-profile-modal-content {
    width: 440px;
    min-width: 320px;
}

.edit-profile-body { padding: 24px !important; }

.ep-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.ep-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--purple-bg);
    border: 3px solid var(--purple-light);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(108,63,197,0.2);
}

.ep-change-photo-btn {
    background: var(--purple-bg);
    color: var(--purple);
    border: 1.5px solid var(--border);
    padding: 6px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s;
}

.ep-change-photo-btn:hover {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

.ep-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.ep-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ep-label {
    font-size: 9px;
    letter-spacing: 1.2px;
    color: var(--purple-dark);
    font-weight: 900;
    text-transform: uppercase;
}

.ep-input {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s;
    outline: none;
}

.ep-input:focus {
    border-color: var(--purple-light);
    box-shadow: 0 0 0 3px rgba(108,63,197,0.12);
    background: white;
}

.ep-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ep-cancel-btn {
    padding: 9px 20px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: white;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-cancel-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.ep-save-btn {
    padding: 9px 22px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(108,63,197,0.35);
    transition: all 0.2s;
}

.ep-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(108,63,197,0.45);
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
    .dashboard-container { padding: 24px 3%; }
}

@media (max-width: 900px) {
    .table-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-header { padding: 12px 15px; }
    .dashboard-container { padding: 18px 14px; }
    .card { height: 340px; }
    .modal-content { width: 90%; margin: 10% auto; }
    .dashboard-welcome { padding: 20px 18px 16px; }
    .dashboard-welcome h1 { font-size: 1.3rem; }
    .edit-profile-modal-content { width: 90%; }
}

@media (max-width: 600px) {
    .dashboard-welcome h1 { font-size: 1.1rem; }
    .table-grid { gap: 16px; }
    .card { height: 320px; }
    .card-header { padding: 12px 16px; }
    .day-selector { padding: 8px 12px; gap: 4px; }
    .day-btn { padding: 5px 2px; font-size: 11px; }

    .dashboard-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .welcome-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    /* bottom row — time on its own line, edit button centered below */
    .welcome-bottom-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .welcome-bottom-row .current-time {
        font-size: 0.8rem;
        width: 100%;
        text-align: left;
    }

    .welcome-right {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    :root { --radius: 14px; --radius-sm: 8px; }

    .logo { font-size: 1rem; gap: 8px; }
    .logo-icon { width: 36px; height: 36px; font-size: 18px; }

    .edit-profile-modal-content {
        width: 95%;
        max-width: 100%;
        border-radius: 14px;
        max-height: 92vh;
        overflow-y: auto;
    }

    .edit-profile-body { padding: 12px !important; padding-bottom: 20px !important; }

    .otp-row { flex-direction: column; }
    .otp-row .ep-input { width: 100%; }
    .otp-row .otp-btn { width: 100%; }

    .ep-actions { flex-direction: column; margin-top: 18px; }
    .ep-actions button { width: 100%; }

    body { overflow-x: hidden; }

    .modal-body { max-height: 50vh; }

    .welcome-edit-btn { font-size: 12px; padding: 8px 16px; }
}

/* ── MODAL SAFE OVERRIDES ── */
#annoModal, #editProfileModal { display: none !important; }
#annoModal.open, #editProfileModal.open { display: flex !important; }
/* ── User Filter Tabs ── */
.user-filter-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1.5px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}
.user-filter-btn {
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.user-filter-btn:hover { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-light); }
.user-filter-btn.active { background: var(--purple); color: white; border-color: var(--purple-dark); }
.user-filter-count {
    background: rgba(255,255,255,0.3);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
}
.user-filter-btn:not(.active) .user-filter-count { background: var(--purple-soft); color: var(--purple-dark); }

/* ── Quick Role Buttons ── */
.user-quick-actions { display: flex; gap: 5px; flex-shrink: 0; }
.quick-role-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.quick-role-btn.promote { background: #FEF3C7; color: #92400E; }
.quick-role-btn.promote:hover { background: #F59E0B; color: white; }
.quick-role-btn.demote { background: #FEE2E2; color: #991B1B; }
.quick-role-btn.demote:hover { background: #EF4444; color: white; }
.quick-role-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* ── Manage Teachers card scrollable ── */
#card-manage-users .card-body {
    overflow-y: auto;
    max-height: 280px;
}

#card-manage-users .card-body::-webkit-scrollbar { width: 6px; }
#card-manage-users .card-body::-webkit-scrollbar-track { background: transparent; }
#card-manage-users .card-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ── LP Overrides card scrollable ── */
#card-lp-overrides .card-body {
    overflow-y: auto;
}