/* === teacher-portal/css/teacher-portal-base.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Base Styles
   ============================================================================ */

/* All CSS from your provided code is included here */
/* It has been slightly enhanced for better consistency and responsiveness. */
:root {
    --primary-color: #ff8c00; /* OGA Orange */
    --primary-dark: #cc7000;
    --primary-light: #ffb366;
    --accent-color: #4db5c3;  /* Teal accent */
    --accent-dark: #3a9aa8;
    --background-dark: #1e1e1e;
    --surface-color: #2d2d2d; /* Slightly lighter background for cards */
    --border-color: #444;
    --text-light: #f5f5f5;
    --text-dim: #a0a0a0;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --error-color: #F44336;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --z-modal: 2000;
    --z-loading: 2001; /* Higher than modal */
    --z-header: 100;
    --z-background: -1;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }
.btn-icon-left { margin-right: 8px; }
.text-dim { color: var(--text-dim); }

/* --- Global & Layout --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; background-color: var(--background-dark); color: var(--text-light); line-height: 1.6; }
.background-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 560'%3e%3cg mask='url(%23a)' fill='none'%3e%3crect width='1440' height='560' fill='rgba(30,30,30,1)'/%3e%3cpath d='M49.66 43.41L86.9 64.91v43l-37.24 21.5-37.24-21.5v-43zm0 258l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM12.42 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM124.14 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM86.9 365.91l37.24 21.5v43L86.9 451.91l-37.24-21.5v-43zM86.9 494.91l37.24 21.5v43L86.9 580.91l-37.24-21.5v-43zM124.14 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM161.38-21.09L198.62.41v43l-37.24 21.5-37.24-21.5v-43zM161.38 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM161.38 236.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM161.38 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM198.62 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM235.86 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM273.1 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM347.58 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM347.58 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM310.34 236.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM310.34 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM347.58 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM384.82 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM422.06 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM422.06 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM384.82 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM496.54 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM459.3 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM496.54 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM459.3 236.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM496.54 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM496.54 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM533.78-21.09L571.02.41v43l-37.24 21.5-37.24-21.5v-43zM533.78 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM533.78 236.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM533.78 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM608.26 236.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM645.5 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM645.5 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM719.98 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM682.74 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM719.98 301.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM682.74 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM719.98 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM682.74 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM757.22-21.09l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM794.46 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM757.22 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM794.46 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM794.46 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM831.7-21.09l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM868.94 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM831.7 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM831.7 236.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM831.7 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM868.94 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM831.7 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM868.94 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM943.42 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM906.18 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM943.42 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM943.42 301.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM906.18 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM943.42 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM943.42 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM980.66-21.09l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM980.66 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1017.9 301.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1092.38 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1092.38 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1055.14 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1166.86 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1129.62 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1166.86 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1166.86 301.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1129.62 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1166.86 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1166.86 559.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1204.1-21.09l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1241.34 172.41l37.25 21.5v43l-37.25 21.5-37.24-21.5v-43zM1241.34 301.41l37.25 21.5v43l-37.25 21.5-37.24-21.5v-43zM1241.34 430.41l37.25 21.5v43l-37.25 21.5-37.24-21.5v-43zM1204.1 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1278.59-21.09l37.24 21.5v43l-37.24 21.5-37.25-21.5v-43zM1315.83 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1278.59 107.91l37.24 21.5v43l-37.24 21.5-37.25-21.5v-43zM1315.83 172.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1278.59 236.91l37.24 21.5v43l-37.24 21.5-37.25-21.5v-43zM1278.59 365.91l37.24 21.5v43l-37.24 21.5-37.25-21.5v-43zM1315.83 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1278.59 494.91l37.24 21.5v43l-37.24 21.5-37.25-21.5v-43zM1353.07-21.09l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1390.31 43.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1390.31 301.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1353.07 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1427.55 107.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1427.55 365.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1464.79 430.41l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43zM1427.55 494.91l37.24 21.5v43l-37.24 21.5-37.24-21.5v-43z' stroke='url(%23b)' stroke-width='2'/%3e%3c/g%3e%3cdefs%3e%3cmask id='a'%3e%3crect width='1440' height='560' fill='%23fff'/%3e%3c/mask%3e%3cradialGradient id='b' r='772.53' gradientUnits='userSpaceOnUse' cx='720' cy='280'%3e%3cstop offset='.4' stop-color='rgba(0,0,0,1)'/%3e%3cstop offset='.75' stop-color='rgba(255,133,0,1)'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e");
    background-size: cover;
}

.container { max-width: 1440px; margin: 0 auto; padding: 2rem; }
.dashboard-section { background: rgba(45, 45, 45, 0.7); backdrop-filter: blur(10px); border-radius: 1rem; padding: 1.5rem; margin-bottom: 2rem; border: 1px solid var(--border-color); min-width: 0; overflow: hidden; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
h2, h3, h4 { color: var(--text-light); }
.section-header h2 { font-size: 1.5rem; color: var(--primary-color); }

/* --- Buttons --- */
.button { display: inline-block; padding: 0.75rem 1.5rem; background: var(--primary-color); color: var(--background-dark); border: none; border-radius: 0.5rem; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; transition: all 0.2s; }
.button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.button.secondary { background: var(--surface-color); color: var(--text-light); border: 1px solid var(--border-color); }
.button.secondary:hover { background: rgba(255, 255, 255, 0.1); }
.button.danger { background: var(--error-color); color: white; }
.button.danger:hover { background: #c0392b; }
.button.small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.button:disabled { background: #555; cursor: not-allowed; transform: none; }

/* --- Modals & Overlays --- */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: var(--z-loading); }
.loading-spinner { width: 50px; height: 50px; border: 4px solid rgba(255, 255, 255, 0.2); border-radius: 50%; border-top-color: var(--primary-color); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: var(--z-modal);
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
    max-width: 500px;
    border-left: 4px solid var(--primary-color);
}

.toast-notification {
    padding: 1.25rem;
    border-left-width: 5px;
}

.toast-success {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, #2d2d2d 0%, #1e3a1e 100%);
}

.toast-error {
    border-left-color: var(--error-color);
    background: linear-gradient(135deg, #2d2d2d 0%, #3a1e1e 100%);
}

.toast-info {
    border-left-color: var(--accent-color);
    background: linear-gradient(135deg, #2d2d2d 0%, #1e2a3a 100%);
}

.toast-message {
    border-left-color: #4db5c3;
    background: linear-gradient(135deg, #2d2d2d 0%, #1e3a3a 100%);
}

.toast-time-off {
    border-left-color: #ff9d1a;
    background: linear-gradient(135deg, #2d2d2d 0%, #3a2f1e 100%);
}

.toast-hidden {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* --- Loading Skeleton --- */
.skeleton-card {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    height: 80px;
    margin-bottom: 0.75rem;
}
.skeleton-card.tall { height: 120px; }
.skeleton-card.short { height: 44px; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: unset;
        max-width: unset;
    }
}

@media (max-width: 768px) {
    .button, .tab-button, .filter-btn, .nav-item {
        min-height: 44px; min-width: 44px;
    }
    .button.small { min-height: 36px; padding: 0.5rem 0.75rem; }
}

@media (max-width: 480px) {
    .dashboard-section { padding: 1rem; border-radius: 0.75rem; }
    .section-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .section-header .button { width: 100%; }
}

/* --- Dashboard Section Text Colors --- */
.dashboard-section p,
.dashboard-section label,
.dashboard-section span,
.dashboard-section li,
.dashboard-section td,
.dashboard-section th {
    color: ghostwhite;
}

/* Specific override for dimmer text to also be lighter */
.dashboard-section .text-dim,
.dashboard-section .info-label,
.dashboard-section .kpi-label,
.dashboard-section .teacher-greeting {
    color: #dcdcdc !important;
}

.dashboard-section .section-header h2 {
    color: #f08c00;
    text-transform: uppercase;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    font-weight: 700;
}

/* ============================== */
/* Reports List                   */
/* (Moved from students.css)      */
/* ============================== */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.report-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.report-item div {
    margin-right: 1rem;
}

.report-item h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-light);
}


/* === teacher-portal/css/teacher-portal-auth.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Authentication & Login
   ============================================================================ */

/* --- Login --- */
.login-page { display: flex; min-height: 100vh; background: rgba(0,0,0,0.4); backdrop-filter: blur(5px); }
.login-section { width: 100%; max-width: 400px; margin: auto; padding: 2rem; background: var(--surface-color); backdrop-filter: blur(10px); border-radius: 1rem; border: 1px solid var(--border-color); }
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; color: var(--text-light); }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 0.75rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); border-radius: 0.5rem; color: white; font-size: 1rem; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.3); }

@media (max-width: 480px) {
    .login-section { margin: 1rem; padding: 1.5rem; max-width: none; }
}

/* --- File Input Styling --- */
.input-group input[type="file"],
.form-group input[type="file"] {
    padding: 0;
    background: transparent;
    border: none;
}
.input-group input[type="file"]::file-selector-button,
.form-group input[type="file"]::file-selector-button {
    padding: 0.6rem 1.2rem;
    background: var(--surface-color);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.2s;
}
.input-group input[type="file"]::file-selector-button:hover,
.form-group input[type="file"]::file-selector-button:hover {
    background: var(--primary-color);
    color: var(--background-dark);
    border-color: var(--primary-color);
}


/* === teacher-portal/css/teacher-portal-layout.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Layout (Header, Navigation, KPI Cards)
   ============================================================================ */

/* --- Header --- */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; background: var(--surface-color); padding: 1rem 1.5rem; border-radius: 1rem; margin-bottom: 2rem; border: 1px solid var(--border-color); }
.teacher-profile-container { display: flex; align-items: center; gap: 1rem; }
.profile-photo { width: 60px; height: 60px; border-radius: 50%; background-color: var(--primary-dark); display: flex; align-items: center; justify-content: center; overflow: hidden; border: 2px solid var(--primary-color); }
.profile-photo img, .avatar-img { width: 100%; height: 100%; object-fit: cover; }
.initials-placeholder { font-size: 1.5rem; font-weight: bold; color: white; }
.teacher-name { font-size: 1.5rem; font-weight: bold; }
.teacher-greeting { color: var(--text-dim); }
.kpi-cards-container { display: flex; gap: 1.5rem; flex-grow: 1; justify-content: center; margin: 0 2rem 2rem; }
.kpi-card { background: rgba(0, 0, 0, 0.2); padding: 0.75rem 1.5rem; border-radius: 0.75rem; text-align: center; min-width: 160px; border-top: 3px solid var(--primary-color); }
.kpi-value { display: block; font-size: 2.2rem; font-weight: 700; color: var(--text-light); line-height: 1.2; }
.kpi-label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-top: 0.25rem; }

/* --- Card Base --- */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

/* --- Navigation --- */
.nav-menu { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 1rem; background: var(--surface-color); border-radius: 0.5rem; margin-bottom: 2rem; }
.nav-item { padding: 0.5rem 1rem; color: var(--text-dim); text-decoration: none; border-radius: 0.25rem; transition: background-color 0.2s, color 0.2s; font-weight: 500; position: relative; display: inline-flex; align-items: center; gap: 0.5rem; }
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-light); }
.nav-item.active { background: var(--primary-color); color: var(--background-dark); }

.nav-section-label {
    width: 100%;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.6;
}
.nav-section-label:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--error-color);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.nav-item.active .nav-badge {
    background: var(--background-dark);
    color: var(--primary-color);
}

.nav-badge.hidden {
    display: none;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.dashboard-grid .full-width-grid-item {
    grid-column: 1 / -1;
}

/* === Mobile Navigation === */

/* Hamburger button — hidden on desktop */
.nav-toggle { display: none; }

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .nav-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; background: var(--surface-color);
        border: 1px solid var(--border-color); border-radius: 0.5rem;
        color: var(--text-light); font-size: 1.2rem; cursor: pointer;
    }
    .nav-menu {
        display: none; flex-direction: column; flex-wrap: nowrap; position: fixed;
        top: 0; left: 0; width: 280px; height: 100vh;
        background: var(--surface-color); z-index: 1500;
        padding: 1rem; overflow-y: auto; box-shadow: 4px 0 20px rgba(0,0,0,0.5);
        margin-bottom: 0; border-radius: 0;
    }
    .nav-menu.open { display: flex; }
    .nav-overlay {
        display: none; position: fixed; top: 0; left: 0; width: 100%;
        height: 100%; background: rgba(0,0,0,0.5); z-index: 1499;
    }
    .nav-overlay.open { display: block; }

    /* Header stacks vertically */
    .dashboard-header {
        flex-direction: column; gap: 1rem; padding: 1rem;
        position: relative;
    }
    .dashboard-header .nav-toggle {
        position: absolute; top: 1rem; right: 1rem;
    }
    .kpi-cards-container {
        margin: 0; gap: 0.75rem; width: 100%; justify-content: space-between;
    }
    .kpi-card { min-width: 0; flex: 1; padding: 0.5rem 0.75rem; }
    .kpi-value { font-size: 1.5rem; }
    .teacher-name { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .kpi-cards-container { flex-direction: column; align-items: center; }
    .kpi-card { text-align: center; min-width: 200px; }
    .container { padding: 0.75rem; }
}

/* --- Dashboard Widget Cards --- */
.message-preview-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem; background: var(--surface-color); border-radius: 8px;
    margin-bottom: 0.5rem; cursor: pointer;
    border-left: 3px solid var(--primary-color); transition: background 0.2s;
}
.message-preview-card:hover { background: var(--background-dark); }

.time-off-card {
    padding: 1rem; background: var(--surface-color); border-radius: 8px;
    margin-bottom: 0.75rem;
}
.time-off-card-header {
    display: flex; justify-content: space-between; align-items: start;
    margin-bottom: 0.5rem;
}
.time-off-status-badge {
    padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.8rem;
    font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem;
}
.time-off-admin-notes {
    margin-top: 0.75rem; padding: 0.5rem; background: var(--background-dark);
    border-radius: 4px; font-size: 0.85rem;
}

.feedback-compact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--warning-color);
}
.feedback-compact-card > div:first-child {
    flex: 1;
    min-width: 0;
}
.feedback-compact-card > div:first-child strong {
    display: block;
    color: var(--text-light);
}
.feedback-compact-card .feedback-student-count {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-dim);
    white-space: nowrap;
}
.feedback-compact-card .button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* --- Goals Widget & Scoreboard (Dashboard) --- */
.goals-widget .section-header h2,
.scoreboard-widget .section-header h2 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.goals-widget .button.accent-button {
    background-color: var(--primary-color);
    color: var(--background-dark);
}
.goals-widget .button.accent-button:hover {
    background-color: var(--primary-dark);
}

.goals-widget h3 {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.goal-metric-card {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 6px;
}

.goal-metric-card label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.goal-metric-card span {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Scoreboard Styling */
#goalScoreboardContainer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.scoreboard-header,
.scoreboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
}

.scoreboard-header {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.scoreboard-header span:not(:first-child),
.scoreboard-row span:not(:first-child) {
    text-align: right;
}

.scoreboard-row {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 0.5rem;
    border-radius: 4px;
}

/* Progress Bars (Goal Scoreboard) */
.progress-bar-track {
    background-color: #1e1e1e;
    border-radius: 1rem;
    height: 24px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    background-color: var(--primary-color);
    height: 100%;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.5s ease-in-out;
}

.progress-bar-fill span {
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}


/* === teacher-portal/css/teacher-portal-modals.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Modals & Overlays
   ============================================================================ */

/* --- Core Modal Styles --- */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); display: none; justify-content: center; align-items: center; z-index: var(--z-modal); opacity: 0; transition: opacity 0.3s ease; }
.modal.active { display: flex; opacity: 1; }
.modal-content { background: var(--background-dark); border-radius: 1rem; padding: 2rem; max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border-color); }
.modal-content.large { max-width: 950px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { margin: 0; color: var(--primary-color); }
.close-modal { background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer; transition: color 0.2s; }
.close-modal:hover { color: var(--text-light); }
.modal-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* --- Dynamic Modal Styles --- */

/* Styles the header section with the title and close button */
.modal.dynamic-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #444;
}

/* Styles the main title "SCHEDULE: ..." */
.modal.dynamic-modal .modal-header h2 {
    margin: 0;
    color: #f08c00;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Styles the 'x' close button */
.modal.dynamic-modal .close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.modal.dynamic-modal .close-modal:hover {
    color: #fff;
}

/* Skill Edit Modal Close Button */
.modal.dynamic-modal .close-skill-edit-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.modal.dynamic-modal .close-skill-edit-modal:hover {
    color: #fff;
}

/*
  This uses CSS Grid to create a clean two-column layout for the labels
  and their corresponding inputs, ensuring they align perfectly.
*/
.modal.dynamic-modal .oga-form .form-group {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Styles the labels (Start Time, Instructor, etc.) */
.modal.dynamic-modal .oga-form label {
    font-weight: 500;
    color: #a0a0a0;
    text-align: right;
}

/* General styles for all input fields and select dropdowns */
.modal.dynamic-modal .oga-form input,
.modal.dynamic-modal .oga-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #1e1e1e;
    border: 1px solid #555;
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 1rem;
}

/* Makes the calendar icon in the date picker visible on a dark background */
.modal.dynamic-modal .oga-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Styles for the disabled instructor dropdown */
.modal.dynamic-modal .oga-form select:disabled {
    color: #888;
    background-color: #252525;
}

/* Styles the container for the action buttons */
.modal.dynamic-modal .form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
}

/* =====================================================
   FORM-GRID: Standard modal form layout (Digital Products, etc.)
   ===================================================== */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.form-grid .form-group label {
    font-weight: 500;
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.9rem;
}

.form-grid .form-group input,
.form-grid .form-group select,
.form-grid .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--background-dark, #1e1e1e);
    border: 1px solid #555;
    border-radius: 6px;
    color: var(--text-primary, #f0f0f0);
    font-size: 1rem;
    box-sizing: border-box;
}

.form-grid .form-group input:focus,
.form-grid .form-group select:focus,
.form-grid .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #ff8c00);
}

.form-grid .form-group input:disabled,
.form-grid .form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-grid .form-group small,
.form-grid .form-group .text-dim {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.form-grid .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
}

.form-grid .form-actions.full-width {
    grid-column: 1 / -1;
}

.oga-form .form-hint {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Adjust the form group to handle the new div wrapper */
.oga-form .form-group {
    grid-template-columns: 150px 1fr;
    align-items: flex-start;
    padding-top: 0.5rem;
}

/* Dynamic modal button styles */
.modal.dynamic-modal .button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

/* Primary "Schedule Workshop" button */
.modal.dynamic-modal .button:not(.secondary) {
    background-color: #f08c00;
    color: #111;
}

.modal.dynamic-modal .button:not(.secondary):hover {
    background-color: #ff9d1a;
}

/* Secondary "Cancel" button */
.modal.dynamic-modal .button.secondary {
    background-color: #4a4a4a;
    color: #f0f0f0;
}

.modal.dynamic-modal .button.secondary:hover {
    background-color: #5a5a5a;
}

/* Make modal content scrollable if too tall */
.modal.dynamic-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal.dynamic-modal .modal-body {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar styling for modal */
.modal.dynamic-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal.dynamic-modal .modal-body::-webkit-scrollbar-track {
    background: var(--background-dark, #1e1e1e);
    border-radius: 3px;
}

.modal.dynamic-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color, #444);
    border-radius: 3px;
}

.modal.dynamic-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color, #ff8c00);
}

/* --- Form Styling --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); font-weight: 500; font-size: 0.95rem; }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-light);
    font-size: 1rem;
    transition: border-color 0.2s, background-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 140, 0, 0.05);
}
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; background: var(--background-dark); color: var(--text-light); }
select.form-control option { background: var(--background-dark); color: var(--text-light); }
select.form-control optgroup { background: var(--surface-color); color: var(--primary-color); font-weight: 600; }
textarea.form-control { resize: vertical; min-height: 100px; font-family: inherit; }
input[type="checkbox"] {
    width: auto !important;
    min-width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* IMPROVED: Modal Footer Buttons */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
}

.footer-actions-left,
.footer-actions-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-actions-right {
    margin-left: auto;
}

/* Button sizing */
.modal-footer .button {
    padding: 0.65rem 1.25rem;
    min-width: 100px;
    white-space: nowrap;
}

.modal-footer .button i {
    margin-right: 0.5rem;
}

/* Responsive button layout */
@media (max-width: 768px) {
    .header-actions {
        width: 100%;
    }

    .header-actions .button {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-actions-left,
    .footer-actions-right {
        width: 100%;
        justify-content: center;
    }

    /* Modal sizing for mobile */
    .modal-content { width: 95vw; max-height: 90vh; padding: 1rem; margin: 1rem; }
    .modal-content.large, .modal-content.large-modal { width: 95vw; max-width: none; }
    .form-row { flex-direction: column; }
    .form-group { grid-template-columns: 1fr; }
    .modal-footer .button { width: 100%; }

    /* Teacher detail modal responsive */
    .modal-content.teacher-detail {
        max-width: none;
        width: 95vw;
        padding: 0;
    }
    .teacher-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    .modal-content.teacher-detail .modal-header {
        padding: 1rem;
        gap: 0.75rem;
    }
    .modal-content.teacher-detail .modal-header h2 {
        font-size: 1.2rem;
    }
    .modal-content.teacher-detail .modal-header .profile-photo {
        width: 44px;
        height: 44px;
    }
    .modal-content.teacher-detail .modal-header .teacher-detail-badges {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    /* Info column compacts */
    .teacher-info-column {
        gap: 1rem;
    }
    .teacher-info-column .info-group + .info-group {
        margin-top: 0.5rem;
    }
    .teacher-info-column .info-group h4 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    /* Tabs scroll horizontally */
    .teacher-management-column .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
        padding-bottom: 0.25rem;
        gap: 0.25rem;
    }
    .teacher-management-column .tab-button {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
    /* Scrollable containers shorter on mobile */
    .teacher-management-column .scrollable-md {
        max-height: 300px;
    }
    .teacher-management-column .scrollable-sm {
        max-height: 200px;
    }
    /* Charts stack and reduce height */
    .teacher-charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .teacher-chart-card {
        padding: 1rem;
    }
    .teacher-chart-card .chart-container {
        height: 220px;
    }
    /* Section info boxes */
    .teacher-management-column .section-info-box {
        padding: 0.75rem;
    }
    .teacher-management-column .section-info-box h4 {
        font-size: 0.9rem;
    }
    /* Forms inside tabs */
    .teacher-management-column .form-row {
        flex-direction: column;
    }
    .teacher-management-column .form-group {
        grid-template-columns: 1fr;
    }
    .teacher-management-column .form-control {
        min-height: 44px;
    }
    .teacher-management-column .button {
        min-height: 44px;
    }
    /* Performance review cards */
    .performance-reviews-section {
        max-height: 350px;
    }
    .review-card {
        padding: 1rem;
    }
    .review-card-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    /* Owner notes */
    .owner-notes-container {
        padding: 1rem;
    }
    .owner-notes-textarea {
        min-height: 120px;
    }
    /* Signature preview */
    #signaturePreviewContainer {
        padding: 0.75rem;
        overflow-x: auto;
    }
}
@media (max-width: 480px) {
    .modal-content { padding: 0.75rem; }
    .modal-header h2 { font-size: 1.1rem; }
    .modal-content.teacher-detail {
        width: 100vw;
        max-height: 95vh;
        margin: 0;
        border-radius: 0;
    }
    .modal-content.teacher-detail .modal-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .modal-content.teacher-detail .modal-header h2 {
        font-size: 1rem;
    }
    .teacher-detail-grid {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .teacher-info-column .metric-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .teacher-info-column .metric-card {
        padding: 0.75rem;
    }
    .teacher-info-column .metric-card .metric-value {
        font-size: 1.2rem;
    }
    .teacher-management-column .tab-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    .teacher-chart-card .chart-container {
        height: 180px;
    }
    .review-card {
        padding: 0.75rem;
    }
    .review-section h6 {
        font-size: 0.8rem;
    }
}

/* ============================== */
/* Teacher Detail Modal           */
/* (Moved from students.css)      */
/* ============================== */
.modal-content.teacher-detail {
    max-width: 950px;
    background-color: #2a2a2e;
    border: 1px solid #444;
}

.modal-content.teacher-detail .modal-header {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-dark) 100%);
    border-bottom: 2px solid var(--primary-color);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.modal-content.teacher-detail .modal-header .profile-photo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.modal-content.teacher-detail .modal-header .teacher-detail-header-info {
    flex: 1;
}
.modal-content.teacher-detail .modal-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: 700;
}
.modal-content.teacher-detail .modal-header .teacher-detail-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.modal-content.teacher-detail .modal-header .close-modal {
    align-self: flex-start;
}

.teacher-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.teacher-info-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.teacher-info-column .profile-section {
    text-align: center;
    margin-bottom: 1.5rem;
    display: none;
}
.teacher-info-column .profile-photo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
}
.teacher-info-column .info-group + .info-group {
    margin-top: 2rem;
}
.teacher-info-column .info-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.teacher-info-column .info-item {
    font-size: 0.9em;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}
.teacher-info-column .info-item label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9em;
}
.teacher-info-column .metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.teacher-info-column .metric-card {
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.teacher-info-column .metric-card h3 {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin: 0;
}
.teacher-info-column .metric-card .metric-value {
    font-size: 1.5rem;
    line-height: 1.1;
}

.teacher-management-column {
    padding-top: 10px;
}
.teacher-management-column .tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
.teacher-management-column .tab-button {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 4px 4px 0 0;
}
.teacher-management-column .tab-button:hover {
    background-color: #3a3a3c;
}
.teacher-management-column .tab-button.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}
.teacher-management-column .tab-panel > h4 {
    text-transform: uppercase;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.teacher-management-column .tab-content {
    padding-top: 1rem;
}
#signaturePreviewContainer {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}
#copySignatureBtn {
    width: 100%;
}

/* ============================== */
/* Performance Reviews            */
/* (Moved from students.css)      */
/* ============================== */
.performance-reviews-section {
    max-height: 400px;
    overflow-y: auto;
}

.review-card {
    background: var(--surface-color);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.review-date {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-color);
}

.review-section {
    margin-bottom: 1rem;
}

.review-section:last-child {
    margin-bottom: 0;
}

.review-section h6 {
    color: var(--text-light);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.review-section p {
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

/* =========================================================== */
/* Teacher Detail Modal - Responsive Overrides                  */
/* MUST come AFTER desktop styles to win same-specificity rules */
/* =========================================================== */
@media (max-width: 768px) {
    .modal-content.teacher-detail {
        max-width: none;
        width: 95vw;
        padding: 0;
    }
    .modal-content.teacher-detail .modal-header {
        padding: 1rem;
        gap: 0.75rem;
    }
    .modal-content.teacher-detail .modal-header h2 {
        font-size: 1.2rem;
    }
    .modal-content.teacher-detail .modal-header .profile-photo {
        width: 44px;
        height: 44px;
    }
    .modal-content.teacher-detail .modal-header .teacher-detail-badges {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .teacher-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    .teacher-info-column {
        gap: 1rem;
    }
    .teacher-info-column .info-group + .info-group {
        margin-top: 0.5rem;
    }
    .teacher-info-column .info-group h4 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    .teacher-management-column .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
        padding-bottom: 0.25rem;
        gap: 0.25rem;
    }
    .teacher-management-column .tab-button {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
    .teacher-management-column .scrollable-md { max-height: 300px; }
    .teacher-management-column .scrollable-sm { max-height: 200px; }
    .teacher-charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .teacher-chart-card .chart-container { height: 220px; }
    .teacher-management-column .form-row { flex-direction: column; }
    .teacher-management-column .form-group { grid-template-columns: 1fr; }
    .teacher-management-column .form-control { min-height: 44px; }
    .teacher-management-column .button { min-height: 44px; }
    .performance-reviews-section { max-height: 350px; }
    .review-card { padding: 1rem; }
    .review-card-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .modal-content.teacher-detail {
        width: 100vw;
        max-height: 95vh;
        margin: 0;
        border-radius: 0;
    }
    .modal-content.teacher-detail .modal-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .modal-content.teacher-detail .modal-header h2 {
        font-size: 1rem;
    }
    .teacher-detail-grid {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .teacher-info-column .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .teacher-info-column .metric-card {
        padding: 0.75rem;
    }
    .teacher-info-column .metric-card .metric-value {
        font-size: 1.2rem;
    }
    .teacher-management-column .tab-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    .teacher-chart-card .chart-container { height: 180px; }
    .review-card { padding: 0.75rem; }
    .review-section h6 { font-size: 0.8rem; }
}


/* === teacher-portal/css/teacher-portal-tables.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Table Components, Tabs, Filters, Pagination
   ============================================================================ */

/* --- General UI Components --- */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.tab-button { background: none; border: none; color: var(--text-dim); padding: 0.5rem 1rem; cursor: pointer; border-radius: 0.25rem 0.25rem 0 0; transition: all 0.2s; border-bottom: 2px solid transparent; }
.tab-button:hover { background: var(--surface-color); color: var(--text-light); }
.tab-button.active { background: var(--surface-color); color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-panel { display: none; padding: 1rem 0; }
.tab-panel.active { display: block; }
.search-input { width: 100%; padding: 0.75rem 1rem; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border-color); border-radius: 0.5rem; color: var(--text-light); transition: border-color 0.2s; }
.search-input:focus { outline: none; border-color: var(--primary-color); }
.filter-select { color: white; background-color: rgba(0, 0, 0, 0.2); border: 1px solid var(--border-color); border-radius: 4px; padding: 0.5rem; }
.filter-select option {
    color: ghostwhite;
    background-color: var(--background-dark);
}
.empty-state { text-align: center; padding: 2rem; color: var(--text-dim); background: rgba(0, 0, 0, 0.2); border-radius: 0.5rem; margin: 1rem 0; }
.error-message { text-align: center; padding: 1rem; color: var(--error-color); background: rgba(244, 67, 54, 0.1); border: 1px solid var(--error-color); border-radius: 0.5rem; }

/* --- Status Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge i { font-size: 0.9rem; }

/* --- Improved Table Readability --- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
    table-layout: auto;
}

.data-table th {
    padding: 10px 15px;
    text-align: left;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    background-color: var(--background-secondary);
    transition: background-color 0.2s ease-in-out;
}

.data-table tbody tr:hover {
    background-color: #3a3d42;
}

.data-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* --- Today Row Highlight --- */
.data-table .today-row { background: rgba(255, 140, 0, 0.08); }
.data-table .today-row td:first-child {
    border-left: 3px solid var(--primary-color);
}

/* --- Action Buttons in Table --- */
.actions-cell {
    text-align: right;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-button.delete-btn:hover {
    color: var(--error-color);
}

/* --- Styled Pagination Buttons --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

.pagination-button {
    background-color: var(--background-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.pagination-button:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    color: var(--text-dim);
    margin: 0 10px;
}

/* Dashboard table containers scroll horizontally in narrow grid cells */
#teacherWeeklyScheduleContainer,
#upcomingWorkshopsContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table td:first-child,
.data-table td:last-child {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .tab-button { white-space: nowrap; flex-shrink: 0; min-height: 44px; }
    .filter-controls { flex-direction: column; gap: 0.75rem; }
    .filter-group { flex-direction: column; width: 100%; }
    .search-input, .filter-select { width: 100%; }
}

/* --- Tab Content Display --- */
.tab-content .tab-panel.active {
    display: block;
}


/* === teacher-portal/css/teacher-portal-students.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Students Module
   ============================================================================ */

/* --- Student List & Cards --- */
.student-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; padding-top: 1rem; }
.student-card { background: var(--surface-color); border-radius: 1rem; padding: 1.5rem; transition: transform 0.2s, background-color 0.2s; cursor: pointer; display: flex; flex-direction: column; }
.student-card:hover { transform: translateY(-3px); background: #3a3a3a; box-shadow: var(--shadow); }

/* --- Status Filter Buttons --- */
.filter-buttons { margin: 20px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-btn:hover { background: #3a3a3a; transform: translateY(-1px); }
.filter-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: white; }
.filter-btn.status-active:not(.active) { border-color: rgba(76, 175, 80, 0.5); }
.filter-btn.status-inactive:not(.active) { border-color: rgba(158, 158, 158, 0.5); }
.filter-btn.status-past-due:not(.active) { border-color: rgba(244, 67, 54, 0.5); }
.filter-btn.status-pending:not(.active) { border-color: rgba(255, 193, 7, 0.5); }
.filter-btn.status-flex:not(.active) { border-color: rgba(33, 150, 243, 0.5); }
.filter-btn.status-paused:not(.active) { border-color: rgba(255, 152, 0, 0.5); }
.filter-btn.status-guest:not(.active) { border-color: rgba(156, 39, 176, 0.5); }
.filter-btn.status-archived:not(.active) { border-color: rgba(96, 96, 96, 0.5); }
.count-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    min-width: 24px;
    text-align: center;
}
.filter-btn.active .count-badge { background: rgba(255, 255, 255, 0.3); }
.student-card-header { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: center; }
.student-info { flex-grow: 1; }
.student-card h3 { margin: 0; font-size: 1.2rem; }
.level-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.level-beginner { background: rgba(76, 175, 80, 0.2); color: #A5D6A7; }
.level-beg-inter { background: rgba(156, 39, 176, 0.2); color: #CE93D8; }
.level-intermediate { background: rgba(33, 150, 243, 0.2); color: #90CAF9; }
.level-inter-adv { background: rgba(244, 67, 54, 0.2); color: #EF9A9A; }
.level-advanced-1, .level-advanced-2 { background: rgba(255, 152, 0, 0.2); color: #FFCC80; }
.info-row { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; }
.info-label { color: var(--text-dim); }
.info-value { color: var(--text-light); font-weight: 500; }
.lessons-critical { color: var(--error-color); font-weight: bold; }
.lessons-warning { color: var(--warning-color); }
.lessons-good { color: var(--success-color); }
.student-progress { margin-top: auto; padding-top: 1rem; }
.progress-item label { display: block; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0.25rem; }
.progress-bar { height: 8px; background: rgba(0, 0, 0, 0.3); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary-color); transition: width 0.5s ease; border-radius: 4px; }
.tab-content .notes-timeline,
.tab-content .practice-log-list,
.tab-content .attendance-history-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 15px;
}

/* --- Improved Student Card (Roster) --- */
.student-card .student-details {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.student-card .info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    font-size: 0.9em;
}
.student-card .info-label {
    color: var(--text-dim);
    font-weight: 500;
}
.student-card .info-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: ghostwhite;
    font-size: 0.9em;
    text-align: right;
}
/* Allow status badges to display fully without clipping */
.student-card .info-value:has(.status-badge) {
    overflow: visible;
}
.student-card .status-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    letter-spacing: 0.3px;
}
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: ghostwhite;
    font-size: 1rem;
}

/* More specific styling for our dropdowns to ensure they look right */
.input-group .filter-select {
    color: ghostwhite;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a0a0a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
}

/* Style for the options within ANY select element in our theme */
select option {
    color: ghostwhite;
    background-color: var(--background-dark);
}

/* --- Improved Student Modal Layout --- */
.student-modal .student-overview-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.student-modal .overview-left-col .profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.student-modal .overview-left-col .profile-photo {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
}
.student-modal .main-progress-overview {
    margin-top: 1.5rem;
}
.student-modal .create-task-btn {
    margin-top: 1rem;
    width: 100%;
}
.student-modal .create-task-btn i {
    margin-right: 6px;
}
.student-modal .overview-right-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.student-modal .info-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.student-modal .info-group h4 {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.student-modal .info-group-header h4 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.student-modal .info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    font-size: 0.95em;
}

.student-modal .info-item label {
    color: var(--text-dim);
    margin-right: 1rem;
}
.student-modal .info-item span {
    font-weight: 500;
    text-align: right;
}
.student-modal .info-item .monospace-id {
    font-family: monospace;
    font-size: 0.85em;
}
.student-modal .info-item .emergency-label {
    color: var(--warning-color);
}
.student-modal .info-item.emergency-separator {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.student-modal .modal-status-badge {
    margin-left: 1rem;
}

.student-modal .archetype-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.student-modal .section-title {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.student-modal .archetype-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.student-modal .archetype-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.student-modal .archetype-emoji-modal {
    font-size: 2rem;
}

.student-modal .archetype-name-modal {
    font-size: 1.2rem;
    font-weight: 600;
}

.student-modal .archetype-description-modal {
    color: var(--text-dim);
    line-height: 1.6;
}

.student-modal .archetype-graph-container {
    min-height: 200px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.student-modal .archetype-graph-container canvas {
    max-width: 100%;
    max-height: 100%;
}

/* --- Progress Tab Chart --- */
.student-modal .progress-chart-container {
    height: 400px;
    position: relative;
}
.student-modal .progress-chart-container .filter-select {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

/* --- Skill Edit Sub-Modal --- */
.student-modal .skill-edit-submodal {
    z-index: 2001;
}
.skill-edit-body {
    max-height: 40vh;
    overflow-y: auto;
}

/* Responsive adjustments for the modal */
@media (max-width: 800px) {
    .student-modal .student-overview-grid,
    .student-modal .archetype-content-wrapper {
        grid-template-columns: 1fr;
    }

    .student-modal .overview-left-col .profile-section {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }

    .student-modal .archetype-graph-container {
        max-height: 250px;
    }
}

/* Custom Scrollbar for these lists */
.notes-timeline::-webkit-scrollbar,
.practice-log-list::-webkit-scrollbar,
.attendance-history-list::-webkit-scrollbar {
    width: 6px;
}
.notes-timeline::-webkit-scrollbar-track,
.practice-log-list::-webkit-scrollbar-track,
.attendance-history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}
.notes-timeline::-webkit-scrollbar-thumb,
.practice-log-list::-webkit-scrollbar-thumb,
.attendance-history-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}
.notes-timeline::-webkit-scrollbar-thumb:hover,
.practice-log-list::-webkit-scrollbar-thumb:hover,
.attendance-history-list::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* --- Notes & History Tab --- */
.notes-timeline .timeline-entry {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}
.notes-timeline .note-date {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.notes-timeline .note-date strong {
    color: var(--primary-light);
}
.notes-timeline .note-content {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-dim);
    white-space: pre-wrap;
}
.level-badge-note {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 0.5rem;
    vertical-align: middle;
    color: var(--text-light);
}
.level-badge-note.level-beginner { background: rgba(76, 175, 80, 0.3); }
.level-badge-note.level-beg-inter { background: rgba(156, 39, 176, 0.3); }
.level-badge-note.level-intermediate { background: rgba(33, 150, 243, 0.3); }
.level-badge-note.level-inter-adv { background: rgba(244, 67, 54, 0.3); }
.level-badge-note.level-advanced-1,
.level-badge-note.level-advanced-2 { background: rgba(255, 152, 0, 0.3); }

/* --- Practice Logs Tab --- */
.practice-log-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}
.practice-log-item .log-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}
.practice-log-item .log-header strong {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
}
.practice-log-item .log-header span {
    font-size: 0.9em;
    color: var(--text-dim);
    background-color: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.practice-log-item .log-details {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9em;
    color: var(--text-dim);
}
.practice-log-item .log-notes {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-light);
    background-color: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 4px;
    white-space: pre-wrap;
}

.practiced-skills-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}
.practiced-skills-list h5 {
    font-size: 0.9em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.practiced-skills-list ul {
    list-style: none;
    padding-left: 0;
    font-size: 0.9em;
}
.practiced-skills-list li {
    background-color: rgba(0,0,0,0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    display: inline-block;
    margin-right: 0.5rem;
    border-left: 3px solid;
}
.practiced-skills-list li span {
    color: var(--text-dim);
    font-size: 0.9em;
}

/* --- Student Card Body --- */
.student-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* --- Student Card Progress --- */
.student-card-progress {
    margin-top: auto;
    background: var(--background-dark);
    padding: 1rem;
    border-radius: 8px;
    border-top: 2px solid var(--primary-color);
}
.student-card-progress .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.student-card-progress .progress-header label {
    margin: 0;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}
.student-card-progress .progress-percent {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}
.student-card-progress .progress-bar {
    height: 8px;
    background: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.student-card-progress .progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* --- Skills Heatmap --- */
.skills-heatmap {
    padding: 0.5rem 0;
}
.category-headers-row {
    display: flex;
    padding-left: 120px;
    margin-bottom: 8px;
}
.category-header {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.difficulty-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.difficulty-label {
    width: 120px;
    color: var(--text-dim);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.category-cells {
    display: flex;
    flex: 1;
    gap: 0.5rem;
}
.category-cell {
    flex: 1;
    padding: 0.75rem 0;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.category-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.cell-value {
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px black;
}

/* Heatmap color levels */
.heatmap-level-0 { background-color: rgba(255, 255, 255, 0.05); }
.heatmap-level-1 { background-color: rgba(244, 67, 54, 0.5); }
.heatmap-level-2 { background-color: rgba(255, 193, 7, 0.5); }
.heatmap-level-3 { background-color: rgba(33, 150, 243, 0.6); }
.heatmap-level-4 { background-color: rgba(76, 175, 80, 0.7); }

/* --- Skill Edit Modal --- */
.skill-edit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.skill-edit-item label {
    flex-grow: 1;
    color: var(--text-light);
    font-size: 0.95em;
}
.skill-completion-input {
    width: 70px;
    text-align: center;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0.3rem;
    font-size: 0.95rem;
}
.skill-edit-actions {
    text-align: right;
    margin-top: 1rem;
}
.speed-best-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(255, 140, 0, 0.15);
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
}
.speed-latest-badge {
    color: var(--text-dim);
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

/* === Students Module Mobile === */
@media (max-width: 768px) {
    .student-list { grid-template-columns: 1fr; }
    .student-card .info-row { grid-template-columns: 100px 1fr; }
    .student-modal .student-overview-grid { grid-template-columns: 1fr; gap: 1rem; }
    .category-headers-row { padding-left: 80px; }
    .difficulty-label { width: 80px; font-size: 0.8rem; }
    .category-header { font-size: 0.7rem; }
}
@media (max-width: 480px) {
    .student-card .info-row { grid-template-columns: 1fr; }
    .student-card .info-value { text-align: left; }
    .filter-buttons { gap: 0.5rem; }
    .filter-btn { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
    .skills-heatmap { overflow-x: auto; }
    .category-headers-row { min-width: 500px; }
    .difficulty-row { min-width: 500px; }
}


/* === teacher-portal/css/teacher-portal-skills.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Skills & Curriculum Module
   ============================================================================ */

/* Skills Section Styling */
.skills-section {
    padding: 1rem 0;
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.1em;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-category {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
}

.category-title {
    color: var(--primary-color);
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.skill-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-light);
    flex: 1;
}

.proficiency-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.proficiency-badge.beginner {
    background: var(--border-color);
    color: #fff;
}

.proficiency-badge.intermediate {
    background: #3182ce;
    color: #fff;
}

.proficiency-badge.advanced {
    background: #805ad5;
    color: #fff;
}

.proficiency-badge.expert {
    background: #d69e2e;
    color: #000;
}

.skill-notes {
    font-size: 0.85em;
    color: var(--text-dim);
    font-style: italic;
}

.remove-skill-btn {
    margin-top: 0.5rem;
    align-self: flex-start;
}

.compact-form {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.compact-form .form-row {
    display: flex;
    gap: 1rem;
}

.compact-form .input-group {
    flex: 1;
}

/* Feedback & Skills Tab Styling */
#feedbackSkillsContainer { display: flex; flex-direction: column; gap: 2rem; padding-top: 1rem;}
.student-feedback-card { background: rgba(0,0,0,0.2); padding: 1.5rem; border-radius: 8px; }
.student-feedback-card h4 { color: var(--primary-light); margin-top: 0; margin-bottom: 1rem; }
.student-feedback-card .skill-progress-list { margin-top: 1rem; }
.skill-progress-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.skill-progress-row label { flex-grow: 1; color: var(--text-dim); }
.skill-progress-row input { width: 80px; text-align: center; }
.skill-row-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.skill-row-header span { font-size: 0.75rem; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.5px; }
.skill-row-header .col-skill { flex-grow: 1; }
.skill-row-header .col-input { width: 80px; text-align: center; }
.speed-best-badge { display: inline-block; background: var(--accent-color); color: white; padding: 1px 6px; border-radius: 10px; font-size: 0.7rem; margin-left: 0.5rem; }
.speed-target-label { font-size: 0.7rem; color: var(--accent-color); text-align: center; margin-top: 2px; }

/* --- Skills Module: Filter placement above cards --- */
.skills-list-section {
    margin-top: 2rem;
}

.skills-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.skills-list-filters {
    display: flex;
    gap: 1rem;
}

/* --- Class Type Card Elements --- */
.class-type-card-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Shared Card Elements (Class Types, Workshops) --- */
.card-description {
    color: var(--text-dim);
    flex-grow: 1;
    min-height: 50px;
}
.card-info-separator {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}
.card-actions {
    margin-top: 1rem;
}

/* --- Class Type Filters --- */
.class-type-filters {
    margin-bottom: 1.5rem;
}
.class-type-filters .view-toggle {
    margin-left: auto;
}

/* --- Manage Skills Modal: Form Flex Layout --- */
.skill-link-field-skill { flex: 3; }
.skill-link-field-type { flex: 2; }
.skill-link-field-pct { flex: 1; }

/* --- Manage Skills Modal: Add Skill Form --- */
.add-skill-link-section {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.add-skill-link-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}
.add-skill-link-section .form-row {
    align-items: flex-end;
    gap: 1rem;
}
.add-skill-link-section .input-group label {
    color: var(--text-dim);
    font-size: 0.9em;
}
/* Style the form inputs text color */
.add-skill-link-section select,
.add-skill-link-section input {
    background-color: var(--background-dark);
    border-color: var(--border-color);
    color: var(--text-light);
}
.add-skill-link-section select option {
    background-color: var(--background-dark);
    color: var(--text-light);
}
.add-skill-link-section .button.primary {
    height: 45px;
}

/* --- Skills Module: Filter Spacing --- */
#skillsSectionTemplate .filter-controls {
    margin-bottom: 2rem;
}

/* --- Skill Card Redesign --- */
/* Header section (Title & Level Badge) */
.skill-card .skill-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0;
}
.skill-card .skill-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-light);
}
.skill-card .skill-header .level-badge {
    margin-top: 0;
}

/* Description */
.skill-card .skill-description {
    color: var(--text-dim);
    font-size: 0.9em;
    font-style: italic;
    min-height: auto;
}

/* Overall Progress Bar Section */
.skill-card .skill-overall-progress {
    margin-top: 0;
}
.skill-card .skill-overall-progress label {
    font-size: 0.85em;
    color: var(--text-dim);
}
.skill-card .skill-overall-progress .progress-text {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-light);
}
.skill-card .skill-overall-progress .progress-fill {
    background-color: var(--primary-color);
}

/* Assigned Students List Section */
.skill-card .assigned-students h5 {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.skill-card .assigned-students .student-name-list {
    font-size: 0.9em;
    color: var(--text-dim);
    line-height: 1.5;
    cursor: default;
}

/* Action Buttons */
.skill-card .class-actions {
    margin-top: 0.5rem;
    gap: 0.75rem;
}
.skill-card .button.secondary {
    border: 1px solid var(--border-color);
}
.skill-card .button.danger {
    background-color: var(--error-color);
}

/* --- Skills Module: New Skill Progress Bar --- */
.skill-card .skill-overall-progress {
    margin-top: 1rem;
}
.skill-card .skill-overall-progress label {
    display: block;
    font-size: 0.8em;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.skill-card .skill-overall-progress .progress-bar {
    height: 10px;
    background-color: rgba(0,0,0,0.4);
}
.skill-card .skill-overall-progress .progress-fill {
    background-color: var(--accent-color);
}
.skill-card .skill-overall-progress .progress-text {
    text-align: right;
    font-size: 0.85em;
    color: var(--text-dim);
    font-weight: 600;
}

/* --- Manage Skills Modal: General Styling --- */
.modal-content.manage-skills {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}
.modal-content.manage-skills h2,
.modal-content.manage-skills h3 {
    color: var(--primary-color);
    font-weight: 700;
}
.modal-content.manage-skills .modal-header h2 {
    font-size: 1.8rem;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

/* --- Manage Skills Modal: Linked Skills List --- */
.linked-skills-section h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.linked-skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid transparent;
}
.linked-skill-info {
    color: var(--text-light);
}
.linked-skill-info .skill-name {
    font-weight: 600;
}
.linked-skill-info .skill-details {
    font-size: 0.85em;
    color: var(--text-dim);
    margin-left: 0.5rem;
}
.linked-skill-item .button.danger {
    background-color: #a12a2a;
    font-weight: 600;
}
.linked-skill-item .button.danger:hover {
    background-color: var(--error-color);
}

/* --- Manage Skills Modal: Footer Buttons --- */
.modal-content.manage-skills .modal-footer {
    justify-content: center;
    gap: 1.5rem;
}
.modal-content.manage-skills .button.secondary {
    background-color: var(--border-color);
}
.modal-content.manage-skills .button.primary {
    min-width: 150px;
}

/* --- Main Modal Content --- */
.modal[id^="skillEditModal_"] .modal-content {
    background-color: #2a2a2e;
    border: 1px solid #444;
    max-width: 550px;
    border-radius: 12px;
}

.modal[id^="skillEditModal_"] .modal-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.modal[id^="skillEditModal_"] .modal-body {
    padding: 0;
    max-height: 50vh;
    overflow-y: auto;
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
}

/* --- Individual Skill Item in the List --- */
.skill-edit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #38383c;
    transition: background-color 0.2s;
}
.skill-edit-item:last-child {
    border-bottom: none;
}
.skill-edit-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.skill-edit-item label {
    color: var(--text-light);
    font-size: 1rem;
    flex-grow: 1;
}

.skill-completion-input {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
    background-color: #1e1e1e;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
}
.skill-completion-input::-webkit-outer-spin-button,
.skill-completion-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Skills Module: New Student List on Card --- */
.skill-card .assigned-students {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.skill-card .assigned-students h5 {
    font-size: 0.9em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    font-weight: 500;
}
.skill-card .student-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.skill-card .student-tag {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-dim);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}
.skill-card .student-tag:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
    font-weight: 600;
}

/* --- Skill Card Item (library cards) --- */
.skill-card-item {
    position: relative;
}
.skill-card-header {
    margin-bottom: 1rem;
}
.skill-card-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    font-size: 1.1rem;
}
.skill-card-progress {
    background: var(--background-dark);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}
.skill-card-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.skill-card-progress-header label {
    margin: 0;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.85rem;
}
.skill-card-progress-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}
.skill-card-progress-bar {
    height: 6px;
    background: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
}
.skill-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}
.skill-card-students {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.skill-card-students-heading {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
}
.skill-card-students-list {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
}
.skill-card-actions {
    margin-top: 1.25rem;
}
.skill-card-actions .button {
    flex: 1;
}

/* --- Skill Category Group (library list) --- */
.skill-category-group {
    margin-bottom: 2rem;
}
.skill-category-heading {
    color: var(--primary-light);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* --- Skill Search & Sort --- */
.skill-search-row {
    margin-bottom: 0.75rem;
}

/* --- Skill Card Link Badges --- */
.skill-card-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.skill-card-link-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.skill-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.skill-link-prereq {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}
.skill-link-outcome {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}
.skill-link-orphan {
    background: rgba(255, 193, 7, 0.15);
    color: var(--warning-color);
}

/* --- Curriculum Graph Filter --- */
.graph-filter-controls {
    margin-bottom: 1rem;
    justify-content: center;
}
.graph-class-select {
    min-width: 300px;
}

/* --- Modal Footer --- */
.modal[id^="skillEditModal_"] .modal-footer {
    border-top: none;
    padding-top: 1.5rem;
    justify-content: flex-end;
}

.modal[id^="skillEditModal_"] .button {
    min-width: 100px;
}

/* --- Associated Skills Block --- */
.associated-skills-block {
    margin-bottom: 1.5rem;
}
.associated-skills-block h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.skill-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.skill-tag {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-dim);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85em;
    border-left: 3px solid;
}

/* --- Curriculum Network Graph Styles --- */
.graph-container {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    min-height: 500px;
    position: relative;
}
.graph-container h3 {
    color: var(--primary-light);
    text-align: center;
    margin-bottom: 1rem;
}

/* D3 Graph Element Styles */
.graph-container .links line {
    stroke: var(--border-color);
    stroke-opacity: 0.8;
}
.graph-container .links line.prerequisite {
    stroke: var(--warning-color);
    stroke-dasharray: 4 2;
}
.graph-container .nodes circle {
    stroke: #fff;
    stroke-width: 1.5px;
    cursor: pointer;
    transition: transform 0.2s;
}
.graph-container .nodes circle:hover {
    transform: scale(1.2);
}
.graph-container .labels text {
    pointer-events: none;
    font-size: 10px;
    fill: var(--text-light);
    paint-order: stroke;
    stroke: var(--background-dark);
    stroke-width: 3px;
    stroke-linejoin: round;
}

/* Graph Legend */
.graph-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.9em;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
}
.legend-color-box {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

/* --- D3 Graph Highlighting --- */
.graph-container .nodes circle.dimmed,
.graph-container .links line.dimmed,
.graph-container .labels text.dimmed {
    opacity: 0.15;
    transition: opacity 0.3s ease-in-out;
}
.graph-container .nodes circle.highlight,
.graph-container .links line.highlight {
    opacity: 1;
}
.graph-container .nodes circle.highlight {
    stroke: var(--primary-color);
    stroke-width: 3px;
}
.graph-container .links line.highlight {
    stroke-width: 4px;
}
.graph-container .labels text.highlight {
    opacity: 1;
    font-weight: bold;
    font-size: 11px;
}

/* --- Curriculum Tree View --- */
#classTreeContainer {
    overflow: hidden;
    width: 100%;
    height: 75vh;
    border-radius: 8px;
    background-color: var(--background-dark);
    padding: 2rem;
    cursor: grab;
    position: relative;
}
#classTreeContainer.grabbing {
    cursor: grabbing;
}

/* Tree Zoom Controls */
.tree-zoom-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(45, 55, 72, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tree-control-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-color);
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.tree-control-btn:hover {
    background: var(--primary-color);
    color: #1a1a1a;
}
.tree-zoom-level {
    font-size: 0.8rem;
    color: var(--text-dim);
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}
.custom-tree-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
    position: relative;
    width: max-content;
    min-width: 100%;
    padding: 2rem 1rem 2rem 1rem;
}

.difficulty-lane {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(45, 55, 72, 0.3);
    border: 1px solid rgba(74, 85, 104, 0.3);
}

.difficulty-title {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 1.5rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, var(--primary-color), #e07b00);
    color: #1a1a1a;
    border: none;
}

.difficulty-lane:has(.difficulty-title:contains('Beginner')) .difficulty-title,
.difficulty-lane .difficulty-title[data-level="beginner"] {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
}

.tree-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 3000px;
    min-height: 2000px;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}
#tree-viewport {
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    transform: translate(0px, 0px) scale(1);
    visibility: visible;
    opacity: 1;
}
.tree-svg-overlay .connector-line {
    stroke: var(--primary-color);
    stroke-width: 2.5;
    fill: none;
    stroke-dasharray: 8 4;
    opacity: 0.6;
    transition: opacity 0.2s, stroke-width 0.2s;
}
.tree-svg-overlay .connector-line:hover {
    opacity: 1;
    stroke-width: 3.5;
}

/* Tree View Card */
.tree-view-card {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tree-view-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: var(--primary-color);
}

.tree-view-card p {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: auto;
    flex-grow: 1;
    font-size: 0.8rem;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tree-view-card h3 {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.tree-view-card .info-row,
.tree-view-card .class-type-card-category {
    font-size: 0.75rem;
}

.tree-view-card .student-card-header {
    padding: 0.75rem;
}

.tree-view-card .class-actions {
    padding: 0.5rem 0.75rem;
    margin-top: auto;
}

.tree-view-card .class-actions .button {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
}

.filter-input {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border-radius: 6px;
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-input::placeholder {
    color: var(--text-dim);
    opacity: 1;
}

.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.3);
}

/* === Skills Module Mobile === */
@media (max-width: 768px) {
    .skill-cards { grid-template-columns: 1fr; }
    .skills-list-controls { flex-direction: column; gap: 0.75rem; }
    #classTreeContainer { height: 50vh; overflow: auto; }
    .tree-view-card { width: 160px; min-width: 160px; font-size: 0.8rem; }
}
@media (max-width: 480px) {
    .skill-card { padding: 1rem; }
}

/* ============================================================================
   Workshop Module
   ============================================================================ */
.workshop-upcoming-widget {
    margin-bottom: 2rem;
}
.workshop-widget-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.workshop-widget-cards .today-class-footer {
    flex-wrap: wrap;
    gap: 0.75rem;
}
.workshop-actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.workshop-fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}
.workshop-fieldset legend {
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 0 0.5rem;
}
.workshop-search {
    margin-bottom: 1.5rem;
}

/* Capacity indicators */
.capacity-available { color: var(--success-color); }
.capacity-filling { color: var(--warning-color); }
.capacity-full { color: var(--error-color); font-weight: 600; }

/* ============================================================================
   Waitlist Module
   ============================================================================ */
.waitlist-header-icon {
    color: var(--warning-color);
    margin-right: 10px;
}
.waitlist-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}
.waitlist-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.waitlist-stats-highlight {
    border-left: 4px solid var(--warning-color);
}
.waitlist-class-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.waitlist-class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--background-dark);
}
.waitlist-class-info h3 {
    margin: 0;
    color: var(--primary-color);
}
.waitlist-class-meta {
    color: var(--text-dim);
    font-size: 0.9rem;
}
.waitlist-count-badge {
    background: var(--warning-color);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}
.waitlist-student-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background-dark);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.waitlist-position {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}
.waitlist-student-info {
    flex: 1;
    margin-left: 1rem;
}
.waitlist-actions {
    display: flex;
    gap: 0.5rem;
}
.waitlist-empty {
    padding: 3rem;
    text-align: center;
}
.waitlist-empty-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}
@media (max-width: 768px) {
    .waitlist-student-row { flex-wrap: wrap; gap: 0.75rem; }
    .waitlist-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================================
   Student Achievements Module
   ============================================================================ */

/* --- Stats Grid --- */
.achievements-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.achievement-stat-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.achievement-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.achievement-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}
.achievement-stat-icon.primary { background: linear-gradient(135deg, var(--primary-color), #ff6b00); }
.achievement-stat-icon.success { background: linear-gradient(135deg, var(--success-color), #2E7D32); }
.achievement-stat-icon.accent  { background: linear-gradient(135deg, var(--accent-color), #00838F); }
.achievement-stat-icon.gold    { background: linear-gradient(135deg, #FFD700, #FFA500); }

.achievement-stat-content .stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1.2;
}
.achievement-stat-content .stat-value.text-sm { font-size: 1rem; }
.achievement-stat-content .stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* --- Tabs --- */
.achievements-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--surface-color);
    padding-bottom: 0;
}
.achievements-tabs .tab-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.achievements-tabs .tab-btn:hover {
    color: var(--text-color);
    background: var(--surface-color);
}
.achievements-tabs .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* --- Filters --- */
.achievements-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.achievements-search {
    flex-grow: 1;
    min-width: 200px;
}
.achievements-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}
.achievements-header-icon {
    color: gold;
    margin-right: 10px;
}

/* --- Badge Cards --- */
.badge-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}
.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}
.badge-card-icon {
    font-size: 2.5rem;
    line-height: 1;
}
.badge-card-info {
    flex: 1;
}
.badge-card-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}
.badge-card-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.badge-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}
.badge-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.badge-card-meta .ach-points { color: gold; }
.badge-card-meta .ach-awarded { color: var(--success-color); }

/* --- Awarded Table Row Badge Cell --- */
.ach-badge-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ach-badge-icon {
    font-size: 1.5rem;
}

/* --- Badges Toolbar --- */
.badges-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

/* --- Badges Grid --- */
.badges-category-section {
    margin-bottom: 2rem;
}
.badges-category-heading {
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* --- Badge Card Actions --- */
.badge-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.badge-card-actions .button.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* --- Badge Icon Images --- */
.badge-icon-img {
    object-fit: contain;
    border-radius: 6px;
}
.badge-card-icon .badge-icon-img {
    width: 48px;
    height: 48px;
}
.ach-badge-icon.badge-icon-img {
    width: 24px;
    height: 24px;
}

/* --- Badge Icon Toggle (Create/Edit Form) --- */
.badge-icon-group {
    grid-column: 1 / -1;
}
.badge-icon-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.badge-icon-toggle-btn {
    flex: 1;
    padding: 0.4rem 0.75rem;
    border: none;
    background: var(--background-dark);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}
.badge-icon-toggle-btn:hover {
    background: var(--surface-color);
}
.badge-icon-toggle-btn.active {
    background: var(--primary-color);
    color: #fff;
}
.badge-icon-preview {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--background-dark);
    border-radius: 6px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.badge-preview-icon {
    font-size: 2.5rem;
}
img.badge-preview-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 6px;
    font-size: initial;
}

/* --- Badge Form --- */
.badge-form-submit {
    width: 100%;
}

/* --- Category Badge --- */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}
.category-badge.speed_exercise { background: #4CAF50; color: white; }
.category-badge.category_progress { background: #2196F3; color: white; }
.category-badge.practice_weekly { background: #9C27B0; color: white; }
.category-badge.practice_monthly { background: #7B1FA2; color: white; }
.category-badge.category_practice { background: #0288D1; color: white; }
.category-badge.level_advancement { background: #E65100; color: white; }
.category-badge.technique { background: #FF9800; color: white; }
.category-badge.speed { background: #F44336; color: white; }
.category-badge.milestone { background: #00BCD4; color: white; }
.category-badge.default { background: var(--primary-color); color: white; }

/* --- Leaderboard Podium --- */
.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
}
.podium-place {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    background: var(--surface-color);
    min-width: 140px;
    transition: transform 0.2s;
}
.podium-place:hover {
    transform: scale(1.05);
}
.podium-place.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    order: 2;
    padding-bottom: 2rem;
}
.podium-place.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #000;
    order: 1;
}
.podium-place.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: #fff;
    order: 3;
}
.podium-medal { font-size: 2.5rem; margin-bottom: 0.5rem; }
.podium-name { font-weight: bold; font-size: 1rem; margin-bottom: 0.25rem; }
.podium-level { font-size: 0.8rem; opacity: 0.8; }
.podium-points { font-size: 1.25rem; font-weight: bold; margin-top: 0.5rem; }
.podium-badges { font-size: 0.8rem; opacity: 0.8; }

/* --- Leaderboard Table --- */
.ach-rank-cell { text-align: center; font-weight: bold; color: var(--text-dim); }
.ach-count-cell { text-align: center; }
.ach-points-cell { text-align: right; }
.ach-points-value { color: var(--primary-color); font-weight: bold; }

/* --- Confirm Revoke Modal --- */
.ach-confirm-modal {
    text-align: center;
    padding: 1rem;
}
.ach-confirm-icon {
    font-size: 3rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
}
.ach-confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- Empty State --- */
.ach-empty {
    padding: 3rem;
    text-align: center;
}
.ach-empty-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.ach-empty .button { margin-top: 1rem; }

/* ============================================================================
   Student Health Module
   ============================================================================ */

/* --- Health Header --- */
.health-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Health Description --- */
.health-description {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* --- Health Help Section --- */
.health-help {
    margin-bottom: 1.5rem;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}
.health-help summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--accent-color);
}
.health-help-body {
    margin-top: 1rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.health-help-body p {
    margin-bottom: 1rem;
}
.health-help-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* --- Health Stats Grid --- */
.health-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.health-stat-excellent { border-left: 4px solid var(--success-color); cursor: pointer; }
.health-stat-good { border-left: 4px solid var(--accent-color); cursor: pointer; }
.health-stat-fair { border-left: 4px solid var(--warning-color); cursor: pointer; }
.health-stat-atrisk { border-left: 4px solid var(--error-color); cursor: pointer; }

/* --- Health Filters --- */
.health-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.health-filters .search-input {
    flex-grow: 1;
    min-width: 200px;
}

/* --- Health Table Row --- */
.health-row { cursor: pointer; }
.health-score-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.health-bar-track {
    width: 60px;
    height: 8px;
    background: var(--surface-color);
    border-radius: 4px;
    overflow: hidden;
}
.health-bar-fill {
    height: 100%;
    border-radius: 4px;
}
.health-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
}
.health-date-warn,
.health-date-warn .text-dim,
.health-date-warn small,
.health-date-warn span { color: var(--warning-color) !important; }
.health-date-danger,
.health-date-danger .text-dim,
.health-date-danger small,
.health-date-danger span { color: var(--error-color) !important; font-weight: 600; }

/* --- Health Note Modal --- */
.health-info-box {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
}
.health-info-box p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.health-info-box.warning {
    border-left-color: var(--warning-color);
}
.health-student-list {
    max-height: 150px;
    overflow-y: auto;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

/* ============================================================================
   Learning Archetypes Module
   ============================================================================ */

/* --- Archetype Cards --- */
.archetype-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}
.archetype-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.archetype-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.archetype-emoji {
    font-size: 3rem;
}
.archetype-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}
.archetype-student-count {
    color: var(--text-dim);
    font-size: 0.85rem;
}
.archetype-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* --- Archetype Trait Bars --- */
.trait-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.trait-label {
    width: 140px;
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.85;
}
.trait-track {
    flex: 1;
    height: 8px;
    background: var(--background-dark);
    border-radius: 4px;
    overflow: hidden;
}
.trait-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.trait-value {
    width: 30px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: bold;
}

/* --- Archetypes Description --- */
.archetypes-description {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* --- Archetypes Stats --- */
.archetypes-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* --- Archetypes Grid --- */
.archetypes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* ============================================================================
   Speed Records Module
   ============================================================================ */

/* --- Speed Stats --- */
.speed-stats {
    margin-bottom: 2rem;
}

/* --- Speed Filters --- */
.speed-filter-card {
    margin-bottom: 1rem;
}
.speed-filter-card .form-group.filter-actions {
    display: flex;
    align-items: flex-end;
}
.speed-filter-card .filter-actions .button {
    width: 100%;
}

/* --- Speed Table Row --- */
.speed-row {
    border-left: 4px solid var(--primary-color);
}
.speed-cell {
    padding: 1rem;
}
.speed-cell-icon {
    color: var(--primary-color);
    margin-right: 0.5rem;
}
.speed-cell-icon.student {
    color: var(--accent-color);
}
.speed-skill-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.speed-skill-name {
    font-weight: 600;
}
.speed-category-tag {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    background: rgba(255, 140, 0, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 140, 0, 0.3);
}

/* --- Speed NPM Badges --- */
.speed-npm-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark, #3a9daa));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
}
.speed-npm-badge.target {
    background: rgba(255, 140, 0, 0.2);
    color: var(--primary-color);
    font-size: 1rem;
}
.speed-actions-cell {
    display: flex;
    gap: 0.5rem;
}

/* --- Speed Table Wrapper --- */
.speed-table-wrap {
    overflow-x: auto;
}

/* --- Speed Confirm Modal --- */
.speed-confirm-modal {
    text-align: center;
    padding: 1rem;
}
.speed-confirm-icon {
    font-size: 3rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
}
.speed-confirm-icon.danger {
    color: var(--error-color);
}
.speed-confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- Speed Progression Chart --- */
.speed-chart-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: rgba(33, 150, 243, 0.08);
    border: 1px dashed rgba(33, 150, 243, 0.3);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}
.speed-chart-hint i {
    color: #2196F3;
    font-size: 1.1rem;
}
.speed-chart-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    height: 350px;
}

/* ============================================================================
   Student Health Module — Note History
   ============================================================================ */
.health-note-history {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color, #eee);
    padding-top: 0.5rem;
}
.health-note-history > summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.5rem 0;
    color: var(--text-color);
}
.health-note-history-body {
    max-height: 300px;
    overflow-y: auto;
    padding-top: 0.5rem;
}
.health-note-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface-color, #f9f9f9);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}
.health-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}
.health-note-action {
    background: var(--accent-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.health-note-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color);
}

/* ============================================================================
   Archetype Module — CRUD + Student List
   ============================================================================ */
.archetype-card-actions {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
}
.archetype-students-details {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color, #eee);
    padding-top: 0.5rem;
}
.archetype-students-details > summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}
.archetype-student-list {
    list-style: none;
    padding: 0.5rem 0 0 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}
.archetype-student-item {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}
.archetype-student-item:last-child {
    border-bottom: none;
}

/* --- Archetype Form Sliders --- */
.archetype-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.archetype-slider-row {
    display: grid;
    grid-template-columns: 100px 1fr 30px;
    align-items: center;
    gap: 0.75rem;
}
.archetype-slider-label {
    font-size: 0.85rem;
    font-weight: 500;
}
.archetype-slider {
    width: 100%;
    cursor: pointer;
}
.archetype-slider-value {
    text-align: right;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ============================================================================
   Shared Module Utility Classes
   ============================================================================ */

/* --- Module Filter Bar (search + actions row) --- */
.module-filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.module-filter-input {
    flex-grow: 1;
    min-width: 200px;
    max-width: 400px;
}

/* --- Text Alignment --- */
.text-center { text-align: center; }

/* --- Module Extend Label --- */
.module-extend-label {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* ============================================================================
   Products Module
   ============================================================================ */

/* --- Products Description --- */
.products-description {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* --- Products Analytics --- */
.products-analytics {
    margin-bottom: 2rem;
}

/* --- Products Chart Container --- */
.products-chart-container {
    height: 400px;
    position: relative;
}

/* --- Products Filter Bar --- */
.products-filter-bar {
    margin-bottom: 1.5rem;
}
.products-filter-bar .search-input {
    width: 100%;
    max-width: 400px;
}

/* ============================================================================
   Digital Products Module
   ============================================================================ */

/* --- Digital Products Description --- */
.dp-description {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* --- Digital Products Stats --- */
.dp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ============================================================================
   Student Resources Module
   ============================================================================ */

/* --- Student Resources Description --- */
.sr-description {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* --- Student Resources Stats --- */
.sr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* --- Student Resources Filters --- */
.sr-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.sr-search {
    flex-grow: 1;
    min-width: 200px;
}

/* --- Student Resources Table Cells --- */
.sr-title-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sr-title-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}
.sr-level-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 140, 0, 0.15);
    color: var(--primary-color);
}
.sr-level-badge.all {
    background: rgba(77, 181, 195, 0.15);
    color: var(--accent-color);
}


/* === teacher-portal/css/teacher-portal-curriculum.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Curriculum Map Module
   ============================================================================ */

/* --- Layout & Filters --- */
.curriculum-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.curriculum-description {
    color: var(--text-light);
    margin-bottom: 1rem;
}
.curriculum-legend-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.curriculum-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.curriculum-legend-item .skill-tag {
    margin: 0;
}
.curriculum-legend-text {
    color: var(--text-dim);
    font-size: 0.85rem;
}
.curriculum-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.curriculum-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.curriculum-search-input {
    min-width: 250px;
}
.curriculum-header-icon {
    color: var(--accent-color);
    margin-right: 10px;
}

/* --- View Toggle --- */
.view-toggle {
    display: flex;
    background: var(--background-dark);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}
.view-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
}
.view-toggle-btn:hover:not(.active) {
    background: var(--surface-color);
    color: var(--text-color);
}

/* --- Cards View --- */
.curriculum-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
}
.curriculum-card {
    background: var(--surface-color);
    border-radius: 14px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.curriculum-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}
.curriculum-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--background-dark);
}
.curriculum-class-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}
.curriculum-class-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.curriculum-class-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.curriculum-class-meta .meta-separator {
    color: var(--text-dim);
}

/* --- Skill Sections & Tags --- */
.skill-section {
    margin-top: 1rem;
}
.skill-section:first-of-type {
    margin-top: 0;
}
.skill-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.skill-section-label .fa-lock { color: #ff6b6b; }
.skill-section-label .fa-graduation-cap { color: #69db7c; }

.skill-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}
.skill-tag:hover {
    transform: scale(1.05);
}
.skill-tag.prerequisite {
    background: rgba(244, 67, 54, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(244, 67, 54, 0.3);
}
.skill-tag.learning_outcome {
    background: rgba(76, 175, 80, 0.15);
    color: #69db7c;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.skill-tag i {
    font-size: 0.7rem;
}
.no-skills {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

/* --- Graph View --- */
#curriculumGraphContainer {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-dark) 100%);
    border-radius: 16px;
    min-height: 650px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 160px;
}
#curriculumGraph {
    width: calc(100% - 160px);
    height: 700px;
    overflow: visible;
}
.graph-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
    background: var(--background-dark);
    padding: 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--surface-color);
}
.graph-controls button {
    padding: 0;
    background: var(--surface-color);
    border: none;
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.graph-controls button:hover {
    background: var(--primary-color);
    color: white;
}

/* D3 Node/Link Styles */
.node-class,
.node-skill {
    cursor: pointer;
}
.node-label {
    font-size: 11px;
    fill: var(--text-light);
    pointer-events: none;
    text-anchor: middle;
}
.link-prerequisite {
    stroke: #F44336;
    stroke-opacity: 0.6;
}
.link-outcome {
    stroke: #4CAF50;
    stroke-opacity: 0.6;
}
.node-highlighted {
    stroke: var(--primary-color);
    stroke-width: 3px;
}
.node-dimmed {
    opacity: 0.2;
}
.link-dimmed {
    opacity: 0.1;
}

/* --- Graph Legend --- */
#curriculumGraphContainer .graph-legend {
    position: absolute;
    top: 1rem;
    left: 0.5rem;
    background: rgba(30, 30, 30, 0.95);
    padding: 0.75rem;
    border-radius: 10px;
    z-index: 100;
    width: 150px;
    max-height: calc(100% - 2rem);
    overflow-y: auto;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    display: block !important;
    font-size: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.3);
}
#curriculumGraphContainer .graph-legend::-webkit-scrollbar { width: 6px; }
#curriculumGraphContainer .graph-legend::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); border-radius: 3px; }
#curriculumGraphContainer .graph-legend::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 3px; }
#curriculumGraphContainer .graph-legend::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

.graph-legend h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
}
.legend-section {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface-color);
}
.legend-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
#curriculumGraphContainer .legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 4px;
    transition: all 0.2s;
}
.legend-item:last-child { margin-bottom: 0; }
.legend-item:hover { background: var(--surface-color); }
.legend-item span { color: var(--text-light); }
.legend-item-static { cursor: default; }

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.legend-item.inactive .legend-color { opacity: 0.25; }
.legend-item.inactive { opacity: 0.4; }
.legend-item.inactive span { text-decoration: line-through; }

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}
.legend-node-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid white;
}
.legend-node-square {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 2px solid white;
}

/* --- Graph Tooltip --- */
.graph-tooltip {
    position: absolute;
    background: var(--background-dark);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 100;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--surface-color);
}
.graph-tooltip h5 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}
.graph-tooltip p {
    margin: 0.35rem 0;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
}
.graph-tooltip p strong {
    color: var(--text-color);
}

/* --- Category Pills --- */
.category-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 12px;
}
.category-pill {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: white;
}
.category-pill.active {
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.category-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* --- Pathways View --- */
#curriculumPathwaysContainer {
    padding: 0.5rem 0;
}
.pathway-category {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.pathway-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--background-dark);
}
.pathway-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pathway-header-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pathway-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}
.pathway-header span {
    color: var(--text-dim);
    font-size: 0.9rem;
}
.pathway-flow {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem 0 1rem 0;
}
.pathway-flow::-webkit-scrollbar { height: 6px; }
.pathway-flow::-webkit-scrollbar-track { background: var(--background-dark); border-radius: 3px; }
.pathway-flow::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 3px; }

.pathway-level {
    min-width: 240px;
    flex-shrink: 0;
}
.pathway-level-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}
.pathway-level-label {
    display: inline-block;
    background: var(--background-dark);
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.pathway-arrow {
    position: absolute;
    right: -1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.1rem;
}
.pathway-class-card {
    background: var(--background-dark);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
    transition: all 0.2s ease;
    cursor: pointer;
}
.pathway-class-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.pathway-class-card:last-child {
    margin-bottom: 0;
}
.pathway-class-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}
.pathway-class-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}
.pathway-class-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-light);
}
.pathway-stat-prereq { color: #ff6b6b; }
.pathway-stat-outcome { color: #69db7c; }

.pathway-class-requires {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--surface-color);
    font-size: 0.8rem;
    color: var(--text-light);
}
.pathway-class-requires strong {
    color: var(--primary-color);
}

/* --- Curriculum Modal (Edit Class Curriculum) --- */
.curriculum-modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
.curriculum-modal-class-name {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.curriculum-modal-meta {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--background-dark);
}
.curriculum-modal-section {
    margin-bottom: 1.5rem;
}
.curriculum-modal-heading-prereq,
.curriculum-modal-heading-outcome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}
.curriculum-modal-heading-prereq { color: #ff6b6b; }
.curriculum-modal-heading-outcome { color: #69db7c; }
.curriculum-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    min-height: 2rem;
}
.curriculum-modal-skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.curriculum-modal-skill-tag.prereq {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}
.curriculum-modal-skill-tag.outcome {
    background: rgba(105, 219, 124, 0.15);
    color: #69db7c;
    border: 1px solid rgba(105, 219, 124, 0.3);
}
.curriculum-modal-skill-tag .fa-times {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.75rem;
    transition: opacity 0.15s;
}
.curriculum-modal-skill-tag .fa-times:hover {
    opacity: 1;
}
.curriculum-modal-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.curriculum-modal-add-row select {
    flex: 1;
}

/* --- Link Skill to Class Form --- */
.curriculum-link-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.curriculum-link-form .form-group.full-width,
.curriculum-link-form .form-actions.full-width {
    grid-column: 1 / -1;
}
.curriculum-link-submit {
    width: 100%;
}
@media (max-width: 480px) {
    .curriculum-link-form { grid-template-columns: 1fr; }
}

/* --- Empty States --- */
.curriculum-empty {
    padding: 3rem;
    text-align: center;
}
.curriculum-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.curriculum-empty-icon.accent { color: var(--accent-color); }
.curriculum-empty-icon.success { color: var(--success-color); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .curriculum-cards-grid { grid-template-columns: 1fr; }
    .pathway-flow { gap: 1rem; }
    .pathway-level { min-width: 200px; }
    #curriculumGraphContainer { padding-left: 0; }
    #curriculumGraph { width: 100%; }
}


/* === teacher-portal/css/teacher-portal-crm.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - CRM Module
   ============================================================================ */

/* --- CRM Pipeline Legend --- */
.pipeline-legend {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease-in-out;
    max-height: 1000px;
    overflow: hidden;
}
.pipeline-legend.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
}
.legend-icon { font-size: 1.8rem; margin-right: 1rem; line-height: 1.2; margin-top: -4px; }
.legend-text h4 { margin: 0 0 0.25rem 0; color: var(--primary-color); font-size: 1rem; }
.legend-text p { margin: 0; color: var(--text-dim); line-height: 1.5; font-size: 0.9rem; }

/* --- CRM Pipeline Card Action Buttons --- */
.lead-card.small .lead-actions.small {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}
.lead-card.small .lead-actions.small .button {
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}
.lead-card.small .lead-actions.small .button:hover {
    background-color: #3f3f3f;
    border-color: var(--primary-color);
}

/* --- CRM Module: General Layout & Tabs --- */
#crmSection .section-header h2 {
    color: var(--primary-color);
}
#crmSection .crm-nav .tab-button {
    font-weight: 600;
}
#crmSection .crm-nav .tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* --- Lead Detail Modal Styling --- */
.lead-detail-modal .modal-header h2 {
    font-size: 1.8rem;
}
.read-only-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.read-only-section h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.details-grid, .details-grid-thirds {
    display: grid;
    gap: 1rem 2rem;
}
.details-grid { grid-template-columns: 1fr 1fr; }
.details-grid-thirds { grid-template-columns: repeat(3, 1fr); }
.detail-item.full-width { grid-column: 1 / -1; }

.detail-item label {
    display: block;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.detail-item span, .initial-message-text {
    color: ghostwhite;
    font-size: 0.95em;
    line-height: 1.5;
}
.initial-message-text { white-space: pre-wrap; }

.history-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.history-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-light);
}
.history-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

/* Interaction History Item Styling */
.interaction-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--surface-color);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}
.interaction-item:last-child {
    margin-bottom: 0;
}
.interaction-item .interaction-date {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.interaction-item .interaction-type {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.interaction-item .interaction-details {
    color: var(--text-light);
    line-height: 1.5;
    white-space: pre-wrap;
}

.add-interaction-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.add-interaction-form textarea {
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.add-interaction-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}
.add-interaction-form textarea::placeholder {
    color: var(--text-dim);
    font-style: italic;
}
.add-interaction-form button {
    align-self: flex-end;
}

/* Email History Item Styling */
.email-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.email-history-item:last-child { border-bottom: none; }
.email-info .date { font-size: 0.8em; color: var(--text-dim); }
.email-info .subject { font-weight: 500; color: ghostwhite; }
.email-status-badge {
    font-size: 0.75em;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    text-transform: uppercase;
}
.email-status-sent { background-color: #6c757d; color: white; }
.email-status-delivered { background-color: #17a2b8; color: white; }
.email-status-opened { background-color: #28a745; color: white; }
.email-status-clicked { background-color: var(--primary-color); color: var(--background-dark); }
.email-status-bounced { background-color: var(--error-color); color: white; }

/* --- CRM Module: Conversion Pipeline --- */
.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding-top: 1rem;
}
.pipeline-stage {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}
.stage-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stage-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
}
.stage-count {
    background-color: var(--surface-color);
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}
.stage-items {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
}

/* --- CRM Module: Pipeline Lead Card --- */
.lead-card.small {
    background-color: var(--surface-color);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.lead-card.small:hover {
    background-color: #3f3f3f;
    transform: translateY(-2px);
}
.lead-card .lead-name.small {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}
.lead-card .lead-info.small {
    font-size: 0.85em;
    color: var(--text-dim);
}
.csv-instructions {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}
.csv-instructions summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-light);
}
.csv-instructions ul { margin-top: 0.75rem; padding-left: 1.25rem; }
.csv-instructions li { margin-bottom: 0.5rem; }

/* --- CRM Module: Leads List View --- */
#leadsTab .filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}
#leadsTab .search-input {
    flex-grow: 1;
}
#leadsListContainer .data-table th {
    color: var(--text-dim);
}
#leadsListContainer .data-table td {
    color: var(--text-light);
    vertical-align: middle;
}

/* Style for the status badges in the table */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Teacher/User Status Badges */
.status-badge.status-active {
    background: rgba(76, 175, 80, 0.25);
    color: #81C784;
    border-color: rgba(76, 175, 80, 0.4);
}

.status-badge.status-inactive {
    background: rgba(158, 158, 158, 0.25);
    color: #BDBDBD;
    border-color: rgba(158, 158, 158, 0.4);
}

.status-badge.status-on_leave {
    background: rgba(255, 193, 7, 0.25);
    color: #FFD54F;
    border-color: rgba(255, 193, 7, 0.4);
}

/* Pipeline Stages */
.status-badge.status-potential-new-student { background-color: rgba(33, 150, 243, 0.2); color: #90CAF9; }
.status-badge.status-evaluation-form-sent,
.status-badge.status-evaluation-sent { background-color: rgba(255, 193, 7, 0.2); color: #FFE082; }
.status-badge.status-evaluation-form-submitted,
.status-badge.status-evaluation-completed { background-color: rgba(156, 39, 176, 0.2); color: #CE93D8; }
.status-badge.status-meet-greet-completed,
.status-badge.status-meet-greet-scheduled { background-color: rgba(0, 150, 136, 0.2); color: #80CBC4; }
.status-badge.status-follow-up-funnel,
.status-badge.status-nurturing { background-color: rgba(103, 58, 183, 0.2); color: #B39DDB; }
.status-badge.status-pending-payment { background-color: rgba(255, 87, 34, 0.2); color: #FFAB91; }
/* Final States */
.status-badge.status-converted { background-color: rgba(76, 175, 80, 0.2); color: #A5D6A7; }
.status-badge.status-dropped, .status-badge.status-archived { background-color: rgba(158, 158, 158, 0.2); color: #E0E0E0; }

/* --- CRM Forecast & Analytics Shared Styles --- */
.forecast-kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.forecast-kpis .kpi-card {
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    padding: 1.5rem;
    min-width: 0;
    overflow: hidden;
}

.forecast-kpis .kpi-value {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-light);
    word-break: break-word;
}

.forecast-kpis .kpi-label {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.crm-chart-container {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    flex-grow: 0;
    min-height: 0;
}

.crm-chart-container.tall { margin-bottom: 2.5rem; }
.crm-chart-container.compact .crm-canvas-wrapper { height: 230px; }

.crm-chart-container h4 {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    margin-bottom: 1rem;
}

.crm-canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}
.crm-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}
.crm-chart-container.tall .crm-canvas-wrapper { height: 400px; }
.crm-chart-container.medium .crm-canvas-wrapper { height: 300px; }

.crm-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.bottom-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.kpi-indicators,
.forecast-notes {
    min-height: 150px;
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.kpi-indicators h4,
.forecast-notes h4 {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.kpi-flex-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.forecast-notes ul {
    font-size: 0.9em;
    color: var(--text-dim);
    padding-left: 1.2rem;
    margin-top: 1rem;
}

.kpi-card.small-kpi {
    text-align: center;
    padding: 1rem;
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
}

.kpi-value.small-value {
    font-size: 2rem;
    color: var(--primary-color);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.analytics-grid .kpi-card {
    min-width: 0;
    overflow: hidden;
}
.analytics-grid .kpi-value {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    word-break: break-word;
}

.kpi-value.text-danger { color: var(--error-color); }

/* --- Drag & Drop Feedback --- */
.stage-items.drag-over {
    background: rgba(255, 140, 0, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
}

/* --- Legend Item Layout --- */
.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* --- Filter Controls Base --- */
.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-controls .search-input {
    flex-grow: 1;
}

/* --- Lead Badge --- */
.level-badge.level-badge-lead {
    background-color: #555;
}

/* --- M&G Schedule Modal --- */
.mg-schedule-form {
    max-width: 400px;
    margin: 0 auto;
}

.mg-schedule-form .mg-schedule-intro {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    text-align: center;
}

.mg-schedule-form .input-group {
    margin-bottom: 1rem;
}

.mg-schedule-form .input-group label {
    color: var(--text-light);
}

.mg-schedule-form .input-group input {
    width: 100%;
}

.mg-schedule-form .mg-time-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mg-schedule-form .mg-time-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.mg-schedule-form .mg-schedule-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mg-schedule-form .mg-schedule-actions .button {
    width: 100%;
}

.mg-schedule-form .mg-schedule-note {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
}

/* --- M&G Meeting Type Toggle --- */
.mg-type-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.mg-type-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: var(--surface-color);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mg-type-btn:hover {
    background: #3a3a3a;
}

.mg-type-btn.active {
    background: var(--primary-color);
    color: var(--background-dark);
}

.mg-online-note {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.mg-online-note i {
    color: #64B5F6;
    margin-right: 0.25rem;
}

.mg-url-input {
    margin-top: 0.75rem;
}

/* --- Scoring Help Modal --- */
.scoring-help h3 {
    margin-top: 20px;
}

.scoring-help hr {
    margin: 20px 0;
    border-color: var(--border-color);
}

/* === CRM Module Tablet === */
@media (max-width: 1024px) {
    .forecast-kpis { grid-template-columns: repeat(3, 1fr); }
    .analytics-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === CRM Module Mobile === */
@media (max-width: 768px) {
    .pipeline-stages { grid-template-columns: 1fr; }
    .pipeline-legend { grid-template-columns: 1fr; }
    .details-grid-thirds { grid-template-columns: 1fr; }
    .detail-item { grid-template-columns: 1fr; }
    .crm-charts-grid,
    .bottom-details-grid { grid-template-columns: 1fr; }
    .mg-schedule-form .mg-time-row { flex-direction: column; }
    .details-grid { grid-template-columns: 1fr; }
    .forecast-kpis { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================== */
/* Meet & Greet Modal             */
/* (Moved from students.css)      */
/* ============================== */
.modal[id^="meetGreetModal_"] .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.modal[id^="meetGreetModal_"] .info-grid-container {
    display: grid;
    gap: 0.75rem 2rem;
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.modal[id^="meetGreetModal_"] .info-grid-container .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal[id^="meetGreetModal_"] .info-grid-container .info-item label {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 80px;
}

.modal[id^="meetGreetModal_"] .info-grid-container .info-item span {
    color: var(--text-light);
    font-size: 1rem;
}


/* === teacher-portal/css/teacher-portal-schedule.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Schedule, Calendar & Attendance
   ============================================================================
   Covers: Attendance tab, class types, schedule generator, draft modal,
   class modal features, attendance forms, scheduling workflow, today's classes,
   class details modal, calendar/FullCalendar responsive styles
   ============================================================================ */

/* --- Improved Attendance Tab Styles --- */
/* Attendance - New Table Layout */
.attendance-table {
    width: 100%;
    border-collapse: collapse;
}
.attendance-row-item {
    border-bottom: 1px solid var(--border-color);
}
.attendance-row-item:last-child {
    border-bottom: none;
}

.attendance-date-cell {
    padding: 0.6rem 0;
    color: var(--text-light);
    font-weight: 500;
}

.attendance-status-cell {
    padding: 0.6rem 0;
    text-align: right;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}
.attendance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    border-top: 3px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-color);
}
.stat-card .stat-label {
    margin-top: 0.5rem;
    font-size: 0.85em;
    color: var(--text-light);
    font-weight: 500;
}
.attendance-table th {
    color: var(--primary-color);
    font-weight: 600;
    padding-bottom: 0.5rem;
    font-size: 0.9em;
    border-bottom: 2px solid var(--border-color);
}
.attendance-class-name-cell {
    text-align: center;
    color: var(--text-dim);
    font-style: normal;
    font-size: 0.9em;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Color coding the stat cards */
.stat-card.present { border-top-color: var(--success-color); }
.stat-card.present .stat-value { color: var(--success-color); }

.stat-card.late { border-top-color: var(--warning-color); }
.stat-card.late .stat-value { color: var(--warning-color); }

.stat-card.absent { border-top-color: var(--error-color); }
.stat-card.absent .stat-value { color: var(--error-color); }

.stat-card.excused { border-top-color: var(--accent-color); }
.stat-card.excused .stat-value { color: var(--accent-color); }

.attendance-rate-container {
    margin-bottom: 2rem;
}
.attendance-rate-label {
    text-align: right;
    font-size: 0.9em;
    margin-top: 0.5rem;
    color: var(--text-dim);
}
.attendance-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.attendance-item {
    display: flex;
    align-items: center;
    background-color: var(--surface-color);
    border-radius: 6px;
    overflow: hidden;
}
.attendance-status-indicator {
    width: 6px;
    align-self: stretch;
}
.attendance-content {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    align-items: center;
}
.attendance-date {
    font-weight: 500;
}
.attendance-status {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
}

/* Status-specific colors for the list items */
.status-present .attendance-status-indicator { background-color: var(--success-color); }
.status-present .attendance-status { color: var(--success-color); }

.status-late .attendance-status-indicator { background-color: var(--warning-color); }
.status-late .attendance-status { color: var(--warning-color); }

.status-absent .attendance-status-indicator { background-color: var(--error-color); }
.status-absent .attendance-status { color: var(--error-color); }

.status-excused .attendance-status-indicator { background-color: var(--accent-color); }
.status-excused .attendance-status { color: var(--accent-color); }

/* --- Schedule Generator Instructions --- */
.instructions-container {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.9em;
}
.instructions-container details {
    padding: 1rem 1.5rem;
}
.instructions-container summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-light);
    font-size: 1.1em;
}
.instructions-container summary:hover {
    color: var(--primary-color);
}
.instructions-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-dim);
    line-height: 1.6;
}
.instructions-content h4 {
    color: var(--text-light);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.instructions-content ol, .instructions-content ul {
    padding-left: 1.5rem;
}
.instructions-content li {
    margin-bottom: 0.5rem;
}

/* ============================================= */
/* == CLASS SCHEDULE MANAGER (DRAFT MODAL)    == */
/* ============================================= */

/* Targets the modal created from weeklyDraftModalTemplate */
.modal-content.large .schedule-grid-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.modal-content.large .schedule-grid-table th,
.modal-content.large .schedule-grid-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: center;
    vertical-align: middle;
}

.modal-content.large .schedule-grid-table th {
    background-color: rgba(0,0,0,0.3);
    color: var(--primary-color);
    font-weight: 600;
}

.modal-content.large .schedule-grid-table td:first-child {
    font-weight: 600;
    color: var(--text-dim);
    background-color: rgba(0,0,0,0.3);
}

/* Style for the dropdowns inside the table */
.modal-content.large .schedule-grid-table .class-select {
    width: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 4px;
}

.modal-content.large .schedule-grid-table .class-select option {
    background-color: var(--background-dark);
}

/* Style for the info text at the top */
#weeklyDraftModalTitle {
    color: var(--primary-color);
    font-size: 1.8rem;
    text-transform: uppercase;
}
.schedule-info {
    font-style: italic;
    color: var(--text-dim);
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

/* --- Tab Styles for Instructions/Templates --- */
.schedule-manager-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.schedule-manager-tabs .tab-button {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.schedule-manager-tabs .tab-button:hover {
    color: var(--text-light);
}

.schedule-manager-tabs .tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

/* --- Footer Buttons --- */
.modal-content.large .modal-footer #submitForApprovalBtn {
    background-color: var(--primary-color);
    color: white;
}
.modal-content.large .modal-footer #submitForApprovalBtn:hover {
    background-color: var(--primary-dark);
}

.modal-content.large .modal-footer #saveDraftBtn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

/* --- Schedule Preview Grid Table (Template Preview & Pending Review) --- */
.schedule-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.schedule-preview-table th {
    background: rgba(0,0,0,0.3);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    text-align: center;
}
.schedule-preview-table th:first-child {
    width: 80px;
}
.schedule-preview-table td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    vertical-align: top;
    height: 80px;
}
.schedule-preview-table .time-label {
    font-weight: bold;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    color: var(--text-dim);
    text-align: center;
    vertical-align: middle;
}
.schedule-grid-cell {
    background: var(--surface-color);
    padding: 0.5rem;
    border-radius: 4px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.schedule-grid-cell .cell-name {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 2px;
    font-size: 0.95em;
    line-height: 1.2;
}
.schedule-grid-cell .cell-category {
    font-size: 0.75em;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 4px;
    flex-grow: 1;
}
.schedule-grid-cell .level-badge {
    font-size: 0.7em;
    padding: 1px 6px;
}
.schedule-grid-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.schedule-grid-empty span {
    color: #444;
    font-style: italic;
    font-size: 0.8em;
}

/* --- Google Calendar Offer Modal --- */
.gcal-offer-modal {
    max-width: 450px;
    text-align: center;
}
.gcal-offer-modal .modal-header {
    justify-content: center;
}
.gcal-offer-modal .modal-header h2 {
    color: var(--success-color);
}
.gcal-offer-modal .gcal-event-info {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.gcal-offer-modal .gcal-event-datetime {
    color: var(--text-dim);
}
.gcal-offer-modal .gcal-prompt {
    margin-bottom: 1.5rem;
}
.gcal-offer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
}
.gcal-offer-modal .gcal-note {
    margin-top: 1.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.gcal-offer-modal .modal-footer {
    justify-content: center;
}

/* --- Sub Request Table --- */
.sub-request-actions .deny-sub-btn {
    margin-left: 0.5rem;
}

/* --- Assignment Table --- */
.assignments-table .assign-to-col {
    width: 250px;
}
.assignments-table .actions-col {
    width: 120px;
}
.assignments-table .assignment-select {
    width: 100%;
}

/* --- Slot Availability Status --- */
.slot-status-success {
    color: var(--success-color);
}
.slot-status-error {
    color: var(--error-color);
}

/* --- Wide Schedule Modals (Template Preview & Pending Review) --- */
.modal-content.schedule-wide {
    max-width: 1100px;
}

/* --- Checkbox Alignment (auto-assign, all-day) --- */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.checkbox-inline input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.checkbox-inline label {
    margin-bottom: 0;
}

/* --- Template Preview Info Text --- */
.template-preview-info {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* --- Pending Schedule Review Area --- */
.schedule-review-area {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* --- Date Help Text --- */
.input-help-text {
    color: var(--text-dim);
    margin-top: 4px;
    display: block;
}

/* --- Input Validation State --- */
.input-error {
    border-color: var(--error-color) !important;
}

/* --- New Class Modal Feature Styling --- */
#editEventClassTypeSelect,
#editEventClassTypeSelect optgroup,
#editEventClassTypeSelect option {
    color: var(--text-light);
    background-color: var(--background-dark);
}
/* Attendance Form Styling */
.attendance-form-list { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 1.5rem; }
.attendance-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem; border-radius: 4px; background: var(--background-dark); }
.attendance-row .student-name { font-weight: 500; }
.attendance-options { display: flex; gap: 0.5rem; }
.attendance-options label {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.attendance-options input { display: none; }
.attendance-options input:checked + label {
    color: var(--background-dark);
    font-weight: 600;
}
.attendance-options input[value="present"]:checked + label { background-color: var(--success-color); border-color: var(--success-color); }
.attendance-options input[value="late"]:checked + label { background-color: var(--warning-color); border-color: var(--warning-color); }
.attendance-options input[value="excused"]:checked + label { background-color: var(--accent-color); border-color: var(--accent-color); }
.attendance-options input[value="absent"]:checked + label { background-color: var(--error-color); border-color: var(--error-color); }

/* --- Schedule Grid Display --- */
.schedule-grid-display {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 2fr 2fr;
    gap: 1rem 0.5rem;
    padding: 1rem;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.schedule-grid-display > div {
    padding: 0.5rem;
    text-align: center;
}

.grid-header {
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.time-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--text-dim);
}

.time-cell span:first-child {
    font-size: 1.2em;
    color: var(--text-light);
}

.time-cell span:last-child {
    font-size: 0.8em;
}

.grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    min-height: 50px;
    line-height: 1.4;
}

/* --- Schedule Section Template Styles --- */
#scheduleSectionTemplate h2,
#scheduleSectionTemplate h3 {
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.2rem;
    font-weight: 700;
}

#scheduleSectionTemplate .section-header {
    margin-bottom: 0.5rem;
}

/* Tab styling */
#scheduleSectionTemplate .schedule-tabs .tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* "Scheduling Workflow" sub-section */
#approvalsViewTab .section-header {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
#approvalsViewTab .section-header h3 {
    font-size: 1rem;
    color: var(--text-dim);
}

/* Draft and Pending Sections */
.schedule-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 2rem;
}

.pending-drafts h3,
.pending-approval h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Styling for each draft item */
.draft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-color);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    color: var(--text-dim);
}
.draft-item span {
    font-weight: 600;
}
.template-actions {
    display: flex;
    gap: 0.5rem;
}

/* "Edit" and "Delete" buttons for drafts */
.draft-item .button.secondary {
    background-color: #444;
}
.draft-item .button.danger {
    background-color: #9c2b2b;
}
.draft-item .button.danger:hover {
    background-color: var(--error-color);
}

/* --- Today's Classes --- */
#todayClassesContainer {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.today-class-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.today-class-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.today-class-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
}

.today-class-meta {
    font-size: 0.9em;
}

.today-class-time {
    font-weight: 600;
    color: var(--primary-color);
}

.today-class-details {
    color: var(--text-dim);
}

.today-class-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.today-class-students {
    font-size: 0.9em;
    color: var(--text-dim);
}

#todayClassesContainer .today-class-footer .button {
    background-color: var(--primary-color);
    color: var(--background-dark);
}
#todayClassesContainer .today-class-footer .button:hover {
    background-color: var(--primary-dark);
}

/* --- New Class/Workshop Details Modal Styling --- */
.modal-content.class-details-modal {
    background-color: #2d2d2d;
    border: 1px solid #444;
    max-width: 800px;
}

.class-details-modal .modal-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.class-details-modal .info-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.class-details-modal .info-item label {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-right: 0.5rem;
}

.class-details-modal .info-item span {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.class-details-modal .description-block h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.class-details-modal .description-block p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* Tab Styling from Reference */
.class-details-modal .tabs {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.class-details-modal .tab-button {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.class-details-modal .tab-button:hover {
    color: var(--text-light);
}
.class-details-modal .tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Student List Item Styling */
.student-list-container {
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.student-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--background-dark);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.student-list-item:hover {
    background-color: #252525;
}
.student-list-item .student-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--surface-color);
    flex-shrink: 0;
}
.student-list-item .student-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.student-list-item .student-name {
    font-weight: 600;
    color: var(--text-light);
    flex: 1;
}
.student-list-item .remove-student-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: color 0.2s;
}
.student-list-item .remove-student-btn:hover {
    color: var(--error-color);
}

/* --- Materials Tab --- */
.materials-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.material-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.material-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 152, 0, 0.15);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.material-title {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.material-title:hover {
    text-decoration: underline;
}
.material-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: capitalize;
}
.delete-material-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: color 0.2s;
}
.delete-material-btn:hover {
    color: var(--error-color);
}

/* Footer Styling */
.class-details-modal .modal-footer {
    justify-content: flex-end;
}

.class-details-modal .modal-footer .button.secondary {
    background-color: #333;
}
.class-details-modal .modal-footer .button.secondary:hover {
    background-color: #444;
}

/* --- Upcoming Workshops Table --- */
#upcomingWorkshopsContainer .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 1rem;
    margin-top: 1rem;
}

#upcomingWorkshopsContainer .data-table thead th {
    color: #a0a0a0;
    text-align: left;
    font-weight: 400;
    font-style: italic;
    padding-bottom: 0.5rem;
}

#upcomingWorkshopsContainer .data-table tbody td {
    vertical-align: middle;
}

#upcomingWorkshopsContainer .level-badge {
    display: inline-block;
    background-color: #7d3c3c;
    color: #f0f0f0;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

#upcomingWorkshopsContainer .button {
    background-color: #f08c00;
    color: #111;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

#upcomingWorkshopsContainer .button:hover {
    background-color: #ff9d1a;
}

/* ============================================= */
/* COMPREHENSIVE MOBILE MEDIA QUERIES           */
/* ============================================= */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Reduce container padding */
    .container {
        padding: 1.5rem !important;
    }

    /* Stack header and KPI cards */
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .kpi-cards-container {
        flex-direction: column;
        margin: 0;
        width: 100%;
    }

    .kpi-card {
        min-width: auto;
        width: 100%;
    }

    /* Fix Vestaboard overflow on mobile */
    .vestaboard-container {
        padding: 0.5rem;
        overflow: hidden;
    }

    .vestaboard-display {
        width: 100%;
        max-width: 100%;
        gap: 2px;
        padding: 0.5rem;
        aspect-ratio: auto;
    }

    .vestaboard-char {
        font-size: clamp(0.4rem, 2.5vw, 0.75rem);
        border-radius: 1px;
    }

    .vestaboard-controls {
        margin-top: 0.75rem;
        gap: 0.5rem;
    }

    .vestaboard-nav-btn {
        font-size: 1.2rem;
        padding: 0.25rem;
    }

    /* Fix Today's Classes */
    #todayClassesContainer {
        gap: 1rem;
    }

    .today-class-card {
        padding: 1rem;
    }

    .today-class-card .today-class-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .today-class-card .today-class-meta {
        text-align: left;
    }

    .today-class-card .today-class-time,
    .today-class-card .today-class-details,
    .today-class-card .today-class-students {
        color: var(--text-light);
    }

    .today-class-card h3 {
        font-size: 1rem;
        word-break: break-word;
    }

    .today-class-card .today-class-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Fix Master Calendar */
    #calendarContainer {
        height: auto !important;
        min-height: 400px !important;
    }

    /* Fix Students section header - wrap search and button */
    .section-header {
        flex-wrap: wrap;
    }

    .section-header > div {
        flex-wrap: wrap;
        width: 100%;
    }

    .section-header input[type="text"] {
        flex: 1 1 200px;
        min-width: 200px;
    }

    /* Fix student cards overflow */
    .student-list {
        padding: 0;
        overflow-x: hidden;
    }

    .student-card {
        margin: 0 0 1rem 0;
        max-width: 100%;
    }

    /* Navigation improvements */
    .nav-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Modal adjustments */
    .modal-content {
        max-height: 80vh !important;
        padding: 1.5rem;
    }

    .modal-content.large {
        max-width: 95%;
    }

    /* Student cards */
    .student-list {
        grid-template-columns: 1fr !important;
    }

    /* Tables - wrap in scrollable container */
    .data-table,
    .schedule-grid-table,
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td,
    .schedule-grid-table th,
    .schedule-grid-table td {
        padding: 0.75rem !important;
    }

    /* Stack fixed-width grids */
    .student-overview-grid {
        grid-template-columns: 1fr !important;
    }

    /* Media manager */
    .media-manager-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
    /* Further reduce padding */
    .container {
        padding: 1rem !important;
    }

    /* Scale down font sizes */
    .teacher-name {
        font-size: 1.2rem !important;
    }

    .kpi-value {
        font-size: 1.5rem !important;
    }

    .section-header h2 {
        font-size: 1.25rem !important;
    }

    /* Ensure minimum touch targets */
    .button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }

    .nav-item {
        min-height: 44px;
        min-width: 100px;
    }

    /* Modal mobile optimizations */
    .modal-content {
        max-height: 85vh !important;
        padding: 1rem;
        width: 95%;
    }

    /* Student card info */
    .student-card .info-row {
        grid-template-columns: minmax(80px, auto) 1fr;
        font-size: 0.85em;
    }

    /* All grids single column */
    .archetype-content-wrapper,
    .analytics-grid,
    .chart-grid {
        grid-template-columns: 1fr !important;
    }

    /* Table cells more compact */
    .data-table th,
    .data-table td {
        padding: 0.5rem !important;
        font-size: 0.9em;
    }

    /* Button groups stack */
    .modal-footer,
    .button-group {
        flex-direction: column;
    }

    .modal-footer .button,
    .button-group .button {
        width: 100%;
    }
}

/* Extra small phones (360px and below) */
@media (max-width: 360px) {
    /* Minimal padding */
    .container {
        padding: 0.75rem !important;
    }

    /* Further scale fonts */
    .teacher-name {
        font-size: 1.1rem !important;
    }

    .kpi-value {
        font-size: 1.3rem !important;
    }

    .kpi-label {
        font-size: 0.75rem !important;
    }

    /* Modal takes full width */
    .modal-content {
        width: 98%;
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    /* Very compact tables */
    .data-table th,
    .data-table td {
        padding: 0.35rem !important;
        font-size: 0.85em;
    }

    /* Nav items can wrap more */
    .nav-menu {
        gap: 0.25rem;
    }

    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9em;
    }
}

/* Landscape orientation handling */
@media (max-height: 600px) and (orientation: landscape) {
    /* Compact modal for landscape */
    .modal-content {
        max-height: 85vh !important;
        padding: 1rem;
    }

    /* Reduce vertical spacing */
    .dashboard-header,
    .section-header {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .kpi-cards-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .kpi-card {
        flex: 1 1 auto;
        min-width: 150px;
    }

    /* Compact student cards */
    .student-card {
        padding: 0.75rem;
    }

    /* Reduce heading margins */
    h1, h2, h3 {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

/* ===================================================================
   FULLCALENDAR CUSTOMIZATIONS
   =================================================================== */

/* Fix last row stretching - ensure consistent row heights */
.fc-timegrid-slot {
    height: 3em;
    min-height: 3em;
}

/* Prevent the calendar container from being taller than needed */
.fc-timegrid-body {
    height: auto !important;
}

/* Ensure the scrollable area doesn't force extra height */
.fc-scroller {
    overflow-y: auto !important;
}

/* Keep time slots visible and properly sized */
#full-calendar-container {
    min-height: 600px;
    height: auto;
}

/* Ensure past events are always visible */
.fc-event-past,
.fc-day-past .fc-event,
.fc-timegrid-event.fc-event-past {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

/* ===================================================================
   FULLCALENDAR MOBILE LIST VIEW STYLES
   =================================================================== */

/* Mobile list view styling */
.fc-list {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.fc-list-day-cushion {
    background: var(--background-dark) !important;
    padding: 0.75rem 1rem !important;
}

.fc-list-day-text,
.fc-list-day-side-text {
    color: var(--text-color) !important;
    font-weight: 600;
}

.fc-list-event {
    background: var(--surface-color) !important;
    border-bottom: 1px solid var(--border-color);
}

.fc-list-event:hover {
    background: var(--background-dark) !important;
}

.fc-list-event-time {
    color: var(--text-secondary) !important;
    padding: 0.75rem 0.5rem !important;
    font-size: 0.9rem;
    min-width: 80px;
}

.fc-list-event-title {
    color: var(--text-color) !important;
    padding: 0.75rem 0.5rem !important;
    font-weight: 500;
}

.fc-list-event-dot {
    border-radius: 50%;
}

.fc-list-empty {
    background: var(--surface-color) !important;
    color: var(--text-secondary) !important;
    padding: 2rem;
    text-align: center;
}

/* Mobile calendar container adjustments */
@media (max-width: 768px) {
    #full-calendar-container {
        min-height: 300px;
        max-height: none;
        overflow: visible;
    }
    /* Keep grid views constrained but let list view flow */
    #full-calendar-container .fc-timegrid,
    #full-calendar-container .fc-daygrid {
        max-height: 500px;
        overflow: auto;
    }

    .fc-header-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fc-toolbar-title {
        font-size: 1rem !important;
        width: 100%;
        text-align: center;
        order: -1;
    }

    .fc-button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
        min-height: 44px;
    }

    .fc-list-event-time,
    .fc-list-event-title {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.85rem;
    }
    .fc-list-event-time { min-width: 70px; }
}


/* === teacher-portal/css/teacher-portal-media.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Media & File Management Module
   ============================================================================
   Covers: Media module layout, file grid, upload modal, file detail modal,
   bulk actions, search bar, file selection, context menu, list view,
   dragging state, file properties, breadcrumbs, file meta, empty state,
   loading indicator, responsive, animations, scrollbar, thumbnail,
   file type badges, upload progress, video styling, file explorer (polished)
   ============================================================================ */

/* --- Media Module Layout --- */
.media-manager {
    display: flex;
    height: calc(100vh - 100px);
    background-color: var(--background-dark);
    padding: 0;
}
.storage-sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: #181818;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.storage-sidebar .section-header {
    padding: 0;
    margin: 0 0 1rem 0;
    align-items: center;
}
.storage-sidebar .section-header h2 {
    color: var(--text-light);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.storage-sidebar #newBucketBtn {
    background-color: var(--primary-color, #f08c00);
    color: var(--background-dark);
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
}
#bucketListNav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
#bucketListNav::-webkit-scrollbar { width: 6px; }
#bucketListNav::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
#bucketListNav::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
#bucketListNav::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
#bucketListNav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

#bucketListNav a .bucket-icon {
    font-size: 1.1em;
}

#bucketListNav a .bucket-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

#bucketListNav a .bucket-file-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85em;
    min-width: 30px;
    text-align: center;
}

#bucketListNav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

#bucketListNav a.active {
    background-color: var(--primary-color, #f08c00);
    color: var(--background-dark);
    font-weight: bold;
}

#bucketListNav a.active .bucket-file-count {
    background: rgba(0, 0, 0, 0.2);
}

.bucket-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}
#bucketListNav a.active .bucket-count {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--background-dark);
}

/* Public vs Private bucket indicators */
#bucketListNav a.public-bucket::after {
    content: 'Public';
    font-size: 0.7em;
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(76, 175, 80, 0.2);
    color: var(--success-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

#bucketListNav a.private-bucket::after {
    content: 'Private';
    font-size: 0.7em;
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.storage-content .content-header {
    border-bottom: 0; padding-bottom: 0;
}

/* --- Breadcrumbs --- */
.breadcrumb-nav {
    color: var(--text-light);
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.breadcrumb-nav a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.breadcrumb-nav .separator {
    color: var(--text-dim);
    margin: 0 0.5rem;
    user-select: none;
}

/* === Main Content Area Styles === */
.storage-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.content-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* FIX: Search/filter row styling */
.search-filter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.header-actions .button {
    white-space: nowrap;
    min-width: fit-content;
    padding: 0.6rem 1rem;
}

.header-actions #uploadFileBtn {
    background-color: var(--primary-color, #f08c00);
    color: var(--background-dark);
    font-weight: bold;
}

/* === File Grid & Item Styles === */
.file-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    align-content: start;
}
.media-item {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-align: left;
    overflow: visible;
    position: relative;
}

.media-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.media-item.selected {
    border-color: var(--primary-color);
    background-color: rgba(255, 140, 0, 0.1);
}

.media-item.selected::after {
    content: '\2713';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: var(--background-dark);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.media-preview {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-dark);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid #222;
    pointer-events: none;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.media-preview .file-icon {
    font-size: 1.2rem;
    color: var(--primary-color, #f08c00);
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0,0,0,0.5);
    padding: 4px 6px;
    border-radius: 4px;
}

.media-info {
    padding: 0.85rem;
    text-align: left;
    pointer-events: none;
}

.media-info * {
    pointer-events: auto;
}

.media-info h4 {
    margin: 0 0 6px 0;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.media-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.student-tags {
    color: var(--accent-color);
    font-size: 0.85em;
    margin-top: 0.25rem;
}

/* --- Upload Modal --- */
.file-drop-zone { border: 2px dashed var(--border-color); border-radius: 8px; padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.file-drop-zone:hover, .file-drop-zone.dragover { border-color: var(--primary-color); background: rgba(255, 140, 0, 0.1); }
.file-preview-list .file-item { display: flex; align-items: center; gap: 1rem; padding: 0.5rem; background: var(--surface-color); border-radius: 4px; margin-top: 0.5rem; }
.file-preview-list .file-item-name { flex-grow: 1; font-size: 0.9em; }

/* --- File Detail Modal --- */
.file-detail-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    align-items: flex-start;
}
.file-preview-section {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.file-preview-pane {
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    min-height: 400px;
    max-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-preview-pane img,
.file-preview-pane video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.file-details-section .input-group {
    margin-bottom: 1.25rem;
}
.file-details-section label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-dim);
}
#studentTagSelect { min-height: 150px; }
.file-metadata-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.file-metadata-section h4 {
    color: var(--primary-light);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}
.metadata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.9em;
}
.metadata-item {
    display: flex;
    flex-direction: column;
}
.metadata-label {
    color: var(--text-dim);
    font-size: 0.9em;
}
.metadata-value {
    color: var(--text-light);
    font-weight: 500;
}
.metadata-item-full {
    grid-column: 1 / -1;
}
.metadata-path {
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9em;
}

/* Footer with actions split left and right */
.file-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-actions-left, .footer-actions-right {
    display: flex;
    gap: 0.75rem;
}

/* File detail modal specific */
.modal-content.file-detail-modal {
    max-width: 600px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

.file-detail-modal .modal-header h2 {
    color: var(--primary-color, #f08c00);
    font-size: 1.2rem;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-detail-modal .file-preview-pane {
    width: 100%;
    height: 450px;
    background-color: var(--background-dark);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.file-detail-modal .file-preview-pane img,
.file-detail-modal .file-preview-pane video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.file-detail-modal .file-preview-pane .file-icon {
    font-size: 5rem;
    color: var(--text-dim);
}

/* Styles for the form below the preview */
#fileDetailForm .input-group {
    margin-bottom: 1.5rem;
}

#fileDetailForm label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-weight: bold;
    font-size: 0.9rem;
}

#fileDetailForm textarea,
#fileDetailForm select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--background-dark);
    border: 1px solid var(--text-dim);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 1rem;
    resize: vertical;
}

#fileDetailForm select[multiple] {
    height: 150px;
}

#fileDetailForm select option {
    padding: 8px;
}

#fileDetailForm .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Large file detail modal content */
.modal-content.file-detail-modal-content {
    max-width: 850px;
    width: 90%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Responsive modal sizing */
@media (max-width: 1024px) {
    .modal-content.file-detail-modal-content {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .modal-content.file-detail-modal-content {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .file-detail-modal .file-preview-pane {
        height: 300px;
    }
}

/* File name editing */
#fileDetailName {
    transition: all 0.3s ease;
}

#fileDetailName:not([readonly]) {
    background: var(--background-dark) !important;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.edit-name-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.edit-name-btn:hover {
    background: rgba(255, 140, 0, 0.1);
    color: var(--primary-color);
}

.edit-name-btn i {
    font-size: 0.9em;
}

/* === Bulk Actions Toolbar === */
.bulk-actions-toolbar {
    display: none;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    margin-top: 1rem;
    gap: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.bulk-actions-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.bulk-actions-toolbar #selectedCount {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.5rem;
}

/* === Search Bar === */
.search-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    max-width: 600px;
}

.search-bar input {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--background-dark);
    color: var(--text-light);
    min-width: 250px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* --- Sort & Filter Controls --- */
.media-sort-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.media-sort-filter select {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--background-dark);
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
}
.media-sort-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* === File Selection === */
.media-item-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-item:hover .media-item-checkbox,
.media-item.selected .media-item-checkbox {
    opacity: 1;
}

.media-item-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* === Context Menu === */
.context-menu {
    position: absolute;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.context-menu-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: rgba(255, 140, 0, 0.1);
}

.context-menu-item.danger {
    color: var(--error-color);
}

.context-menu-item.danger:hover {
    background: rgba(244, 67, 54, 0.1);
}

.context-menu hr {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Regenerate thumbnail button in context menu */
.context-menu-item[data-action="regenerate-thumb"] i {
    color: var(--primary-color);
}

/* === List View Mode === */
.file-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-grid.list-view .media-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.file-grid.list-view .media-preview {
    height: 40px;
    width: 40px;
    min-height: auto;
}

.file-grid.list-view .media-preview img {
    object-fit: cover;
}

.file-grid.list-view .media-info {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.file-grid.list-view .media-info h4 {
    margin: 0;
    flex-grow: 1;
}

.file-grid.list-view .media-info p {
    margin: 0;
    font-size: 0.85em;
}

/* === Dragging State === */
.media-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

#bucketListNav a.drag-over,
.bucket-nav a.drag-over {
    background: rgba(255, 140, 0, 0.2);
    border: 2px dashed var(--primary-color);
}

/* === File Properties Table === */
.properties-table {
    width: 100%;
    border-collapse: collapse;
}

.properties-table tr {
    border-bottom: 1px solid var(--border-color);
}

.properties-table td {
    padding: 0.75rem;
    color: var(--text-light);
}

.properties-table td:first-child {
    width: 30%;
    color: var(--text-dim);
}

/* === Empty State === */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
    font-size: 1.1em;
}

/* === Loading Indicator === */
.loading-indicator {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
}

.loading-indicator::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* === Responsive Design === */
@media (max-width: 1024px) {
    .media-manager {
        flex-direction: column;
        height: auto;
    }

    .storage-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }

    #bucketListNav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0.5rem;
        max-height: none;
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
    }

    #bucketListNav a {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .search-bar input {
        min-width: 150px;
    }

    .bulk-actions-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .file-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    /* File detail modal: single column on tablet/mobile */
    .file-detail-layout {
        grid-template-columns: 1fr;
    }

    .file-preview-pane {
        min-height: 250px;
    }

    /* Breadcrumb responsive font */
    .breadcrumb-nav {
        font-size: 0.95rem;
        min-width: 120px;
    }

    .bulk-actions-buttons {
        flex-wrap: wrap;
        width: 100%;
    }

    .bulk-actions-buttons button {
        flex: 1;
        min-width: 100px;
        min-height: 44px;
    }

    .edit-name-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .context-menu-item {
        min-height: 44px;
    }

    /* Context menu: constrain to viewport */
    .context-menu {
        max-height: 80vh;
        overflow-y: auto;
    }

    .media-sort-filter {
        width: 100%;
    }
    .media-sort-filter select {
        flex: 1;
        min-width: 0;
    }

    /* Search bar input shrink */
    .search-bar input {
        min-width: 120px;
    }

    /* File actions stack */
    .media-file-actions {
        flex-direction: column;
    }

    /* Header actions wrap tighter */
    .header-actions {
        gap: 0.5rem;
    }
    .header-actions .button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
    .breadcrumb-nav { font-size: 0.8rem; min-width: 80px; }
    .media-item { padding: 0.5rem; }

    .media-sort-filter {
        flex-direction: column;
    }

    /* Stack bulk action buttons vertically */
    .bulk-actions-buttons {
        flex-direction: column;
        width: 100%;
    }
    .bulk-actions-buttons button {
        width: 100%;
    }

    /* Search bar full width */
    .search-bar {
        max-width: 100%;
    }
    .search-bar input {
        min-width: 80px;
        flex: 1;
    }

    /* Header actions stack */
    .header-top-row {
        flex-direction: column;
        align-items: stretch;
    }
    .header-actions {
        justify-content: flex-end;
    }

    /* File detail modal tighter */
    .file-preview-pane {
        min-height: 200px;
    }

    /* Sidebar horizontal scroll tighter on small phones */
    #bucketListNav a {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* --- Inline style extractions --- */
.media-readonly-input {
    background: rgba(0, 0, 0, 0.2);
}
.media-readonly-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 4px;
    color: var(--text-dim);
}
.media-class-tag-display {
    padding: 0.75rem;
    background: rgba(77, 181, 195, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--accent-color);
}
.media-class-tag-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.media-class-tag-type {
    color: var(--text-dim);
}
.media-file-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}
.media-file-path {
    word-break: break-all;
}
.media-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.media-form-hint {
    margin-top: 0.5rem;
    display: block;
}
.media-drop-icon {
    font-size: 3em;
    color: var(--primary-color);
}
.media-drop-text {
    margin-top: 1rem;
    font-weight: 600;
}
.media-drop-or {
    color: var(--text-dim);
    margin-top: 0.5rem;
}
.media-browse-btn {
    margin-top: 0.5rem;
}
.media-preview-list {
    margin-top: 1.5rem;
}
.media-upload-category {
    margin-top: 1.5rem;
}
/* Sort/filter select auto-width */
.media-sort-select {
    width: auto;
    min-width: 130px;
}
.media-filter-select {
    width: auto;
    min-width: 120px;
}
/* Untracked file indicator */
.media-untracked-label {
    font-size: 0.85em;
    color: #999;
}
/* Preview action button */
.media-preview-action-btn {
    width: 100%;
}
/* File preview content sizing */
.media-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.media-preview-video {
    max-width: 100%;
    max-height: 100%;
}
.media-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
}
.media-preview-fallback {
    text-align: center;
    padding: 2rem;
}
.media-preview-fallback-icon {
    font-size: 4em;
    margin-bottom: 1rem;
}
.media-preview-fallback-icon.pdf {
    color: var(--error-color);
}
.media-preview-fallback-icon.audio {
    color: var(--primary-color);
}
.media-preview-fallback-icon.generic {
    color: var(--text-dim);
}
.media-preview-fallback-btn {
    margin-top: 1rem;
}
.media-preview-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}
.media-preview-center.audio {
    gap: 2rem;
}
.media-preview-audio {
    width: 100%;
    max-width: 400px;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Scrollbar Styling === */
.file-grid::-webkit-scrollbar {
    width: 8px;
}

.file-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.file-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 0, 0.3);
    border-radius: 4px;
}

.file-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 0, 0.5);
}

/* === Additional Refinements === */
.media-item.is-untracked {
    cursor: pointer;
}
.media-item.is-folder:hover {
    background-color: rgba(255, 140, 0, 0.1);
    cursor: pointer;
}

.media-item:not(.is-folder):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Thumbnail pending indicator */
.thumbnail-pending-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 140, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.thumbnail-pending-indicator i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

/* Play icon overlay for videos */
.media-preview .file-type-icon.fa-play-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    opacity: 0.9;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.media-item:hover .file-type-icon.fa-play-circle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video icon when no thumbnail */
.media-preview .file-icon.fa-film {
    font-size: 3em;
    color: var(--text-dim);
}

/* Thumbnail error fallback */
.media-preview img[style*="display: none"] + .file-icon {
    display: flex !important;
}

/* Loading state for thumbnails */
.media-item.thumbnail-loading {
    position: relative;
}

.media-item.thumbnail-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Thumbnail success indicator (briefly shown after generation) */
.thumbnail-success-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Video file special styling */
.media-item[data-file-id] .media-preview:has(video),
.media-item[data-file-id] .media-preview:has(.fa-film) {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 100%);
}

/* Tooltip for pending thumbnails */
.thumbnail-pending-indicator[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 8px;
    font-size: 0.85em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.thumbnail-pending-indicator[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: 2px;
}

/* File type badges */
.file-type-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75em;
    text-transform: uppercase;
    font-weight: 600;
}

/* HEIC grid placeholder */
.heic-grid-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.heic-grid-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Upload progress indicator */
.upload-progress {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.upload-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}


/* === teacher-portal/css/teacher-portal-email.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Email Marketing, Articles & Content Module
   ============================================================================
   Covers: Article editor, newsletter editor, FAQ builder, email marketing
   tables, funnel editor, funnel enrollments, campaign statuses, campaign
   details modal, content calendar, status badges
   ============================================================================ */

/* --- Newsletter Editor Image Preview --- */
.image-preview-box {
    margin-top: 0.5rem;
    width: 100%;
    height: 150px;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.image-preview {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.image-preview-placeholder {
    color: var(--text-dim);
    font-style: italic;
}

/* =============================================== */
/* Styles for the Article Editor Page              */
/* =============================================== */

/* The main form container */
.oga-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Styles for each section (Core Details, SEO, etc.) */
.oga-form .form-section {
    padding: 1.5rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
}

/* The title for each section (e.g., "Core Details") */
.oga-form .form-section legend {
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0 0.5rem;
    margin-left: -0.5rem;
}

/* General styles for input groups */
.oga-form .form-group {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Remove bottom margin from the last group in a section */
.oga-form .form-group:last-child {
    margin-bottom: 0;
}

/* Styles for labels */
.oga-form .form-group label {
    font-weight: 500;
    color: var(--text-dim);
    text-align: right;
}

/* Styles for all text inputs, textareas, and selects */
.oga-form input[type="text"],
.oga-form textarea,
.oga-form select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 1rem;
}

/* Specific styling for the FAQ builder section */
#faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item-editor .form-group {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: flex-start;
}
.faq-item-editor .faq-question {
    margin-bottom: 0.5rem;
}

/* Makes the "Remove" button smaller and aligns it next to the textarea */
.faq-item-editor .remove-faq-btn {
    margin-top: 0;
    padding: 0.5rem 1rem;
}

/* Styles for the Publishing section's inline checkboxes */
.oga-form .form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.oga-form .form-group-inline > span {
    color: var(--text-light);
}

/* The main "Save Article" button */
.oga-form .form-actions {
    display: flex;
    justify-content: flex-start;
}

.oga-form .form-actions .button {
    padding: 0.75rem 2.5rem;
    font-size: 1.1rem;
    font-weight: bold;
}

/* --- Article Feedback Modal: Final Metric Card Styles --- */
#articleFeedbackModalTemplate .analytics-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Higher specificity via parent selector avoids !important */
#articleFeedbackModalTemplate .feedback-metric-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

#articleFeedbackModalTemplate .feedback-metric-card h3 {
    margin-top: 0;
    font-size: 0.9em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

#articleFeedbackModalTemplate .feedback-metric-card .metric-value {
    font-size: 2.2rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text-light);
}

/* --- General Table Styling for Email Marketing Module --- */
#emailMarketingSection .data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

#emailMarketingSection .data-table th,
#emailMarketingSection .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-light);
}

#emailMarketingSection .data-table th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
}

#emailMarketingSection .data-table tbody tr {
    transition: background-color 0.2s;
}

#emailMarketingSection .data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- Action Button Styling --- */
#emailMarketingSection .data-table .button.small {
    padding: 0.4rem 0.9rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    min-width: 80px;
    text-align: center;
}
#emailMarketingSection .data-table .button.secondary {
    background-color: var(--surface-color);
    color: var(--text-dim);
    border: 1px solid var(--border-color);
}
#emailMarketingSection .data-table .button.secondary:hover {
    background-color: #3f3f3f;
    border-color: var(--primary-color);
    color: var(--text-light);
}

/* --- Funnel Editor Specific Styling --- */
.funnel-editor .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.funnel-editor .section-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.funnel-step-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.funnel-step-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.funnel-step-item .step-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 40px;
}
.funnel-step-item .step-content {
    flex: 1;
}
.funnel-step-item .step-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}
.funnel-step-item .step-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
}
.funnel-step-item .step-meta .template-name {
    color: var(--primary-color);
}
.funnel-step-item .step-actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Funnel Enrollments Tracker --- */
.funnel-enrollment-card {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
}

.funnel-enrollment-card.completed {
    border-left-color: var(--success-color);
    opacity: 0.7;
}

.funnel-enrollment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.funnel-enrollment-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.funnel-enrollment-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.enrollment-progress-tracker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    position: relative;
}

.enrollment-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.enrollment-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background-dark);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-dim);
    position: relative;
    z-index: 2;
}

.enrollment-step.completed .enrollment-step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--text-light);
}

.enrollment-step.current .enrollment-step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.5);
    animation: enrollmentPulse 2s infinite;
}

@keyframes enrollmentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.enrollment-step-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    max-width: 120px;
    margin: 0 auto;
    line-height: 1.2;
}

.enrollment-step.completed .enrollment-step-label {
    color: var(--success-color);
}

.enrollment-step.current .enrollment-step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.enrollment-step-connector {
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
}

.enrollment-step.completed .enrollment-step-connector {
    background: var(--success-color);
}

.enrollment-step:last-child .enrollment-step-connector {
    display: none;
}

.enrollment-person-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.enrollment-person-name {
    font-weight: 600;
    color: var(--text-light);
}

.enrollment-person-email {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.enrollment-next-email {
    font-size: 0.85rem;
    color: var(--accent-color);
}

#addStepFormContainer {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#addStepFormContainer h5 {
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

/* --- Email Marketing Status Badges --- */
#emailMarketingSection .status-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

/* --- Campaign & Scheduled Email Statuses --- */

/* Green for successful/active states */
#emailMarketingSection .status-badge.status-sent,
#emailMarketingSection .status-badge.status-active {
    background-color: rgba(76, 175, 80, 0.2);
    color: #A5D6A7;
    border-color: rgba(76, 175, 80, 0.5);
}

/* Yellow/Gold for pending/draft states */
#emailMarketingSection .status-badge.status-pending,
#emailMarketingSection .status-badge.status-queued,
#emailMarketingSection .status-badge.status-draft {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFE082;
    border-color: rgba(255, 193, 7, 0.5);
}

/* Red for failed/canceled states */
#emailMarketingSection .status-badge.status-failed,
#emailMarketingSection .status-badge.status-canceled,
#emailMarketingSection .status-badge.status-error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #EF9A9A;
    border-color: rgba(244, 67, 54, 0.5);
}

/* Grey for neutral/inactive states */
#emailMarketingSection .status-badge.status-inactive,
#emailMarketingSection .status-badge.status-archived {
    background-color: rgba(158, 158, 158, 0.2);
    color: #E0E0E0;
    border-color: rgba(158, 158, 158, 0.5);
}

/* --- Content Calendar Styles --- */
#contentCalendarStats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

#contentCalendarStats .kpi-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

#contentCalendarStats .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

#contentCalendarStats .kpi-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* --- Email Marketing Utility Classes --- */

/* Stat/metric card used in analytics and calendar metrics */
.em-stat-card {
    text-align: center;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
}

.em-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.em-stat-value.success { color: var(--success-color); }
.em-stat-value.accent { color: var(--accent-color); }
.em-stat-value.purple { color: #9c27b0; }
.em-stat-value.error { color: var(--error-color); }

.em-stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Metrics grid layouts */
.em-metrics-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.em-metrics-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Rate card with gradient background */
.em-rate-card {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.em-rate-card.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.em-rate-card.accent {
    background: linear-gradient(135deg, rgba(77, 181, 195, 0.15), rgba(77, 181, 195, 0.05));
    border: 1px solid rgba(77, 181, 195, 0.3);
}

.em-rate-card.purple {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(156, 39, 176, 0.05));
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.em-rate-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.em-rate-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Preview modal sidebar step items */
.em-preview-step {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.em-preview-step.active {
    background: var(--primary-color);
}

.em-preview-step-title {
    font-weight: 600;
    color: var(--text-light);
}

.em-preview-step.active .em-preview-step-title {
    color: white;
}

.em-preview-step-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.em-preview-step.active .em-preview-step-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

/* Week info header in modals */
.em-week-info {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Email part section in calendar edit */
.em-part-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.em-part-section.has-template {
    background: var(--surface-color);
}

.em-part-section.no-template {
    background: rgba(255, 165, 0, 0.1);
}

/* Part breakdown mini-cards */
.em-part-mini-stat {
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
}

.em-part-mini-stat .em-stat-value {
    font-size: 1.25rem;
}

.em-part-mini-stat .em-stat-label {
    font-size: 0.7rem;
}

/* Schedule preview cards */
.em-schedule-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: 6px;
}

/* Enrollment cancel button */
.em-cancel-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

/* Form control class additions - modals need this for dark theme */
.em-form-control {
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    width: 100%;
}

/* --- Analytics KPI grid (4 columns) --- */
.em-analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* --- Chart container with top margin --- */
.em-chart-card {
    margin-top: 2rem;
}

.em-chart-card-tall {
    margin-top: 2rem;
    height: 450px;
}

/* --- Preview modal layout --- */
.em-preview-modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.em-preview-modal-wide {
    max-width: 1000px;
}

.em-preview-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.em-preview-sidebar {
    width: 250px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
}

.em-preview-sidebar-wide {
    width: 280px;
}

.em-preview-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.em-preview-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.em-preview-subject-label {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.em-preview-subject-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

.em-preview-iframe-wrap {
    flex: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.em-preview-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

/* --- Mini stat grid (2-col) for part breakdowns --- */
.em-part-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.8rem;
}

/* --- Variable input grid (2-col) --- */
.em-variable-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- Part breakdown grid (3-col) --- */
.em-part-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* --- Part card (surface bg, border-left accent) --- */
.em-part-card {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.em-part-card.part-2 {
    border-left-color: var(--accent-color);
}

.em-part-card.part-3 {
    border-left-color: #9c27b0;
}

/* --- Calendar filter bar --- */
.em-calendar-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.em-filter-narrow {
    width: 120px;
}

.em-filter-medium {
    width: 150px;
}

/* --- View toggle row --- */
.em-view-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* --- Newsletter template selector --- */
.em-newsletter-selector {
    margin-left: 2rem;
}

.em-newsletter-selector label {
    margin-right: 0.5rem;
    font-weight: 500;
}

/* --- Schedule preview color variants --- */
.em-schedule-card.part-1 { border-left: 3px solid #5cb85c; }
.em-schedule-card.part-2 { border-left: 3px solid #f0ad4e; }
.em-schedule-card.part-3 { border-left: 3px solid #5bc0de; }

/* --- Campaign stat value color classes --- */
.campaign-stat-value.success { color: #5cb85c; }
.campaign-stat-value.info { color: #5bc0de; }
.campaign-stat-value.warning { color: #f0ad4e; }

/* --- Sidebar heading --- */
.em-sidebar-heading {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* --- Metrics section wrapper --- */
.em-metrics-section {
    background: linear-gradient(135deg, rgba(77, 181, 195, 0.1), rgba(255, 140, 0, 0.1));
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* --- Error pre-formatted block --- */
.em-error-pre {
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-light);
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 6px;
}

/* --- Content calendar KPI color classes --- */
.kpi-value.purple { color: #9b59b6; }
.kpi-value.success { color: #5cb85c; }
.kpi-value.info { color: #5bc0de; }
.kpi-value.warning { color: #f0ad4e; }

/* --- Calendar edit form actions bar --- */
.em-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Scrollable table containers ---
   Industry-standard pattern: the TABLE scrolls (not the whole section).
   Section header + filters stay visible above; only the data rows scroll.
   Sticky thead keeps column labels visible while scrolling rows. */
.table-container {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.table-container::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Sticky column headers inside scrollable table containers */
.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-color);
}

/* Content calendar list: horizontal scroll wrapper */
.content-calendar-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.content-calendar-list::-webkit-scrollbar {
    height: 6px;
}

.content-calendar-list::-webkit-scrollbar-track {
    background: transparent;
}

.content-calendar-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.content-calendar-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.content-calendar-list .calendar-row {
    min-width: 600px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 1024px) {
    .em-analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .em-metrics-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .content-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    #contentCalendarStats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* --- Tab bar: horizontal scroll --- */
    .email-marketing-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .email-marketing-tabs .tab-button {
        flex-shrink: 0;
        white-space: nowrap;
        min-height: 44px;
    }

    /* --- Analytics --- */
    .em-analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- Metrics grids --- */
    .em-metrics-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .em-metrics-grid-3 {
        grid-template-columns: 1fr;
    }

    /* --- Preview modals: stack sidebar above content --- */
    .em-preview-modal-body {
        flex-direction: column;
    }
    .em-preview-sidebar,
    .em-preview-sidebar.em-preview-sidebar-wide {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1rem;
    }
    .em-preview-iframe-wrap iframe {
        min-height: 300px;
    }

    /* --- Content calendar --- */
    #contentCalendarStats {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-calendar-grid {
        grid-template-columns: 1fr;
    }
    .content-calendar-list .calendar-row {
        grid-template-columns: 1fr;
        min-width: 0; /* override 600px min for stacked layout */
        gap: 0.5rem;
    }

    /* --- Campaign stats --- */
    .campaign-stats-grid {
        grid-template-columns: 1fr;
    }

    /* --- Enrollment progress tracker --- */
    .enrollment-progress-tracker {
        flex-wrap: wrap;
    }
    .enrollment-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .enrollment-step-label {
        font-size: 0.65rem;
    }

    /* --- Funnel steps --- */
    .funnel-step-item {
        flex-wrap: wrap;
    }

    /* --- Schedule cards --- */
    .em-schedule-card {
        grid-template-columns: 1fr;
    }

    /* --- Part breakdown / mini grids --- */
    .em-part-breakdown,
    .em-part-mini-grid {
        grid-template-columns: 1fr;
    }

    /* --- Variable grid --- */
    .em-variable-grid {
        grid-template-columns: 1fr;
    }

    /* --- Tables: horizontal scroll --- */
    #emailMarketingSection .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Calendar filters --- */
    .em-calendar-filters {
        flex-wrap: wrap;
    }

    /* --- Newsletter image rows --- */
    #newsletterEditorForm .form-row {
        flex-direction: column;
    }

    /* --- Form elements --- */
    .oga-form .form-group {
        grid-template-columns: 1fr;
    }

    /* --- Newsletter selector --- */
    .em-newsletter-selector {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    /* --- Form actions --- */
    .em-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    /* --- Preview modal content --- */
    .em-preview-modal-content,
    .em-preview-modal-content.em-preview-modal-wide {
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    /* --- Analytics: single column --- */
    .em-analytics-kpi-grid {
        grid-template-columns: 1fr;
    }

    /* --- Metrics: single column --- */
    .em-metrics-grid-5 {
        grid-template-columns: 1fr;
    }

    /* --- Stat cards: smaller text --- */
    .em-stat-card .em-stat-value {
        font-size: 1.5rem;
    }
    .em-rate-value {
        font-size: 1.25rem;
    }
    .campaign-stat-value {
        font-size: 1.5rem;
    }

    /* --- Calendar stats --- */
    #contentCalendarStats {
        grid-template-columns: 1fr;
    }
    .content-calendar-kpi-grid {
        grid-template-columns: 1fr;
    }

    /* --- Preview sidebar: shorter on small phones --- */
    .em-preview-sidebar,
    .em-preview-sidebar.em-preview-sidebar-wide {
        max-height: 150px;
    }

    /* --- Calendar filter selects: full width --- */
    .em-calendar-filters {
        flex-direction: column;
    }
    .em-filter-narrow,
    .em-filter-medium {
        width: 100%;
    }
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.content-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.content-calendar-quarter {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.content-calendar-quarter h4 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    font-size: 1rem;
}

.calendar-week-card {
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #666;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-week-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(3px);
}

.calendar-week-card.status-not_started { border-left-color: #666; }
.calendar-week-card.status-draft { border-left-color: #f0ad4e; }
.calendar-week-card.status-ready { border-left-color: #5bc0de; }
.calendar-week-card.status-templates_created { border-left-color: #5cb85c; }
.calendar-week-card.status-sent { border-left-color: #9b59b6; }

.calendar-week-card .week-number {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.calendar-week-card .sequence-name {
    font-size: 0.9rem;
    margin: 0.25rem 0;
    color: var(--text-light);
}

.calendar-week-card .program-focus {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: inline-block;
    background: rgba(255,140,0,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Content Calendar List View */
.content-calendar-list {
    width: 100%;
}

.content-calendar-list .calendar-row {
    display: grid;
    grid-template-columns: 60px 1fr 150px 120px 150px;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background 0.2s;
}

.content-calendar-list .calendar-row:hover {
    background: rgba(255,255,255,0.03);
}

.content-calendar-list .calendar-row.current-week {
    background: rgba(255, 140, 0, 0.1);
    border-left: 3px solid var(--primary-color);
}

.content-calendar-list .calendar-header {
    font-weight: bold;
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.calendar-actions {
    display: flex;
    gap: 0.5rem;
}

.calendar-actions .button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.calendar-week-card.current-week {
    background: rgba(255, 140, 0, 0.15);
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* --- Campaign Details Modal Styles --- */
.campaign-details-modal {
    max-width: 500px;
    padding: 0;
}

.campaign-details-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.campaign-details-header h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
}

.campaign-details-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.campaign-status-badge {
    display: inline-block;
    padding: 0.6rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 1.5rem;
}

.campaign-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.campaign-stat-card {
    background: rgba(50, 55, 65, 0.8);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.campaign-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.campaign-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.campaign-description-section {
    width: 100%;
    background: rgba(50, 55, 65, 0.5);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
}

.campaign-description-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.campaign-description-text {
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
}

.campaign-details-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.campaign-close-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    border-radius: 8px;
}


/* === teacher-portal/css/teacher-portal-finance.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Finance, Tasks & Utility Module
   ============================================================================ */

/* --- Scoring Help Modal Styles --- */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    margin-bottom: 2rem;
    font-size: 0.9em;
}
.help-table th, .help-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
    color: var(--text-light);
}
.help-table th {
    background-color: var(--surface-color);
    color: var(--primary-color);
    font-weight: 600;
}
.help-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.2);
}
.help-table td:first-child {
    text-align: center;
    font-size: 1.5rem;
    vertical-align: middle;
}
#scoringHelpModal .modal-body {
    color: var(--text-light);
}
#scoringHelpModal .modal-body p,
#scoringHelpModal .modal-body h3,
#scoringHelpModal .modal-body li,
#scoringHelpModal .modal-body small,
#scoringHelpModal .modal-body strong {
    color: var(--text-light);
}
#scoringHelpModal .modal-body ul {
    padding-left: 1.5rem;
    margin-top: 1rem;
    list-style-type: disc;
    color: var(--text-light);
}
#scoringHelpModal .modal-body li {
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

/* =================================== */
/* == Financial Dashboard Styling   == */
/* =================================== */

/* --- Grid Layouts for a clean, responsive structure --- */

/* For the top row of KPIs */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* For the side-by-side charts at the bottom */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* --- The Main "Card" Style --- */
/* This is the key style that makes everything look like a contained module */
.metric-card {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* --- Card Header and Content Styling --- */
.metric-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #3a3d42);
}

.metric-card .card-header h3,
.metric-card .card-header h4 {
    margin: 0;
    color: var(--text-light);
}

.metric-card .metric-value {
    font-size: 2em;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Style the <h4> title above the table */
.metric-card h4 {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --- Chart Container Fix --- */
/* This ensures the chart container has a defined space for the canvas to fill */
.chart-container {
    position: relative; /* Required for Chart.js responsiveness */
    flex-grow: 1; /* Allows the container to fill the card's space */
    min-height: 300px; /* Ensures a minimum height to prevent squishing */
}

/* More specific chart container within metric cards */
.metric-card .chart-container {
    position: relative;
    flex-grow: 1;
    min-height: 0; /* Prevents flexbox from overflowing on small screens */
}

/* Canvas sizing for charts within metric cards */
.metric-card .chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* --- Vestaboard Display --- */
.vestaboard-container {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.vestaboard-display {
    display: grid;
    grid-template-columns: repeat(22, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 3px;
    background: #0a0a0a;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    aspect-ratio: 22 / 6;
    perspective: 1000px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.vestaboard-char {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: clamp(0.6rem, 1.2vw, 0.9rem);
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        inset 0 1px 1px rgba(255,255,255,0.2);
    transform-style: preserve-3d;
    animation: flip-tile 0.6s ease-out backwards;
}

.vestaboard-char.empty {
    background: #2a2a2a;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.vestaboard-char.space {
    background: #1a1a1a;
    box-shadow: none;
}

@keyframes flip-tile {
    0% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

/* Stagger animation based on position */
.vestaboard-char {
    animation-delay: calc(var(--tile-index) * 0.015s);
}

.vestaboard-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.vestaboard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #555;
}

.vestaboard-dot:hover {
    background: #666;
}

.vestaboard-dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.vestaboard-nav-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s;
}

.vestaboard-nav-btn:hover {
    color: var(--primary-color);
}

.vestaboard-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- LTV Table Styling --- */

/* Target the table specifically inside the LTV container */
#topStudentsByLtvTable .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 1rem;
}

/* Style the table headers (Student, Total Revenue, Months) */
#topStudentsByLtvTable .data-table th {
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    text-align: left;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Right-align the second and third header columns */
#topStudentsByLtvTable .data-table th:nth-child(2),
#topStudentsByLtvTable .data-table th:nth-child(3) {
    text-align: right;
}

/* Style each data row */
#topStudentsByLtvTable .data-table td {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.25rem 0;
}

/* Right-align the second and third data columns */
#topStudentsByLtvTable .data-table td:nth-child(2),
#topStudentsByLtvTable .data-table td:nth-child(3) {
    text-align: right;
}

/* =================================== */
/* == Task Widget & My Tasks        == */
/* =================================== */

/* --- Dashboard Task Widget Items --- */
.task-widget-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 0.5rem; }
.task-widget-item:last-child { border-bottom: none; }
.task-widget-main { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 200px; }
.task-widget-main .task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.task-widget-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.85em; color: rgba(255, 255, 255, 0.7); flex-wrap: wrap; }
.task-student-link { cursor: pointer; transition: color 0.2s; }
.task-student-link:hover { color: var(--primary-light); }
.task-due-date.overdue { color: var(--error-color); font-weight: 600; }
.task-due-date.due-today { color: var(--warning-color); font-weight: 600; }
.task-widget-meta .fas { margin-right: 4px; }

/* --- My Tasks: Filter Bar --- */
.task-filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.task-filter-bar .filter-select,
.task-filter-bar .search-input {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.task-filter-bar .filter-select:focus,
.task-filter-bar .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.task-filter-bar .search-input {
    flex: 1;
    min-width: 180px;
    padding: 0.6rem 1rem;
}

.task-filter-bar .search-input::placeholder {
    color: var(--text-dim);
}

/* --- My Tasks: Count Display --- */
.task-count-display {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    padding-left: 0.25rem;
}

/* --- My Tasks: Empty State --- */
.task-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.task-empty-state i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 1.25rem;
}

.task-empty-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.task-empty-message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35);
}

/* --- Priority Color Coding --- */
.priority-high { color: var(--error-color); font-weight: 600; }
.priority-medium { color: var(--warning-color); }
.priority-low { color: var(--success-color); }

/* --- Task Card Styles --- */
.task-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-card {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    border-left: 5px solid var(--warning-color);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.task-card.priority-high { border-left-color: var(--error-color); }
.task-card.priority-medium { border-left-color: var(--warning-color); }
.task-card.priority-low { border-left-color: var(--success-color); }

.task-card.overdue {
    background: rgba(244, 67, 54, 0.08);
}

.task-card.due-today {
    background: rgba(255, 152, 0, 0.08);
}

.task-card.completed {
    opacity: 0.55;
}

.task-card.completed .task-card-title {
    text-decoration: line-through;
    color: var(--text-dim);
}

.task-card-checkbox {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.task-card-content {
    flex: 1;
    min-width: 0;
}

.task-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.task-card-description {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.task-card-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.task-card-priority-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.task-card-priority-badge.high {
    background: var(--error-color);
    color: white;
}

.task-card-priority-badge.medium {
    background: var(--warning-color);
    color: #1a1a1a;
}

.task-card-priority-badge.low {
    background: var(--success-color);
    color: white;
}

.task-card-due-date.overdue {
    color: var(--error-color);
    font-weight: 600;
}

.task-card-due-date.due-today {
    color: var(--warning-color);
    font-weight: 600;
}

.task-card-status .fa-circle {
    font-size: 0.5rem;
    vertical-align: middle;
}

.task-card-student {
    color: var(--primary-color);
    transition: opacity 0.2s;
}

.task-card-student:hover {
    opacity: 0.8;
}

.task-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.task-card-actions .button {
    padding: 0.5rem 0.75rem;
}

/* --- Custom Checkbox Styling --- */
.task-status-toggle {
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    border: 2px solid var(--text-dim);
    border-radius: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.task-status-toggle:hover {
    border-color: var(--primary-color);
}

.task-status-toggle:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.task-status-toggle:checked::after {
    content: '\2714';
    position: absolute;
    color: var(--background-dark);
    font-size: 12px;
    font-weight: 900;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- Action Buttons for Task List --- */
#userTaskListContainer .button.secondary {
    background-color: #555;
    border-color: #666;
}

#userTaskListContainer .button.danger {
    background-color: var(--error-color);
}

/* --- Overdue Banner --- */
.task-overdue-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(244, 67, 54, 0.12);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    color: var(--error-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.task-overdue-banner i {
    font-size: 1.1rem;
}

.task-overdue-banner-btn {
    margin-left: auto;
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.task-overdue-banner-btn:hover {
    opacity: 0.85;
}

/* --- Task Card Age --- */
.task-card-age {
    opacity: 0.6;
    font-size: 0.8rem;
}

/* --- Checklist Progress Bar (on task card) --- */
.task-card-checklist-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.task-checklist-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.task-checklist-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* --- Checklist Edit (inside task modal) --- */
.task-checklist-edit {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.task-checklist-edit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.task-checklist-edit-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.task-checklist-edit-item span.completed {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-checklist-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.task-checklist-add .search-input {
    flex: 1;
}

.task-checklist-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-dim);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    background: transparent;
    transition: all 0.2s;
}

.task-checklist-toggle:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.task-checklist-toggle:checked::after {
    content: '\2714';
    position: absolute;
    color: var(--background-dark);
    font-size: 10px;
    font-weight: 900;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.task-checklist-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.2rem;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.task-checklist-edit-item:hover .task-checklist-remove {
    opacity: 1;
}

.task-checklist-remove:hover {
    color: var(--error-color);
}

/* --- Task Comments (inside task modal) --- */
.task-comments-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
}

.task-comment-item {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.task-comment-item:last-child {
    border-bottom: none;
}

.task-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.task-comment-header strong {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.task-comment-body {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.task-comment-add {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.task-comment-add .search-input {
    flex: 1;
}

/* --- Tasks: Mobile Responsive --- */
@media (max-width: 768px) {
    .task-filter-bar {
        gap: 0.5rem;
    }

    .task-filter-bar .filter-select {
        flex: 1;
        min-width: 0;
    }

    .task-filter-bar .search-input {
        width: 100%;
        flex-basis: 100%;
        order: -1;
    }

    .task-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .task-card-actions {
        flex-direction: column;
        gap: 0.35rem;
    }

    .task-card-actions .button {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .task-filter-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .task-filter-bar .filter-select,
    .task-filter-bar .search-input {
        width: 100%;
        flex: none;
        min-width: 0;
    }

    .task-card {
        padding: 0.85rem;
        flex-wrap: wrap;
    }

    .task-card-content {
        min-width: calc(100% - 36px);
    }

    .task-card-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .task-card-meta {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .task-empty-state {
        padding: 2.5rem 1.5rem;
    }

    .task-empty-state i {
        font-size: 2.5rem;
    }
}

/* =================================== */
/* == Analytics Filters & KPIs      == */
/* =================================== */

/* --- Dashboard Section (analytics page wrapper) --- */
.dashboard-section {
    padding: 2rem;
}

/* --- Section Header (h2 + action button row) --- */
.dashboard-section > .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.dashboard-section > .section-header h2 {
    margin: 0;
    color: var(--text-light);
}

/* --- Feedback States --- */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--error-color);
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    font-size: 0.95rem;
}
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* --- Analytics Filter Buttons --- */
.analytics-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    background-color: rgba(0,0,0,0.2);
    width: fit-content;
}
.filter-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0.5rem 1rem;
    min-height: 44px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.filter-btn:hover {
    background-color: var(--surface-color);
    color: var(--text-light);
}
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--background-dark);
    font-weight: 600;
}

/* --- Analytics Summary Cards --- */
.analytics-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.analytics-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.analytics-summary-row:last-child {
    border-bottom: none;
}
.analytics-summary-row span {
    color: var(--text-dim);
    font-size: 0.9rem;
}
.analytics-summary-row strong {
    color: var(--text-light);
    font-size: 1.1rem;
}
/* --- Analytics Date Selectors Row --- */
.analytics-date-selectors {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* --- Finance Date Selector (month/quarter pickers) --- */
.finance-date-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* --- Finance KPI Grid (responsive auto-fit) --- */
.finance-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* --- Finance Filter Bar --- */
.finance-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- Budget Progress List --- */
.budget-progress-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.budget-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}
.budget-row-header label {
    color: var(--text-light);
    font-weight: 500;
}
.budget-row-header span {
    font-size: 0.9em;
}
.budget-row-header .text-error {
    color: var(--error-color);
    font-weight: 600;
}
.budget-row-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* --- Budget vs Actual Card (scrollable, height-matched to compact pie chart) --- */
.finance-budget-card {
    display: flex;
    flex-direction: column;
}
.finance-budget-card #budgetVsActualContainer {
    flex: 1;
    overflow-y: auto;
    max-height: 230px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.finance-budget-card #budgetVsActualContainer::-webkit-scrollbar { width: 6px; }
.finance-budget-card #budgetVsActualContainer::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
.finance-budget-card #budgetVsActualContainer::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.finance-budget-card #budgetVsActualContainer::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* --- Reports History Section --- */
.finance-reports-history {
    margin-top: 2rem;
}
/* Left-align h4 inside report sections */
.reports-list h4 {
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0.25rem;
}

/* --- Expense Categories Section --- */
.finance-categories-section {
    margin-top: 2rem;
    overflow: visible;
}
.finance-categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.finance-categories-header h4 {
    text-align: left;
    margin-bottom: 0;
}
.finance-categories-subtitle {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
/* Scrollable categories table */
.finance-categories-section .speed-table-wrap {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.finance-categories-section .speed-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.finance-categories-section .speed-table-wrap::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
.finance-categories-section .speed-table-wrap::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.finance-categories-section .speed-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* === Finance Module Mobile === */
@media (max-width: 768px) {
    .analytics-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .metric-card { padding: 1rem; }
    .task-cards-container { grid-template-columns: 1fr; }
    .vestaboard-display { font-size: 0.5rem; }
    .analytics-kpi-card { padding: 0.75rem; }
    #analyticsKpiContainer { grid-template-columns: repeat(2, 1fr); }

    /* Analytics filters: horizontal scroll */
    .analytics-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Analytics date selectors stack */
    .analytics-date-selectors {
        flex-wrap: wrap;
    }

    /* Dashboard section tighter padding */
    .dashboard-section {
        padding: 1rem;
    }
    .dashboard-section > .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .finance-categories-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .finance-categories-section .speed-table-wrap { max-height: 300px; }

    .vestaboard-container {
        padding: 0.75rem;
    }
    .vestaboard-display {
        padding: 0.5rem;
        gap: 2px;
        aspect-ratio: auto;
    }
    .vestaboard-char {
        font-size: clamp(0.35rem, 2.5vw, 0.7rem);
    }
}
@media (max-width: 480px) {
    #analyticsKpiContainer { grid-template-columns: 1fr; }
    .analytics-kpi-card .kpi-value { font-size: 1.6rem; }
    .analytics-summary-row span { font-size: 0.8rem; }
    .analytics-summary-row strong { font-size: 0.95rem; }
    .dashboard-section { padding: 0.75rem; }

    .vestaboard-container {
        padding: 0.5rem;
        overflow: hidden;
    }
    .vestaboard-display {
        padding: 0.25rem;
        gap: 1px;
        aspect-ratio: auto;
    }
    .vestaboard-char {
        font-size: clamp(0.3rem, 2vw, 0.6rem);
        border-radius: 1px;
    }
    .vestaboard-controls {
        margin-top: 0.75rem;
        gap: 0.5rem;
    }
    .vestaboard-nav-btn {
        font-size: 1rem;
        padding: 0.25rem;
    }
    .vestaboard-dot {
        width: 8px;
        height: 8px;
    }
}

/* ============================== */
/* Product Analytics              */
/* (Moved from students.css)      */
/* ============================== */
.product-analytics-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.analytics-chart-container .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.analytics-chart-container .chart-header h3 {
    margin: 0;
    color: var(--primary-light);
}


/* === teacher-portal/css/teacher-portal-teachers.css === */
/* ===================================================================
   OGA Teacher Portal 2.0 - Teacher Module Styles
   =================================================================== */

/* ============================== */
/* Teacher Card Overrides         */
/* ============================== */
.teacher-card {
    position: relative;
    border-top: 3px solid var(--primary-color);
}

.teacher-card .count-badge {
    background: var(--warning-color);
    color: white;
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 10;
}

.teacher-card .count-badge i {
    font-size: 0.9rem;
}

.teacher-card .info-row.separator {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* ============================== */
/* Role Badge Colors              */
/* ============================== */
/* Card role badges - scoped to .teacher-card for specificity */
.teacher-card .level-badge.role-badge-owner {
    background: var(--primary-color);
    color: #000;
}

.teacher-card .level-badge.role-badge-admin {
    background: var(--accent-color);
    color: #000;
}

.teacher-card .level-badge.role-badge-teacher {
    background: #2196F3;
    color: white;
}

.teacher-card .level-badge.role-badge-student {
    background: #9C27B0;
    color: white;
}

/* Modal role badges - scoped to teacher-detail for specificity */
.modal .level-badge.role-badge-owner {
    background: var(--primary-color);
    color: #000;
}

.modal .level-badge.role-badge-admin {
    background: var(--accent-color);
    color: #000;
}

.modal .level-badge.role-badge-teacher {
    background: #2196F3;
    color: white;
}

.modal .level-badge.role-badge-student {
    background: #9C27B0;
    color: white;
}

/* ============================== */
/* Proficiency Badges             */
/* ============================== */
.proficiency-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

.proficiency-proficient {
    background: #3182ce;
    color: #fff;
}

.proficiency-advanced {
    background: #805ad5;
    color: #fff;
}

.proficiency-expert {
    background: #d69e2e;
    color: #000;
}

.proficiency-certified {
    background: #38a169;
    color: #fff;
}

.proficiency-default {
    background: #4a5568;
    color: #fff;
}

/* ============================== */
/* Teacher Skills Section         */
/* ============================== */
.skill-category-section {
    margin-bottom: 1.5rem;
}

.skill-category-section h5 {
    color: var(--primary-color);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.skill-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.teacher-skill-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    position: relative;
}

.teacher-skill-card .skill-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.teacher-skill-card .skill-header .skill-info {
    flex: 1;
}

.teacher-skill-card .skill-name {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.teacher-skill-card .skill-remove-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.8em;
    margin-left: 0.5rem;
}

.teacher-skill-card .skill-notes {
    font-size: 0.85em;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* ============================== */
/* Teacher Document Table         */
/* ============================== */
.teacher-document-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
}

.teacher-document-table thead tr {
    background: var(--background-dark);
}

.teacher-document-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--primary-color);
    font-size: 0.9rem;
}

.teacher-document-table th:last-child {
    text-align: center;
}

.teacher-document-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.teacher-document-table tbody tr:hover {
    background: var(--background-dark);
}

.teacher-document-table td {
    padding: 1rem 1.25rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.teacher-document-table td:first-child {
    color: var(--text-light);
}

.teacher-document-table td:first-child i {
    color: var(--primary-color);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.teacher-document-table .doc-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.teacher-document-table .doc-actions .button {
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 90px;
}

.teacher-document-table .doc-actions .button.primary {
    background: var(--primary-color);
    color: #000;
    min-width: 110px;
}

/* ============================== */
/* Time-Off Request Cards         */
/* ============================== */
.time-off-request-item {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--warning-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.time-off-dates-grid {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1rem;
    align-items: center;
}

.time-off-date-group {
    text-align: center;
}

.time-off-date-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.time-off-date-value {
    font-weight: 600;
    color: var(--text-light);
}

.time-off-date-value i {
    color: var(--warning-color);
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

.time-off-reason-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.time-off-reason-value {
    color: var(--text-light);
    font-size: 0.9rem;
}

.time-off-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.time-off-actions .button {
    flex: 1;
}

/* Empty state for time-off */
.time-off-empty {
    text-align: center;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 8px;
}

.time-off-empty i {
    font-size: 2rem;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.time-off-empty p {
    color: var(--text-dim);
    margin: 0;
}

/* ============================== */
/* Time-Off Approved Section      */
/* ============================== */
.time-off-approved-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.time-off-approved-section h4 {
    margin-bottom: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-off-approved-section h4 i {
    color: var(--success-color);
}

.time-off-approved-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.time-off-approved-card {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--success-color);
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1.5rem;
    align-items: center;
}

.time-off-approved-card .time-off-date-value i {
    color: var(--success-color);
    margin-right: 0.35rem;
}

.time-off-approved-card .time-off-date-label {
    font-size: 0.75rem;
}

.time-off-approved-empty {
    text-align: center;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 8px;
}

.time-off-approved-empty i {
    font-size: 2rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.time-off-approved-empty p {
    color: var(--text-dim);
    margin: 0;
}

/* ============================== */
/* Pending Time-Off (inline view) */
/* ============================== */
.time-off-pending-inline {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--surface-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--warning-color);
}

.time-off-pending-status {
    padding: 0.5rem;
    color: var(--warning-color);
    font-size: 0.85rem;
}

/* ============================== */
/* Pending Approval Cards         */
/* ============================== */
.pending-approval-card {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--warning-color);
    display: flex;
    gap: 1.5rem;
    align-items: start;
}

.pending-approval-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.pending-approval-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.pending-approval-body {
    flex: 1;
}

.pending-approval-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.pending-approval-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.pending-approval-requested {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.pending-approval-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(var(--warning-color-rgb, 255, 193, 7), 0.12);
    color: var(--warning-color);
}

.pending-approval-details {
    background: var(--background-dark);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.pending-approval-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.pending-approval-date-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.pending-approval-date-value {
    font-weight: 600;
}

.pending-approval-reason {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.pending-approval-reason-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.pending-approval-actions {
    display: flex;
    gap: 0.75rem;
}

.pending-approval-actions .button {
    flex: 1;
}

/* ============================== */
/* Schedule Cards (in modal)      */
/* ============================== */
.teacher-schedule-card {
    background: var(--surface-color);
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
}

.teacher-schedule-card .schedule-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.teacher-schedule-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-light);
}

.teacher-schedule-card .schedule-date {
    font-size: 0.85em;
    color: var(--text-dim);
}

.teacher-schedule-card .schedule-enrolled {
    font-size: 0.9em;
    color: var(--text-dim);
    font-weight: 500;
    margin-left: 1rem;
    text-align: right;
}

/* ============================== */
/* Message Preview CTA            */
/* ============================== */
.message-preview-cta {
    text-align: center;
    padding: 2rem;
}

.message-preview-cta > i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.message-preview-cta .button i {
    color: white;
}

.message-preview-cta p {
    margin-bottom: 1rem;
}

/* ============================== */
/* Payroll Summary                */
/* ============================== */
.payroll-summary {
    margin-top: 1rem;
}

.payroll-summary hr {
    border-color: var(--border-color);
    margin: 0.5rem 0;
}

.payroll-summary .info-row.total-row {
    font-weight: bold;
    font-size: 1.1em;
}

.payroll-summary .button {
    margin-top: 1rem;
    width: 100%;
}

/* ============================== */
/* Onboarding Checklist           */
/* ============================== */
.onboarding-checklist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.onboarding-checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.onboarding-checklist-item label {
    margin-bottom: 0;
    font-weight: normal;
}

/* ============================== */
/* Availability Grid Checkboxes   */
/* ============================== */
.schedule-grid-table td input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.schedule-grid-table td {
    text-align: center;
}

/* ============================== */
/* Expense Status Colors          */
/* ============================== */
.expense-status {
    font-weight: 500;
}

.expense-status-pending {
    color: var(--warning-color);
}

.expense-status-approved {
    color: var(--success-color);
}

.expense-status-denied {
    color: var(--error-color);
}

/* ============================== */
/* Student Feedback in Teacher    */
/* ============================== */
.teacher-feedback-entry {
    border-left-color: var(--primary-color);
    margin-bottom: 1rem;
}

.teacher-feedback-content {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    white-space: pre-wrap;
}

/* ============================== */
/* Teacher Empty States           */
/* ============================== */
.teacher-empty-state {
    text-align: center;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 8px;
}

.teacher-empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.teacher-empty-state p {
    margin: 0;
    color: var(--text-dim);
}

.teacher-empty-state.large {
    padding: 3rem;
}

.teacher-empty-state.large i {
    font-size: 3rem;
    opacity: 1;
}

/* Initials placeholder in modal header */
.teacher-info-column .initials-placeholder.initials-lg {
    font-size: 3rem;
}

.teacher-info-column .initials-placeholder.initials-sm {
    font-size: 1.5rem;
}

/* Admin note on expenses */
.expense-admin-note {
    margin-top: 4px;
}

/* ============================== */
/* Section Info Box (reusable)    */
/* ============================== */
.section-info-box {
    background: var(--surface-color);
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1.5rem;
}
.section-info-box.border-success { border-left-color: var(--success-color); }
.section-info-box.border-accent { border-left-color: var(--accent-color); }
.section-info-box.border-warning { border-left-color: var(--warning-color); }

.section-info-box h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
    font-size: 1rem;
}
.section-info-box h4:last-child {
    margin-bottom: 0;
}
.section-info-box p {
    font-size: 0.9em;
    color: var(--text-dim);
    margin: 0;
}

/* ============================== */
/* Scrollable Containers          */
/* ============================== */
.scrollable-sm {
    max-height: 300px;
    overflow-y: auto;
}
.scrollable-md {
    max-height: 400px;
    overflow-y: auto;
}

/* ============================== */
/* Tab Heading with Icon          */
/* ============================== */
.teacher-management-column .tab-panel > h4.tab-heading-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

/* ============================== */
/* Teacher Charts (Analytics)     */
/* ============================== */
.teacher-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.teacher-chart-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.teacher-chart-card h5 {
    margin: 0 0 1rem 0;
    color: var(--text-light);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.teacher-chart-card .chart-container {
    position: relative;
    height: 300px;
}

/* ============================== */
/* Form Section Separator         */
/* ============================== */
.form-section-separator {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ============================== */
/* Owner Notes Tab                */
/* ============================== */
.owner-notes-container {
    background: var(--background-dark);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.owner-notes-container label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
}
.owner-notes-textarea {
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 1rem;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

/* ============================== */
/* Upload / Document Form         */
/* ============================== */
.upload-form-container {
    padding: 1.5rem;
    background: var(--background-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.upload-form-container h5 {
    margin: 0 0 1rem 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================== */
/* Signature Tab                  */
/* ============================== */
.signature-description {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    font-size: 0.9em;
}

/* ============================== */
/* Tab Footer Button              */
/* ============================== */
.tab-footer-btn {
    margin-top: 1.5rem;
}

/* ============================== */
/* Input Group Flex Sizing        */
/* ============================== */
.input-group-flex-2 { flex: 2; }
.input-group-flex-1 { flex: 1; }

/* ============================== */
/* Messages Tab Container         */
/* ============================== */
#directMessageContainer {
    padding: 2rem;
    text-align: center;
}

/* ============================== */
/* Availability Helper Text       */
/* ============================== */
.availability-helper-text {
    font-size: 0.9em;
    margin-bottom: 1.5rem;
}

/* ============================== */
/* Performance Review List        */
/* ============================== */
#performanceReviewList {
    margin-bottom: 2rem;
}
#teacherSkillsList {
    margin-bottom: 2rem;
}
#payrollResult {
    margin-top: 1rem;
}
#teacherDocumentList {
    margin-bottom: 1.5rem;
}

/* ============================== */
/* Announcements (Teacher Module) */
/* ============================== */
.announcement-card {
    background: var(--surface-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.announcement-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.announcement-date {
    font-size: 0.85em;
    color: var(--text-dim);
}

.announcement-actions {
    display: flex;
}

.announcement-content {
    color: var(--text-light);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ============================== */
/* Pending Approvals Description  */
/* ============================== */
.pending-approvals-description {
    color: var(--text-dim);
    margin-bottom: 1rem;
}

/* ============================== */
/* Recent Announcements Heading   */
/* ============================== */
.recent-announcements-heading {
    margin-top: 2rem;
}

/* ============================== */
/* Roster Filter Controls         */
/* ============================== */
#rosterTab .filter-controls {
    margin-bottom: 1.5rem;
}

/* ============================== */
/* Empty State (large variant)    */
/* ============================== */
.teacher-empty-state.large i {
    color: var(--success-color);
}

/* ============================== */
/* Utility                        */
/* ============================== */
.text-italic { font-style: italic; }

/* ============================== */
/* Responsive                     */
/* ============================== */
@media (max-width: 768px) {
    .skill-cards-grid {
        grid-template-columns: 1fr;
    }

    .time-off-dates-grid,
    .time-off-approved-card {
        grid-template-columns: 1fr 1fr;
    }

    .pending-approval-card {
        flex-direction: column;
    }

    .pending-approval-dates {
        grid-template-columns: 1fr;
    }

    .teacher-document-table .doc-actions {
        flex-direction: column;
    }

    /* Upload/document form */
    .upload-form-container {
        padding: 1rem;
    }

    /* Section info boxes */
    .section-info-box {
        padding: 1rem;
    }

    /* Signature */
    .signature-description {
        font-size: 0.85em;
    }

    /* Availability grid */
    .availability-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .time-off-dates-grid,
    .time-off-approved-card {
        grid-template-columns: 1fr;
    }

    .upload-form-container {
        padding: 0.75rem;
    }

    .section-info-box {
        padding: 0.75rem;
    }
    .section-info-box h4 {
        font-size: 0.9rem;
    }
    .section-info-box p {
        font-size: 0.85em;
    }
}


/* === teacher-portal/css/teacher-portal-messaging.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Messaging UI
   Ported from student portal with teacher portal design system
   ============================================================================ */

/* ============================== */
/* Messaging Layout               */
/* ============================== */
.messaging-layout {
    --messaging-chrome-height: 250px; /* header + nav + padding */
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    height: calc(100vh - var(--messaging-chrome-height));
    min-height: 500px;
}

/* ============================== */
/* Conversations Sidebar          */
/* ============================== */
.conversations-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: rgba(45, 45, 45, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.conversations-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.conversation-search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    margin-bottom: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}

.conversation-search-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.conversation-search-input:focus { outline: none; border-color: var(--primary-color); }

.conversations-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.conversations-list::-webkit-scrollbar { width: 6px; }
.conversations-list::-webkit-scrollbar-track { background: transparent; }
.conversations-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

/* ============================== */
/* Conversation Skeleton Loading  */
/* ============================== */
.conversation-skeleton {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
}

.conversation-skeleton .skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.conversation-skeleton .skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-skeleton .skeleton-text {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.conversation-skeleton .skeleton-text.medium { width: 70%; }
.conversation-skeleton .skeleton-text.short { width: 40%; }

/* ============================== */
/* Conversation Item              */
/* ============================== */
.conversation-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.conversation-item.active {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.35);
}

/* Avatar Circle */
.msg-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #000;
    flex-shrink: 0;
}

.msg-avatar-circle.small {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
}

.conversation-item-content {
    flex: 1;
    min-width: 0;
}

.conversation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.conversation-item-name {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Unread conversation bold styling */
.conversation-item.unread .conversation-item-name {
    color: #fff;
    font-weight: 700;
}

.conversation-item.unread .conversation-item-preview {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
}

.conversation-item-preview {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.83em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.conversation-item-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72em;
    margin-top: 4px;
}

/* ============================== */
/* Role Badges                    */
/* ============================== */
.msg-role-badge {
    font-size: 0.68em;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.msg-role-badge-owner { background: var(--primary-color); color: #000; }
.msg-role-badge-admin { background: rgba(76, 175, 80, 0.8); color: white; }
.msg-role-badge-teacher { background: rgba(33, 150, 243, 0.8); color: white; }
.msg-role-badge-student { background: rgba(156, 39, 176, 0.8); color: white; }

/* ============================== */
/* Unread Badge                   */
/* ============================== */
.msg-unread-badge {
    background: var(--primary-color);
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.73em;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================== */
/* Thread Panel                   */
/* ============================== */
.messages-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: rgba(45, 45, 45, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.message-thread-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.thread-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thread-header h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Mobile back button */
.thread-back-btn {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thread-back-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--primary-color); }

/* ============================== */
/* Message Thread                 */
/* ============================== */
.thread-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0.75rem 1rem;
    min-height: 0;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.thread-messages::-webkit-scrollbar { width: 6px; }
.thread-messages::-webkit-scrollbar-track { background: transparent; }
.thread-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

/* ============================== */
/* Date Separator                 */
/* ============================== */
.msg-date-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.msg-date-separator::before,
.msg-date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.msg-date-separator span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ============================== */
/* Message Rows & Bubbles         */
/* ============================== */
.message-row {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.message-row.sent { align-self: flex-end; }
.message-row.received { align-self: flex-start; }

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.message-row.sent .message-bubble {
    background: linear-gradient(135deg, #ff7c00, #ff9a44);
    color: #000;
    border-bottom-right-radius: 4px;
}

.message-row.received .message-bubble {
    background: var(--surface-color);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.message-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72em;
    margin-top: 4px;
    padding: 0 8px;
}

.message-row.sent .message-time { text-align: right; }

/* Read receipt checkmarks */
.message-read-receipt {
    font-size: 0.75em;
    margin-left: 4px;
    opacity: 0.5;
}

.message-read-receipt.read {
    opacity: 1;
    color: #4fc3f7;
}

/* Grouped timestamps — hidden on non-last messages in a group */
.message-row.grouped .message-time { display: none; }

/* Auto-linked URLs */
.message-bubble a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.message-bubble a:hover { opacity: 0.8; }
.message-row.sent .message-bubble a { color: #000; text-decoration-thickness: 2px; }
.message-row.received .message-bubble a { color: var(--primary-color); }

/* Pending / failed states */
.message-row.pending { opacity: 0.6; }

.message-row.pending .message-time::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    margin-right: 4px;
    font-size: 0.9em;
}

.message-row.failed .message-bubble { border: 1px solid rgba(255, 80, 80, 0.5); }
.message-row.failed .message-time { color: rgba(255, 80, 80, 0.7); }

/* ============================== */
/* Scroll-to-Bottom Button        */
/* ============================== */
.scroll-to-bottom-btn {
    position: absolute;
    bottom: 80px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.scroll-to-bottom-btn.visible { opacity: 1; pointer-events: auto; }
.scroll-to-bottom-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ============================== */
/* Reply Form                     */
/* ============================== */
.reply-form-container {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    flex-shrink: 0;
}

.reply-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.reply-input-wrapper {
    flex: 1;
    position: relative;
}

.reply-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-light);
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
    max-height: 150px;
    line-height: 1.5;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.reply-textarea:focus { outline: none; border-color: var(--primary-color); }
.reply-textarea::placeholder { color: rgba(255, 255, 255, 0.3); }

/* Character count */
.msg-char-count {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.msg-char-count.warning { color: #f0ad4e; }
.msg-char-count.limit { color: #ff5050; font-weight: 600; }

.msg-send-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.msg-send-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3); }
.msg-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================== */
/* Empty States                   */
/* ============================== */
.thread-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

.thread-empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.thread-empty-state .empty-state-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: rgba(255, 255, 255, 0.5); }
.thread-empty-state .empty-state-message { font-size: 0.9rem; color: rgba(255, 255, 255, 0.35); }

.conversations-list .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.conversations-list .empty-state i { font-size: 2.5rem; color: rgba(255, 255, 255, 0.2); margin-bottom: 0.75rem; }
.conversations-list .empty-state .empty-state-title { font-size: 0.95rem; font-weight: 600; color: rgba(255, 255, 255, 0.5); margin-bottom: 0.25rem; }
.conversations-list .empty-state .empty-state-message { font-size: 0.85rem; color: rgba(255, 255, 255, 0.35); }

/* ============================== */
/* Emoji Reaction Picker          */
/* ============================== */
.reaction-picker {
    position: absolute;
    bottom: 100%;
    margin-bottom: 6px;
    display: flex;
    gap: 2px;
    padding: 6px 10px;
    background: rgba(30, 30, 35, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px) scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.reaction-picker::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 100%;
    height: 10px;
}

.message-row.sent .reaction-picker { right: 0; }
.message-row.received .reaction-picker { left: 0; }

@media (hover: hover) {
    .message-row:hover .reaction-picker {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
        transition-delay: 0.15s; /* Prevent flash during scroll */
    }
    .message-row:not(:hover) .reaction-picker {
        transition-delay: 0s;
    }
}

.message-row.picker-visible .reaction-picker {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.reaction-picker button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 4px 6px;
    border-radius: 8px;
    line-height: 1;
    transition: transform 0.12s ease, background 0.12s ease;
}

.reaction-picker button:hover { transform: scale(1.3); background: rgba(255, 255, 255, 0.1); }

/* ============================== */
/* Emoji Reaction Pills           */
/* ============================== */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    padding: 0 4px;
}

.message-row.sent .message-reactions { justify-content: flex-end; }
.message-row.received .message-reactions { justify-content: flex-start; }

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    user-select: none;
}

.reaction-pill:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.18); }
.reaction-pill .reaction-emoji { font-size: 0.9rem; line-height: 1; }
.reaction-pill .reaction-count { color: rgba(255, 255, 255, 0.6); font-weight: 600; font-size: 0.72rem; }

.reaction-pill.user-reacted { background: rgba(255, 140, 0, 0.15); border-color: rgba(255, 140, 0, 0.35); }
.reaction-pill.user-reacted .reaction-count { color: var(--primary-color); }

/* Long-press feedback */
.message-row.long-press-active .message-bubble {
    transform: scale(0.98);
    transition: transform 0.15s ease;
}

/* ============================== */
/* Responsive: Messaging          */
/* ============================== */
@media (max-width: 768px) {
    .messaging-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }

    .conversations-sidebar {
        max-height: none;
        min-height: 300px;
    }

    .conversations-sidebar.mobile-hidden { display: none; }

    .messages-main { min-height: 400px; }

    #messageThreadContainer {
        display: none;
    }

    #messageThreadContainer.mobile-active {
        display: flex;
    }

    .thread-back-btn { display: flex; }
    .message-row { max-width: 85%; }

    .reaction-picker button { font-size: 1.5rem; padding: 6px 8px; }
    .reaction-pill { padding: 4px 10px; font-size: 0.82rem; }
}

@media (max-width: 480px) {
    .reply-form { flex-direction: column; }
    .reply-input-wrapper { width: 100%; }
    .msg-send-btn { align-self: flex-end; }
    .message-row { max-width: 90%; }
}


/* === teacher-portal/css/teacher-portal-songwriters.css === */
/* ===================================================================
   OGA Teacher Portal 2.0 - Songwriters Module Styles
   =================================================================== */

/* --- Tabs --- */
.songwriters-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.songwriters-tabs .tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    border: none;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.songwriters-tabs .tab-btn.active {
    background: var(--primary-color);
    color: #000;
    font-weight: 600;
}
.songwriters-tabs .tab-btn:hover:not(.active) {
    background: var(--background-dark);
    color: var(--primary-color);
}

/* --- Member Cards --- */
.songwriter-member-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
}
.songwriter-member-card.paused { border-left-color: var(--warning-color); }
.songwriter-member-card.canceled { border-left-color: var(--error-color); opacity: 0.7; }

.songwriter-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.songwriter-info { flex: 1; }
.songwriter-info h4 { margin: 0 0 0.25rem 0; }
.songwriter-info .meta { color: var(--text-dim); font-size: 0.85rem; }

/* --- Status Badges --- */
.songwriter-status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.songwriter-status-badge.active { background: var(--success-color); color: #000; }
.songwriter-status-badge.paused { background: var(--warning-color); color: #000; }
.songwriter-status-badge.canceled { background: var(--error-color); color: white; }
.songwriter-status-badge.past_due { background: #ff6b6b; color: white; }

/* --- Resource Cards --- */
.resource-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.resource-card h4 {
    margin: 0;
    color: var(--primary-color);
}
.resource-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}
.resource-category-badge {
    background: var(--background-dark);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}
.resource-actions { display: flex; gap: 0.5rem; }

/* --- Resources Grid --- */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* --- Filters --- */
.songwriters-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.songwriters-filters .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
}
.songwriters-filters .filter-select {
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
}

/* --- Empty States --- */
.sw-empty-state { text-align: center; padding: 3rem; color: var(--text-dim); }
.sw-empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; display: block; }
.sw-empty-grid { grid-column: 1 / -1; }

/* --- Member Detail Modal --- */
.sw-member-detail { padding: 1rem; }
.sw-member-detail-header { text-align: center; margin-bottom: 2rem; }
.sw-member-avatar-large {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--primary-color); color: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: bold; margin: 0 auto 1rem;
}
.sw-member-detail-header h3 { margin: 0; }
.sw-member-detail-header .songwriter-status-badge { display: inline-block; margin-top: 0.5rem; }
.sw-detail-grid { display: grid; gap: 1rem; }
.sw-detail-row {
    background: var(--surface-color); padding: 1rem; border-radius: 8px;
}
.sw-detail-label { color: var(--text-dim); font-size: 0.85rem; }
.sw-detail-mono { font-family: monospace; font-size: 0.85rem; }
/* No explicit color on detail values - inherits var(--text-light) from body */

/* --- Resource Form Modal --- */
.sw-resource-form { padding: 1rem; }
.sw-form-group { margin-bottom: 1rem; }
.sw-form-label { display: block; margin-bottom: 0.5rem; }
.sw-form-group textarea.form-control { resize: vertical; }
/* Inputs/selects/textareas use .form-control class */

/* --- Source Type Toggle --- */
.sw-source-toggles { display: flex; gap: 0.5rem; }
.sw-source-btn {
    flex: 1; padding: 0.75rem;
    border: 2px solid var(--background-dark);
    background: var(--surface-color);
    border-radius: 8px; color: var(--text-light); cursor: pointer;
}
.sw-source-btn.active {
    border-color: var(--primary-color);
    background: rgba(255, 140, 0, 0.1);
}
.sw-source-btn i { margin-right: 0.5rem; }

/* --- File Upload --- */
.sw-file-drop-zone {
    border: 2px dashed var(--background-dark); border-radius: 8px;
    padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s;
}
.sw-file-drop-zone i { font-size: 2rem; color: var(--primary-color); margin-bottom: 0.5rem; }
.sw-file-drop-zone p { color: var(--text-dim); margin: 0; }
.sw-file-drop-zone small { color: var(--text-dim); }
.sw-upload-progress { display: none; margin-top: 1rem; }
.sw-upload-progress-inner { display: flex; align-items: center; gap: 0.5rem; }
.sw-progress-track { flex: 1; background: var(--background-dark); height: 8px; border-radius: 4px; overflow: hidden; }
.sw-progress-bar { height: 100%; background: var(--primary-color); width: 0%; transition: width 0.3s; }
.sw-progress-text { color: var(--text-dim); font-size: 0.85rem; }
.sw-uploaded-file {
    display: none; margin-top: 1rem; padding: 0.75rem;
    background: var(--background-dark); border-radius: 8px;
}
.sw-uploaded-file-inner { display: flex; align-items: center; gap: 0.5rem; }
.sw-uploaded-file i { color: var(--primary-color); }
.sw-uploaded-file-name { flex: 1; }
.sw-clear-file-btn { background: none; border: none; color: var(--error-color); cursor: pointer; }

/* --- URL Preview --- */
.sw-url-hint { color: var(--text-dim); display: block; margin-top: 0.5rem; }
.sw-url-preview { margin-top: 1rem; }
.sw-url-detected {
    padding: 0.75rem; background: var(--background-dark); border-radius: 8px; color: var(--text-dim);
}
.sw-url-detected i { color: var(--success-color); margin-right: 0.5rem; }

/* --- Resource Preview --- */
.sw-media-preview { text-align: center; padding: 1.5rem; background: var(--background-dark); border-radius: 8px; }
.sw-media-preview i { font-size: 2.5rem; color: var(--primary-color); }
.sw-video-embed, .sw-resource-img { border-radius: 8px; }
.sw-resource-img { width: 100%; max-height: 150px; object-fit: cover; }
.sw-video-player { border-radius: 8px; max-height: 200px; }

/* --- Form Actions --- */
.sw-form-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1.5rem; }

/* --- Songwriters Stats Grid (for HTML template) --- */
.sw-stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.sw-stat-active { border-left: 4px solid var(--success-color); }
.sw-stat-paused { border-left: 4px solid var(--warning-color); }
.sw-stat-canceled { border-left: 4px solid var(--error-color); }
.sw-stat-resources { border-left: 4px solid var(--accent-color); }
.sw-subtitle { margin-bottom: 1.5rem; }
.sw-section-icon { color: var(--primary-color); }

/* --- Resource link button --- */
.sw-resource-link { background: var(--accent-color); color: #000; }

/* --- Resource info section --- */
.sw-resource-info { margin-bottom: 1rem; }


/* === teacher-portal/css/teacher-portal-social-events.css === */
/* ===== Social Events Module Styles ===== */

/* --- Container --- */
.se-grid-container { padding: 1.5rem; }

/* --- Events Grid --- */
.se-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* --- Event Card --- */
.se-event-card { padding: 1.5rem; position: relative; }
.se-event-card.se-cancelled { opacity: 0.6; }
.se-status-area { position: absolute; top: 1rem; right: 1rem; }

/* --- Status Badges --- */
.se-status-badge {
    padding: 0.25rem 0.5rem; border-radius: 4px;
    font-size: 0.8rem; color: white;
}
.se-status-badge.se-cancelled { background: #f44336; }
.se-status-badge.se-past { background: #666; }
.se-status-badge.se-upcoming { background: #4CAF50; }

/* --- Event Content --- */
.se-event-title { color: var(--primary-color); margin-bottom: 0.5rem; margin-top: 0; }
.se-event-details { margin-bottom: 1rem; }
.se-event-detail-row { color: #ccc; margin-bottom: 0.3rem; }
.se-event-detail-row i { margin-right: 0.5rem; width: 16px; text-align: center; }
.se-event-description { color: #ddd; margin-bottom: 1rem; font-size: 0.9rem; }
.se-event-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* --- Confirm Modals (extend .speed-confirm-modal pattern) --- */
.se-confirm-body { text-align: center; padding: 1rem 0; }
.se-confirm-body i { font-size: 3rem; margin-bottom: 1rem; }
.se-confirm-body h3 { margin-bottom: 1rem; }
.se-confirm-body p { margin-bottom: 1rem; color: var(--text-secondary); }
.se-confirm-body .se-warning-text { color: var(--warning-color); font-weight: 600; margin-bottom: 1.5rem; }
.se-confirm-body .se-icon-warning { color: var(--warning-color); }
.se-confirm-body .se-icon-danger { color: var(--error-color); }
.se-confirm-body .se-heading-danger { color: var(--error-color); }
.se-confirm-actions { display: flex; gap: 1rem; justify-content: center; }

/* --- Registration Modal --- */
.se-capacity-full { color: var(--error-color); font-weight: 600; }


/* === teacher-portal/css/teacher-portal-olympics.css === */
/* ============================================================================
   OGA Teacher Portal 2.0 - Olympics Module
   ============================================================================ */

/* --- Container --- */
.ol-content-card { padding: 1.5rem; }

/* --- Header Buttons --- */
.ol-header-buttons { display: flex; gap: 0.5rem; }

/* --- Grids --- */
.ol-years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.ol-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Year Cards --- */
.ol-year-card {
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}
.ol-year-header {
    display: flex; justify-content: space-between;
    align-items: start; margin-bottom: 1rem;
}
.ol-year-title { margin: 0; color: var(--primary-color); }
.ol-year-theme { margin: 0.25rem 0; color: var(--text-dim); }
.ol-year-actions { display: flex; gap: 0.5rem; }
.ol-year-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1rem; text-align: center; margin-bottom: 1rem;
}
.ol-stat-value { font-size: 1.5rem; font-weight: bold; }
.ol-stat-value.signups { color: var(--accent-color); }
.ol-stat-value.results { color: var(--success-color); }
.ol-stat-label { font-size: 0.8rem; color: var(--text-dim); }
.ol-champion-emoji { font-size: 1rem; font-weight: bold; }
.ol-year-dates { font-size: 0.85rem; color: var(--text-dim); }
.ol-year-highlights { margin-top: 0.5rem; font-style: italic; font-size: 0.9rem; }

/* --- Event Cards --- */
.ol-event-card { padding: 1.25rem; }
.ol-event-card.active { border-left: 4px solid var(--success-color); }
.ol-event-card.inactive { border-left: 4px solid var(--text-dim); }
.ol-event-header {
    display: flex; justify-content: space-between;
    align-items: start; margin-bottom: 0.75rem;
}
.ol-event-name { margin: 0; }
.ol-event-category { font-size: 0.75rem; color: var(--text-dim); }
.ol-event-desc { font-size: 0.9rem; color: var(--text-dim); margin: 0.5rem 0; }
.ol-event-badge { height: 40px; margin-top: 0.5rem; }
.ol-event-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* --- Table Links (student profile links) --- */
.data-table a:not(.button), .ol-leaderboard-table a:not(.button) {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.data-table a:not(.button):hover, .ol-leaderboard-table a:not(.button):hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* --- Signups Table --- */
.ol-not-linked { color: var(--text-dim); }

/* --- Results --- */
.ol-results-filter {
    margin-bottom: 1rem; display: flex;
    gap: 1rem; align-items: center;
}
.ol-results-filter select { padding: 0.5rem; }
.ol-rank-display { font-size: 1.2rem; }

/* --- Leaderboard --- */
.ol-leaderboard-table { width: 100%; border-collapse: collapse; }
.ol-leaderboard-table th {
    text-align: left; padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase;
}
.ol-leaderboard-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.ol-leaderboard-rank { font-size: 1.2rem; font-weight: bold; width: 50px; text-align: center; }
.ol-leaderboard-rank.gold { color: #ffd700; }
.ol-leaderboard-rank.silver { color: #c0c0c0; }
.ol-leaderboard-rank.bronze { color: #cd7f32; }
.ol-medal-count { display: inline-flex; align-items: center; gap: 0.25rem; min-width: 40px; }
.ol-medal-count.gold { color: #ffd700; }
.ol-medal-count.silver { color: #c0c0c0; }
.ol-medal-count.bronze { color: #cd7f32; }
.ol-total-medals { font-weight: bold; color: var(--primary-color); }
.ol-leaderboard-student { font-weight: 600; }
.ol-podium-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem; margin-bottom: 2rem;
}
.ol-podium-card {
    background: var(--surface-color); border-radius: 12px;
    padding: 1.5rem; text-align: center;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}
.ol-podium-card.gold { border-top-color: #ffd700; }
.ol-podium-card.silver { border-top-color: #c0c0c0; }
.ol-podium-card.bronze { border-top-color: #cd7f32; }
.ol-podium-medal { font-size: 2.5rem; margin-bottom: 0.5rem; }
.ol-podium-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.ol-podium-count { color: var(--text-dim); font-size: 0.9rem; }
.ol-podium-events { margin-top: 0.5rem; font-size: 0.85rem; }

/* --- Confirm Modals (extend .speed-confirm-modal pattern) --- */
/* Uses .speed-confirm-modal, .speed-confirm-icon, .speed-confirm-actions from skills.css */
.speed-confirm-icon.danger { color: var(--error-color); }


/* === teacher-portal/css/teacher-portal-reviews.css === */
/* ===== Reviews Module Styles ===== */

/* --- Container --- */
.rv-grid-container { padding: 1.5rem; }

/* --- Reviews Grid --- */
.rv-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

/* --- Review Card --- */
.rv-review-card {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1.5rem;
}
.rv-review-card.featured { border-left: 4px solid var(--primary-color); }
.rv-review-card.standard { border-left: 4px solid var(--accent-color); }

/* --- Card Header --- */
.rv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}
.rv-stars { color: #ffd700; font-size: 1.2rem; margin-bottom: 0.5rem; }
.rv-card-header h3 { margin: 0; font-size: 1.1rem; }

/* --- Reviewer Info --- */
.rv-reviewer-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}
.rv-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.rv-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}
.rv-reviewer-name { font-weight: 600; }
.rv-reviewer-detail { font-size: 0.85rem; color: var(--text-secondary); }

/* --- Review Content --- */
.rv-review-text { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.rv-original-review { margin-bottom: 1rem; }
.rv-review-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* --- Response Box --- */
.rv-response-box {
    background: rgba(77, 181, 195, 0.1);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.rv-response-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.rv-response-text { font-size: 0.9rem; }

/* --- Action Buttons --- */
.rv-review-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.rv-action-btn { font-size: 0.85rem; padding: 0.4rem 0.8rem; }

/* --- Status Badges --- */
.rv-status-badge.featured { background: var(--primary-color); }
.rv-status-badge.published { background: var(--success-color); }
.rv-status-badge.pending { background: var(--warning-color); }

/* --- Review Footer --- */
.rv-review-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Response Modal Review Summary --- */
.rv-review-summary {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 8px;
}
.rv-review-summary .rv-stars { margin-bottom: 0.5rem; }
.rv-review-summary h3 { margin-bottom: 0.5rem; }
.rv-review-summary p { color: var(--text-secondary); font-size: 0.9rem; }
.rv-review-summary .rv-reviewer-detail { margin-top: 0.5rem; font-size: 0.85rem; }

/* --- Confirm Modal Overrides --- */
.rv-confirm-icon { font-size: 2.5rem; }
.rv-confirm-icon.warning { color: var(--warning-color); }
.rv-confirm-icon.danger { color: var(--error-color); }
.rv-confirm-detail { font-size: 0.9rem; }

/* --- Search & Sort Filter Bar --- */
.rv-filter-bar .form-control { min-width: 150px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .rv-grid-container { padding: 1rem; }
    .rv-reviews-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .rv-review-card { padding: 1rem; }
    .rv-card-header { flex-direction: column; gap: 0.5rem; }
    .rv-review-meta { flex-wrap: wrap; gap: 0.5rem; }
    .rv-review-actions { gap: 0.35rem; }
    .rv-action-btn { min-height: 44px; padding: 0.5rem 0.75rem; }
    .rv-filter-bar { flex-direction: column; }
    .rv-filter-bar .form-control { min-width: 100%; }
    /* Modal form rows stack */
    .rv-review-summary { padding: 0.75rem; }
}
@media (max-width: 480px) {
    .rv-grid-container { padding: 0.5rem; }
    .rv-reviewer-row { gap: 0.5rem; }
    .rv-avatar, .rv-avatar-placeholder { width: 40px; height: 40px; font-size: 1rem; }
    .rv-stars { font-size: 1rem; }
    .rv-card-header h3 { font-size: 1rem; }
    .rv-review-actions { flex-direction: column; }
    .rv-action-btn { width: 100%; text-align: center; }
}


/* === teacher-portal/css/teacher-portal-referrals.css === */
/* ============================================================================
   Referrals Module — ref- prefix
   ============================================================================ */

/* --- Tabs --- */
.referrals-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.referrals-tabs .tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    border: none;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.referrals-tabs .tab-btn.active {
    background: var(--primary-color);
    color: #000;
    font-weight: 600;
}
.referrals-tabs .tab-btn:hover:not(.active) {
    background: var(--background-dark);
    color: var(--primary-color);
}

/* --- Referral Card --- */
.referral-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s;
}
.referral-card:hover { transform: translateX(4px); }
.referral-card.converted { border-left-color: var(--success-color); }
.referral-card.pending   { border-left-color: var(--warning-color); }
.referral-card.lost      { border-left-color: var(--error-color); opacity: 0.7; }

/* --- Card Header --- */
.referral-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.referral-header h4 { margin: 0; color: var(--text-light); }
.referral-meta { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.25rem; }

/* --- Status Badge --- */
.referral-status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.referral-status-badge.converted { background: var(--success-color); color: #000; }
.referral-status-badge.new,
.referral-status-badge.pending   { background: var(--warning-color); color: #000; }
.referral-status-badge.contacted { background: var(--accent-color); color: #000; }
.referral-status-badge.lost      { background: var(--error-color); color: white; }

/* --- Referrer Box --- */
.referrer-box {
    background: var(--background-dark);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.referrer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}
.referrer-info { flex: 1; }
.referrer-info .name  { color: var(--text-light); font-weight: 500; }
.referrer-info .email { color: var(--text-dim); font-size: 0.85rem; }

/* --- Reward Badge --- */
.reward-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.reward-badge.pending   { background: rgba(255,193,7,0.2); color: var(--warning-color); }
.reward-badge.fulfilled { background: rgba(76,175,80,0.2); color: var(--success-color); }

/* --- Leaderboard Card --- */
.top-referrer-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s;
}
.top-referrer-card:hover { transform: translateY(-4px); }
.top-referrer-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    margin: 0 auto 0.75rem;
}
.top-referrer-card h4 { margin: 0 0 0.25rem 0; color: var(--text-light); }
.top-referrer-card .count { color: var(--primary-color); font-size: 1.5rem; font-weight: bold; }
.top-referrer-card .label { color: var(--text-dim); font-size: 0.85rem; }

/* --- Filters --- */
.referrals-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.referrals-filters .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
}
.referrals-filters .filter-select {
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
}

/* --- Analytics Grid --- */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.analytics-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}
.analytics-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}
.analytics-card .label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.analytics-card .change {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.analytics-card .change.positive { color: var(--success-color); }
.analytics-card .change.negative { color: var(--error-color); }

/* --- Utility: Stats Grid --- */
.ref-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* --- Utility: Stat Border Accents --- */
.ref-stat-primary { border-top: 3px solid var(--primary-color); }
.ref-stat-success { border-top: 3px solid var(--success-color); }
.ref-stat-accent  { border-top: 3px solid var(--accent-color); }
.ref-stat-warning { border-top: 3px solid var(--warning-color); }

/* --- Utility: Header Actions --- */
.ref-header-actions { display: flex; gap: 0.5rem; }

/* --- Utility: Leaderboard Grid --- */
.ref-leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* --- Confirm Modals (extend .speed-confirm-modal pattern) --- */
/* Uses .speed-confirm-modal, .speed-confirm-icon, .speed-confirm-actions from skills.css */

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ref-stats-grid,
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .referrals-filters {
        flex-direction: column;
    }
    .referral-card .referrer-box {
        flex-wrap: wrap;
    }
    .referrals-tabs .tab-btn {
        flex-shrink: 0;
        min-height: 44px;
    }
    .referrals-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .ref-stats-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .top-referrer-card {
        padding: 0.75rem;
    }
}


/* === teacher-portal/css/teacher-portal-competitors.css === */
/* Competitor Analysis Module — comp- prefix */

/* --- Header --- */
.competitor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.competitor-header h2 { color: var(--primary-color); margin: 0; }

/* --- Stats Grid --- */
.competitor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.competitor-stat-card { background: var(--surface-color); padding: 1.25rem; border-radius: 12px; text-align: center; }
.competitor-stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary-color); }
.competitor-stat-card .stat-label { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.25rem; }

/* --- Tabs --- */
.competitor-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.competitor-tabs .tab-btn { padding: 0.75rem 1.5rem; background: var(--surface-color); border: none; border-radius: 8px; color: var(--text-light); cursor: pointer; transition: all 0.2s; font-size: 0.95rem; }
.competitor-tabs .tab-btn.active { background: var(--primary-color); color: #000; font-weight: 600; }
.competitor-tabs .tab-btn:hover:not(.active) { background: var(--background-dark); color: var(--primary-color); }

/* --- Filters --- */
.competitor-filters { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; background: var(--surface-color); padding: 1rem; border-radius: 12px; }
.competitor-filters .filter-group { display: flex; flex-direction: column; gap: 0.25rem; }
.competitor-filters label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; }
.competitor-filters input[type="text"],
.competitor-filters select { padding: 0.5rem 0.75rem; background: var(--background-dark); border: 1px solid #444; border-radius: 6px; color: var(--text-light); min-width: 150px; }
.competitor-filters input[type="range"] { width: 150px; }

/* --- Card Grid --- */
.competitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.competitor-card { background: var(--surface-color); border-radius: 12px; padding: 1.25rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.competitor-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.competitor-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.competitor-card h4 { margin: 0; color: var(--primary-color); font-size: 1.1rem; }
.competitor-address { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.25rem; }

/* --- Badges --- */
.distance-badge { background: var(--accent-color); color: #000; padding: 0.35rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.distance-badge-large { background: var(--accent-color); color: #000; padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600; display: inline-block; margin-bottom: 1rem; }

/* --- Card Body --- */
.competitor-rating { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.5rem; }
.rating-stars { color: #FFC107; }
.competitor-pricing { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 0.5rem; line-height: 1.4; }
.competitor-instruments { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.5rem; }
.comp-tag { display: inline-block; background: var(--background-dark); padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.8rem; color: var(--text-light); }
.comp-tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* --- Pricing Section --- */
.pricing-section { background: var(--surface-color); padding: 1.5rem; border-radius: 12px; }
.pricing-section h3 { color: var(--primary-color); margin-top: 0; margin-bottom: 1rem; }
.pricing-table-section { background: var(--surface-color); padding: 1.5rem; border-radius: 12px; }
.pricing-table { width: 100%; border-collapse: collapse; }
.pricing-table th,
.pricing-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--background-dark); }
.pricing-table th { color: var(--primary-color); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }
.pricing-table td { color: var(--text-light); font-size: 0.9rem; }

/* --- Analysis Grid --- */
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.analysis-card { background: var(--surface-color); padding: 1.5rem; border-radius: 12px; }
.analysis-card.full-width { grid-column: 1 / -1; }
.analysis-card h3 { color: var(--primary-color); margin-top: 0; margin-bottom: 1rem; font-size: 1.1rem; }
.analysis-stats { display: flex; flex-direction: column; gap: 0.75rem; }
.analysis-stat { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: var(--background-dark); border-radius: 8px; border-left: 3px solid var(--primary-color); }
.analysis-stat .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.analysis-stat .stat-label { color: var(--text-dim); font-size: 0.85rem; }

/* --- Gap List --- */
.gap-list { list-style: none; padding: 0; margin: 0; }
.gap-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--background-dark); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.gap-list li:last-child { border-bottom: none; }
.gap-list li.opportunity { background: rgba(255, 140, 0, 0.1); margin: 0 -1rem; padding: 0.75rem 1rem; border-radius: 8px; }
.opportunity-badge { background: var(--primary-color); color: #000; padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

/* --- Claims Chart --- */
.claims-chart { display: flex; flex-direction: column; gap: 0.75rem; }
.claim-bar { display: flex; align-items: center; gap: 0.75rem; }
.claim-label { width: 120px; min-width: 120px; flex-shrink: 0; font-size: 0.85rem; color: var(--text-dim); text-transform: capitalize; text-align: right; }
.claim-bar-fill { height: 20px; background: var(--primary-color); border-radius: 4px; min-width: 5px; transition: width 0.3s; }
.claim-count { font-size: 0.85rem; color: var(--text-light); font-weight: 600; }

/* --- Analysis Insight --- */
.analysis-insight { background: var(--background-dark); padding: 1rem; border-radius: 8px; margin-top: 1rem; font-size: 0.9rem; color: var(--text-light); border-left: 3px solid var(--primary-color); }
.analysis-table { width: 100%; border-collapse: collapse; }
.analysis-table th,
.analysis-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--background-dark); }
.analysis-table th { color: var(--primary-color); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

/* --- Competitor Detail Modal --- */
.competitor-detail { padding: 0.5rem; }
.comp-detail-section { margin-bottom: 1.25rem; }
.comp-detail-section label { display: block; color: var(--primary-color); font-size: 0.8rem; text-transform: uppercase; margin-bottom: 0.35rem; font-weight: 600; }
.comp-detail-section p { margin: 0; color: var(--text-light); line-height: 1.5; }
.comp-detail-section a { color: var(--primary-color); }
.comp-detail-section .motto { font-style: italic; color: var(--accent-color); }
.rating-display { display: flex; align-items: center; gap: 0.5rem; }
.rating-display .stars { color: #FFC107; font-size: 1.2rem; }

/* --- Refresh Button (class-based) --- */
.comp-refresh-btn { background: var(--surface-color); border: 1px solid var(--primary-color); color: var(--primary-color); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.comp-refresh-btn:hover { background: var(--primary-color); color: #000; }

/* --- Chart Canvas --- */
.comp-chart-canvas { max-height: 400px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .competitor-stats { grid-template-columns: repeat(2, 1fr); }
    .competitor-filters { flex-direction: column; }
    .competitor-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .analysis-grid { grid-template-columns: 1fr; }
    .analysis-stats { grid-template-columns: 1fr; }
    .competitor-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .competitor-tabs .tab-btn { flex-shrink: 0; min-height: 44px; }
    .claim-label { width: 90px; }
}

@media (max-width: 480px) {
    .competitor-stats { grid-template-columns: 1fr; }
    .competitor-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
}


/* === teacher-portal/css/teacher-portal-inventory.css === */
/* Inventory Module — inv- prefix */

/* ===================================================================
   Tabs
   =================================================================== */
.inventory-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.inventory-tabs .tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    border: none;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.inventory-tabs .tab-btn.active {
    background: var(--primary-color);
    color: #000;
    font-weight: 600;
}
.inventory-tabs .tab-btn:hover:not(.active) {
    background: var(--background-dark);
    color: var(--primary-color);
}

/* ===================================================================
   Grid & Cards
   =================================================================== */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.inventory-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.inventory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.inventory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.inventory-card h4 { margin: 0; color: var(--primary-color); }
.inventory-card .item-type { color: var(--text-dim); font-size: 0.85rem; }

/* ===================================================================
   Status Badges
   =================================================================== */
.inventory-status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.inventory-status-badge.available { background: var(--success-color); color: #000; }
.inventory-status-badge.loaned { background: var(--warning-color); color: #000; }
.inventory-status-badge.maintenance { background: var(--accent-color); color: #000; }
.inventory-status-badge.retired { background: var(--error-color); color: white; }

/* ===================================================================
   Detail Rows
   =================================================================== */
.inventory-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--background-dark);
    font-size: 0.9rem;
}
.inventory-detail-row:last-child { border-bottom: none; }
.inventory-detail-row .label { color: var(--text-dim); }
.inventory-detail-row .value { color: var(--text-light); }

/* ===================================================================
   Loaner Info
   =================================================================== */
.loaner-info {
    background: var(--background-dark);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.75rem;
}
.loaner-info .student-name { color: var(--primary-color); font-weight: 500; }
.loaner-info .loan-date { color: var(--text-dim); font-size: 0.85rem; }

/* ===================================================================
   Filters
   =================================================================== */
.inventory-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.inventory-filters .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
}
.inventory-filters .filter-select {
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
}

/* ===================================================================
   Low Stock Alert
   =================================================================== */
.low-stock-alert {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.low-stock-alert i { color: var(--error-color); font-size: 1.5rem; }
.low-stock-alert .message { color: var(--text-light); }
.low-stock-alert .count { color: var(--error-color); font-weight: bold; }

/* ===================================================================
   Stats Grid & Stat Card Variants
   =================================================================== */
.inv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.inv-stat-primary { border-left: 4px solid var(--primary-color); }
.inv-stat-success { border-left: 4px solid var(--success-color); }
.inv-stat-warning { border-left: 4px solid var(--warning-color); }
.inv-stat-accent  { border-left: 4px solid var(--accent-color); }
.inv-stat-dim     { border-left: 4px solid var(--text-dim); }

/* ===================================================================
   Card Actions & Inline Utilities
   =================================================================== */
.inv-card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.inv-serial-value { font-family: monospace; }
.inv-qty-low { color: var(--error-color); }
.inv-return-btn { background: var(--success-color); color: #000; }
.inv-return-btn:hover { background: #43a047; }

/* ===================================================================
   Form Grid (Item Modal / Loan Modal)
   =================================================================== */
.inv-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===================================================================
   Responsive — Tablet
   =================================================================== */
@media (max-width: 768px) {
    .inv-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .inventory-filters {
        flex-direction: column;
    }
    .inventory-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .inventory-tabs .tab-btn {
        flex-shrink: 0;
        min-height: 44px;
    }
}

/* ===================================================================
   Responsive — Mobile
   =================================================================== */
@media (max-width: 480px) {
    .inv-stats-grid {
        grid-template-columns: 1fr;
    }
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    }
    .inv-form-grid {
        grid-template-columns: 1fr;
    }
}


/* === teacher-portal/css/teacher-portal-video-lessons.css === */
/* Video Lessons Module — vl- prefix */

/* ── Grid & Cards ── */
.video-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.video-lesson-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ── Thumbnail ── */
.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--background-dark);
    overflow: hidden;
}

.video-thumbnail img,
.video-thumbnail iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 140, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.video-thumbnail .play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-thumbnail .play-overlay i {
    color: #000;
    font-size: 1.5rem;
    margin-left: 4px;
}

.video-thumbnail .duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ── Content ── */
.video-lesson-content {
    padding: 1rem;
}

.video-lesson-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.3;
}

.video-lesson-content .description {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Meta ── */
.video-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.video-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.video-meta-item i {
    color: var(--primary-color);
}

/* ── Badges ── */
.video-category-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--background-dark);
    color: var(--accent-color);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-difficulty-badge.beginner {
    background: #4CAF50;
    color: #000;
}

.video-difficulty-badge.intermediate {
    background: #FF9800;
    color: #000;
}

.video-difficulty-badge.advanced {
    background: #f44336;
    color: white;
}

.video-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.video-status-badge.published {
    background: var(--success-color);
    color: #000;
}

.video-status-badge.draft {
    background: var(--warning-color);
    color: #000;
}

.video-status-badge.unlisted {
    background: var(--text-dim);
    color: #000;
}

/* ── Actions ── */
.video-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--background-dark);
}

/* ── Filters ── */
.video-lessons-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.video-lessons-filters .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
}

.video-lessons-filters .filter-select {
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
}

/* ── Stats Grid ── */
.vl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.vl-stat-primary {
    border-left: 4px solid var(--primary-color);
}

.vl-stat-success {
    border-left: 4px solid var(--success-color);
}

.vl-stat-warning {
    border-left: 4px solid var(--warning-color);
}

.vl-stat-accent {
    border-left: 4px solid var(--accent-color);
}

/* ── Form Grid ── */
.vl-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Delete Button ── */
.vl-delete-btn {
    background: var(--error-color);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .vl-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-lessons-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .video-lessons-filters {
        flex-direction: column;
    }

    .vl-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .vl-stats-grid {
        grid-template-columns: 1fr;
    }

    .video-lessons-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    }
}


/* === teacher-portal/css/teacher-portal-smart-logic.css === */
/* ===== Smart Logic Analytics Module Styles ===== */
/* Prefix: sl- */

/* --- Health Dashboard --- */
.sl-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.sl-health-card {
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.sl-health-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.sl-health-value {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--text-light);
    margin: 0.5rem 0;
}

.sl-health-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* --- Health Dashboard Card (wrapper) --- */
.sl-dashboard-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.sl-dashboard-card h3 {
    color: var(--text-light);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sl-dashboard-card .sl-refresh-btn {
    margin-left: auto;
    font-size: 0.85rem;
}

/* --- Action Items --- */
.sl-action-items {
    grid-column: 1 / -1;
    background: rgba(255, 200, 0, 0.15);
    border: 1px solid rgba(255, 200, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
}
.sl-action-items h4 {
    color: var(--text-light);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sl-action-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--warning-color);
}
.sl-action-card:last-child { margin-bottom: 0; }
.sl-action-card.priority-high { border-left-color: var(--error-color); }
.sl-action-card.priority-medium { border-left-color: var(--warning-color); }
.sl-action-card.priority-low { border-left-color: var(--success-color); }

.sl-action-category {
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-dim);
}
.sl-action-title {
    color: var(--text-light);
    font-weight: 600;
    margin-top: 0.25rem;
}
.sl-action-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.25rem;
}

/* --- Info / Warning Boxes (dark theme) --- */
.sl-info-box {
    background: rgba(77, 181, 195, 0.15);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 8px;
    color: var(--text-light);
}
.sl-info-box p { margin: 0; color: var(--text-light); }
.sl-info-box .sl-info-note { margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-dim); }

.sl-warning-box {
    background: rgba(255, 193, 7, 0.12);
    border-left: 4px solid var(--warning-color);
    padding: 2rem;
    border-radius: 8px;
    color: var(--text-light);
}
.sl-warning-box h3 { margin-top: 0; color: var(--warning-color); }
.sl-warning-box p { color: var(--text-dim); margin-bottom: 1rem; }
.sl-warning-box p:last-child { margin-bottom: 0; }

/* --- Report Containers --- */
.sl-report-grid {
    display: grid;
    gap: 2rem;
    min-width: 0;
}
.sl-report-grid > * {
    min-width: 0;
}

/* --- Summary Metric Cards (matches kpi-card pattern) --- */
.sl-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.sl-summary-grid .metric-card {
    background-color: rgba(21, 21, 21, 0.7);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.sl-summary-grid .metric-card .metric-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.sl-summary-grid .metric-card .metric-value {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--text-light);
}

/* --- Bold table values --- */
.sl-bold { font-weight: 600; }

/* --- Table scroll wrapper --- */
.sl-report-grid .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
}

/* --- Two Column Layout --- */
.sl-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.sl-two-col > * {
    min-width: 0;
}

/* --- Section Headings --- */
.sl-section-heading {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* --- Distribution Bars --- */
.sl-dist-row {
    margin-bottom: 1rem;
}
.sl-dist-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.sl-dist-pct {
    font-weight: 600;
}
.sl-dist-track {
    background: var(--background-dark);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.sl-dist-fill {
    height: 100%;
    border-radius: 4px;
}
.sl-dist-fill.primary { background: var(--primary-color); }
.sl-dist-fill.accent { background: var(--accent-color); }
.sl-dist-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* --- Priority Score Cards --- */
.sl-priority-grid {
    display: grid;
    gap: 1rem;
}
.sl-priority-card {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}
.sl-priority-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sl-priority-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.sl-priority-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
}
.sl-priority-value {
    font-size: 2rem;
    font-weight: 700;
    text-align: right;
}

/* --- Stat Rows (Engagement / Skill Progression) --- */
.sl-stat-row {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.sl-stat-row:last-child { margin-bottom: 0; }
.sl-stat-row-inner {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.sl-stat-row-inner span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.sl-stat-row-inner .sl-stat-value {
    flex-shrink: 0;
}
.sl-stat-value {
    font-weight: 600;
}
.sl-stat-value.success { color: var(--success-color); }

/* --- Stat Rows Container --- */
.sl-stat-list {
    margin-top: 1rem;
}

/* --- Color Utilities for Metric Values --- */
.sl-color-success { color: var(--success-color); }
.sl-color-warning { color: var(--warning-color); }
.sl-color-error { color: var(--error-color); }

/* --- Refinement Guide --- */
.sl-guide-title { margin-bottom: 2rem; }
.sl-param-section { margin-top: 1.5rem; }
.sl-dist-track-spaced { margin-top: 0.75rem; }

.sl-guide-container {
    max-width: 900px;
    margin: 0 auto;
}
.sl-guide-section {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}
.sl-guide-section.accent { border-left-color: var(--accent-color); }
.sl-guide-section h4 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sl-guide-section h5.primary { color: var(--primary-color); }
.sl-guide-section h5.accent { color: var(--accent-color); }

.sl-param-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
.sl-param-card {
    background: var(--background-dark);
    padding: 1rem;
    border-radius: 8px;
}
.sl-param-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.sl-param-card-body {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

.sl-guide-list {
    color: var(--text-dim);
    line-height: 1.8;
    padding-left: 1.5rem;
}
.sl-guide-tips {
    margin-top: 2rem;
}

/* --- Quick Reference --- */
.sl-quick-ref {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.sl-quick-ref h5 { margin-top: 0; }
.sl-quick-ref-grid {
    display: grid;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* --- Filter Row Fix --- */
.sl-filter-row {
    align-self: flex-end;
}

/* --- Description Text --- */
.sl-description {
    color: var(--text-dim);
    margin-bottom: 2rem;
}
.sl-sub-description {
    color: var(--text-dim);
    margin-bottom: 1rem;
}

/* ===== Responsive ===== */

/* --- Tablet (768px) --- */
@media (max-width: 768px) {
    /* Dashboard Card */
    .sl-dashboard-card { padding: 1.25rem; }
    .sl-dashboard-card h3 {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 1.1rem;
    }
    .sl-dashboard-card .sl-refresh-btn { margin-left: 0; width: 100%; }

    /* Health Grid */
    .sl-health-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .sl-health-card { padding: 1rem; }
    .sl-health-value { font-size: 1.8rem; word-break: break-word; }

    /* Summary Metric Cards */
    .sl-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    .sl-summary-grid .metric-card .metric-value {
        font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    }

    /* Two Column → Single */
    .sl-two-col {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Report Grid */
    .sl-report-grid { gap: 1.5rem; }

    /* Tables */
    .sl-report-grid .table-container {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }

    /* Distribution Bars */
    .sl-dist-header { gap: 0.5rem; }
    .sl-dist-meta { font-size: 0.8rem; }

    /* Priority Cards */
    .sl-priority-value { font-size: 1.5rem; }

    /* Stat Rows */
    .sl-stat-row-inner { gap: 0.5rem; }

    /* Guide Section */
    .sl-guide-section { padding: 1.25rem; }
    .sl-guide-container { max-width: none; }
    .sl-guide-section h4 { font-size: 1rem; }

    /* Param Grid */
    .sl-param-grid { gap: 0.75rem; }

    /* Quick Reference */
    .sl-quick-ref { padding: 1rem; }

    /* Info / Warning Boxes */
    .sl-info-box, .sl-warning-box { padding: 1rem; }
    .sl-warning-box { padding: 1.25rem; }
    .sl-action-items { padding: 1rem; }

    /* Section Headings */
    .sl-section-heading { font-size: 1.1rem; }
    .sl-sub-description { font-size: 0.85rem; }

    /* Description Text */
    .sl-description { font-size: 0.9rem; margin-bottom: 1.5rem; }
}

/* --- Phone (480px) --- */
@media (max-width: 480px) {
    /* Dashboard Card */
    .sl-dashboard-card { padding: 1rem; }
    .sl-dashboard-card h3 { font-size: 1rem; }

    /* Health Grid → Single Column */
    .sl-health-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .sl-health-card { padding: 0.75rem; }
    .sl-health-value { font-size: 1.5rem; }
    .sl-health-label { font-size: 0.8rem; }
    .sl-health-sub { font-size: 0.8rem; }

    /* Summary Metric Cards → Single Column */
    .sl-summary-grid {
        grid-template-columns: 1fr;
    }
    .sl-summary-grid .metric-card {
        padding: 1rem;
    }
    .sl-summary-grid .metric-card .metric-value {
        font-size: 1.3rem;
    }
    .sl-summary-grid .metric-card .metric-label {
        font-size: 0.8rem;
    }

    /* Report Grid */
    .sl-report-grid { gap: 1rem; }

    /* Distribution Bars */
    .sl-dist-header {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .sl-dist-header span { font-size: 0.85rem; }
    .sl-dist-pct { font-size: 0.85rem; }
    .sl-dist-meta { font-size: 0.75rem; }

    /* Priority Cards */
    .sl-priority-card-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .sl-priority-value { font-size: 1.5rem; text-align: left; }
    .sl-priority-label { font-size: 0.9rem; }
    .sl-priority-sub { font-size: 0.8rem; }

    /* Stat Rows */
    .sl-stat-row { padding: 0.75rem; }
    .sl-stat-row-inner {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .sl-stat-row-inner span { font-size: 0.85rem; }

    /* Action Items */
    .sl-action-card { padding: 0.75rem; }
    .sl-action-title { font-size: 0.9rem; }
    .sl-action-text { font-size: 0.8rem; }
    .sl-action-category { font-size: 0.7rem; }

    /* Guide Section */
    .sl-guide-section { padding: 1rem; }
    .sl-guide-section h4 { font-size: 0.95rem; }
    .sl-guide-section h5 { font-size: 0.9rem; }
    .sl-param-card { padding: 0.75rem; }
    .sl-param-card-title { font-size: 0.9rem; }
    .sl-param-card-body { font-size: 0.8rem; line-height: 1.5; }
    .sl-guide-list { padding-left: 1.25rem; font-size: 0.85rem; line-height: 1.6; }
    .sl-guide-title { margin-bottom: 1.5rem; font-size: 1.1rem; }

    /* Quick Reference */
    .sl-quick-ref { padding: 0.75rem; }
    .sl-quick-ref h5 { font-size: 0.9rem; }
    .sl-quick-ref-grid { font-size: 0.8rem; }

    /* Info / Warning Boxes */
    .sl-info-box { padding: 0.75rem; font-size: 0.85rem; }
    .sl-info-box .sl-info-note { font-size: 0.8rem; }
    .sl-warning-box { padding: 1rem; }
    .sl-warning-box h3 { font-size: 1rem; }
    .sl-warning-box p { font-size: 0.85rem; }

    /* Section Headings */
    .sl-section-heading { font-size: 1rem; }
    .sl-sub-description { font-size: 0.8rem; }
    .sl-description { font-size: 0.85rem; margin-bottom: 1rem; }
}
