@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #135bec;
    --background-light: #f6f6f8;
    --background-dark: #101622;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #0d121b;
    --text-dim: #4c669a;
    --accent: #2c99b4;
    --white: #ffffff;

    --bg-light: #f1f5f9;
    --bg-header: rgba(255, 255, 255, 0.8);
    --card-bg: rgba(255, 255, 255, 0.7);
    --accent-glow: rgba(44, 153, 180, 0.2);
    --header-height: 80px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-light);
    color: var(--text-main);
    font-family: 'Lexend', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    overflow-x: hidden;
    background-image:
        radial-gradient(at 0% 0%, rgba(123, 202, 215, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 44, 133, 0.05) 0px, transparent 50%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(123, 202, 215, 0.3);
    /* CPA Teal */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Body backgrounds and global styles already defined above */

.logo {
    display: none;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: brightness(0.2);
}

header {
    min-height: 80px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    background: white;
    border-bottom: 2px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.header-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    margin: 0 5px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
}

.search-bar {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar .material-symbols-outlined {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Redesigned Buttons */
.icon-btn,
.icon-btn-accent {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    color: var(--text-main);
}

.icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.icon-btn-accent {
    background: #2c99b4;
    color: white;
    border: none;
    border-radius: 8px;
    /* Square with rounded corners per mockup */
    width: 38px;
    height: 38px;
}

.icon-btn-accent:hover {
    background: #248aa3;
}

#switch-project-btn {
    border: none;
    color: #1e8e3e;
}

#sync-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.text-link-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
}

.primary-btn-sm {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

#user-display {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c99b4;
    margin-right: 5px;
}

.header-btn {
    padding: 8px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-weight: 700;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.header-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.hidden-btn {
    display: none !important;
}

#auth-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

main {
    flex: 1;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
}

.view {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
}

.view.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    max-height: none;
    overflow: visible;
}


/* THE WHEEL */
.wheel-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    min-height: 500px;
    /* Stronger height for tablets */
    height: 100%;
}

#main-wheel {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    max-width: 95vw;
    aspect-ratio: 1/1;
    display: block;
}

.wheel-group {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    transform-origin: 300px 300px;
}

.wheel-group.active-click {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.wheel-slice {
    stroke: rgba(255, 255, 255, 0.1);
}

.wheel-label {
    fill: white;
    font-weight: 700;
    font-size: clamp(13px, 1.6vw, 15px);
    pointer-events: none;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
}

/* DRILL DOWN LIST */
.content-container {
    max-width: 900px;
    margin: 40px auto;
    width: 100%;
    /* No max-height to avoid double scrollbars */
    display: flex;
    flex-direction: column;
    padding: 30px;
    background: white;
    border-radius: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

#view-roster .content-container {
    max-width: 1400px;
}

.view-header {
    margin-bottom: 30px;
}

.view-header.sticky {
    background: var(--bg-light);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.back-link {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    margin-bottom: 10px;
    font-weight: 700;
}

.drill-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: visible;
    padding-bottom: 20px;
}

.descriptor-row {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: all 0.2s;
    user-select: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.descriptor-row.queued-pos {
    border-color: var(--accent);
    background: rgba(123, 202, 215, 0.1);
}

.descriptor-row.queued-neg {
    border-color: var(--danger);
    background: rgba(224, 61, 77, 0.1);
}

.mode-btn.active-pos {
    background: var(--accent);
    color: var(--bg-dark);
}

.mode-btn.active-neg {
    background: var(--danger);
    color: white;
}

.descriptor-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-main);
}

.mode-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.mode-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    font-size: 1.1rem;
    font-weight: 900;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mode-btn:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-btn:active {
    transform: scale(0.98);
}

.mode-btn.d {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.mode-btn.p {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.mode-btn.a {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.mode-btn.active-d {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.mode-btn.active-p {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.mode-btn.active-a {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

/* Evaluation Legend */
.eval-legend {
    margin-top: 40px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}

.eval-legend h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 15px;
    font-weight: 800;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.legend-box {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 900;
}


/* CLASS SELECTOR TABS */
.class-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    width: fit-content;
}

.class-tab {
    padding: 10px 25px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.class-tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-main);
}

.class-tab.active {
    background: white;
    color: var(--accent);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.05);
}

/* STUDENT GRID */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    overflow: visible;
    padding: 10px;
    padding-bottom: 20px;
}

.student-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 100px;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.student-card.selected {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent);
    transform: scale(1.05);
}

.student-card .inspect-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-card:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.student-card.just-scored-pos {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: var(--accent);
}

.student-card.just-scored-neg {
    background: rgba(244, 63, 94, 0.3) !important;
    border-color: var(--danger);
}

.assignment-info {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.pills-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 5px;
}

#assign-indicator-text {
    font-size: 1.1rem;
    line-height: 1.2;
    margin: 0;
}

.mode-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.mode-badge.pos {
    background: var(--accent);
    color: var(--bg-dark);
}

.mode-badge.neg {
    background: var(--danger);
    color: white;
}

.done-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
}

@media (max-width: 650px) {
    .view-header.sticky {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }

    .assignment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .assignment-info {
        width: 100%;
    }

    #assign-indicator-text {
        font-size: 0.95rem;
        font-weight: 800;
        margin-top: 5px;
    }

    .done-btn {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
    }

    .back-link {
        margin-bottom: 5px;
        font-size: 0.85rem;
    }

    .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
        padding: 5px;
    }

    .student-card {
        padding: 15px 10px;
        font-size: 0.85rem;
        min-height: 80px;
    }
}

.done-btn {
    background: var(--accent);
    color: var(--bg-dark);
    font-weight: 900;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ANALYTICS ROSTER */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
    overflow: visible;
    padding: 10px;
    padding-bottom: 20px;
    width: 100%;
}

@media (max-width: 600px) {
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 5px;
    }
}

.analytics-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 25px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
    .analytics-card {
        padding: 12px 18px;
        min-height: 80px;
        gap: 12px;
        border-radius: 20px;
    }

    .student-name {
        font-size: 1.15rem;
    }

    .mini-dashboard {
        gap: 6px;
    }

    .comp-dot {
        width: 18px;
        height: 18px;
    }

    .dot-count {
        font-size: 8px;
    }
}

.analytics-card:hover {
    background: white;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-main-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.student-name {
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
}

.last-activity {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-top: 5px;
}

.card-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.mini-dashboard {
    display: flex;
    gap: 10px;
}

.comp-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.dot-count {
    font-size: 10px;
    font-weight: 900;
    color: white;
}


/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 30px;
    border-radius: 24px;
    width: 500px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: var(--text-main);
}

textarea {
    width: 100%;
    height: 300px;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    font-family: inherit;
}

/* STUDENT DASHBOARD REDESIGN */
.dashboard-modal {
    max-width: 1100px !important;
    width: 95% !important;
    max-height: 90vh !important;
    padding: 0 !important;
    background: var(--background-light) !important;
    border-radius: 20px;
    overflow-y: auto !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dashboard-container {
    padding: 30px;
}

.dashboard-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.dashboard-header-simple h1 {
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.02em;
}

.dashboard-header-simple p {
    color: var(--text-dim);
    margin: 5px 0 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card.primary-bg {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(19, 91, 236, 0.3);
}

.stat-card .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card.primary-bg .label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
}

.stat-progress {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.stat-card.primary-bg .stat-progress {
    background: rgba(255, 255, 255, 0.2);
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

.stat-card.primary-bg .progress-fill {
    background: white;
}

.summary-section {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.summary-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
}

.range-tabs {
    display: flex;
    gap: 20px;
    align-items: center;
}

.visibility-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chart-area {
    padding: 24px;
    height: 400px;
    position: relative;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
}

.status-item {
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #f1f5f9;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.status-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.status-item:active {
    transform: scale(0.96);
}

.status-item.is-off {
    opacity: 0.45;
    filter: grayscale(0.8);
    border-style: dashed;
}

.status-label {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
}

.status-item.s-a {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.status-item.s-a .status-label {
    color: var(--success);
}

.status-item.s-p {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.status-item.s-p .status-label {
    color: var(--warning);
}

.status-item.s-d {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.status-item.s-d .status-label {
    color: var(--danger);
}



.status-item.s-none .status-label {
    color: #94a3b8;
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    border-top: 1px solid #e2e8f0;
}

.dashboard-footer a {
    color: var(--text-dim);
    margin-left: 15px;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
}

/* Detail Table/List inside Modal */
.detail-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    border-left: 4px solid var(--accent);
    text-align: left;
    color: var(--text-main);
}

.detail-list {
    margin-top: 20px;
    max-height: 40vh;
    overflow-y: auto;
}

.secondary-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: var(--text-dim);
    border: none;
    margin-top: 10px;
    cursor: pointer;
    font-weight: 700;
}

.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--accent);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 900;
    z-index: 3000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* QUEUE BAR */
.queue-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #0e2c85;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 1500;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.queue-bar.active {
    transform: translateX(-50%) translateY(0);
}

.queue-info {
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

#queue-count {
    background: var(--accent);
    color: var(--bg-dark);
    padding: 2px 10px;
    border-radius: 20px;
    margin-right: 5px;
}

.queue-btn {
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.queue-btn:active {
    transform: scale(0.95);
}


.sync-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.sync-status.syncing {
    background: var(--accent-glow);
    color: var(--accent);
    animation: pulse 1.5s infinite;
}

.sync-status.success {
    background: #e6f4ea;
    color: #1e8e3e;
}

.sync-status.error {
    background: #fce8e6;
    color: var(--danger);
}

@media (max-width: 600px) {
    .search-col-header h2 {
        font-size: 1.4rem;
    }

    .search-comp-card,
    .search-student-card {
        padding: 16px;
        border-radius: 20px;
    }

    .stud-name {
        font-size: 1.2rem;
    }

    .mini-dot {
        width: 18px;
        height: 18px;
        font-size: 7px;
    }

    .stud-last-act {
        display: none;
    }

    .search-student-card {
        gap: 4px;
        padding: 12px 18px;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-btn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        min-width: 70px !important;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.project-item:hover {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.project-item.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.project-item div:first-child {
    font-weight: 700;
    color: var(--text-main);
}

.project-item div:last-child {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}


/* VOICE btn in header */
#voice-btn {
    width: 33px !important;
    height: 33px !important;
    min-width: 33px !important;
    /* Overriding the 80px default */
    max-width: 33px !important;
    padding: 0 !important;
    background: var(--accent) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    /* Slightly more rounded for premium feel */
    margin-left: 5px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#voice-btn .material-symbols-outlined {
    font-size: 20px !important;
    /* Adjusted for 33px button */
}

/* VOICE FEATURE STYLES - Minimalist Refinement */
.glow-mic-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #64748b;
    position: relative;
    outline: none;
}

.glow-mic-btn:hover {
    border-color: #cbd5e1;
    color: var(--text-main);
    transform: scale(1.05);
}

.glow-mic-btn * {
    pointer-events: none;
}

.glow-mic-btn.is-recording {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 30px var(--accent), inset 0 0 30px var(--accent);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 20px var(--accent), inset 0 0 20px var(--accent);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 50px var(--accent), inset 0 0 40px var(--accent);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 20px var(--accent), inset 0 0 20px var(--accent);
        transform: scale(1);
    }
}

#voice-suggestions {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.descriptor-path {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--category-color, var(--text-dim));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.transcription-reason {
    font-size: 0.85rem;
    color: #475569;
    font-style: italic;
    background: rgba(241, 245, 249, 0.5);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 4px;
    line-height: 1.4;
}

#voice-transcript {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #334155 !important;
    background: rgba(241, 245, 249, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

#voice-suggestions {
    margin-bottom: 20px;
    text-align: left;
}

#suggestions-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 10px;
}

/* Custom Scrollbar for suggestions */
#suggestions-list::-webkit-scrollbar {
    width: 6px;
}

#suggestions-list::-webkit-scrollbar-track {
    background: transparent;
}

#suggestions-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

#suggestions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.suggestion-item {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-right: 30px;
    /* Room for remove button */
    gap: 10px;
}

.mode-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.remove-sug {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(241, 245, 249, 0.8);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.remove-sug:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: scale(1.1);
}

.suggestion-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--category-color, #cbd5e1);
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-right: 30px;
    /* Room for remove button */
    gap: 10px;
}

.student-ref {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.mode-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.mode-badge.pos {
    background: #dcfce7;
    color: #166534;
}

.mode-badge.neg {
    background: #fee2e2;
    color: #991b1b;
}

.descriptor-ref {
    font-weight: 500;
    font-size: 0.9rem;
    color: #475569;
}

/* FOOTER */
footer {
    background: white;
    padding: 20px 40px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    z-index: 10;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.footer-right {
    display: flex;
    gap: 25px;
}

.footer-right a {
    color: #94a3b8;
    text-decoration: none;
}

/* RESPONSIVE HEADER REDESIGN */
@media (max-width: 1100px) {
    .header-center {
        max-width: 250px;
    }
}

@media (max-width: 950px) {
    header {
        padding: 10px 20px;
        height: auto;
        min-height: 80px;
    }

    .header-center {
        display: flex;
        flex: 1;
        max-width: none;
        margin: 0 20px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .header-left {
        width: 100%;
        justify-content: flex-start;
        gap: 20px;
    }

    .header-center {
        width: 100%;
        margin: 0;
        display: flex;
    }

    .search-bar {
        width: 100%;
        max-width: none;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .header-divider {
        display: none;
    }
}

/* SEARCH RESULTS VIEW */
.search-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    height: auto;
    /* Allow growth */
    min-height: 500px;
    max-width: 1400px !important;
    padding-bottom: 20px;
}


.search-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

.search-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.search-col-header h2 {
    font-weight: 900;
    font-size: 1.8rem;
}

.count-badge {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
}

.search-list {
    flex: 1;
    overflow: visible;
    padding: 10px 5px 60px 5px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 1000px) {
    .search-container {
        display: flex;
        flex-direction: column;
        gap: 30px;
        overflow-y: visible;
        padding-bottom: 60px;
        height: auto;
    }

    .search-column {
        height: auto !important;
        min-height: 400px;
        overflow: visible !important;
    }

    .search-list {
        overflow-y: visible !important;
        height: auto !important;
    }
}

/* Removed scrollbar custom styles for search-list */

.search-list::-webkit-scrollbar {
    width: 6px;
}

.search-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.search-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* COMPETENCY CARD (SEARCH) */
.search-comp-card {
    background: white;
    padding: 18px;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.search-comp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.comp-info {
    flex: 1;
}

.comp-code {
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--text-main);
}

.comp-text {
    font-size: 0.90rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-top: 4px;
}

.comp-category {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.comp-quick-actions {
    display: flex;
    gap: 10px;
}

.quick-btn {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-size: 1.5rem;
}

.quick-btn .material-symbols-outlined {
    font-size: 28px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.quick-btn.pos {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #10b981;
}

.quick-btn.neg {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #f43f5e;
}

.quick-btn.pos:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.quick-btn.neg:hover {
    background: #f43f5e;
    color: white;
    border-color: #f43f5e;
}

/* STUDENT CARD (SEARCH) */
.search-student-card {
    background: white;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

@media (max-width: 600px) {
    .search-student-card {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 18px !important;
        gap: 12px !important;
        border-radius: 20px;
    }

    .stud-header {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }

    .stud-name {
        font-size: 1.1rem;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .search-student-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 18px;
        gap: 12px;
        border-radius: 20px;
    }

    .stud-header {
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }

    .stud-name {
        font-size: 1.1rem;
        max-width: none;
    }
}

.search-student-card:hover {
    transform: translateY(-2px);
}

.search-student-card.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.stud-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stud-name {
    font-weight: 900;
    font-size: 1.4rem;
    max-width: 180px;
    line-height: 1.1;
}

.stud-last-act {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.stud-last-act .material-symbols-outlined {
    font-size: 14px;
}

.stud-last-act strong {
    color: var(--accent);
}

.stud-footer {
    /* border-top: 1px solid #f1f5f9; */
    /* padding-top: 12px; */
    /* margin-top: 5px; */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stud-class {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.search-mini-dots {
    display: flex;
    gap: 6px;
}

.mini-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
}

.mini-dot.active {
    background: var(--accent);
}

.search-col-header .count-badge {
    background: rgba(44, 153, 180, 0.1);
    color: var(--accent);
}

.search-column:first-child .count-badge {
    background: rgba(217, 48, 37, 0.1);
    color: var(--danger);
}

/* INITIAL LOADER */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s;
}

#app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#app-loader .loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#app-loader .loader-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(44, 153, 180, 0.15);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: app-spin 1s linear infinite;
}

#app-loader p {
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

@keyframes app-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* AUTH GATE LOGIC */
body.not-logged-in header,
body.not-logged-in main,
body.not-logged-in footer,
body.not-logged-in #queue-bar {
    display: none !important;
}

body:not(.not-logged-in) .login-view {
    display: none !important;
}

/* PREMIUM LOGIN SCREEN */
.login-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    z-index: 9999;
}

.login-background {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #2c99b4;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: #0e2c85;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 100px) scale(1.1);
    }
}

.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 60px 40px;
    border-radius: 40px;
    text-align: center;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.login-logo img {
    height: 70px;
    margin-bottom: 25px;
    filter: brightness(0.1);
    /* Dark logo for light theme */
}

.login-card h1 {
    color: #0f172a;
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.login-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.premium-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    background: #0f172a;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: #1e293b;
}

.premium-login-btn:active {
    transform: scale(0.98);
}

.premium-login-btn img {
    width: 24px;
    height: 24px;
}