:root {
    --primary: #2563eb;
    --primary-soft: #dbeafe;
    --dark: #0f172a;
    --sidebar-bg: #111827;
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text-main: #1f2937;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #16a34a;
    --warning: #f59e0b;
    --shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
    min-height: 100%;
}

body {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), rgba(248, 250, 252, 1));
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

img, svg {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.login-card {
    width: min(100%, 420px);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 26px;
    padding: 40px 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.login-header {
    margin-bottom: 30px;
    text-align: center;
}

.login-header i {
    display: inline-flex;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 18px;
}

.login-header h2 {
    font-size: 1.95rem;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.input-group input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: var(--text-main);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.input-group input:focus,
textarea:focus,
select:focus {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.error-text {
    margin-top: 12px;
    font-size: 0.95rem;
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.18);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 1px solid #e2e8f0;
}

.login-header .btn-secondary {
    padding: 0.5rem 0.85rem;
    font-size: 0.92rem;
    min-width: 0;
    line-height: 1.1;
    border-radius: 999px;
}

.login-header .btn-secondary i {
    font-size: 0.95rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(100, 116, 139, 0.18);
    color: var(--dark);
}

/* Role Selection Styles */
.role-selection-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.role-selection-card {
    width: min(100%, 760px);
}

.role-btn {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 15px;
    width: 100%;
    min-height: 128px;
    padding: 20px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    background: white;
    border-radius: 12px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: normal;
    box-shadow: none;
}

@media (max-width: 640px) {
    .role-selection-body {
        grid-template-columns: 1fr;
    }

    .role-selection-card {
        width: min(100%, 460px);
    }
}

.role-btn:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.role-btn i {
    font-size: 1.6rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 3px;
}

.role-btn h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.25;
}

.role-btn p {
    margin: 5px 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-sm {
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.btn-action {
    min-width: 120px;
}

.app-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 30px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 1.25rem;
    font-weight: 800;
}

.sidebar-brand i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.admin-profile-box {
    padding: 24px 22px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    margin: 0 18px 26px;
    line-height: 1.6;
    font-size: 0.94rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
    flex: 1;
}

.menu-item {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 16px;
    color: #cbd5e1;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(2px);
}

.menu-item.active {
    border-left: 4px solid var(--primary);
    background: rgba(37, 99, 235, 0.12);
    color: white;
}

.sidebar-footer {
    padding: 16px 20px;
}

.btn-logout {
    width: 100%;
    max-width: 240px;
}

.main-content {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow-y: auto;
    min-width: 0;
}

.viewport-inner {
    width: 100%;
}

#main-render-area {
    width: 100%;
    max-width: none;
}

.announcement-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr);
    gap: 28px;
    align-items: start;
}

.ann-form-card,
.ann-history-container {
    background: white;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}

.ann-history-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ann-scroll-area {
    display: grid;
    gap: 18px;
}

.ann-item {
    background: #f8fafc;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.ann-item-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.ann-item-header .status-tag {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
}

.ann-item h4 {
    margin: 0 0 8px;
}

.ann-item p {
    margin: 0;
    color: var(--text-main);
    line-height: 1.7;
}

.ann-item-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.btn-broadcast {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    border: none;
    font-weight: 700;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(18px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px 40px;
}

.page-header h2 {
    font-size: 1.65rem;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.clock-badge {
    padding: 0.85rem 1rem;
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    font-size: 0.95rem;
    min-width: 120px;
    text-align: center;
}

.viewport-inner {
    padding: 36px 40px 48px;
    width: 100%;
}


.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 28px;
}

.module-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.head-school-filter select {
    min-width: 200px;
    max-width: 280px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.95rem;
    cursor: pointer;
}

.head-school-filter select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    border: 1px solid #e2e8f0;
}

.filter-bar span {
    color: var(--text-muted);
    font-weight: 600;
}

.search-bar {
    display: flex;
    width: 100%;
    margin-top: 16px;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    gap: 22px;
}

.post-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-tag {
    display: inline-flex;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    width: fit-content;
}

.post-body h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.post-body p {
    margin: 0;
    color: var(--text-muted);
}

.status-label {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #eff6ff;
    color: #2563eb;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    margin-bottom: 28px;
    background: white;
    border-radius: 28px;
    padding: 32px 34px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.85);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 2rem;
}

.dashboard-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 680px;
    line-height: 1.6;
}

.dashboard-config-btn {
    align-self: flex-start;
}

.dashboard-details-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
}

.details-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}

.details-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
}

.activity-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #f8fafc;
}

.status-item {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.status-item span {
    font-weight: 600;
}

.status-item:last-child {
    margin-bottom: 0;
}

.stats-grid,
.card-grid,
.dashboard-layout {
    display: grid;
    gap: 24px;
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.dashboard-layout {
    grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr);
}

.dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.side-panel {
    background: white;
    border-radius: 24px;
    padding: 26px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}

.side-panel h3 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 1.1rem;
}

.action-list {
    display: grid;
    gap: 14px;
}

.config-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
    padding: 22px;
}

.config-demo-banner {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #1e40af;
    font-size: 0.92rem;
    line-height: 1.45;
}

.config-demo-banner i {
    margin-right: 8px;
    opacity: 0.9;
}

.config-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 14px;
}

.config-tab {
    border-radius: 999px;
    padding: 0.65rem 1rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.config-tab.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.config-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.config-section-header p {
    margin: 0;
    color: var(--text-muted);
}

/* Config user toolbar: search left; actions grouped on the right with even gaps (no stretched space-between). */
.config-section-header .action-bar.config-users-toolbar {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
}

.config-section-header .action-bar.config-users-toolbar > * {
    min-height: 44px;
    flex-shrink: 0;
}

/* Push PDF + Upload + filter + Add User into one tight cluster on the right */
.config-section-header .action-bar.config-users-toolbar .search-box + .btn {
    margin-left: auto;
}

.config-section-header .action-bar.config-users-toolbar .search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #ffffff;
    flex: 0 1 320px;
    min-width: 220px;
    max-width: min(380px, 42vw);
}

.config-section-header .action-bar.config-users-toolbar .search-box i {
    color: #64748b;
    font-size: 0.9rem;
}

.config-section-header .action-bar.config-users-toolbar .search-box input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: 0.95rem;
}

.config-section-header .action-bar.config-users-toolbar .search-box input::placeholder {
    color: #94a3b8;
}

.config-section-header .action-bar.config-users-toolbar .btn,
.config-section-header .action-bar.config-users-toolbar .btn-primary,
.config-section-header .action-bar.config-users-toolbar .btn-secondary {
    height: 44px;
    border-radius: 12px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.config-section-header .action-bar.config-users-toolbar .head-school-filter {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #ffffff;
    flex-shrink: 0;
}

.config-section-header .action-bar.config-users-toolbar .head-school-filter select {
    min-width: 170px;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #334155;
}

@media (max-width: 1100px) {
    .config-section-header .action-bar.config-users-toolbar {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .config-section-header .action-bar.config-users-toolbar .search-box + .btn {
        margin-left: 0;
    }

    .config-section-header .action-bar.config-users-toolbar .search-box {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
    }
}

@media (max-width: 680px) {
    .config-section-header .action-bar.config-users-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .config-section-header .action-bar.config-users-toolbar .btn,
    .config-section-header .action-bar.config-users-toolbar .head-school-filter {
        width: 100%;
        justify-content: center;
    }
}

.config-placeholder {
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    padding: 18px;
    background: #f8fafc;
}

.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 700;
}

.insight-item strong {
    font-size: 1.15rem;
}

.card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

th,
td {
    padding: 18px 20px;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

td {
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

/* Match header alignment to cells (UA defaults center `th`, left `td` — causes skew in Config etc.). */
.modern-table th,
.modern-table td {
    text-align: left;
    vertical-align: middle;
}

.modern-table td.action-cells {
    white-space: nowrap;
}

.modern-table td.theme-task-capsules-cell {
    vertical-align: middle;
    min-width: 140px;
}

.theme-task-capsules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.theme-task-capsule {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--primary-soft, #dbeafe);
    color: var(--primary, #2563eb);
    border: 1px solid rgba(37, 99, 235, 0.22);
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.theme-task-capsule {
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

button.theme-task-capsule:hover {
    filter: brightness(0.97);
    border-color: rgba(37, 99, 235, 0.42);
}

button.theme-task-capsule:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.theme-task-capsule--readonly {
    cursor: default;
}

.theme-task-capsules-empty {
    font-size: 0.84rem;
}

.mentor-schools-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 280px;
}

.mentor-schools-cell .user-school {
    flex: 1 1 auto;
    min-width: 0;
}

button.mentor-schools-allot-capsule {
    flex: 0 0 auto;
    font-size: 0.72rem;
    padding: 3px 10px;
}

.mentor-school-allotment-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1400;
}

.mentor-school-allotment-overlay.open {
    display: flex;
}

.mentor-school-allotment-sheet {
    width: min(100%, 760px);
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
    padding: 22px 24px 20px;
}

#mentor-school-allotment-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.mentor-school-allotment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.mentor-school-allotment-header h3 {
    margin: 0 0 4px;
    font-size: 1.35rem;
}

.mentor-school-allotment-sub {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
}

.mentor-school-allotment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 72px;
    overflow-y: auto;
    margin-bottom: 12px;
    flex-shrink: 0;
    padding: 2px 0;
}

.mentor-school-allotment-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid rgba(37, 99, 235, 0.2);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mentor-school-allotment-chip--empty {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
    font-weight: 500;
}

.mentor-school-allotment-search-wrap {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.mentor-school-allotment-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
    min-height: 0;
}

.mentor-school-allotment-list {
    flex: 1;
    min-height: 200px;
    max-height: min(52vh, 480px);
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.institute-school-picker-list {
    min-height: 120px;
    max-height: min(36vh, 280px);
}

.mentor-school-allotment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #e8eef4;
    cursor: pointer;
    margin: 0;
    background: #fff;
    transition: background 0.15s ease;
}

.mentor-school-allotment-row:last-child {
    border-bottom: none;
}

.mentor-school-allotment-row:hover {
    background: #f8fafc;
}

.mentor-school-allotment-row.is-selected {
    background: #eff6ff;
}

.mentor-school-allotment-row.is-readonly {
    cursor: default;
}

.mentor-school-allotment-row-name {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text-main, #0f172a);
}

.mentor-school-allotment-row input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.mentor-school-allotment-row.is-readonly input {
    cursor: default;
}

.mentor-school-allotment-empty {
    margin: 0;
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.mentor-school-allotment-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8eef4;
    flex-shrink: 0;
}

.progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    height: 12px;
}

.progress {
    height: 100%;
    border-radius: 999px;
}

.progress.blue { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.progress.green { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress.yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-pill.active { background: #dcfce7; color: #166534; }
.status-pill.deactivated { background: #fee2e2; color: #991b1b; }
.status-pill.pending { background: #fef3c7; color: #92400e; }

.btn-filter {
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    border: 1px solid transparent;
    background: #f8fafc;
    color: var(--text-main);
}

.btn-filter.active,
.btn-filter:hover {
    background: white;
    border-color: rgba(37, 99, 235, 0.16);
    color: var(--primary);
}

.btn-mod,
.btn-text-edit,
.btn-text-delete,
.btn-save,
.btn-cancel,
.btn-edit-task,
.btn-icon {
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    min-width: 88px;
    font-weight: 700;
    border: 1px solid transparent;
}

.btn-mod.delete,
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-mod.hide,
.btn-cancel,
.btn-outline {
    background: #f8fafc;
    color: var(--text-main);
    border-color: #e2e8f0;
}

.btn-mod.approve {
    background: var(--success);
    color: white;
}

.btn-mod.reject {
    background: var(--danger);
    color: white;
}

/* Pending Approval Section Styles */
.pending-section {
    background: white;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 32px;
    border: 2px solid #fef3c7;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.pending-header {
    margin-bottom: 22px;
    border-bottom: 2px solid #fef3c7;
    padding-bottom: 16px;
}

.pending-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pending-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    gap: 22px;
}

.pending-post-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef9e7 100%);
    border: 2px solid #fcd34d;
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pending-post-card::before {
    content: '⏳';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 3rem;
    opacity: 0.1;
}

.pending-post-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.15);
}

.pending-post-card .post-tag {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.pending-post-card .status-label.pending {
    background: #fde68a;
    color: #78350f;
    font-weight: 700;
}

.pending-post-card .post-body h3 {
    color: #78350f;
}

.pending-post-card .post-body p {
    color: #92400e;
}

.content-section {
    margin-bottom: 32px;
}

.content-section h3 {
    margin: 0 0 22px 0;
    font-size: 1.4rem;
    color: var(--text-main);
    padding: 0 0 16px 0;
    border-bottom: 2px solid #e2e8f0;
}

@media (max-width: 1024px) {
    .content-grid,
    .pending-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .content-grid,
    .pending-grid {
        grid-template-columns: 1fr;
    }
    
    .pending-section {
        padding: 20px;
    }
    
    .pending-post-card {
        padding: 18px;
    }
}

.btn-save,
.btn-success {
    background: var(--success);
    color: white;
}

.btn-text-edit,
.btn-action {
    background: #2563eb;
    color: white;
}

.btn-icon {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
    padding: 0.75rem;
}

.btn-icon.edit { color: #2563eb; }
.btn-icon.delete { color: var(--danger); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 24px;
    width: min(100%, 520px);
    box-shadow: var(--shadow);
}

textarea {
    width: 100%;
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    resize: vertical;
    min-height: 120px;
}

@media (max-width: 1100px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        width: 100%;
    }
    .main-content {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 84px);
    }
    .top-nav {
        grid-column: 1 / -1;
    }
    .page-header,
    .viewport-inner,
    .dashboard-right-panel {
        padding-left: 26px;
        padding-right: 26px;
    }
}

@media (max-width: 720px) {
    .login-card {
        padding: 32px 24px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .clock-badge {
        width: 100%;
        text-align: left;
    }
    .sidebar-menu {
        gap: 6px;
    }
    .menu-item {
        padding: 14px 16px;
    }
    .viewport-inner {
        padding: 24px;
    }
}

/* Competitions (local module) */
.module-header-desc {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 640px;
}

.competition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.competition-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 24px 26px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.competition-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.competition-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
}

.competition-badge--active {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.competition-track {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-muted);
}

.competition-track--nmo {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.competition-track--kb {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

/* Student Activity: level-kind badges on level picker cards */
.competition-track--mcq {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.competition-track--group {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.competition-track--presentation {
    background: rgba(139, 92, 246, 0.12);
    color: #6d28d9;
}

.competition-card--level {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.competition-card--level:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.text-muted {
    color: var(--text-muted);
}

.competition-card-title {
    margin: 8px 0 0;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.competition-card-meta {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.competition-card-meta i {
    width: 1.1em;
    color: var(--primary);
    opacity: 0.85;
}

.competition-card--disabled {
    opacity: 0.9;
    background: #f8fafc;
}

.competition-card--disabled .competition-card-meta i {
    color: var(--text-muted);
}

.competition-badge--disabled {
    background: rgba(100, 116, 139, 0.2);
    color: #475569;
}

.competition-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.competition-action-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
    justify-content: center;
}

.track-stats-grid {
    margin-bottom: 18px;
}

.track-stat-btn {
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
}

.track-stat-btn .stat-card {
    width: 100%;
}

.track-stat-btn .stat-card:hover {
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.1);
}

.track-page-layout {
    display: block;
}

.track-main-column {
    min-width: 0;
}

.track-schools-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1200;
}

.track-schools-overlay.open {
    display: flex;
}

.track-schools-sheet {
    width: min(100%, 680px);
    max-height: min(80vh, 760px);
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.25);
    padding: 24px;
}

.track-schools-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.track-schools-sheet-header h3 {
    margin: 0;
}

.student-activity-root {
    display: grid;
    gap: 18px;
}

.student-activity-section h3 {
    margin: 0 0 10px;
    font-size: 1.9rem;
}

.student-activity-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 12px;
}

.student-activity-quick h3 {
    font-size: 1.7rem;
}

.student-activity-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 18px;
}

.student-activity-quick-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.student-activity-quick-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}

.student-activity-quick-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.student-activity-quick-badge {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 16px;
}

.student-activity-quick-card--purple .student-activity-quick-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}

.student-activity-quick-card--green .student-activity-quick-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.student-activity-quick-card--orange .student-activity-quick-badge {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
}

.student-activity-quick-card h4 {
    margin: 0 0 4px;
    font-size: 1.08rem;
}

.student-activity-quick-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.35;
}

.student-activity-quick-btn {
    align-self: flex-end;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.student-activity-quick-btn--purple {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.student-activity-quick-btn--green {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.student-activity-quick-btn--orange {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
}

@media (max-width: 980px) {
    .student-activity-quick-grid {
        grid-template-columns: 1fr;
    }
}

.student-activity-card {
    border-radius: 12px;
    padding: 14px 16px 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.student-activity-card--clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.student-activity-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
    border-color: #cbd5e1;
}

.student-activity-card--clickable:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.student-activity-metric-list-modal-content {
    width: min(100%, 920px);
    max-height: min(90vh, 800px);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.student-activity-metric-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.student-activity-metric-list-header h3 {
    margin: 0;
}

.student-activity-metric-list-count {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.student-activity-metric-list-tablewrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.student-activity-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 11px;
}

.student-activity-card h2 {
    margin: 2px 0 4px;
    font-size: 1.95rem;
    line-height: 1;
}

.student-activity-card h4 {
    margin: 0 0 4px;
    font-size: 1.03rem;
}

.student-activity-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.student-activity-card--green {
    background: #f3faf5;
    border-color: #d9efe0;
}

.student-activity-card--green .student-activity-icon,
.student-activity-card--green h2 {
    color: #16a34a;
    background: #dff5e7;
}

.student-activity-card--blue {
    background: #f3f9fd;
    border-color: #dbeaf3;
}

.student-activity-card--blue .student-activity-icon,
.student-activity-card--blue h2 {
    color: #0891b2;
    background: #d9f2f6;
}

.student-activity-card--yellow {
    background: #fffaf0;
    border-color: #f6ead1;
}

.student-activity-card--yellow .student-activity-icon,
.student-activity-card--yellow h2 {
    color: #f59e0b;
    background: #fef3c7;
}

.student-activity-card--orange {
    background: #fff8ef;
    border-color: #f7e6cf;
}

.student-activity-card--orange .student-activity-icon,
.student-activity-card--orange h2 {
    color: #f97316;
    background: #fde8d1;
}

.student-activity-card--red {
    background: #fff6f6;
    border-color: #f4dddd;
}

.student-activity-card--red .student-activity-icon,
.student-activity-card--red h2 {
    color: #ef4444;
    background: #fee2e2;
}

.student-activity-card--slate {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.student-activity-card--slate .student-activity-icon,
.student-activity-card--slate h2 {
    color: #64748b;
    background: #e2e8f0;
}

.manage-groups-screen {
    display: grid;
    gap: 16px;
}

.manage-groups-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #065f46;
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
}

.manage-groups-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.manage-groups-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.manage-groups-rag {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px;
    overflow: hidden;
}

.manage-groups-rag-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.manage-groups-rag-btn:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.65);
}

.manage-groups-rag-btn.is-active.manage-groups-rag-btn--allocated {
    background: #bbf7d0;
    color: #14532d;
    box-shadow: 0 1px 4px rgba(22, 101, 52, 0.2);
}

.manage-groups-rag-btn.is-active.manage-groups-rag-btn--not_allocated {
    background: #fde68a;
    color: #78350f;
    box-shadow: 0 1px 4px rgba(180, 83, 9, 0.2);
}

.manage-groups-rag-btn.is-active.manage-groups-rag-btn--all {
    background: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.manage-groups-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
}

.manage-groups-search input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background: #fff7ed;
    padding: 12px 14px;
}

.manage-groups-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
}

.manage-group-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.manage-group-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    background: #4b5563;
    color: #fff;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.manage-group-card p {
    margin: 0 0 8px;
    line-height: 1.25;
}

.manage-group-root {
    display: grid;
    gap: 18px;
}

.manage-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 16px;
}

.manage-group-grid--three {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.manage-group-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.manage-group-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    margin-bottom: 10px;
}

.manage-group-card h3 {
    margin: 0 0 6px;
}

.manage-group-card-allot {
    margin-top: 12px;
    width: 100%;
    border: 1px solid transparent;
    font-weight: 600;
}

.manage-group-card-allot--allot {
    background: #fecaca;
    color: #991b1b;
    border-color: #fca5a5;
}

.manage-group-card-allot--allot:hover {
    background: #fca5a5;
    color: #7f1d1d;
    border-color: #f87171;
}

.manage-group-card-allot--change {
    background: #bbf7d0;
    color: #166534;
    border-color: #86efac;
}

.manage-group-card-allot--change:hover {
    background: #86efac;
    color: #14532d;
    border-color: #4ade80;
}

.manage-group-awaiting {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.manage-group-card p {
    margin: 0 0 12px;
    color: var(--text-muted);
}

.manage-group-placeholder-box {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.92rem;
}

.manage-group-card--clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.manage-group-card--clickable:hover,
.manage-group-card--clickable:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12);
    outline: none;
}

.manage-group-card-icon--teams {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

.manage-group-card-badge {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #059669;
}

.manage-group-card-badge i {
    margin-right: 6px;
}

.manage-group-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #2563eb;
}

.my-teams-root {
    gap: 14px;
}

.my-teams-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.my-teams-back {
    align-self: flex-start;
}

.my-teams-header {
    margin: 0;
}

.my-teams-header h1 {
    margin: 0 0 4px;
}

.my-teams-search-wrap {
    margin-bottom: 4px;
}

.my-teams-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(68vh, 640px);
    overflow-y: auto;
    padding-right: 4px;
}

.my-teams-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: #64748b;
}

.my-teams-empty i {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: #94a3b8;
}

.my-teams-empty h3 {
    margin: 0 0 6px;
    color: #334155;
}

.my-teams-empty p {
    margin: 0;
}

.my-teams-row.my-teams-row--clickable {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.my-teams-row.my-teams-row--clickable:hover,
.my-teams-row.my-teams-row--clickable:focus-visible {
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.my-teams-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.my-teams-row-title {
    font-size: 1rem;
    color: #0f172a;
}

.my-teams-row-meta {
    font-size: 0.82rem;
    color: #64748b;
}

.my-teams-row-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.my-teams-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-teams-chevron {
    color: #94a3b8;
}

.team-detail-root {
    gap: 14px;
}

.team-detail-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.team-detail-hero h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.team-detail-hero-meta {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 0.92rem;
}

.team-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin: 0 0 22px;
}

.team-detail-facts dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin: 0 0 4px;
}

.team-detail-facts dd {
    margin: 0;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.45;
}

.team-detail-uploads {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid #e8eef4;
}

.team-detail-uploads-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.team-detail-uploads-title {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-detail-uploads-hint {
    margin: -8px 0 16px;
    font-size: 0.85rem;
    color: #64748b;
}

.team-uploads-group {
    margin-bottom: 20px;
}

.team-uploads-group:last-child {
    margin-bottom: 0;
}

.team-uploads-group-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-uploads-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
}

.team-upload-thumb {
    position: relative;
}

.team-upload-source {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.team-upload-source--team {
    background: #dbeafe;
    color: #1e40af;
}

.team-upload-source--mentor {
    background: #d1fae5;
    color: #047857;
}

.team-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.team-detail-panel-title {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-detail-panel-desc {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.team-detail-empty {
    margin: 0;
    padding: 24px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.team-upload-file-input {
    display: none;
}

.team-upload-pick-btn {
    align-self: flex-start;
}

.team-uploads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.team-upload-thumb {
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.team-upload-file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #e2e8f0;
    text-decoration: none;
    color: inherit;
}

.team-upload-file-preview--image {
    padding: 0;
}

.team-upload-file-preview--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-upload-file-preview--video {
    flex-direction: column;
    padding: 0;
    background: #0f172a;
}

.team-upload-file-preview--video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.team-upload-file-preview--audio {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: #f1f5f9;
}

.team-upload-file-preview--audio audio {
    width: 100%;
    max-width: 100%;
}

.team-upload-file-preview--doc {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
    font-weight: 700;
    color: #334155;
}

.team-upload-file-icon {
    font-size: 2rem;
    color: #2563eb;
}

.team-upload-file-preview--doc .fa-file-pdf {
    color: #dc2626;
}

.team-upload-open-link {
    display: block;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    text-align: center;
    text-decoration: none;
    border-top: 1px solid #e8eef4;
    background: #f8fafc;
}

.team-upload-open-link:hover {
    text-decoration: underline;
}

.team-upload-thumb figcaption {
    padding: 8px 10px;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.35;
}

.team-upload-thumb figcaption span {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .manage-group-grid--three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .team-detail-facts {
        grid-template-columns: 1fr;
    }

    .my-teams-pill {
        display: none;
    }

    .team-detail-uploads-head {
        flex-direction: column;
        align-items: stretch;
    }

    .team-detail-uploads-head .btn {
        width: 100%;
    }
}

.manage-group-guard {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 26px;
    text-align: center;
}

.manage-group-guard i {
    font-size: 1.5rem;
    color: #334155;
    margin-bottom: 10px;
}

.manage-group-guard h3 {
    margin: 0 0 6px;
}

.manage-group-guard p {
    margin: 0;
    color: var(--text-muted);
}

/* Group approval — teacher workspace */
.group-approval-root .module-header .header-info h1 {
    margin: 0 0 6px;
    font-size: 1.65rem;
}

.group-approval-approved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.group-approval-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: #64748b;
}

.group-approval-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.group-approval-empty p {
    margin: 0;
    font-size: 1rem;
}

.group-approval-team-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.group-approval-team-card:hover {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.group-approval-team-card__header {
    padding: 18px 18px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #fff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.group-approval-team-card__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.group-approval-team-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.group-approval-team-card__icon--pending {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.group-approval-team-card__title {
    margin: 0 0 8px;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    text-transform: capitalize;
}

.group-approval-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
}

.group-approval-badge--approved {
    background: #dcfce7;
    color: #15803d;
}

.group-approval-badge--pending {
    background: #fef3c7;
    color: #b45309;
}

.group-approval-team-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.group-approval-team-card__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-approval-team-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.group-approval-team-card__label i {
    margin-right: 4px;
    color: var(--primary);
}

.group-approval-team-card__label em {
    font-style: normal;
    font-weight: 500;
    color: #94a3b8;
}

.group-approval-avatars {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.group-approval-avatar {
    width: 36px;
    height: 36px;
    margin-left: -8px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: hsl(var(--avatar-hue, 220), 65%, 48%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.group-approval-avatars .group-approval-avatar:first-child {
    margin-left: 0;
}

.group-approval-avatar--more {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.65rem;
}

.group-approval-avatars-empty {
    font-size: 0.85rem;
    color: #94a3b8;
}

.group-approval-members-line {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.group-approval-topic {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: #1e40af;
    font-size: 0.88rem;
    font-weight: 600;
}

.group-approval-topic i {
    opacity: 0.85;
}

.group-approval-topic--empty {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 500;
}

.group-approval-leader {
    margin: 0;
    font-size: 0.88rem;
    color: #475569;
}

.group-approval-leader i {
    color: #eab308;
    margin-right: 4px;
}

.group-approval-leader strong {
    color: #0f172a;
}

.group-approval-pending-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
}

.group-approval-pending-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.group-approval-pending-row.is-expanded {
    border-color: #93c5fd;
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.14);
}

.group-approval-pending-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.group-approval-pending-title {
    display: block;
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.group-approval-pending-sub {
    margin: 0 0 10px !important;
    font-size: 0.85rem !important;
    color: #64748b !important;
}

.group-approval-pending-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.group-approval-pending-click {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    text-align: left;
    border-radius: 10px;
    margin: -6px;
    padding: 6px;
    outline: none;
}

.group-approval-pending-click:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}

.group-approval-pending-hint {
    margin: 8px 0 0 !important;
    font-size: 0.8rem !important;
    color: #64748b !important;
}

.group-approval-pending-detail {
    display: none;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.group-approval-pending-row.is-expanded .group-approval-pending-detail {
    display: block;
}

.group-approval-pending-detail-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-approval-pending-detail-dl div {
    margin: 0;
}

.group-approval-pending-detail-dl dt {
    margin: 0 0 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.group-approval-pending-detail-dl dd {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.35;
}

.group-approval-pending-row p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.group-approval-pending-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .group-approval-approved-grid {
        grid-template-columns: 1fr;
    }

    .group-approval-pending-actions {
        width: 100%;
    }

    .group-approval-pending-actions .btn {
        flex: 1;
    }
}

.group-eval-box-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 16px;
}

.group-eval-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.group-eval-box-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    margin-bottom: 8px;
}

.group-eval-box h3 {
    margin: 0 0 6px;
}

.group-eval-box p {
    margin: 0;
    color: var(--text-muted);
}

.group-assignment-status-card {
    margin-top: 8px;
    display: grid;
    gap: 12px;
}

.group-assignment-status-card h3 {
    margin: 0;
}

.group-assignment-top-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.group-assignment-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.group-assignment-icon {
    width: 30px;
    height: 30px;
    margin: 0 auto 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.group-assignment-tile--assigned {
    background: #f7f8ff;
}

.group-assignment-tile--assigned .group-assignment-icon {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.12);
}

.group-assignment-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin: 6px 0 10px;
}

.group-assignment-tile p {
    margin: 0 0 6px;
    font-weight: 700;
}

.group-assignment-tile small {
    color: #64748b;
    font-size: 0.8rem;
}

.group-assignment-total {
    background: #5f7f90;
    color: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-assignment-total span {
    display: block;
    font-size: 1.05rem;
    opacity: 0.95;
}

.group-assignment-total strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.group-assignment-total i {
    font-size: 2.1rem;
    opacity: 0.9;
}

@media (max-width: 980px) {
    .manage-groups-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .manage-group-grid {
        grid-template-columns: 1fr;
    }

    .group-eval-box-grid {
        grid-template-columns: 1fr;
    }

    .group-assignment-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .manage-groups-filters {
        grid-template-columns: 1fr;
    }

    .manage-groups-grid {
        grid-template-columns: 1fr;
    }
}

.track-school-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-main);
}

.track-school-list li + li {
    margin-top: 6px;
}

@media (max-width: 1200px) {
    .track-schools-sheet {
        width: min(100%, 560px);
        max-height: 82vh;
    }

    .student-activity-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 760px) {
    .student-activity-grid {
        grid-template-columns: 1fr;
    }
}

.comp-create-layout {
    max-width: 720px;
}

.comp-form-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 28px 30px 32px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.comp-form-section-title {
    margin: 28px 0 12px;
    font-size: 1.05rem;
    color: var(--dark);
}

.comp-form-card .comp-form-section-title:first-child {
    margin-top: 0;
}

.comp-help {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.comp-check-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comp-check-tile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.comp-check-tile:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.03);
}

.comp-check-tile input {
    margin-top: 4px;
    width: auto;
}

.comp-check-tile-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comp-check-tile-body small {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.comp-tick-dropdown {
    position: relative;
}

.comp-tick-toggle {
    width: 100%;
    justify-content: space-between;
}

.comp-tick-menu {
    display: none;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
}

.comp-tick-menu.open {
    display: block;
}

.comp-dropdown-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
}

.comp-dropdown-option:hover {
    background: #f8fafc;
}

.comp-dropdown-option input {
    width: auto;
    margin-top: 3px;
}

.config-app-allot-cell {
    min-width: 140px;
    vertical-align: middle;
}

.config-app-allot-dropdown {
    min-width: 130px;
}

.config-app-allot-toggle {
    width: 100%;
    min-width: 120px;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 6px 10px;
}

.config-app-allot-menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    min-width: 140px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.config-app-allot-menu.open {
    display: block;
}

.comp-empty-levels {
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.92rem;
}

.school-participation-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.school-participation-block {
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fafbfc;
}

.school-participation-main {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.school-participation-main input {
    width: auto;
}

.school-tier-toggles {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.school-tier-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    width: 100%;
}

.tier-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.tier-pill input {
    width: auto;
}

.comp-level-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.comp-form-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.comp-modal-wide {
    width: min(100%, 480px);
}

/* Config: add / edit master data (centered overlay, same family as level modals) */
.config-crud-modal-overlay {
    z-index: 1100;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 24px;
}

.config-cmodal-content {
    width: min(100%, 560px);
    max-height: min(90vh, 900px);
    overflow-y: auto;
    box-sizing: border-box;
}

.config-cmodal-top {
    margin-bottom: 8px;
}

.config-cmodal-top h3 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.config-cmodal-desc {
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.config-cmodal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    padding-top: 4px;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.btn-text-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: inherit;
    display: inline;
}

.btn-text-link:hover {
    color: #1d4ed8;
}

.level-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.level-template-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 22px 24px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
}

.level-template-card-top {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.level-status-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
}

.level-status-badge--on {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.level-status-badge--off {
    background: rgba(100, 116, 139, 0.2);
    color: #475569;
}

.level-template-card--disabled {
    opacity: 0.92;
    background: #f8fafc;
}

.level-template-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.level-action-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-content-modal {
    width: min(100%, 760px);
    max-height: 90vh;
    overflow-y: auto;
}

.level-content-list-wrap {
    margin: 12px 0 18px;
    max-height: 320px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    padding: 12px;
}

.level-content-list {
    display: grid;
    gap: 10px;
}

.level-content-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.level-content-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.level-content-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 700;
}

.level-option-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: grid;
    gap: 6px;
}

.level-option-list li {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
}

.level-option-list li.is-correct {
    background: #dcfce7;
    color: #166534;
}

.level-content-form {
    margin-top: 6px;
}

.level-content-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 760px) {
    .level-content-grid-2 {
        grid-template-columns: 1fr;
    }
}

.level-type-badge {
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.level-type-badge--mcq {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.level-type-badge--group {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.level-type-badge--presentation {
    background: rgba(147, 51, 234, 0.12);
    color: #7c3aed;
}

.level-template-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.level-template-id {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.level-template-id code {
    font-size: 0.9em;
    background: var(--surface-soft);
    padding: 2px 6px;
    border-radius: 6px;
}

/* Config: theme task instructions — Quill + rich HTML preview */
.input-group .field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.theme-subtask-quill-wrap .ql-toolbar.ql-snow {
    border-radius: 12px 12px 0 0;
    border-color: #e2e8f0;
    font-family: inherit;
}

.theme-subtask-quill-wrap .ql-container.ql-snow {
    border-radius: 0 0 12px 12px;
    border-color: #e2e8f0;
    min-height: 160px;
    font-size: 0.95rem;
    font-family: inherit;
}

.theme-subtask-quill-wrap .ql-editor {
    min-height: 140px;
    line-height: 1.55;
}

.theme-task-instructions-rich {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-main);
}

.theme-task-instructions-rich p {
    margin: 0 0 0.5em;
}

.theme-task-instructions-rich p:last-child {
    margin-bottom: 0;
}

.theme-task-instructions-rich ul,
.theme-task-instructions-rich ol {
    margin: 0.35em 0 0.65em;
    padding-left: 1.35rem;
}

.theme-task-instructions-rich h1,
.theme-task-instructions-rich h2,
.theme-task-instructions-rich h3 {
    margin: 0.45em 0 0.3em;
    line-height: 1.25;
    font-weight: 600;
}

.theme-task-instructions-rich h1 {
    font-size: 1.2rem;
}

.theme-task-instructions-rich h2 {
    font-size: 1.08rem;
}

.theme-task-instructions-rich h3 {
    font-size: 1rem;
}

.theme-task-instructions-rich a {
    color: var(--primary);
    text-decoration: underline;
}

.theme-task-instructions-rich blockquote {
    margin: 0.5em 0;
    padding-left: 0.85rem;
    border-left: 3px solid var(--primary-soft, #dbeafe);
    color: var(--text-muted);
}