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

        :root {
            --hd-bg:          #0a0a1a;
            --hd-card-bg:     #12122a;
            --hd-gold:        #d4a017;
            --hd-gold-bright: #e6b422;
            --hd-gold-dark:   #b8860b;
            --hd-gold-subtle: rgba(212, 160, 23, 0.15);
            --hd-gold-border: rgba(212, 160, 23, 0.25);
            --hd-text:        #e0e0e0;
            --hd-text-muted:  #888;
            --hd-text-secondary: #aaa;
            --hd-danger:      #f85149;
            --hd-sidebar-w:   280px;
            --hd-right-w:     300px;
            --hd-overlay-rgb: 255,255,255;
            --hd-chart-text:  #aaa;
        }

        [data-theme="light"] {
            --hd-bg:          #dedad4;
            --hd-card-bg:     #eae7e1;
            --hd-gold:        #6b4f06;
            --hd-gold-bright: #7a5c08;
            --hd-gold-dark:   #5a4205;
            --hd-gold-subtle: rgba(107, 79, 6, 0.1);
            --hd-gold-border: rgba(107, 79, 6, 0.22);
            --hd-text:        #2a2520;
            --hd-text-muted:  #655e58;
            --hd-text-secondary: #5c5550;
            --hd-danger:      #c42020;
            --hd-overlay-rgb: 0,0,0;
            --hd-chart-text:  #5c5550;
            --hd-shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
            --hd-shadow-md:   0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06);
            --hd-shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.06);
        }

        /* Light mode — card elevations */
        [data-theme="light"] .hd-header {
            box-shadow: var(--hd-shadow-sm);
            border-bottom-color: rgba(0,0,0,0.06);
        }
        [data-theme="light"] .hd-stat-card {
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
            border-left-color: var(--hd-gold-border);
        }
        [data-theme="light"] .hd-stat-card:hover {
            box-shadow: var(--hd-shadow-md);
        }
        [data-theme="light"] .hd-analytics-section {
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
        }
        [data-theme="light"] .hd-donut-card {
            background: var(--hd-card-bg);
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
        }
        [data-theme="light"] .hd-donut-card:hover {
            box-shadow: var(--hd-shadow-md);
        }
        [data-theme="light"] .hd-analytics-card {
            background: var(--hd-card-bg);
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
        }
        [data-theme="light"] .hd-analytics-card:hover {
            box-shadow: var(--hd-shadow-md);
        }
        [data-theme="light"] .hd-activity-section {
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
        }
        [data-theme="light"] .hd-leaderboard-item {
            background: rgba(0,0,0,0.03);
        }
        [data-theme="light"] .hd-leaderboard-item.top-1 {
            background: rgba(180, 150, 20, 0.1);
        }
        [data-theme="light"] .hd-leaderboard-item.top-2 {
            background: rgba(140, 140, 140, 0.1);
        }
        [data-theme="light"] .hd-leaderboard-item.top-3 {
            background: rgba(165, 100, 35, 0.1);
        }
        [data-theme="light"] .hd-grade-row {
            background: rgba(0,0,0,0.03);
        }
        [data-theme="light"] .hd-grade-row-name {
            color: #3a3530;
        }
        [data-theme="light"] .hd-tab-bar {
            background: var(--hd-bg);
            border-bottom-color: var(--hd-gold-border);
        }
        [data-theme="light"] .hd-mini-stat {
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
        }
        [data-theme="light"] .hd-sparkline-wrap {
            box-shadow: var(--hd-shadow-sm);
            border-color: rgba(0,0,0,0.04);
        }
        [data-theme="light"] .hd-asgn-table td {
            border-bottom-color: rgba(0,0,0,0.06);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--hd-bg);
            color: var(--hd-text);
            min-height: 100vh;
        }

        /* ═══════════════════════════════════════════════════
           HEADER
           ═══════════════════════════════════════════════════ */

        .hd-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 24px;
            background: var(--hd-card-bg);
            border-bottom: 1px solid var(--hd-gold-border);
        }

        .hd-header-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .hd-back-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--hd-text-muted);
            text-decoration: none;
            font-size: 0.85rem;
            padding: 6px 12px;
            border-radius: 6px;
            transition: all 0.2s;
        }

        .hd-back-btn:hover {
            color: var(--hd-gold);
            background: var(--hd-gold-subtle);
        }

        .hd-title {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .hd-title-sigil {
            display: inline-block;
            width: 20px;
            height: 20px;
            background: var(--hd-gold);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A6 6 0 1 0 11.35 10H7v2h1v6h2v-6h2v6h2v-6h1v-2h-2.35zM12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A6 6 0 1 0 11.35 10H7v2h1v6h2v-6h2v6h2v-6h1v-2h-2.35zM12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") center/contain no-repeat;
        }

        .hd-title h1 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--hd-gold);
            letter-spacing: 0.5px;
        }

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

        .hd-theme-btn {
            background: none;
            border: 1px solid rgba(var(--hd-overlay-rgb),0.12);
            border-radius: 6px;
            color: var(--hd-text-muted);
            font-size: 1rem;
            width: 32px;
            height: 32px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .hd-theme-btn:hover {
            color: var(--hd-gold);
            border-color: var(--hd-gold-border);
            background: var(--hd-gold-subtle);
        }

        .hd-user-name {
            font-size: 0.85rem;
            color: var(--hd-text-muted);
        }

        .hd-user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 2px solid var(--hd-gold);
            object-fit: cover;
        }

        .hd-user-avatar-placeholder {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 2px solid var(--hd-gold);
            background: var(--hd-gold-subtle);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--hd-gold);
        }

        /* ═══════════════════════════════════════════════════
           LAYOUT: 3-COLUMN
           ═══════════════════════════════════════════════════ */

        .hd-layout {
            display: grid;
            grid-template-columns: var(--hd-sidebar-w) 1fr var(--hd-right-w);
            min-height: calc(100vh - 65px);
        }

        /* ═══════════════════════════════════════════════════
           SIDEBAR (Left)
           ═══════════════════════════════════════════════════ */

        .hd-sidebar {
            background: var(--hd-card-bg);
            border-right: 1px solid var(--hd-gold-border);
            padding: 20px 0;
            display: flex;
            flex-direction: column;
        }

        .hd-sidebar-title {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--hd-gold);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            padding: 0 20px 12px;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.05);
            margin-bottom: 8px;
        }

        .hd-class-list {
            flex: 1;
            overflow-y: auto;
            padding: 0 10px;
        }

        .hd-class-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            margin-bottom: 4px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            border-left: 3px solid transparent;
        }

        .hd-class-item:hover {
            background: var(--hd-gold-subtle);
        }

        .hd-class-item.active {
            background: var(--hd-gold-subtle);
            border-left-color: var(--hd-gold);
        }

        .hd-class-item-name {
            font-size: 0.85rem;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 180px;
        }

        .hd-class-item-count {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            background: rgba(var(--hd-overlay-rgb),0.05);
            padding: 2px 8px;
            border-radius: 10px;
            flex-shrink: 0;
        }

        .hd-new-class-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin: 12px 16px 0;
            padding: 12px;
            background: transparent;
            border: 1px dashed var(--hd-gold-border);
            border-radius: 8px;
            color: var(--hd-gold);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .hd-new-class-btn:hover {
            background: var(--hd-gold-subtle);
            border-color: var(--hd-gold);
        }

        /* Mobile class selector (hidden on desktop) */
        .hd-mobile-class-select {
            display: none;
        }

        /* ═══════════════════════════════════════════════════
           MAIN AREA (Center)
           ═══════════════════════════════════════════════════ */

        .hd-main {
            padding: 24px;
            overflow-y: auto;
        }

        /* Empty / Welcome State */
        .hd-empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 80px 30px;
        }

        .hd-empty-sigil {
            width: 48px;
            height: 48px;
            margin: 0 auto 20px;
            background: var(--hd-gold);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A6 6 0 1 0 11.35 10H7v2h1v6h2v-6h2v6h2v-6h1v-2h-2.35zM12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A6 6 0 1 0 11.35 10H7v2h1v6h2v-6h2v6h2v-6h1v-2h-2.35zM12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") center/contain no-repeat;
            filter: drop-shadow(0 0 12px rgba(212, 160, 23, 0.4));
        }

        .hd-empty-title {
            font-size: 1.4rem;
            font-weight: 600;
            color: var(--hd-gold);
            margin-bottom: 10px;
        }

        .hd-empty-subtitle {
            font-size: 0.9rem;
            color: var(--hd-text-muted);
            max-width: 400px;
            line-height: 1.6;
            margin-bottom: 30px;
        }

        .hd-empty-create-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 14px 28px;
            background: linear-gradient(135deg, var(--hd-gold), var(--hd-gold-dark));
            color: #000;
            border: none;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.5px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .hd-empty-create-btn:hover {
            background: linear-gradient(135deg, var(--hd-gold-bright), var(--hd-gold));
            box-shadow: 0 4px 20px rgba(212, 160, 23, 0.4);
            transform: translateY(-1px);
        }

        /* Home State */
        .hd-home-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 60px 30px;
        }

        .hd-home-state.hidden {
            display: none;
        }

        .hd-home-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 16px;
            width: 100%;
            max-width: 600px;
            margin-top: 30px;
        }

        .hd-home-stat {
            background: rgba(212, 160, 23, 0.06);
            border: 1px solid var(--hd-gold-border);
            border-radius: 10px;
            padding: 20px 16px;
            text-align: center;
        }

        .hd-home-stat-value {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--hd-gold);
        }

        .hd-home-stat-label {
            font-size: 0.75rem;
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 4px;
        }

        /* Class Detail View */
        .hd-class-detail {
            display: none;
        }

        .hd-class-detail.visible {
            display: block;
        }

        .hd-detail-header {
            margin-bottom: 24px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }

        .hd-detail-header-text {
            flex: 1;
            min-width: 0;
        }

        .hd-detail-name {
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--hd-text);
            margin-bottom: 4px;
        }

        .hd-refresh-btn {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: rgba(168, 85, 247, 0.15);
            border: 1px solid rgba(168, 85, 247, 0.3);
            border-radius: 8px;
            color: #c4b5fd;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .hd-refresh-btn:hover {
            background: rgba(168, 85, 247, 0.25);
            border-color: rgba(168, 85, 247, 0.5);
            color: #e0d5ff;
        }

        .hd-refresh-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .hd-refresh-btn .refresh-icon {
            display: inline-block;
            transition: transform 0.3s;
        }

        .hd-refresh-btn.refreshing .refresh-icon {
            animation: hd-spin 0.8s linear infinite;
        }

        @keyframes hd-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        .hd-detail-desc {
            font-size: 0.85rem;
            color: var(--hd-text-muted);
        }

        /* Stats Grid */
        .hd-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 28px;
        }

        .hd-stat-card {
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 12px;
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 16px;
            border-left: 3px solid var(--hd-gold-border);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .hd-stat-card:hover {
            transform: translateY(-2px);
        }

        .hd-stat-ring {
            flex-shrink: 0;
            width: 56px;
            height: 56px;
        }

        .hd-stat-ring circle {
            fill: none;
            stroke-width: 5;
            stroke-linecap: round;
        }

        .hd-stat-ring .ring-bg {
            stroke: rgba(var(--hd-overlay-rgb),0.06);
        }

        .hd-stat-ring .ring-fill {
            transition: stroke-dashoffset 0.6s ease;
        }

        .hd-stat-text {
            min-width: 0;
        }

        .hd-stat-value {
            font-size: 1.9rem;
            font-weight: 700;
            color: var(--hd-gold);
            margin-bottom: 2px;
            line-height: 1.1;
        }

        .hd-stat-label {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-weight: 500;
        }

        .hd-stat-card.at-risk .hd-stat-value {
            color: #f87171;
        }

        .hd-stat-card.at-risk {
            border-color: rgba(248, 113, 113, 0.3);
            background: rgba(248, 113, 113, 0.05);
        }

        /* Activity Feed */
        .hd-activity-section {
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 24px;
        }

        .hd-activity-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .hd-activity-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .hd-activity-badge {
            background: var(--hd-accent);
            color: #000;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 10px;
        }

        .hd-activity-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .hd-activity-filter {
            background: rgba(var(--hd-overlay-rgb),0.05);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 6px;
            color: var(--hd-text);
            font-size: 0.75rem;
            padding: 4px 8px;
            cursor: pointer;
            min-width: 120px;
        }

        .hd-activity-filter:hover {
            border-color: var(--hd-gold-border);
        }

        .hd-activity-filter:focus {
            outline: none;
            border-color: var(--hd-gold);
        }

        .hd-activity-filter option {
            background: var(--hd-card-bg);
            color: var(--hd-text);
        }

        .hd-activity-feed {
            max-height: 200px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .hd-activity-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px;
            background: rgba(var(--hd-overlay-rgb),0.02);
            border-radius: 6px;
            font-size: 0.8rem;
        }

        .hd-activity-icon {
            font-size: 1rem;
            flex-shrink: 0;
            width: 1.2em;
            text-align: center;
            font-weight: bold;
        }

        .hd-activity-icon.scored {
            color: #4ade80;
        }

        .hd-activity-icon.unscored {
            color: #60a5fa;
        }

        .hd-activity-content {
            flex: 1;
            min-width: 0;
        }

        .hd-activity-text {
            color: var(--hd-text-secondary);
            line-height: 1.4;
        }

        .hd-activity-text strong {
            color: var(--hd-text);
        }

        .hd-activity-time {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            margin-top: 2px;
        }

        .hd-activity-empty {
            text-align: center;
            padding: 20px;
            color: var(--hd-text-muted);
            font-size: 0.8rem;
        }

        /* Student Roster */
        .hd-roster-section {
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 10px;
            padding: 20px;
        }

        .hd-roster-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.5px;
            text-transform: uppercase;
            margin-bottom: 16px;
        }

        .hd-roster-empty {
            text-align: center;
            padding: 40px 20px;
        }

        .hd-roster-empty-icon {
            font-size: 1.2rem;
            margin-bottom: 12px;
            opacity: 0.4;
            color: var(--hd-text-muted);
            letter-spacing: 0.1em;
        }

        .hd-roster-empty-text {
            font-size: 0.85rem;
            color: var(--hd-text-muted);
            line-height: 1.6;
        }

        /* Roster Cards */
        .hd-roster-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.04);
        }

        .hd-roster-card:last-child {
            border-bottom: none;
        }

        .hd-roster-card:hover {
            background: rgba(var(--hd-overlay-rgb),0.02);
            margin: 0 -10px;
            padding: 12px 10px;
            border-radius: 6px;
        }

        .hd-roster-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            flex-shrink: 0;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            color: #fff;
            background: rgba(var(--hd-overlay-rgb),0.1);
        }

        .hd-roster-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .hd-roster-info {
            flex: 1;
            min-width: 0;
        }

        .hd-roster-name {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--hd-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-roster-meta {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 2px;
        }

        .hd-roster-house {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: capitalize;
        }

        .hd-roster-joined {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
        }

        .hd-roster-actions {
            flex-shrink: 0;
        }

        .hd-roster-actions button {
            background: none;
            border: 1px solid transparent;
            color: var(--hd-text-muted);
            font-size: 0.75rem;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .hd-roster-actions button:hover {
            color: var(--hd-danger);
            border-color: rgba(248, 81, 73, 0.3);
            background: rgba(248, 81, 73, 0.1);
        }

        .hd-roster-count {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            margin-bottom: 12px;
        }

        /* Roster Progress Bar */
        .hd-roster-progress {
            margin-top: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .hd-roster-progress-bar {
            flex: 1;
            height: 4px;
            background: rgba(var(--hd-overlay-rgb),0.08);
            border-radius: 2px;
            overflow: hidden;
        }

        .hd-roster-progress-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.4s ease;
        }

        .hd-roster-progress-fill.green { background: #4ade80; }
        .hd-roster-progress-fill.yellow { background: #fbbf24; }
        .hd-roster-progress-fill.red { background: #f87171; }

        .hd-roster-progress-label {
            font-size: 0.65rem;
            font-weight: 600;
            min-width: 32px;
            text-align: right;
        }

        .hd-roster-progress-label.green { color: #4ade80; }
        .hd-roster-progress-label.yellow { color: #fbbf24; }
        .hd-roster-progress-label.red { color: #f87171; }
        .hd-roster-progress-label.none { color: var(--hd-text-muted); }

        .hd-roster-card { cursor: pointer; }

        .hd-roster-active-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.6rem;
            font-weight: 600;
            color: #4ade80;
            background: rgba(74, 222, 128, 0.12);
            padding: 2px 6px;
            border-radius: 8px;
            margin-left: 6px;
        }

        .hd-roster-active-badge::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #4ade80;
            animation: pulse-active 1.5s infinite;
        }

        @keyframes pulse-active {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.4; }
        }

        .hd-roster-anon-badge {
            display: inline-flex;
            align-items: center;
            font-size: 0.6rem;
            font-weight: 600;
            color: #f59e0b;
            background: rgba(245, 158, 11, 0.12);
            padding: 2px 6px;
            border-radius: 8px;
            margin-left: 6px;
        }

        /* Student Detail Modal */
        .hd-student-detail {
            max-width: 900px;
            width: 90%;
        }

        .hd-student-header {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 20px;
        }

        .hd-student-header-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            font-weight: 700;
            color: #fff;
        }

        .hd-student-header-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
        }

        .hd-student-header-info h2 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--hd-text);
            margin-bottom: 2px;
        }

        .hd-student-header-info span {
            font-size: 0.75rem;
            color: var(--hd-text-muted);
        }

        .hd-student-summary {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }

        .hd-student-stat {
            flex: 1;
            text-align: center;
            background: rgba(var(--hd-overlay-rgb),0.03);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 8px;
            padding: 10px 6px;
        }

        .hd-student-stat-value {
            font-size: 1.1rem;
            font-weight: 700;
        }

        .hd-student-stat-label {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            margin-top: 2px;
        }

        .hd-student-assignments-title {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }

        .hd-student-assignment-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.04);
            font-size: 0.8rem;
        }

        .hd-student-assignment-row:last-child {
            border-bottom: none;
        }

        .hd-student-assignment-status {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            flex-shrink: 0;
        }

        .hd-student-assignment-status.done {
            background: rgba(74, 222, 128, 0.15);
            color: #4ade80;
        }

        .hd-student-assignment-status.pending {
            background: rgba(var(--hd-overlay-rgb),0.06);
            color: var(--hd-text-muted);
        }

        .hd-student-assignment-name {
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-student-assignment-score {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            min-width: 40px;
            text-align: right;
        }

        .hd-student-assignment-date {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            min-width: 60px;
            text-align: right;
        }

        .hd-student-no-assignments {
            text-align: center;
            padding: 20px;
            color: var(--hd-text-muted);
            font-size: 0.8rem;
        }

        .hd-student-stat-value.green { color: #4ade80; }
        .hd-student-stat-value.yellow { color: #fbbf24; }
        .hd-student-stat-value.red { color: #f87171; }
        .hd-student-stat-value.none { color: var(--hd-text-muted); }

        .hd-student-assignment-duration {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            min-width: 50px;
            text-align: right;
        }

        .hd-student-assignment-overdue {
            font-size: 0.6rem;
            color: #f87171;
            font-weight: 600;
        }

        /* Path progress bar (inline in student detail) */
        .hd-student-path-progress {
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 1;
            min-width: 80px;
            max-width: 140px;
        }

        .hd-student-path-progress-bar {
            flex: 1;
            height: 6px;
            background: rgba(var(--hd-overlay-rgb),0.08);
            border-radius: 3px;
            overflow: hidden;
        }

        .hd-student-path-progress-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s;
        }

        .hd-student-path-progress-fill.green { background: #4ade80; }
        .hd-student-path-progress-fill.yellow { background: #fbbf24; }
        .hd-student-path-progress-fill.red { background: #f87171; }

        .hd-student-path-progress-label {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            white-space: nowrap;
        }

        /* Expand/collapse chevron */
        .hd-student-chevron {
            cursor: pointer;
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            transition: transform 0.2s;
            flex-shrink: 0;
            width: 16px;
            text-align: center;
        }

        .hd-student-chevron.expanded {
            transform: rotate(90deg);
        }

        /* Module list (hidden by default) */
        .hd-student-module-list {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s ease;
            background: rgba(0,0,0,0.15);
            border-radius: 6px;
            margin: 0 0 4px 0;
        }

        .hd-student-module-list.expanded {
            max-height: 60vh;
            overflow-y: auto;
        }

        .hd-student-module-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            font-size: 0.72rem;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.03);
        }

        .hd-student-module-row:last-child { border-bottom: none; }

        .hd-student-module-status {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.55rem;
            flex-shrink: 0;
        }

        .hd-student-module-status.done {
            background: rgba(74, 222, 128, 0.15);
            color: #4ade80;
        }

        .hd-student-module-status.pending {
            background: rgba(var(--hd-overlay-rgb),0.06);
            color: var(--hd-text-muted);
        }

        .hd-student-module-name {
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-student-module-type {
            font-size: 0.55rem;
            padding: 1px 5px;
            border-radius: 3px;
            background: rgba(var(--hd-overlay-rgb),0.06);
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            flex-shrink: 0;
        }

        .hd-student-module-score {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            min-width: 32px;
            text-align: right;
        }

        .hd-student-module-duration {
            font-size: 0.6rem;
            color: var(--hd-text-muted);
            min-width: 40px;
            text-align: right;
        }

        .hd-student-module-date {
            font-size: 0.6rem;
            color: var(--hd-text-muted);
            min-width: 50px;
            text-align: right;
        }

        /* Path row clickable */
        .hd-student-assignment-row.path-row {
            cursor: pointer;
        }

        .hd-student-assignment-row.path-row:hover {
            background: rgba(var(--hd-overlay-rgb),0.03);
            border-radius: 4px;
        }

        /* At-Risk Stat Card */
        .hd-stat-card.at-risk {
            cursor: pointer;
            border-color: rgba(248, 81, 73, 0.3);
        }

        .hd-stat-card.at-risk:hover {
            background: rgba(248, 81, 73, 0.08);
            border-color: var(--hd-danger);
        }

        /* At-Risk Detail Modal */
        .hd-atrisk-detail {
            max-width: 520px;
            width: 90%;
        }

        .hd-atrisk-title {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--hd-text);
            margin-bottom: 16px;
        }

        .hd-atrisk-list {
            max-height: 400px;
            overflow-y: auto;
        }

        .hd-atrisk-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.04);
            cursor: pointer;
            border-radius: 6px;
            transition: background 0.15s;
        }

        .hd-atrisk-row:hover {
            background: rgba(var(--hd-overlay-rgb),0.04);
        }

        .hd-atrisk-name {
            flex: 1;
            font-size: 0.85rem;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-atrisk-pct {
            font-size: 0.8rem;
            font-weight: 700;
            color: #f87171;
            min-width: 36px;
            text-align: right;
        }

        .hd-atrisk-behind {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            max-width: 180px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ═══════════════════════════════════════════════════
           EARLY WARNING FLAGS
           ═══════════════════════════════════════════════════ */

        .hd-warnings-section {
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 10px;
            padding: 16px 20px;
            margin-bottom: 20px;
        }

        .hd-warnings-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .hd-warnings-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .hd-warnings-icon {
            display: inline-block;
            width: 16px;
            height: 16px;
            background: var(--hd-danger);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E") center/contain no-repeat;
        }

        .hd-warnings-count {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
        }

        .hd-warnings-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: 320px;
            overflow-y: auto;
        }

        .hd-warning-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 0.78rem;
            cursor: pointer;
            transition: background 0.15s;
        }

        .hd-warning-item:hover {
            background: rgba(var(--hd-overlay-rgb),0.04);
        }

        .hd-warning-item.danger {
            background: rgba(248, 81, 73, 0.08);
            border: 1px solid rgba(248, 81, 73, 0.2);
        }

        .hd-warning-item.warning {
            background: rgba(251, 191, 36, 0.08);
            border: 1px solid rgba(251, 191, 36, 0.2);
        }

        .hd-warning-badge {
            flex-shrink: 0;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .hd-warning-badge.danger {
            background: rgba(248, 81, 73, 0.2);
            color: #f87171;
        }

        .hd-warning-badge.warning {
            background: rgba(251, 191, 36, 0.2);
            color: #fbbf24;
        }

        .hd-warning-name {
            flex: 1;
            min-width: 0;
            font-weight: 600;
            color: var(--hd-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-warning-reason {
            flex: 2;
            min-width: 0;
            color: var(--hd-text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-warning-dismiss {
            flex-shrink: 0;
            background: none;
            border: none;
            color: #808080;
            font-size: 14px;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            line-height: 1;
            transition: all 0.15s;
        }

        .hd-warning-dismiss:hover {
            color: var(--hd-text);
            background: rgba(var(--hd-overlay-rgb),0.08);
        }

        /* ═══════════════════════════════════════════════════
           LOWEST QUIZ SCORES
           ═══════════════════════════════════════════════════ */

        .hd-lowest-scores-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: 380px;
            overflow-y: auto;
        }

        .hd-lowest-score-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
        }

        .hd-lowest-score-row:nth-child(odd) {
            background: rgba(var(--hd-overlay-rgb),0.02);
        }

        .hd-lowest-score-rank {
            flex-shrink: 0;
            width: 20px;
            text-align: right;
            color: var(--hd-text-muted);
            font-size: 0.7rem;
        }

        .hd-lowest-score-name {
            flex: 1;
            min-width: 0;
            color: var(--hd-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-lowest-score-avg {
            flex-shrink: 0;
            font-weight: 700;
            font-size: 0.8rem;
            min-width: 40px;
            text-align: right;
        }

        .hd-lowest-score-range {
            flex-shrink: 0;
            color: var(--hd-text-muted);
            font-size: 0.65rem;
            min-width: 60px;
            text-align: right;
        }

        .hd-lowest-score-count {
            flex-shrink: 0;
            color: var(--hd-text-muted);
            font-size: 0.65rem;
            min-width: 24px;
            text-align: right;
        }

        .score-red { color: #f87171; }
        .score-yellow { color: #fbbf24; }
        .score-green { color: #4ade80; }

        /* ═══════════════════════════════════════════════════
           ASSIGNMENT HEALTH TABLE
           ═══════════════════════════════════════════════════ */

        .hd-health-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.75rem;
        }

        .hd-health-table th {
            text-align: left;
            padding: 8px 10px;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            font-weight: 600;
            font-size: 0.68rem;
            text-transform: uppercase;
            color: var(--hd-text-muted);
            letter-spacing: 0.3px;
        }

        .hd-health-table td {
            padding: 7px 10px;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.04);
            color: var(--hd-text);
        }

        .hd-health-table tr:last-child td { border-bottom: none; }

        .hd-health-table tr:hover td { background: rgba(var(--hd-overlay-rgb),0.02); }

        .health-good { color: #4ade80; }
        .health-warn { color: #fbbf24; }
        .health-bad { color: #f87171; }

        /* ═══════════════════════════════════════════════════
           SCORE HEATMAP
           ═══════════════════════════════════════════════════ */

        .hd-heatmap-wrap {
            max-height: 500px;
            overflow: auto;
            position: relative;
        }

        .hd-heatmap-table {
            border-collapse: collapse;
            font-size: 0.68rem;
        }

        .hd-heatmap-table th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: var(--hd-card-bg);
            padding: 4px;
        }

        .hd-heatmap-table th.hd-heatmap-col-header {
            writing-mode: vertical-lr;
            text-orientation: mixed;
            transform: rotate(180deg);
            max-width: 28px;
            height: 100px;
            font-weight: 500;
            color: var(--hd-text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.08);
        }

        .hd-heatmap-table th.hd-heatmap-corner {
            position: sticky;
            left: 0;
            z-index: 3;
        }

        .hd-heatmap-table td.hd-heatmap-name {
            position: sticky;
            left: 0;
            z-index: 1;
            background: var(--hd-card-bg);
            padding: 4px 8px;
            font-weight: 500;
            color: var(--hd-text);
            white-space: nowrap;
            max-width: 140px;
            overflow: hidden;
            text-overflow: ellipsis;
            border-right: 1px solid rgba(var(--hd-overlay-rgb),0.06);
        }

        .hd-heatmap-cell {
            width: 28px;
            height: 28px;
            text-align: center;
            vertical-align: middle;
            border: 1px solid rgba(0,0,0,0.2);
            font-size: 0.6rem;
            font-weight: 600;
            cursor: default;
            position: relative;
        }

        .hd-heatmap-cell[title]:hover::after {
            content: attr(title);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: #222;
            color: #fff;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.65rem;
            white-space: nowrap;
            z-index: 10;
            pointer-events: none;
        }

        .hd-heatmap-legend {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 10px;
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            flex-wrap: wrap;
        }

        .hd-heatmap-legend-swatch {
            display: inline-block;
            width: 16px;
            height: 12px;
            border-radius: 2px;
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
        }

        /* ═══════════════════════════════════════════════════
           COHORT COMPARISON MODAL
           ═══════════════════════════════════════════════════ */

        .hd-cohort-class-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 16px;
        }

        .hd-cohort-class-btn {
            padding: 8px 16px;
            border-radius: 8px;
            border: 1px solid rgba(var(--hd-overlay-rgb),0.12);
            background: rgba(var(--hd-overlay-rgb),0.04);
            color: var(--hd-text);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.15s;
        }

        .hd-cohort-class-btn:hover {
            border-color: var(--hd-gold-border);
        }

        .hd-cohort-class-btn.selected {
            background: var(--hd-gold-subtle);
            border-color: var(--hd-gold);
            color: var(--hd-gold);
        }

        .hd-cohort-compare-btn {
            padding: 10px 24px;
            border-radius: 8px;
            border: none;
            background: var(--hd-gold);
            color: #000;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.15s;
            margin-bottom: 20px;
        }

        .hd-cohort-compare-btn:hover { opacity: 0.9; }
        .hd-cohort-compare-btn:disabled { opacity: 0.4; cursor: default; }

        .hd-cohort-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
        }

        .hd-cohort-table th {
            text-align: left;
            padding: 10px 12px;
            border-bottom: 2px solid rgba(var(--hd-overlay-rgb),0.1);
            font-weight: 600;
            font-size: 0.7rem;
            text-transform: uppercase;
            color: var(--hd-text-muted);
        }

        .hd-cohort-table td {
            padding: 10px 12px;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.05);
            color: var(--hd-text);
        }

        .hd-cohort-table tr:hover td { background: rgba(var(--hd-overlay-rgb),0.02); }

        .hd-cohort-loading {
            text-align: center;
            padding: 30px;
            color: var(--hd-text-muted);
            font-size: 0.85rem;
        }

        /* ═══════════════════════════════════════════════════
           PERFORMANCE TRACKER (Civ-style)
           ═══════════════════════════════════════════════════ */

        .hd-analytics-card-full {
            grid-column: 1 / -1;
        }

        .hd-perf-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 12px;
        }

        .hd-perf-controls {
            display: flex;
            align-items: flex-end;
            gap: 16px;
            flex-wrap: wrap;
        }

        .hd-perf-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .hd-perf-label {
            font-size: 0.6rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--hd-text-muted);
        }

        .hd-perf-toggle {
            display: flex;
            border: 1px solid var(--hd-gold-border);
            border-radius: 6px;
            overflow: hidden;
        }

        .hd-perf-toggle-btn {
            padding: 5px 12px;
            font-size: 0.72rem;
            font-weight: 600;
            background: transparent;
            border: none;
            color: var(--hd-text-muted);
            cursor: pointer;
            transition: all 0.15s;
        }

        .hd-perf-toggle-btn:not(:last-child) {
            border-right: 1px solid var(--hd-gold-border);
        }

        .hd-perf-toggle-btn.active {
            background: var(--hd-gold-subtle);
            color: var(--hd-gold);
        }

        .hd-perf-select {
            padding: 5px 10px;
            font-size: 0.72rem;
            background: var(--hd-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 6px;
            color: var(--hd-text);
            cursor: pointer;
            appearance: auto;
        }

        .hd-perf-chart-wrap {
            height: 320px;
            position: relative;
        }

        /* Time on Task section */
        .hd-tot-summary {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 16px;
        }

        .hd-tot-stat {
            text-align: center;
            padding: 10px 6px;
            background: rgba(var(--hd-overlay-rgb), 0.04);
            border-radius: 8px;
            border: 1px solid rgba(var(--hd-overlay-rgb), 0.06);
        }

        .hd-tot-stat-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--hd-text);
            line-height: 1.2;
        }

        .hd-tot-stat-label {
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--hd-text-muted);
            margin-top: 2px;
        }

        .hd-tot-table-header {
            display: grid;
            grid-template-columns: 1fr 70px 70px 70px 160px 60px;
            gap: 8px;
            padding: 6px 10px;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: var(--hd-text-muted);
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb), 0.1);
        }

        .hd-tot-row {
            display: grid;
            grid-template-columns: 1fr 70px 70px 70px 160px 60px;
            gap: 8px;
            align-items: center;
            padding: 8px 10px;
            font-size: 0.78rem;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb), 0.05);
        }

        .hd-tot-row:hover {
            background: rgba(var(--hd-overlay-rgb), 0.03);
        }

        .hd-tot-row-name {
            font-weight: 600;
            color: var(--hd-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-tot-row-val {
            text-align: center;
            color: var(--hd-text-muted);
        }

        .hd-tot-range {
            position: relative;
            height: 10px;
            background: rgba(var(--hd-overlay-rgb), 0.06);
            border-radius: 5px;
            overflow: visible;
        }

        .hd-tot-range-bar {
            position: absolute;
            top: 0;
            height: 100%;
            background: linear-gradient(90deg, #4ade80, #fbbf24);
            border-radius: 5px;
            min-width: 4px;
        }

        .hd-tot-range-avg {
            position: absolute;
            top: -3px;
            width: 2px;
            height: 16px;
            background: var(--hd-gold);
            border-radius: 1px;
        }

        .hd-tot-outlier {
            display: inline-block;
            padding: 2px 6px;
            font-size: 0.62rem;
            font-weight: 700;
            border-radius: 4px;
            text-align: center;
        }

        .hd-tot-outlier-slow {
            background: rgba(248, 113, 113, 0.15);
            color: #f87171;
        }

        .hd-tot-outlier-fast {
            background: rgba(74, 222, 128, 0.15);
            color: #4ade80;
        }

        .hd-tot-chart-wrap {
            height: 320px;
            position: relative;
        }

        @media (max-width: 600px) {
            .hd-tot-summary {
                grid-template-columns: repeat(2, 1fr);
            }
            .hd-tot-table-header,
            .hd-tot-row {
                grid-template-columns: 1fr 55px 55px 55px 100px 50px;
                font-size: 0.68rem;
            }
        }

        .hd-perf-empty {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 320px;
            color: var(--hd-text-muted);
            font-size: 0.8rem;
        }

        /* ═══════════════════════════════════════════════════
           RIGHT PANEL
           ═══════════════════════════════════════════════════ */

        .hd-right {
            background: var(--hd-card-bg);
            border-left: 1px solid var(--hd-gold-border);
            padding: 24px 20px;
            display: none;
        }

        .hd-right.visible {
            display: block;
        }

        .hd-right-section {
            margin-bottom: 28px;
        }

        .hd-right-label {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--hd-text-muted);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            margin-bottom: 12px;
        }

        /* Class Code Display */
        .hd-code-display {
            background: var(--hd-bg);
            border: 1px solid var(--hd-gold-border);
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            margin-bottom: 12px;
        }

        .hd-code-text {
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--hd-gold);
            letter-spacing: 3px;
            text-shadow: 0 0 12px rgba(212, 160, 23, 0.3);
        }

        .hd-copy-btn {
            width: 100%;
            padding: 10px;
            background: var(--hd-gold-subtle);
            border: 1px solid var(--hd-gold-border);
            border-radius: 8px;
            color: var(--hd-gold);
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .hd-copy-btn:hover {
            background: rgba(212, 160, 23, 0.25);
            border-color: var(--hd-gold);
        }

        .hd-copy-btn.copied {
            background: rgba(212, 160, 23, 0.3);
            color: var(--hd-gold-bright);
        }

        /* Class Settings */
        .hd-settings-btn {
            display: block;
            width: 100%;
            padding: 10px;
            margin-bottom: 8px;
            background: transparent;
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 8px;
            color: var(--hd-text);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .hd-settings-btn:hover {
            background: rgba(var(--hd-overlay-rgb),0.05);
            border-color: rgba(var(--hd-overlay-rgb),0.2);
        }

        .hd-settings-btn.danger {
            color: var(--hd-danger);
            border-color: rgba(248, 81, 73, 0.2);
        }

        .hd-settings-btn.danger:hover {
            background: rgba(248, 81, 73, 0.1);
            border-color: var(--hd-danger);
        }

        /* ═══════════════════════════════════════════════════
           ANALYTICS SECTION
           ═══════════════════════════════════════════════════ */

        .hd-analytics-section {
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 14px;
            padding: 24px;
            margin-bottom: 24px;
        }

        .hd-analytics-header {
            margin-bottom: 20px;
        }

        .hd-analytics-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .hd-donut-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-bottom: 24px;
        }

        .hd-donut-card {
            background: rgba(var(--hd-overlay-rgb),0.02);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .hd-donut-card:hover {
            transform: translateY(-1px);
        }

        .hd-donut-card-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--hd-text-muted);
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .hd-donut-wrap {
            height: 200px;
            position: relative;
        }

        .hd-analytics-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 24px;
        }

        .hd-analytics-card {
            background: rgba(var(--hd-overlay-rgb),0.02);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 12px;
            padding: 20px;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .hd-analytics-card:hover {
            transform: translateY(-1px);
        }

        .hd-analytics-card-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--hd-text-muted);
            margin-bottom: 14px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .hd-analytics-chart-wrap {
            height: 260px;
            position: relative;
        }

        .hd-analytics-empty {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--hd-text-muted);
            font-size: 0.8rem;
        }

        .hd-grade-table-wrap {
            max-height: 280px;
            overflow-y: auto;
        }
        .hd-grade-table {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .hd-grade-row {
            display: grid;
            grid-template-columns: 1fr 42px 42px 42px 100px;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            background: rgba(var(--hd-overlay-rgb),0.03);
            border-radius: 6px;
            font-size: 0.75rem;
        }
        .hd-grade-row-name {
            color: #ccc;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .hd-grade-stat {
            text-align: center;
            font-weight: 600;
            font-size: 0.7rem;
        }
        .hd-grade-stat-label {
            display: block;
            font-size: 0.55rem;
            font-weight: 400;
            color: var(--hd-text-muted);
            margin-bottom: 1px;
        }
        .hd-grade-bar {
            display: flex;
            height: 14px;
            border-radius: 3px;
            overflow: hidden;
        }
        .hd-grade-bar span {
            display: block;
            height: 100%;
        }
        .hd-grade-none {
            color: var(--hd-text-muted);
            font-style: italic;
            grid-column: 2 / -1;
            text-align: center;
            font-size: 0.65rem;
        }

        /* Leaderboard */
        .hd-leaderboard-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            cursor: pointer;
        }

        .hd-leaderboard-toggle input {
            accent-color: var(--hd-gold);
        }

        .hd-leaderboard-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .hd-leaderboard-empty {
            text-align: center;
            padding: 20px;
            color: var(--hd-text-muted);
            font-size: 0.8rem;
        }

        .hd-leaderboard-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            background: rgba(var(--hd-overlay-rgb),0.02);
            border-radius: 6px;
        }

        .hd-leaderboard-item.top-1 { background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.2); }
        .hd-leaderboard-item.top-2 { background: rgba(192, 192, 192, 0.08); border: 1px solid rgba(192, 192, 192, 0.15); }
        .hd-leaderboard-item.top-3 { background: rgba(205, 127, 50, 0.08); border: 1px solid rgba(205, 127, 50, 0.15); }

        .hd-leaderboard-rank {
            min-width: 28px;
            text-align: center;
        }

        .hd-rank-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            font-size: 0.7rem;
            font-weight: 700;
            color: #000;
        }

        .hd-rank-badge.rank-1 {
            background: linear-gradient(135deg, #ffd700, #f0c030);
            box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
        }

        .hd-rank-badge.rank-2 {
            background: linear-gradient(135deg, #e0e0e0, #c0c0c0);
            box-shadow: 0 0 6px rgba(192, 192, 192, 0.3);
        }

        .hd-rank-badge.rank-3 {
            background: linear-gradient(135deg, #e8a050, #cd7f32);
            box-shadow: 0 0 6px rgba(205, 127, 50, 0.3);
        }

        .hd-rank-badge.rank-default {
            background: rgba(var(--hd-overlay-rgb),0.08);
            color: var(--hd-text-muted);
        }

        .hd-leaderboard-name {
            flex: 1;
            font-size: 0.85rem;
            color: var(--hd-text);
        }

        .hd-leaderboard-score {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--hd-gold);
        }

        .hd-leaderboard-pct {
            font-size: 0.7rem;
            color: var(--hd-text-muted);
            min-width: 40px;
            text-align: right;
        }

        /* ═══════════════════════════════════════════════════
           MODALS
           ═══════════════════════════════════════════════════ */

        .hd-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10001;
            backdrop-filter: blur(6px);
            animation: hdFadeIn 0.25s ease;
        }

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

        .hd-overlay.fade-out {
            opacity: 0;
            transition: opacity 0.25s ease;
        }

        .hd-modal {
            background: #12121e;
            border: 1px solid var(--hd-gold-border);
            border-radius: 12px;
            padding: 30px;
            width: 90%;
            max-width: 900px;
            max-height: 85vh;
            overflow-y: auto;
            position: relative;
        }

        .hd-modal-close {
            position: absolute;
            top: 12px; right: 15px;
            background: none;
            border: none;
            color: #8a8a8a;
            font-size: 22px;
            cursor: pointer;
            line-height: 1;
        }

        .hd-modal-close:hover {
            color: var(--hd-gold);
        }

        .hd-modal-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--hd-gold);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .hd-input-group {
            margin-bottom: 16px;
        }

        .hd-input-label {
            display: block;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--hd-text-muted);
            letter-spacing: 0.5px;
            margin-bottom: 6px;
            text-transform: uppercase;
        }

        .hd-input {
            width: 100%;
            padding: 12px;
            background: var(--hd-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 6px;
            color: var(--hd-text);
            font-size: 0.9rem;
            transition: border-color 0.2s;
        }

        .hd-input:focus {
            outline: none;
            border-color: var(--hd-gold);
            box-shadow: 0 0 8px rgba(212, 160, 23, 0.2);
        }

        .hd-input::placeholder {
            color: #808080;
        }

        .hd-input-hint {
            font-size: 0.7rem;
            color: #808080;
            margin-top: 4px;
        }

        textarea.hd-input {
            resize: vertical;
            min-height: 70px;
            font-family: inherit;
        }

        .hd-modal-actions {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }

        .hd-btn {
            flex: 1;
            padding: 12px;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .hd-btn-primary {
            background: linear-gradient(135deg, var(--hd-gold), var(--hd-gold-dark));
            color: #000;
            border: none;
        }

        .hd-btn-primary:hover {
            background: linear-gradient(135deg, var(--hd-gold-bright), var(--hd-gold));
            box-shadow: 0 4px 15px rgba(212, 160, 23, 0.3);
        }

        .hd-btn-primary:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .hd-btn-secondary {
            background: transparent;
            border: 1px solid rgba(var(--hd-overlay-rgb),0.15);
            color: var(--hd-text-muted);
        }

        .hd-btn-secondary:hover {
            border-color: rgba(var(--hd-overlay-rgb),0.3);
            color: var(--hd-text);
        }

        .hd-btn-danger {
            background: transparent;
            border: 1px solid var(--hd-danger);
            color: var(--hd-danger);
        }

        .hd-btn-danger:hover {
            background: rgba(248, 81, 73, 0.15);
        }

        /* Success state in create modal */
        .hd-create-success {
            text-align: center;
            padding: 10px 0;
        }

        .hd-create-success-icon {
            width: 36px;
            height: 36px;
            margin: 0 auto 12px;
            background: var(--hd-gold);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A6 6 0 1 0 11.35 10H7v2h1v6h2v-6h2v6h2v-6h1v-2h-2.35zM12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A6 6 0 1 0 11.35 10H7v2h1v6h2v-6h2v6h2v-6h1v-2h-2.35zM12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8z'/%3E%3C/svg%3E") center/contain no-repeat;
        }

        .hd-create-success-msg {
            font-size: 0.9rem;
            color: var(--hd-text);
            margin-bottom: 16px;
        }

        .hd-create-success-code {
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            font-size: 2rem;
            font-weight: 700;
            color: var(--hd-gold);
            letter-spacing: 3px;
            text-shadow: 0 0 12px rgba(212, 160, 23, 0.3);
            margin-bottom: 16px;
        }

        /* Error message */
        .hd-error {
            color: var(--hd-danger);
            font-size: 0.8rem;
            margin-top: 8px;
            display: none;
        }

        /* Delete confirmation */
        .hd-delete-warning {
            font-size: 0.9rem;
            color: var(--hd-text-muted);
            line-height: 1.6;
            margin-bottom: 12px;
        }

        .hd-delete-class-name {
            color: var(--hd-text);
            font-weight: 600;
        }

        /* Loading spinner */
        .hd-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(212, 160, 23, 0.3);
            border-top-color: var(--hd-gold);
            border-radius: 50%;
            animation: hdSpin 0.6s linear infinite;
        }

        @keyframes hdSpin {
            to { transform: rotate(360deg); }
        }

        /* Toast notification */
        .hd-toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(80px);
            background: var(--hd-card-bg);
            border: 1px solid var(--hd-gold-border);
            border-radius: 8px;
            padding: 12px 24px;
            font-size: 0.85rem;
            color: var(--hd-gold);
            z-index: 10002;
            transition: transform 0.3s ease;
            pointer-events: none;
        }

        .hd-toast.show {
            transform: translateX(-50%) translateY(0);
        }

        /* ═══════════════════════════════════════════════════
           RESPONSIVE
           ═══════════════════════════════════════════════════ */

        @media (max-width: 1200px) {
            .hd-layout {
                grid-template-columns: var(--hd-sidebar-w) 1fr;
            }

            .hd-right {
                border-left: none;
                border-top: 1px solid var(--hd-gold-border);
            }

            .hd-right.visible {
                display: block;
                grid-column: 1 / -1;
            }

            .hd-donut-row {
                grid-template-columns: repeat(2, 1fr);
            }

            .hd-donut-row > :nth-child(3) {
                grid-column: 1 / -1;
            }
        }

        /* ═══════════════════════════════════════════════════
           AI EXPLOIT LAB ANALYTICS
           ═══════════════════════════════════════════════════ */

        .hd-ailab-section {
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 14px;
            padding: 24px;
            margin-bottom: 24px;
        }

        .hd-ailab-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            cursor: pointer;
            user-select: none;
        }

        .hd-ailab-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .hd-ailab-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .hd-ailab-badge {
            font-size: 0.6rem;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 4px;
            background: rgba(212, 160, 23, 0.15);
            color: var(--hd-gold);
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .hd-ailab-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .hd-ailab-chevron {
            display: inline-block;
            width: 18px;
            height: 18px;
            color: var(--hd-text-muted);
            transition: transform 0.2s ease;
        }

        .hd-ailab-chevron.collapsed {
            transform: rotate(-90deg);
        }

        .hd-ailab-body {
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .hd-ailab-body.collapsed {
            max-height: 0 !important;
            overflow: hidden;
        }

        .hd-ailab-stats-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }

        .hd-ailab-stat {
            background: rgba(var(--hd-overlay-rgb),0.02);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 10px;
            padding: 16px;
            text-align: center;
        }

        .hd-ailab-stat-value {
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--hd-gold);
            line-height: 1.2;
        }

        .hd-ailab-stat-label {
            font-size: 0.68rem;
            color: var(--hd-text-muted);
            margin-top: 4px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .hd-ailab-table-wrap {
            margin-bottom: 24px;
        }

        .hd-ailab-table-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--hd-text-muted);
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .hd-ailab-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.78rem;
        }

        .hd-ailab-table th {
            text-align: left;
            padding: 8px 12px;
            font-size: 0.68rem;
            font-weight: 600;
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.08);
        }

        .hd-ailab-table td {
            padding: 8px 12px;
            color: var(--hd-text);
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.04);
        }

        .hd-ailab-table tr:hover td {
            background: rgba(var(--hd-overlay-rgb),0.03);
        }

        .hd-ailab-hardest {
            display: inline-block;
            font-size: 0.6rem;
            font-weight: 600;
            padding: 1px 6px;
            border-radius: 3px;
            background: rgba(248, 81, 73, 0.12);
            color: var(--hd-danger);
            text-transform: uppercase;
            margin-left: 6px;
        }

        .hd-ailab-student-row {
            cursor: pointer;
        }

        .hd-ailab-student-row td:first-child {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .hd-ailab-expand-icon {
            display: inline-block;
            width: 14px;
            height: 14px;
            color: var(--hd-text-muted);
            transition: transform 0.15s ease;
            flex-shrink: 0;
        }

        .hd-ailab-expand-icon.open {
            transform: rotate(90deg);
        }

        .hd-ailab-detail-row td {
            padding: 6px 12px 6px 32px;
            font-size: 0.72rem;
            color: var(--hd-text-muted);
            background: rgba(var(--hd-overlay-rgb),0.02);
        }

        .hd-ailab-score-bar {
            display: inline-block;
            height: 6px;
            border-radius: 3px;
            background: var(--hd-gold);
            vertical-align: middle;
            margin-right: 6px;
        }

        .hd-ailab-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px;
            color: var(--hd-text-muted);
            font-size: 0.8rem;
            gap: 8px;
        }

        .hd-ailab-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(var(--hd-overlay-rgb),0.1);
            border-top-color: var(--hd-gold);
            border-radius: 50%;
            animation: hd-ailab-spin 0.6s linear infinite;
        }

        @keyframes hd-ailab-spin {
            to { transform: rotate(360deg); }
        }

        @media (max-width: 768px) {
            .hd-ailab-stats-row {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* ═══════════════════════════════════════════════════
           ASSIGNMENTS SECTION
           ═══════════════════════════════════════════════════ */

        /* Handler Comms (F-27) */
        .hd-comms-section {
            margin-bottom: 30px;
        }

        .hd-comms-header {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }

        .hd-comms-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .hd-comms-compose {
            background: rgba(245, 158, 11, 0.05);
            border: 1px solid rgba(245, 158, 11, 0.2);
            border-radius: 6px;
            padding: 14px;
            margin-bottom: 12px;
        }

        .hd-comms-row { margin-bottom: 10px; }
        .hd-comms-row:last-child { margin-bottom: 0; }

        .hd-comms-label {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #f59e0b;
            margin-right: 8px;
        }

        .hd-comms-select {
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.15);
            color: #e2e8f0;
            padding: 6px 10px;
            border-radius: 4px;
            font-family: 'Courier New', monospace;
            font-size: 0.8rem;
            min-width: 200px;
        }

        .hd-comms-textarea {
            width: 100%;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.15);
            color: #e2e8f0;
            padding: 8px 10px;
            border-radius: 4px;
            font-family: 'Courier New', monospace;
            font-size: 0.8rem;
            resize: vertical;
            min-height: 60px;
            box-sizing: border-box;
        }

        .hd-comms-textarea:focus {
            outline: none;
            border-color: #f59e0b;
        }

        .hd-comms-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .hd-comms-charcount {
            font-size: 0.65rem;
            color: #808080;
            font-family: 'Courier New', monospace;
        }

        .hd-comms-send-btn {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: #000;
            font-weight: 700;
            font-size: 0.7rem;
            letter-spacing: 0.5px;
        }

        .hd-comms-send-btn:hover { filter: brightness(1.1); }

        .hd-comms-sent-title {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #f59e0b;
            margin-bottom: 8px;
        }

        .hd-comms-sent-empty {
            font-size: 0.75rem;
            color: #808080;
            text-align: center;
            padding: 12px 0;
        }

        .hd-comms-sent-item {
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 6px;
            padding: 10px 12px;
            margin-bottom: 8px;
        }

        .hd-comms-sent-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
        }

        .hd-comms-sent-to {
            font-size: 0.7rem;
            font-weight: 700;
            color: #f59e0b;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .hd-comms-sent-time {
            font-size: 0.65rem;
            color: #8a8a8a;
        }

        .hd-comms-sent-text {
            font-size: 0.8rem;
            color: #ccc;
            line-height: 1.4;
            margin-bottom: 4px;
        }

        .hd-comms-sent-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .hd-comms-sent-read {
            font-size: 0.65rem;
            color: #808080;
        }

        .hd-comms-delete-btn {
            background: none;
            border: 1px solid rgba(248, 113, 113, 0.3);
            color: #f87171;
            font-size: 0.9rem;
            line-height: 1;
            padding: 2px 6px;
            border-radius: 4px;
            cursor: pointer;
            opacity: 0.5;
            transition: opacity 0.15s;
        }

        .hd-comms-sent-item:hover .hd-comms-delete-btn { opacity: 1; }
        .hd-comms-delete-btn:hover { background: rgba(248, 113, 113, 0.15); }

        .hd-assignments-section {
            margin-bottom: 30px;
        }

        .hd-assignments-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .hd-assignments-title {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--hd-text);
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .hd-btn-sm {
            flex: none;
            padding: 8px 14px;
            font-size: 0.75rem;
        }

        .hd-btn-outline {
            background: transparent;
            border: 1px solid var(--hd-border, rgba(255,255,255,0.12));
            color: var(--hd-text-muted, #888);
        }
        .hd-btn-outline:hover {
            border-color: var(--hd-gold, #d4a017);
            color: var(--hd-gold, #d4a017);
        }

        .hd-roster-pagination {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 0 4px;
            justify-content: center;
        }

        .hd-roster-page-info {
            font-size: 0.8rem;
            color: var(--hd-text-muted, #888);
            min-width: 80px;
            text-align: center;
        }

        .hd-assignment-card {
            background: var(--hd-card-bg);
            border: 1px solid var(--hd-gold-border);
            border-radius: 10px;
            padding: 16px 18px;
            margin-bottom: 10px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            position: relative;
            transition: border-color 0.2s;
        }

        .hd-assignment-card:hover {
            border-color: var(--hd-gold);
        }

        .hd-assignment-icon {
            font-size: 1.2rem;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .hd-assignment-info {
            flex: 1;
            min-width: 0;
        }

        .hd-assignment-name {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--hd-text);
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .hd-assignment-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            font-size: 0.7rem;
            color: var(--hd-text-muted);
        }

        .hd-assignment-meta span {
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }

        .hd-assignment-badge {
            display: inline-block;
            padding: 1px 7px;
            border-radius: 4px;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .hd-assignment-badge.path { background: rgba(212,160,23,0.15); color: var(--hd-gold); }
        .hd-assignment-badge.item { background: rgba(var(--hd-overlay-rgb),0.08); color: var(--hd-text-muted); }

        .hd-assignment-delete {
            position: absolute;
            top: 12px;
            right: 12px;
            background: none;
            border: none;
            color: #808080;
            font-size: 16px;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            line-height: 1;
            transition: all 0.2s;
        }

        .hd-assignment-delete:hover {
            color: var(--hd-danger);
            background: rgba(248, 81, 73, 0.1);
        }

        .hd-assignment-completion {
            color: #4ade80;
            font-size: 0.7rem;
            background: rgba(74, 222, 128, 0.1);
            padding: 2px 8px;
            border-radius: 10px;
            border: 1px solid rgba(74, 222, 128, 0.2);
        }

        .hd-assignment-empty {
            text-align: center;
            padding: 30px 20px;
            font-size: 0.85rem;
            color: var(--hd-text-muted);
            background: var(--hd-card-bg);
            border: 1px dashed rgba(var(--hd-overlay-rgb),0.08);
            border-radius: 10px;
        }

        .hd-assignment-notes {
            font-size: 0.75rem;
            color: var(--hd-text-muted);
            font-style: italic;
            margin-top: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ═══════════════════════════════════════════════════
           CONTENT BROWSER MODAL
           ═══════════════════════════════════════════════════ */

        .cb-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.92);
            z-index: 10001;
            display: flex;
            flex-direction: column;
            animation: hdFadeIn 0.25s ease;
        }

        .cb-overlay.fade-out {
            opacity: 0;
            transition: opacity 0.25s ease;
        }

        .cb-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 24px;
            border-bottom: 1px solid var(--hd-gold-border);
            background: var(--hd-card-bg);
            flex-shrink: 0;
        }

        .cb-header-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--hd-gold);
        }

        .cb-close {
            background: none;
            border: none;
            color: #8a8a8a;
            font-size: 24px;
            cursor: pointer;
            line-height: 1;
            padding: 4px 8px;
        }

        .cb-close:hover { color: var(--hd-gold); }

        .cb-tabs {
            display: flex;
            background: var(--hd-card-bg);
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            flex-shrink: 0;
        }

        .cb-tab {
            flex: 1;
            padding: 12px 20px;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            color: var(--hd-text-muted);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .cb-tab:hover { color: var(--hd-text); }

        .cb-tab.active {
            color: var(--hd-gold);
            border-bottom-color: var(--hd-gold);
        }

        .cb-filters {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 24px;
            background: var(--hd-bg);
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.06);
            flex-shrink: 0;
            flex-wrap: wrap;
        }

        .cb-filter-select {
            padding: 8px 12px;
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 6px;
            color: var(--hd-text);
            font-size: 0.8rem;
            cursor: pointer;
            appearance: none;
            padding-right: 28px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
        }

        .cb-filter-select:focus {
            outline: none;
            border-color: var(--hd-gold);
        }

        .cb-search {
            flex: 1;
            min-width: 160px;
            padding: 8px 12px;
            background: var(--hd-card-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 6px;
            color: var(--hd-text);
            font-size: 0.8rem;
        }

        .cb-search::placeholder { color: #808080; }
        .cb-search:focus {
            outline: none;
            border-color: var(--hd-gold);
        }

        .cb-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px 24px;
        }

        .cb-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 14px;
        }

        .cb-card {
            background: var(--hd-card-bg);
            border: 2px solid rgba(var(--hd-overlay-rgb),0.06);
            border-radius: 10px;
            padding: 16px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .cb-card:hover {
            border-color: rgba(212,160,23,0.4);
            background: rgba(18, 18, 42, 0.9);
        }

        .cb-card.selected {
            border-color: var(--hd-gold);
            background: var(--hd-gold-subtle);
        }

        .cb-card.selected::after {
            content: '\2713';
            position: absolute;
            top: 8px;
            right: 10px;
            color: var(--hd-gold);
            font-size: 1rem;
            font-weight: 700;
        }

        .cb-card-icon {
            font-size: 1.5rem;
            margin-bottom: 8px;
        }

        .cb-card-title {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--hd-text);
            margin-bottom: 4px;
            line-height: 1.3;
        }

        .cb-card-desc {
            font-size: 0.72rem;
            color: var(--hd-text-muted);
            margin-bottom: 8px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .cb-card-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
        }

        .cb-badge {
            display: inline-block;
            padding: 2px 7px;
            border-radius: 4px;
            font-size: 0.6rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .cb-badge-house {
            color: #fff;
        }

        .cb-badge-type {
            background: rgba(var(--hd-overlay-rgb),0.08);
            color: var(--hd-text-muted);
        }

        .cb-badge-diff {
            background: rgba(var(--hd-overlay-rgb),0.05);
            color: #777;
        }

        .cb-badge-count {
            background: rgba(212,160,23,0.12);
            color: var(--hd-gold);
        }

        .cb-footer {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 24px;
            background: var(--hd-card-bg);
            border-top: 1px solid var(--hd-gold-border);
            flex-shrink: 0;
            flex-wrap: wrap;
        }

        .cb-footer-count {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--hd-gold);
            white-space: nowrap;
        }

        .cb-footer-field {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.75rem;
            color: var(--hd-text-muted);
        }

        .cb-footer-field label {
            white-space: nowrap;
        }

        .cb-footer-input {
            padding: 6px 10px;
            background: var(--hd-bg);
            border: 1px solid rgba(var(--hd-overlay-rgb),0.1);
            border-radius: 5px;
            color: var(--hd-text);
            font-size: 0.8rem;
        }

        .cb-footer-input:focus {
            outline: none;
            border-color: var(--hd-gold);
        }

        input[type="date"].cb-footer-input {
            color-scheme: dark;
        }

        .cb-notes-input {
            flex: 1;
            min-width: 120px;
            max-width: 300px;
        }

        .cb-footer-actions {
            display: flex;
            gap: 8px;
            margin-left: auto;
        }

        .cb-footer-actions .hd-btn {
            flex: none;
            padding: 8px 20px;
            font-size: 0.8rem;
        }

        .cb-section-label {
            font-size: 0.65rem;
            font-weight: 700;
            color: var(--hd-text-muted);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            margin-bottom: 14px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(var(--hd-overlay-rgb),0.06);
        }

        .cb-section-label:not(:first-child) {
            margin-top: 28px;
        }

        .cb-empty {
            text-align: center;
            padding: 60px 20px;
            color: var(--hd-text-muted);
            font-size: 0.85rem;
        }

        @media (max-width: 768px) {
            .hd-layout {
                grid-template-columns: 1fr;
            }

            .hd-sidebar {
                display: none;
            }

            .hd-mobile-class-select {
                display: block;
                padding: 12px 16px;
                background: var(--hd-card-bg);
                border-bottom: 1px solid var(--hd-gold-border);
            }

            .hd-mobile-select {
                width: 100%;
                padding: 10px 12px;
                background: var(--hd-bg);
                border: 1px solid var(--hd-gold-border);
                border-radius: 6px;
                color: var(--hd-text);
                font-size: 0.9rem;
                appearance: none;
                cursor: pointer;
            }

            .hd-mobile-select-wrap {
                position: relative;
            }

            .hd-mobile-select-wrap::after {
                content: '\25BC';
                position: absolute;
                right: 12px;
                top: 50%;
                transform: translateY(-50%);
                color: var(--hd-gold);
                font-size: 0.7rem;
                pointer-events: none;
            }

            .hd-right.visible {
                grid-column: 1;
            }

            .hd-stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .hd-header-right .hd-user-name {
                display: none;
            }

            .hd-student-summary {
                grid-template-columns: repeat(3, 1fr);
            }

            .hd-perf-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .hd-perf-controls {
                width: 100%;
            }

            .hd-perf-chart-wrap {
                height: 260px;
            }

            .hd-donut-row {
                grid-template-columns: 1fr;
            }

            .hd-donut-row > :nth-child(3) {
                grid-column: auto;
            }

            .hd-analytics-grid {
                grid-template-columns: 1fr;
            }

            .hd-warnings-list {
                max-height: 200px;
            }

            .hd-heatmap-cell {
                width: 24px;
                height: 24px;
                font-size: 0.55rem;
            }

            .hd-health-table .hd-health-median {
                display: none;
            }
        }

        /* ═══════════════════════════════════════════════════
           CLASS REPORT (Print-Friendly)
           ═══════════════════════════════════════════════════ */

        .hd-report-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: #fff;
            z-index: 20000;
            overflow-y: auto;
            color: #1a1a1a;
        }

        .hd-report {
            max-width: 800px;
            margin: 0 auto;
            padding: 40px 32px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }

        .hd-report-toolbar {
            display: flex;
            gap: 10px;
            margin-bottom: 24px;
        }

        .hd-report-toolbar button {
            padding: 8px 20px;
            border-radius: 6px;
            border: 1px solid #ccc;
            background: #f5f5f5;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
        }

        .hd-report-toolbar button:hover { background: #e8e8e8; }

        .hd-report-toolbar .primary {
            background: var(--hd-gold);
            color: #000;
            border-color: var(--hd-gold);
        }

        .hd-report h2 {
            font-size: 1.4rem;
            margin-bottom: 4px;
            color: #111;
        }

        .hd-report .report-subtitle {
            font-size: 0.8rem;
            color: #8a8a8a;
            margin-bottom: 24px;
        }

        .hd-report-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 28px;
        }

        .hd-report-stat {
            text-align: center;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 14px 8px;
        }

        .hd-report-stat-value {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .hd-report-stat-label {
            font-size: 0.7rem;
            color: #888;
            margin-top: 2px;
        }

        .hd-report-section-title {
            font-size: 0.85rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #808080;
            margin-bottom: 10px;
            padding-bottom: 6px;
            border-bottom: 2px solid #e0e0e0;
        }

        .hd-report-section { margin-bottom: 28px; }

        .hd-report table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
        }

        .hd-report th {
            text-align: left;
            padding: 8px 10px;
            border-bottom: 2px solid #ccc;
            font-weight: 600;
            font-size: 0.7rem;
            text-transform: uppercase;
            color: #808080;
        }

        .hd-report td {
            padding: 7px 10px;
            border-bottom: 1px solid #eee;
        }

        .hd-report tr:last-child td { border-bottom: none; }

        .report-tag {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.7rem;
            font-weight: 600;
        }

        .report-tag.green { background: #dcfce7; color: #166534; }
        .report-tag.yellow { background: #fef9c3; color: #854d0e; }
        .report-tag.red { background: #fee2e2; color: #991b1b; }
        .report-tag.gray { background: #f3f4f6; color: #6b7280; }

        .hd-report-alert {
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 0.8rem;
            margin-bottom: 12px;
        }

        .hd-report-alert.warning {
            background: #fef3c7;
            border: 1px solid #fbbf24;
            color: #92400e;
        }

        .hd-report-alert.success {
            background: #dcfce7;
            border: 1px solid #4ade80;
            color: #166534;
        }

        .hd-report-footer {
            margin-top: 32px;
            padding-top: 16px;
            border-top: 1px solid #e0e0e0;
            font-size: 0.7rem;
            color: #aaa;
            text-align: center;
        }

        @media print {
            body > *:not(.hd-report-overlay) { display: none !important; }
            .hd-report-overlay { position: static; overflow: visible; }
            .hd-report-toolbar { display: none !important; }
            .hd-report { padding: 0; }
            .hd-report-stat { border: 1px solid #ccc; }
            .report-tag { border: 1px solid #ccc; }
        }

        /* ── View Engine Breadcrumb ──────────────────────────────── */
        .hd-breadcrumb {
            padding: 8px 20px;
            font-size: 0.75rem;
            letter-spacing: 0.04em;
            background: var(--hd-card-bg, #1e1e2e);
            border-bottom: 1px solid var(--hd-border, rgba(255,255,255,0.06));
        }
        .hd-crumb { color: var(--hd-accent, #d4a017); cursor: pointer; }
        .hd-crumb:hover { text-decoration: underline; }
        .hd-crumb-current { color: var(--hd-text, #e0e0e0); }

        /* ═══════════════════════════════════════════════════════════════
           DRILL-DOWN VIEWS (Wave 24b)
           ═══════════════════════════════════════════════════════════════ */

        .hd-stat-clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
        .hd-stat-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

        .hd-drilldown { padding: 20px; }
        .hd-drilldown-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
        .hd-drilldown-title { font-size: 1.1rem; font-weight: 600; color: var(--hd-text, #e0e0e0); margin: 0; }

        .hd-drill-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
        .hd-drill-table th { text-align: left; padding: 8px 12px; color: var(--hd-text-muted, #888); font-weight: 500; border-bottom: 1px solid var(--hd-border, rgba(255,255,255,0.06)); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; }
        .hd-drill-table td { padding: 8px 12px; border-bottom: 1px solid var(--hd-border, rgba(255,255,255,0.04)); color: var(--hd-text, #e0e0e0); }
        .hd-drill-table tr:hover { background: var(--hd-row-hover, rgba(255,255,255,0.02)); }

        .hd-drill-charts { display: flex; justify-content: center; margin: 16px 0; }
        .hd-drill-chart-wrap { min-width: 160px; min-height: 160px; display: flex; align-items: center; justify-content: center; }

        .hd-drill-subtitle { font-size: 0.75rem; font-weight: 600; color: var(--hd-text-muted, #888); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.06em; }

        .hd-drill-bars { display: flex; flex-direction: column; gap: 6px; }
        .hd-drill-bar-row { display: flex; align-items: center; gap: 10px; }
        .hd-drill-bar-label { width: 120px; font-size: 0.75rem; color: var(--hd-text, #e0e0e0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
        .hd-drill-bar-track { flex: 1; height: 8px; background: var(--hd-border, rgba(255,255,255,0.06)); border-radius: 4px; overflow: hidden; }
        .hd-drill-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
        .hd-drill-bar-value { width: 40px; font-size: 0.7rem; color: var(--hd-text-muted, #888); text-align: right; flex-shrink: 0; }

        .hd-drill-empty { text-align: center; padding: 40px; color: var(--hd-text-muted, #888); font-size: 0.85rem; }

        /* Student Profile Drill-Down (Wave 24c) */
        .hd-student-header { display: flex; align-items: center; gap: 16px; padding: 16px 0; margin-bottom: 16px; border-bottom: 1px solid var(--hd-border, rgba(255,255,255,0.06)); }
        .hd-student-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--hd-accent, #d4a017); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; color: #000; flex-shrink: 0; }
        .hd-student-info { flex: 1; }
        .hd-student-name { font-size: 1.1rem; font-weight: 600; color: var(--hd-text, #e0e0e0); }
        .hd-student-meta { font-size: 0.75rem; color: var(--hd-text-muted, #888); margin-top: 4px; }

        .hd-profile-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--hd-border, rgba(255,255,255,0.06)); }
        .hd-profile-tab { padding: 10px 20px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: none; border: none; border-bottom: 2px solid transparent; color: var(--hd-text-muted, #888); cursor: pointer; transition: all 0.2s; }
        .hd-profile-tab:hover { color: var(--hd-text, #e0e0e0); }
        .hd-profile-tab.active { color: var(--hd-accent, #d4a017); border-bottom-color: var(--hd-accent, #d4a017); }

        .hd-profile-content { min-height: 200px; }

        .hd-stat-cards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
        .hd-profile-stat { background: var(--hd-card-bg, #1e1e2e); border: 1px solid var(--hd-border, rgba(255,255,255,0.06)); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; transition: all 0.15s; }
        .hd-profile-stat:hover { border-color: var(--hd-accent, #d4a017); transform: translateY(-1px); }
        .hd-profile-stat-value { font-size: 1.2rem; font-weight: 700; color: var(--hd-text, #e0e0e0); }
        .hd-profile-stat-label { font-size: 0.65rem; color: var(--hd-text-muted, #888); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

        .hd-risk-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; }
        .hd-risk-high { background: rgba(239,83,80,0.15); color: #ef5350; }
        .hd-risk-medium { background: rgba(255,152,0,0.15); color: #ff9800; }
        .hd-risk-low { background: rgba(102,187,106,0.15); color: #66bb6a; }

        .hd-assignment-status { display: flex; flex-direction: column; gap: 6px; }
        .hd-asgn-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hd-border, rgba(255,255,255,0.03)); }
        .hd-asgn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .hd-asgn-dot.complete { background: #66bb6a; }
        .hd-asgn-dot.incomplete { background: var(--hd-text-muted, #555); }
        .hd-asgn-name { flex: 1; font-size: 0.8rem; color: var(--hd-text, #e0e0e0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .hd-asgn-score { font-size: 0.75rem; color: var(--hd-text-muted, #888); width: 50px; text-align: right; }
        .hd-asgn-date { font-size: 0.7rem; color: var(--hd-text-muted, #666); width: 80px; text-align: right; }

        .hd-roster-clickable { cursor: pointer; }
        .hd-roster-clickable:hover { background: var(--hd-row-hover, rgba(255,255,255,0.03)); }

        /* ═══════════════════════════════════════════════════════════════
           TAB SYSTEM (Dashboard Redesign)
           ═══════════════════════════════════════════════════════════════ */

        .hd-tab-bar {
            display: flex;
            gap: 0;
            border-bottom: 1px solid var(--hd-gold-border);
            margin-bottom: 20px;
            position: sticky;
            top: 0;
            z-index: 10;
            background: var(--hd-bg);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .hd-tab-bar::-webkit-scrollbar { display: none; }

        .hd-tab-btn {
            padding: 12px 20px;
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            color: var(--hd-text-muted);
            cursor: pointer;
            transition: color 0.2s, border-color 0.2s;
            white-space: nowrap;
            font-family: inherit;
        }
        .hd-tab-btn:hover { color: var(--hd-text); }
        .hd-tab-btn.active {
            color: var(--hd-gold);
            border-bottom-color: var(--hd-gold);
        }

        .hd-tab-panel { display: none; }
        .hd-tab-panel.active { display: block; }

        .hd-analytics-group-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin: 24px 0 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--hd-gold-border);
        }
        .hd-analytics-group-title:first-child { margin-top: 0; }

        /* ── Enhanced Student Profile (Mini-Stats + Sparkline + Table) ── */

        .hd-mini-stats-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin: 16px 0;
        }
        .hd-mini-stat {
            background: var(--hd-card-bg);
            border: 1px solid var(--hd-gold-border);
            border-radius: 8px;
            padding: 12px;
            text-align: center;
        }
        .hd-mini-stat-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--hd-text);
        }
        .hd-mini-stat-label {
            font-size: 0.6rem;
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-top: 4px;
        }

        .hd-sparkline-wrap {
            margin: 12px 0 20px;
            padding: 10px 16px;
            background: var(--hd-card-bg);
            border: 1px solid var(--hd-gold-border);
            border-radius: 8px;
        }
        .hd-sparkline-title {
            font-size: 0.65rem;
            color: var(--hd-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
        }

        .hd-asgn-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.8rem;
        }
        .hd-asgn-table th {
            text-align: left;
            padding: 8px 10px;
            color: var(--hd-text-muted);
            font-weight: 500;
            border-bottom: 1px solid var(--hd-gold-border);
            font-size: 0.65rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }
        .hd-asgn-table td {
            padding: 8px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
            color: var(--hd-text);
            vertical-align: middle;
        }
        .hd-asgn-table tr:hover {
            background: var(--hd-row-hover, rgba(255,255,255,0.02));
        }
        .hd-asgn-table .hd-score-green { color: #66bb6a; }
        .hd-asgn-table .hd-score-yellow { color: #ff9800; }
        .hd-asgn-table .hd-score-red { color: #ef5350; }
        .hd-asgn-overdue-tag {
            display: inline-block;
            padding: 1px 6px;
            font-size: 0.6rem;
            font-weight: 600;
            background: rgba(248,81,73,0.15);
            color: #f85149;
            border-radius: 4px;
            margin-left: 6px;
        }
        .hd-asgn-sub-row td {
            padding-left: 30px;
            font-size: 0.75rem;
            color: var(--hd-text-muted);
        }
        .hd-asgn-expand-btn {
            background: none;
            border: none;
            color: var(--hd-gold);
            cursor: pointer;
            font-size: 0.7rem;
            padding: 0;
            font-family: inherit;
        }

        @media (max-width: 768px) {
            .hd-tab-bar { padding: 0 8px; }
            .hd-tab-btn { padding: 10px 14px; font-size: 0.7rem; }
            .hd-mini-stats-row { grid-template-columns: repeat(2, 1fr); }
        }
