/* Lab Builder Control Plane - Consolidated Styles */

/* ============================================
   0. Font Imports
   ============================================ */

/* NVIDIA Sans - self-hosted */
@font-face {
    font-family: 'NVIDIA Sans';
    src: url('/static/fonts/nvidiasans-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NVIDIA Sans';
    src: url('/static/fonts/nvidiasans-medium.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NVIDIA Sans';
    src: url('/static/fonts/nvidiasans-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* IBM Plex Mono - Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap');

/* ============================================
   1. CSS Variables / Theme
   ============================================ */
:root {
    /* NVIDIA Brand Palette — per nvidia-brand.md */
    --color-bg: #000000;
    --color-bg-secondary: #151515;
    --color-bg-tertiary: #1a1a1a;
    --color-border: #2a2a2a;
    --color-text: #FFFFFF;
    --color-text-muted: #B3B3B3;
    --color-text-tertiary: #707070;

    /* Single accent color - NVIDIA Green */
    --color-accent: #76B900;

    /* Action button colors */
    --color-primary: #76B900;
    --color-primary-hover: #5F8F00;
    --color-secondary: #6e7681;
    --color-secondary-hover: #848d97;
    --color-warning: #ffb300;
    --color-warning-hover: #e6a200;
    --color-danger: #ff5252;
    --color-danger-hover: #ff7070;

    /* Semantic status colors */
    --color-success: #00C853;        /* Success green — distinct from brand green (#76B900) */
    --color-info: #00b0ff;
    --color-status-warning: #ffb300;
    --color-status-danger: #ff5252;

    /* Elevated surfaces (dropdowns, popovers) */
    --color-bg-elevated: #151515;
    --color-input-bg: #222222;
    --color-icon-muted: #444444;
    --color-surface-tint: rgba(255, 255, 255, 0.03);

    /* Link colors */
    --color-link: #00B0FF;
    --color-link-hover: #40C4FF;

    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
    --font-sans: 'NVIDIA Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 4px;
    --shadow: none;
}

/* ============================================
   1b. Light Theme Overrides
   ============================================ */
[data-theme="light"] {
    --color-bg: #E8E8E8;
    --color-bg-secondary: #FFFFFF;
    --color-bg-tertiary: #F5F5F5;
    --color-bg-elevated: #FFFFFF;
    --color-border: #B8B8B8;
    --color-text: #1A1A1A;
    --color-text-muted: #5A5A5A;
    --color-text-tertiary: #808080;
    --color-input-bg: #FFFFFF;
    --color-icon-muted: #9E9E9E;
    --color-avatar-bg: #D4D4D4;
    --color-surface-tint: rgba(0, 0, 0, 0.03);

    --color-primary: #76B900;
    --color-primary-hover: #5F8F00;
    --color-danger: #d32f2f;
    --color-danger-hover: #e53935;
    --color-success: #00C853;
    /* Success text for light backgrounds — darker green for contrast */
    --color-success-text: #2E7D32;
    --color-info: #00B0FF;
    --color-warning: #F59E0B;
    --color-warning-hover: #D97706;
    /* Warning text for light backgrounds */
    --color-warning-text: #B45309;
    --color-status-warning: #F59E0B;
    --color-status-danger: #FF5252;

    --color-link: #0277BD;
    --color-link-hover: #0288D1;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Light mode overrides for elements using hardcoded rgba or #hex */
[data-theme="light"] .nav-tab.active {
    color: var(--color-text);
}

[data-theme="light"] .logo-title {
    color: var(--color-text);
}

[data-theme="light"] .user-avatar {
    background: var(--color-avatar-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--color-text);
}

[data-theme="light"] .user-dropdown-avatar {
    background: var(--color-avatar-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--color-text);
}

[data-theme="light"] .user-zone:hover,
[data-theme="light"] .user-zone.active {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .user-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text);
}

[data-theme="light"] .filter-bar {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .filter-input {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .filter-input:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .filter-input:focus {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .filter-input::placeholder {
    color: var(--color-icon-muted);
}

[data-theme="light"] .student-checkbox,
[data-theme="light"] .course-select-all {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .student-checkbox:hover,
[data-theme="light"] .course-select-all:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .student-checkbox:checked,
[data-theme="light"] .course-select-all:checked {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .student-checkbox:checked::after,
[data-theme="light"] .course-select-all:checked::after {
    border-color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .course-select-all:indeterminate {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .course-select-all:indeterminate::after {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .filter-chip {
    background: rgba(118, 185, 0, 0.08);
    border: 1px solid rgba(118, 185, 0, 0.25);
}

[data-theme="light"] .btn-primary {
    color: var(--color-bg);
}

[data-theme="light"] .btn-primary:hover:not(:disabled) {
    color: var(--color-bg);
}

/* Light mode status pills — outline style, use darker text variants for contrast */
[data-theme="light"] .status-ready,
[data-theme="light"] .status-installed {
    background: transparent;
    color: var(--color-success-text);
    border: 1px solid var(--color-success-text);
}

[data-theme="light"] .status-building,
[data-theme="light"] .status-deploying,
[data-theme="light"] .status-resuming,
[data-theme="light"] .status-installing {
    background: transparent;
    color: var(--color-link);
    border: 1px solid var(--color-link);
}

[data-theme="light"] .status-failed,
[data-theme="light"] .status-install-failed,
[data-theme="light"] .status-destroying {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

[data-theme="light"] .status-stopping,
[data-theme="light"] .status-stopped {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .status-none,
[data-theme="light"] .status-not-installed {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-tertiary);
}

/* Light mode badges */
[data-theme="light"] .badge-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--color-success-text);
}

[data-theme="light"] .badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning-text);
}

[data-theme="light"] .badge-error {
    background: rgba(211, 47, 47, 0.1);
    color: var(--color-danger);
}

[data-theme="light"] .user-dropdown-item-danger {
    color: var(--color-danger);
}

[data-theme="light"] .user-dropdown-item-danger:hover {
    background: rgba(211, 47, 47, 0.08);
    color: var(--color-danger);
}

[data-theme="light"] .login-form .form-group input:focus {
    border-color: var(--color-accent);
}

[data-theme="light"] .filter-dropdown,
[data-theme="light"] .filter-submenu {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .action-menu {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .login-header h1 {
    color: var(--color-text);
}

[data-theme="light"] .login-page {
    background: var(--color-bg-secondary);
}

[data-theme="light"] .login-box {
    background: var(--color-bg);
    border-color: var(--color-border);
}

[data-theme="light"] .password-toggle {
    color: var(--color-text-muted);
}

/* Light mode hover states — swap white tints for black tints */
[data-theme="light"] .action-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] th.sortable:hover,
[data-theme="light"] .student-header .sortable:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .log-tab:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .log-event:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .btn-refresh:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .course-tab:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .course-tab.active {
    color: var(--color-text-muted);
    border-bottom-color: rgba(118, 185, 0, 0.45);
}

/* Light mode pagination buttons */
[data-theme="light"] .pagination-controls .btn-secondary:disabled {
    color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .pagination-controls .btn-secondary:not(:disabled) {
    color: var(--color-text);
}

[data-theme="light"] .pagination-controls .btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text);
}

/* Light mode table column headers — NVIDIA brand: uppercase, letter-spaced, smaller font */
[data-theme="light"] .table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Light mode feature card descriptions — tertiary to distinguish from structural labels */
[data-theme="light"] .feature-card p {
    color: var(--color-text-tertiary);
}

/* Light mode log viewer */
[data-theme="light"] .logs-viewer-container {
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .logs-viewer-content {
    color: var(--color-text);
}

[data-theme="light"] .log-event {
    border-bottom-color: var(--color-border);
}

/* ============================================
   2. Base / Reset
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   3. Layout
   ============================================ */

/* Top Bar — logo + environment + user */
.header {
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Primary Nav Bar — page-level tabs */
.primary-nav-bar {
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.primary-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 40px;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-right: 2rem;
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

/* Primary Navigation */
.primary-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: 100%;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 1rem;
    height: 100%;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.nav-tab:hover {
    color: var(--color-text);
    background: var(--color-surface-tint);
}

.nav-tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

.nav-tab-disabled {
    opacity: 0.55;
    color: var(--color-text-muted);
    cursor: default;
    pointer-events: none;
}

.nav-tab-external {
    opacity: 0.4;
    margin-left: 2px;
}

.nav-tab:hover .nav-tab-external {
    opacity: 0.7;
}

/* Header Right Zone */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.header-zone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    flex-shrink: 0;
}

/* Theme Toggle Button */
.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
    flex-shrink: 0;
}

.btn-theme-toggle:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(118, 185, 0, 0.06);
}

.btn-theme-toggle svg {
    display: none;
}

/* Environment Zone */
.env-zone {
    gap: 0.5rem;
}

.env-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    white-space: nowrap;
    cursor: default;
}

.env-badge svg {
    opacity: 0.5;
}

/* User Zone */
.user-zone {
    position: relative;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.user-zone:hover,
.user-zone.active {
    background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.user-name {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

.user-chevron {
    opacity: 0.4;
    transition: transform 0.15s, opacity 0.15s;
}

.user-zone.active .user-chevron {
    transform: rotate(180deg);
    opacity: 0.7;
}

/* User Dropdown */
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}

.user-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-border);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text);
    flex-shrink: 0;
}

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-dropdown-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
}

.user-dropdown-role {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--color-border);
}

.user-dropdown-section {
    padding: 0.625rem 1rem;
}

.user-dropdown-section-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.375rem;
}

.user-dropdown-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
}

.user-dropdown-item-danger {
    color: var(--color-danger);
}

.user-dropdown-item-danger:hover {
    background: rgba(255, 82, 82, 0.08);
    color: var(--color-danger);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0.75rem 2rem 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: 0.75rem max(2rem, calc((100vw - 1400px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.version-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.version-badge:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Page header — title + feature highlights */
.page-header {
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
}

.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feature-pill-link {
    margin-left: auto;
    text-decoration: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s;
}

.feature-pill-link:hover {
    color: var(--color-text);
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: default;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.feature-pill:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.feature-pill-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Sections */
.section {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    line-height: 1;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-right: 0.75rem;
}

.section.collapsed .section-content { display: none; }

/* ============================================
   4. Components - Tables
   ============================================ */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.5rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--color-surface-tint);
}

.table code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-sm td, .table-sm th {
    padding: 0.5rem 0.75rem;
}

/* Student header with filter */
.student-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.student-header .sortable {
    cursor: pointer;
}

.student-header .sortable:hover {
    color: var(--color-accent);
}

/* Filter input — standalone (not inside .filter-bar) */
.filter-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    color: var(--color-text);
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    width: 100%;
    max-width: 110px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.filter-input:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.filter-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.2);
}

/* ============================================
   Filter Row + Bar (full-width, above table)
   ============================================ */

.filter-row {
    margin-bottom: 0.75rem;
}

.filter-bar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.6rem 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.filter-bar:focus-within {
    border-color: var(--color-accent);
}

.filter-search-icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

/* Input inside the filter-bar: no own border, inherits bar context */
.filter-bar .filter-input {
    flex: 1;
    min-width: 140px;
    max-width: none;
    border: none;
    background: transparent;
    padding: 0.15rem 0.25rem;
    box-shadow: none;
}

.filter-bar .filter-input::placeholder {
    color: var(--color-text-muted);
}

.filter-bar .filter-input:focus {
    box-shadow: none;
    border: none;
}

/* Filter chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(118, 185, 0, 0.12);
    border: 1px solid rgba(118, 185, 0, 0.3);
    border-radius: 10px;
    font-size: 0.72rem;
    color: var(--color-text);
    white-space: nowrap;
}

.filter-chip .chip-label {
    font-size: 0.72rem;
}

.filter-chip .chip-remove {
    cursor: pointer;
    color: rgba(118, 185, 0, 0.6);
    font-size: 0.9rem;
    line-height: 1;
}

.filter-chip .chip-remove:hover {
    color: var(--color-accent);
}

/* Filter dropdown panel */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-width: 220px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.filter-dropdown-header {
    padding: 8px 14px 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 4px;
}

.filter-category {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--color-text);
}

.filter-category svg {
    flex-shrink: 0;
    color: var(--color-text-muted);
    transition: color 0.15s;
}

.filter-category:hover {
    background: var(--color-border);
    color: var(--color-accent);
}

.filter-category:hover svg {
    color: var(--color-accent);
}

/* Filter submenu panel */
.filter-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.filter-submenu-item {
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--color-text);
}

.filter-submenu-item:hover {
    background: var(--color-border);
    color: var(--color-accent);
}

/* Custom checkboxes - match filter input aesthetic */
.student-checkbox,
.course-select-all {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.student-checkbox:hover,
.course-select-all:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.student-checkbox:checked,
.course-select-all:checked {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.student-checkbox:checked::after,
.course-select-all:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid rgba(255, 255, 255, 0.7);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Indeterminate state for course-select-all */
.course-select-all:indeterminate {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.course-select-all:indeterminate::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
}

.student-checkbox:focus,
.course-select-all:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* ============================================
   4. Components - Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Primary button - Green for positive/deploy actions */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-bg);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    color: var(--color-bg);
}

/* Secondary button - Ghost style for neutral actions */
.btn-secondary {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

/* Muted button - for less prominent actions like Clear */
.btn-muted {
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-muted:hover:not(:disabled) {
    background: var(--color-border);
    color: var(--color-text);
}

/* Warning button - Ghost, colour on hover (destructive but recoverable) */
.btn-warning {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-warning:hover:not(:disabled) {
    background: rgba(255, 179, 0, 0.15);
    color: var(--color-warning);
    border-color: var(--color-warning);
}

/* Danger button - Ghost, colour on hover (permanent actions) */
.btn-danger {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 82, 82, 0.15);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

/* Info button - Ghost, colour on hover */
.btn-info {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-info:hover:not(:disabled) {
    background: rgba(0, 176, 255, 0.15);
    color: var(--color-info);
    border-color: var(--color-info);
}

/* All buttons when disabled - consistent muted appearance */
.btn:disabled,
.btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Success button (same as primary for consistency) */
.btn-success {
    background: var(--color-success);
    color: var(--color-bg);
}

.btn-success:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.btn-with-icon { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.4rem; 
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    min-width: auto;
    border-radius: 4px;
    vertical-align: middle;
}

.btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

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

.btn-outline-danger:hover:not(:disabled) {
    background: var(--color-danger);
    color: white;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: var(--radius);
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-close:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

/* Refresh button - square icon */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--color-border);
    color: var(--color-text);
}

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

/* Refresh button spin animation */
.refresh-icon.spinning {
    animation: spin 0.8s linear infinite;
}

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

/* Copy button */
.btn-copy {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-copy:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-copy.copied {
    border-color: var(--color-success);
    color: var(--color-success);
}

/* Tooltip wrapper for disabled buttons */
.btn-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.btn-tooltip-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 2px;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 6px;
    width: max-content;
    max-width: 350px;
    text-align: center;
    line-height: 1.4;
}

.btn-tooltip-wrapper:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Arrow for tooltip */
.btn-tooltip-wrapper::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-border);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1001;
    margin-bottom: 0;
}

.btn-tooltip-wrapper:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   4. Components - Badges
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(0, 200, 83, 0.15);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(255, 179, 0, 0.15);
    color: var(--color-warning);
}

.badge-error {
    background: rgba(255, 82, 82, 0.15);
    color: var(--color-danger);
}

.badge-secondary {
    background: rgba(139, 148, 158, 0.2);
    color: var(--color-text-muted);
}

.badge-outline { 
    background: transparent; 
    border: 1px solid var(--color-border); 
    color: var(--color-text-muted); 
}

/* ============================================
   4. Components - Status Pills (outline style per NVIDIA brand)
   Brand rule: "Outline pills for dense tables. Solid fills only for single key status at page top."
   All pills: transparent bg, coloured border + text, border-radius 999px, NVIDIA Sans 11-12px medium.
   ============================================ */
.status-cell {
    white-space: nowrap;
    text-align: center;
}

.status-pill {
    display: inline-block;
    position: relative;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
    min-width: 110px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--color-border);
}

/* Ready / Installed — NVIDIA brand green */
.status-ready,
.status-installed {
    color: var(--color-success);
    border-color: var(--color-success);
    background: transparent;
}

/* Not deployed / Not installed — neutral outline */
.status-none,
.status-not-installed {
    background: transparent;
    border: 1px solid var(--color-text-tertiary);
    color: var(--color-text-muted);
}

/* Stopped — muted outline */
.status-stopped {
    background: transparent;
    border: 1px solid var(--color-text-tertiary);
    color: var(--color-text-muted);
}

/* Building / Deploying / Resuming — info blue outline with pulse */
.status-building,
.status-deploying,
.status-resuming {
    color: var(--color-info);
    border-color: var(--color-info);
    background: transparent;
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Installing — info blue outline with pulse (same family as building) */
.status-installing {
    color: var(--color-info);
    border-color: var(--color-info);
    background: transparent;
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Stopping / Suspending — muted outline with pulse */
.status-stopping {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Destroying — danger outline with pulse */
.status-destroying {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background: transparent;
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Plain muted em-dash for empty table cells (no pill styling) */
.cell-muted {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* Inactive pill — neutral muted (training-access page) */
.pill--inactive {
    color: var(--color-text-secondary);
    border-color: var(--color-border);
    background: transparent;
}

/* Failed / Install Failed — danger outline (static) */
.status-failed,
.status-install-failed {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background: transparent;
}

@keyframes pulse-border {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   4. Components - Forms
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.form-group input,
.form-group select,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(118, 185, 0, 0.2);
}

.form-select option:disabled {
    color: var(--color-text-muted);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Input validation states — using :is() for equal specificity win over :focus */
.form-group input.input-valid,
.form-group input.input-valid:focus {
    border-color: var(--color-success);
    box-shadow: 0 0 0 2px rgba(35, 134, 54, 0.2);
}

.form-group input.input-invalid,
.form-group input.input-invalid:focus {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 2px rgba(218, 54, 51, 0.2);
}

.validation-feedback {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    min-height: 1.2em;
}

.validation-feedback.valid {
    color: var(--color-success);
}

.validation-feedback.invalid {
    color: var(--color-danger);
}

/* ============================================
   4. Components - Alerts
   ============================================ */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

/* ============================================
   4. Components - Modals
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-width: 400px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

/* Confirmation Modal */
.modal-confirm {
    max-width: 480px;
    padding: 2rem;
}

.modal-confirm .modal-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.modal-confirm .modal-body {
    padding: 1.5rem 0;
}

.modal-confirm .modal-body p {
    margin: 0 0 0.5rem 0;
}

.modal-confirm .modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* Notification Modal */
.modal-notification {
    max-width: 500px;
}

.modal-notification .modal-body {
    padding: 1rem 0;
}

.modal-notification .table {
    margin: 0;
}

.modal-notification .table td,
.modal-notification .table th {
    padding: 0.5rem;
}

.notification-error {
    color: var(--color-danger);
}

/* Solid destructive button inside confirm modals */
.modal-confirm .btn-danger {
    background: var(--color-danger);
    color: var(--color-bg);
    border-color: var(--color-danger);
    font-weight: 600;
}

.modal-confirm .btn-danger:hover:not(:disabled) {
    background: var(--color-danger-hover);
    color: var(--color-bg);
    border-color: var(--color-danger-hover);
}

/* Warning text for irreversible actions */
.text-danger {
    color: var(--color-danger);
}

/* Resource name badge in confirm dialogs */
.modal-resource-names {
    display: block;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin: 0.75rem 0;
    word-break: break-word;
    line-height: 1.5;
}

/* Danger icon in modal headers */
.modal-danger-icon {
    color: var(--color-danger);
    vertical-align: -3px;
    margin-right: 0.375rem;
    flex-shrink: 0;
}

/* Light mode modal overrides */
[data-theme="light"] .modal-content {
    background: var(--color-bg-secondary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-confirm .btn-danger {
    color: var(--color-bg-secondary);
}

[data-theme="light"] .modal-confirm .btn-danger:hover:not(:disabled) {
    color: var(--color-bg-secondary);
}

[data-theme="light"] .btn-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-resource-names {
    background: var(--color-bg-tertiary);
}

/* ============================================
   5. Dashboard-Specific Styles
   ============================================ */

/* Environment Indicators */
.env-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
}

.env-indicator-online {
    background: rgba(0, 200, 83, 0.08);
    border: 1px solid rgba(0, 200, 83, 0.2);
    color: var(--color-success);
}

.env-indicator .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

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

/* Action Bar — hidden when no selection, slides in when students selected */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius);
    margin-top: 1rem;
    border: 1px solid var(--color-border);
    animation: slideDown 0.15s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.selected-count {
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Actions Dropdown */
.action-dropdown {
    position: relative;
}

.action-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-width: 220px;
    z-index: 100;
    overflow: hidden;
}

.action-menu.open {
    display: block;
}

.action-menu-group {
    padding: 0.25rem 0;
}

.action-menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.825rem;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.action-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-item:disabled:hover {
    background: transparent;
}

.action-item-warning:hover:not(:disabled) {
    color: var(--color-warning);
}

.action-item-danger:hover:not(:disabled) {
    color: var(--color-danger);
}

.action-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Students Table Layout — fixed widths for consistent column alignment */
#students-table {
    table-layout: fixed;
    width: 100%;
}

#students-table td {
    padding: 0.5rem;
}

/* Column alignment — #students-table prefix beats .table th specificity */
#students-table .type-col, #students-table .type-cell { text-align: center; white-space: nowrap; }
#students-table .status-col, #students-table .status-cell { text-align: center; white-space: nowrap; }
#students-table .runai-col, #students-table .runai-status-cell { text-align: center; white-space: nowrap; }
#students-table .created-col, #students-table .created-cell { text-align: center; white-space: nowrap; }
#students-table .age-col, #students-table .age-cell { text-align: center; white-space: nowrap; }
#students-table .cost-col, #students-table .cost-cell { text-align: center; white-space: nowrap; }
#students-table .dot-col, #students-table .dot-cell { text-align: center; padding: 0 0.5rem 0 0; }
td.status-cell { text-align: center; vertical-align: middle; }
td.runai-status-cell { text-align: center; vertical-align: middle; }
td.age-cell { text-align: center; vertical-align: middle; }
td.cost-cell { text-align: center; vertical-align: middle; }
td.created-cell { text-align: center; vertical-align: middle; }
.created-display { font-size: 0.8rem; color: var(--color-text); }
.age-display { font-size: 0.8rem; color: var(--color-text-muted); }
.cost-display { font-size: 0.8rem; color: var(--color-text-muted); font-family: var(--font-mono); }

.student-name-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-name-cell .student-checkbox {
    margin-right: 0.75rem;
    vertical-align: middle;
}

.student-name-cell strong {
    font-weight: 600;
}

/* Sortable columns */
th.sortable {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.15s;
}
th.sortable:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.04);
}
.student-header .sortable {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.student-header .sortable:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-primary);
}
.sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
    opacity: 0.5;
    vertical-align: middle;
    transition: opacity 0.15s;
}
.sort-icon svg {
    display: block;
}
th.sortable:hover .sort-icon {
    opacity: 1;
    color: var(--color-accent);
}
/* Sort direction states */
th.sort-asc .sort-icon svg {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--color-accent);
}
th.sort-desc .sort-icon svg {
    transform: rotate(0deg);
    opacity: 1;
    color: var(--color-accent);
}
.sortable.sort-asc .sort-icon svg {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--color-accent);
}
.sortable.sort-desc .sort-icon svg {
    transform: rotate(0deg);
    opacity: 1;
    color: var(--color-accent);
}

/* Traffic Light Indicators for Run:AI Status */
.runai-status-cell { text-align: center; vertical-align: middle; }
.remove-col { vertical-align: middle; }

.traffic-light {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
}

.traffic-light.green {
    background: var(--color-success);
    box-shadow: 0 0 6px var(--color-success);
}

.traffic-light.yellow {
    background: var(--color-warning);
    box-shadow: 0 0 6px var(--color-warning);
}

.traffic-light.red {
    background: var(--color-danger);
    box-shadow: 0 0 6px var(--color-danger);
}

.traffic-light.off {
    background: var(--color-bg-tertiary);
    border-color: var(--color-bg-tertiary);
    opacity: 0.5;
}

.traffic-light.grey {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.traffic-light.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Expand/Collapse for Student Details */
/* Student rows are clickable to open the detail panel */
tr.student-row { cursor: pointer; }
tr.student-row:hover td { background: rgba(255, 255, 255, 0.03); }
tr.student-row.active td { background: rgba(118, 185, 0, 0.06); }

/* Hidden data rows — never displayed as table rows */
.student-details { display: none !important; }

.details-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---- Slide-out detail panel ---- */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 880px;
    max-width: 92vw;
    height: 100vh;
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.detail-panel.open { transform: translateX(0); }

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.detail-panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-mono);
    color: var(--color-text);
}

.detail-panel-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.detail-panel-close:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.06);
}

.detail-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.detail-panel-body::-webkit-scrollbar { width: 6px; }
.detail-panel-body::-webkit-scrollbar-track { background: transparent; }
.detail-panel-body::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.detail-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Section dividers inside the panel body (sections are direct children after innerHTML copy) */
.detail-panel-body > .details-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.detail-panel-body > .details-section:first-child {
    padding-top: 0;
}

.detail-panel-body > .details-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.detail-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.details-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 32px;
    font-size: 0.875rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}

.detail-item-wide {
    grid-column: 1 / -1;
}

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

.detail-value {
    color: var(--color-text);
}

.vscode-password-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-display {
    background: var(--color-bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.error-message { color: var(--color-danger); grid-column: 1 / -1; }

.quick-links { display: flex; gap: 0.5rem; }

/* Quick Link buttons - prominent outlined style with NVIDIA green */
.btn-quick-link {
    background: rgba(118, 185, 0, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(118, 185, 0, 0.4);
}

.btn-quick-link:hover:not(:disabled):not(.btn-disabled) {
    background: rgba(118, 185, 0, 0.2);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-quick-link.btn-disabled {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Health Status Grid */
.health-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: help;
}

.health-item[title] {
    position: relative;
}

.health-item:hover {
    background: var(--color-border);
}

.health-item-hidden {
    display: none;
}

.health-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-indicator.health-healthy {
    background: var(--color-success);
    box-shadow: 0 0 4px var(--color-success);
}

.health-indicator.health-unhealthy {
    background: var(--color-danger);
    box-shadow: 0 0 4px var(--color-danger);
}

.health-indicator.health-pending {
    background: var(--color-warning);
}

.health-indicator.health-missing {
    background: var(--color-secondary);
}

.health-indicator.health-not_installed {
    background: var(--color-secondary);
}

.health-label {
    color: var(--color-text-muted);
}

.health-timestamp {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Logs Panel */
.logs-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
}

.logs-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
}

.log-tab {
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.log-tab:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.05);
}

.log-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: rgba(118, 185, 0, 0.1);
}

.log-follow-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s;
}

.log-follow-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.log-follow-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
}

.log-follow-btn .follow-label {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.log-refresh-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.log-refresh-btn:hover {
    color: var(--color-primary);
}

.logs-viewer-container {
    height: 250px;
    overflow: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.logs-viewer-container::-webkit-scrollbar { width: 6px; height: 6px; }
.logs-viewer-container::-webkit-scrollbar-track { background: transparent; }
.logs-viewer-container::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.logs-viewer-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

.logs-viewer-content {
    margin: 0;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--color-text-muted);
    min-height: 100%;
}

.logs-viewer-content.loading {
    color: var(--color-text-muted);
    font-style: italic;
}

.actions { white-space: nowrap; }

/* Recent activity section — fills remaining viewport space */
.main-content > section:last-of-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.main-content > section:last-of-type > .section-content {
    flex: 1;
    min-height: 0;
}

/* Scrollable recent activity */
.activity-scroll {
    max-height: none;
    overflow-y: auto;
    flex: 1;
    min-height: 80px;
}
.activity-scroll::-webkit-scrollbar {
    width: 6px;
}
.activity-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}
.activity-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.activity-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Empty state cells — used for "No students" and "No activity" */
td.empty-state-cell {
    padding: 1.5rem 1rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.empty-state-icon {
    color: var(--color-icon-muted);
    flex-shrink: 0;
}

.empty-state-text {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.empty-state-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.875rem;
}

.empty-state-link:hover {
    text-decoration: underline;
}

/* Section collapsible header with SVG chevron */
.section-collapsible {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}

.section-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

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

/* Activity panel collapse animation */
.section-content {
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.section.collapsed .section-content {
    display: none;
}

/* Btn-refresh hover (dark-mode tint variant — combined with definition above) */

/* ============================================
   6. Login Page
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    position: relative;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2rem;
    box-shadow: none;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* Login-specific input styling */
.login-form .form-group input {
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.2);
}

/* Higher specificity than the generic :focus rule — no !important needed */
.login-form .form-group input.input-error,
.login-form .form-group input.input-error:focus {
    border-color: var(--color-danger);
    box-shadow: none;
}

.login-form .form-group input.input-error:focus {
    box-shadow: 0 0 0 2px rgba(255, 82, 82, 0.2);
}

.login-field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--color-danger);
}

/* Password toggle wrapper */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    transition: color 0.15s ease;
}

.password-toggle:hover {
    color: var(--color-text);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Login card footer — version badge */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

/* Login page theme toggle */
.login-theme-toggle {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.login-theme-toggle:hover {
    opacity: 1;
}

/* ============================================
   7. Logs Page
   ============================================ */
.logs-page .page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.log-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.log-container {
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.log-placeholder,
.log-loading,
.log-error {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

.log-error {
    color: var(--color-danger);
}

.log-events {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
}

.log-event {
    padding: 0.25rem 1rem;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.log-event:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-time {
    color: var(--color-text-muted);
    margin-right: 1rem;
}

.log-message {
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================
   8. Utility Classes
   ============================================ */
.text-muted {
    color: var(--color-text-muted);
}

.text-center {
    text-align: center;
}

.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* ============================================
   8b. Pagination
   ============================================ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-page {
    font-size: 0.8rem;
    min-width: 80px;
    text-align: center;
}

.pagination-info {
    min-width: 160px;
}

/* Pagination buttons — disabled state is visible but clearly inactive */
.pagination-controls .btn-secondary:disabled {
    opacity: 1;
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-controls .btn-secondary:not(:disabled) {
    color: var(--color-text);
}

.pagination-controls .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.page-size-select {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-tertiary);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
}

.page-size-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ============================================
   9. Placeholder Pages
   ============================================ */

.placeholder-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 0;
}

.placeholder-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: rgba(0, 176, 255, 0.04);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-link);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.placeholder-banner-icon {
    flex-shrink: 0;
    color: var(--color-link);
}

.placeholder-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card.muted {
    /* Placeholder cards: dim value color instead of the whole card */
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    font-family: var(--font-mono);
}

/* Placeholder em-dash values are dimmed */
.stat-card.muted .stat-value {
    color: var(--color-text-muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: background 0.15s, border-color 0.15s;
}

.feature-card:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-border);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    border-radius: 50%;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.settings-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.settings-info-item {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.settings-info-value {
    font-size: 0.9375rem;
    color: var(--color-text);
}

.settings-info-value code {
    font-family: var(--font-mono);
    background: var(--color-bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
}

/* ============================================
   10. Course Sub-Navigation
   ============================================ */

.course-nav {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.course-nav-inner {
    display: flex;
    align-items: stretch;
    height: 34px;
    padding: 0 2rem;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.course-tab {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-text-tertiary);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1.5px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.course-tab:hover {
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.02);
}

.course-tab.active {
    color: var(--color-text-muted);
    border-bottom-color: rgba(118, 185, 0, 0.5);
}

.course-tab-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* Course placeholder page */
.course-placeholder-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.course-placeholder {
    text-align: center;
    max-width: 500px;
    padding: 3rem 2rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.course-placeholder h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
}

.course-placeholder-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    margin-bottom: 1rem;
}

.course-placeholder p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   10b. Compact Sticky Header
   ============================================ */

.header-compact {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 44px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    will-change: transform, opacity;
}

body.header-collapsed .header-compact {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.header-compact-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Compact logo — eye icon only */
.compact-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.compact-logo-img {
    height: 20px;
    width: auto;
}

/* Vertical dividers between sections */
.compact-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    flex-shrink: 0;
    margin: 0 0.75rem;
}

/* Primary nav tabs in compact bar */
.compact-primary-nav {
    display: flex;
    align-items: stretch;
    height: 100%;
    flex-shrink: 0;
}

.compact-tab {
    display: inline-flex;
    align-items: center;
    padding: 0 0.625rem;
    height: 100%;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

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

.compact-tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

.compact-tab-disabled {
    opacity: 0.55;
    color: var(--color-text-muted);
    cursor: default;
    pointer-events: none;
}

/* Sub-nav section (dynamically populated) */
.compact-subnav {
    display: flex;
    align-items: stretch;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
}

.compact-subnav::-webkit-scrollbar {
    display: none;
}

.compact-subnav .compact-tab {
    font-size: 0.6875rem;
    padding: 0 0.5rem;
    color: var(--color-text-muted);
}

.compact-subnav .compact-tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

/* Hide divider when no sub-nav content */
.compact-subnav-divider.hidden {
    display: none;
}

/* Right-side controls */
.compact-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 0.75rem;
}

.compact-theme-toggle {
    width: 28px;
    height: 28px;
}

.compact-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-bg);
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Light mode overrides for compact header */
[data-theme="light"] .compact-tab.active {
    color: var(--color-text);
}

[data-theme="light"] .compact-avatar {
    background: var(--color-avatar-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--color-text);
}

/* ============================================
   11. Responsive
   ============================================ */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        min-width: unset;
        margin: 1rem;
    }

    .header-compact-inner {
        padding: 0 1rem;
    }

    .compact-tab {
        padding: 0 0.5rem;
        font-size: 0.6875rem;
    }

    .compact-divider {
        margin: 0 0.5rem;
    }
}

/* ============================================
   12. Entity Tiles (Courses, Instructors, Companies)
   ============================================ */

.entity-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.entity-tile {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: background 0.15s ease, border-color 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.entity-tile:hover {
    background: var(--color-bg-elevated);
    border-color: rgba(118, 185, 0, 0.25);
}

.entity-tile--clickable {
    cursor: pointer;
}

/* Tile header: portrait layout — icon on top, name below, centred */
.tile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

/* Company logo container */
.tile-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.tile-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.tile-logo svg {
    color: var(--color-icon-muted);
}

/* Person avatar placeholder */
.tile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tile-avatar svg {
    color: var(--color-icon-muted);
}

.tile-avatar-initials {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
}

/* Tile title area */
.tile-title-area {
    min-width: 0;
    width: 100%;
}

.tile-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tile badges row */
.tile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

/* Neutral metadata badge (per NVIDIA brand: grey bg, grey border) */
.tile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.tile-badge svg {
    flex-shrink: 0;
}

/* Accent badge for key status */
.tile-badge--active {
    border-color: var(--color-success);
    color: var(--color-success);
    background: transparent;
}

.tile-badge--archived {
    border-color: var(--color-border);
    color: var(--color-text-tertiary);
    background: transparent;
}

.tile-badge--lab-type {
    border-color: var(--color-info);
    color: var(--color-info);
    background: transparent;
}

/* Tile metadata rows */
.tile-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.tile-meta-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.3;
}

.tile-meta-row svg {
    flex-shrink: 0;
    color: var(--color-icon-muted);
}

/* Tile description text */
.tile-description {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tile stat (large number, e.g. student count) */
.tile-stat {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.tile-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    font-family: var(--font-mono);
    line-height: 1;
}

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

/* Tile footer separator */
.tile-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
    margin-top: auto;
    text-align: center;
}

/* Tile empty state */
.entity-tile-empty {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.entity-tile-empty p:first-child {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.entity-tile-empty p:last-child {
    margin: 0;
    font-size: 0.875rem;
}

/* Tile course layout: header row with stat on the right */
.tile-header-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.tile-header-split .tile-stat {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

/* Light mode overrides for tiles */
[data-theme="light"] .entity-tile:hover {
    border-color: rgba(118, 185, 0, 0.3);
}

[data-theme="light"] .tile-logo {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border);
}

[data-theme="light"] .tile-avatar {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border);
}

[data-theme="light"] .tile-badge {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

[data-theme="light"] .tile-badge--active {
    background: transparent;
    border-color: var(--color-success);
    color: var(--color-success);
}

[data-theme="light"] .tile-badge--lab-type {
    background: transparent;
    border-color: var(--color-info);
    color: var(--color-link);
}

[data-theme="light"] .tile-badge--archived {
    background: transparent;
    color: var(--color-text-tertiary);
}

[data-theme="light"] .tile-logo svg,
[data-theme="light"] .tile-avatar svg {
    color: var(--color-icon-muted);
}

[data-theme="light"] .tile-meta-row svg {
    color: var(--color-icon-muted);
}

/* Responsive: stack tiles on small screens */
@media (max-width: 768px) {
    .entity-tile-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   15. Course Timeline
   ============================================ */

.timeline-container {
    background: #111111;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.timeline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.timeline-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-today-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.timeline-today-btn:hover {
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.2);
}

.timeline-zoom-group {
    display: flex;
    gap: 2px;
    background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.04));
    border-radius: 4px;
    padding: 2px;
}

.timeline-zoom-btn {
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timeline-zoom-btn:hover {
    color: var(--color-text);
}

.timeline-zoom-btn.active {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.timeline-grid-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.timeline-grid-wrapper::-webkit-scrollbar {
    height: 6px;
}

.timeline-grid-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-grid-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.timeline-grid-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

.timeline-grid-wrapper.grabbing {
    cursor: grabbing;
    user-select: none;
}

.timeline-grid {
    position: relative;
    min-width: 800px;
    display: grid;
    grid-template-columns: 200px 1fr;
}

.timeline-axis {
    grid-column: 2;
    position: sticky;
    top: 0;
    z-index: 2;
    height: 36px;
    border-bottom: 1px solid var(--color-border);
    background: #111111;
}

.timeline-axis-label {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.timeline-row {
    display: contents;
}

.timeline-row-label {
    padding: 1rem 1rem 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.125rem;
    cursor: pointer;
    transition: background 0.15s ease;
    position: sticky;
    left: 0;
    background: #111111;
    z-index: 2;
    text-decoration: none;
    color: inherit;
}

.timeline-row-label:hover {
    background: var(--color-bg-secondary);
}

.timeline-row-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.timeline-row-company {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding-left: 1.125rem;
}

.timeline-row-name-line {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.timeline-row-status {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-row-status--active { background: var(--color-success); }
.timeline-row-status--upcoming { background: var(--color-text-muted); }
.timeline-row-status--completed { background: color-mix(in srgb, var(--color-brand) 40%, transparent); }

.timeline-row-bars {
    position: relative;
    border-bottom: 1px solid var(--color-border);
    min-height: 72px;
    display: flex;
    align-items: center;
}

.timeline-row:hover .timeline-row-bars {
    background: rgba(255, 255, 255, 0.02);
}

.timeline-bar {
    position: absolute;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: filter 0.15s ease;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    overflow: hidden;
    text-decoration: none;
}

.timeline-bar:hover {
    filter: brightness(1.15);
}

.timeline-bar--active {
    background: rgba(118, 185, 0, 0.15);
}

.timeline-bar--active .timeline-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--color-accent);
    border-radius: 6px 0 0 6px;
    transition: width 0.3s ease;
}

.timeline-bar--upcoming {
    background: #222222;
    border: 1px solid #2A2A2A;
}

.timeline-bar--completed {
    background: rgba(118, 185, 0, 0.2);
}

.timeline-bar-text {
    position: relative;
    z-index: 1;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-bar--upcoming .timeline-bar-text {
    color: var(--color-text-muted);
}

.timeline-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: var(--color-accent);
    z-index: 3;
    pointer-events: none;
}

.timeline-today-chip {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.625rem;
    font-weight: 600;
    color: #000000;
    background: var(--color-accent);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.timeline-month-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.timeline-tooltip {
    position: fixed;
    z-index: 100;
    background: #1B1B1B;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    max-width: 280px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.timeline-tooltip.visible {
    opacity: 1;
}

.timeline-tooltip-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.375rem;
}

.timeline-tooltip-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    white-space: pre-line;
}

.timeline-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.timeline-empty-icon {
    color: var(--color-text-tertiary);
    margin-bottom: 1rem;
}

.timeline-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.timeline-empty-text {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .timeline-grid {
        grid-template-columns: 140px 1fr;
        min-width: 600px;
    }
    .timeline-row-name {
        max-width: 120px;
    }
}

/* =============================================================
   Section 13: Extracted Utility Classes (formerly inline styles)
   ============================================================= */

/* Page header h1 — replaces style="font-size: 1.5rem; font-weight: 700;" */
.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Subsection h2 — replaces style="font-size: 1.125rem;" */
.section-h2 {
    font-size: 1.125rem;
}

/* Course header: badge row below the title */
.course-header-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Smaller status pill (0.6875rem) */
.status-pill-sm {
    font-size: 0.6875rem;
}

/* Inline metadata span — replaces style="font-size: 0.8125rem; color: var(--color-text-muted);" */
.meta-inline {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Inline SVG icon — replaces style="vertical-align: -1px; margin-right: 2px;" */
.icon-inline {
    vertical-align: -1px;
    margin-right: 2px;
}

/* Course description below course name */
.course-header-desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0.75rem 0 0 0;
}

/* Modal body with standard padding */
.modal-body-padded {
    padding: 1.25rem;
}

/* Modal form stack — replaces style="display: flex; flex-direction: column; gap: 1rem;" */
.modal-form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

/* Modal form label — replaces repeated inline label style */
.modal-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

/* Base input/select/textarea styling — dark/light theme aware */
.input,
.form-input {
    padding: 0.5rem 0.75rem;
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(118, 185, 0, 0.2);
}

.input::placeholder,
.form-input::placeholder {
    color: var(--color-text-tertiary);
}

select.input,
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2rem;
}

textarea.input,
textarea.form-input {
    min-height: 2.5rem;
    line-height: 1.5;
}

/* Full-width input in modals */
.input-full {
    width: 100%;
}

/* Resizable textarea */
.textarea-resize {
    resize: vertical;
}

/* Modal footer — replaces style="display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--color-border);" */
.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

/* Small modal (max-width 420px) */
.modal-sm .modal-content {
    max-width: 420px;
}

/* Medium modal (max-width 520px) */
.modal-md .modal-content {
    max-width: 520px;
}

/* Or as direct modal-content modifiers */
.modal-content-sm {
    max-width: 420px;
}
.modal-content-md {
    max-width: 520px;
}

/* Empty state for course students — replaces inline div style */
.course-empty-state {
    text-align: center;
    padding: 2.5rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.course-empty-state p {
    margin: 0;
    font-size: 1rem;
}

.course-empty-state p + p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Anchor styled as a button — removes default text-decoration */
a.btn-link {
    text-decoration: none;
}

/* Back-link row — replaces inline style on <a> in course_detail */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* Collapsible course groups on Students page */
.collapsible-group {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-bg-secondary);
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: background 0.15s ease;
}

.collapsible-header:hover {
    background: var(--color-bg-elevated);
}

.collapsible-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.collapsible-header.open .collapsible-chevron {
    transform: rotate(90deg);
}

.collapsible-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 0.25rem;
}

.collapsible-title {
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.collapsible-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.collapsible-badge {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.collapsible-badge-gpu {
    color: var(--color-brand);
    border: 1px solid var(--color-brand);
    background: transparent;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.collapsible-body {
    border-top: 1px solid var(--color-border);
}

.collapsible-body .table {
    margin: 0;
}

/* Course group header rows in lab tables */
.course-group-header {
    cursor: pointer;
    transition: background 0.15s ease;
}

.course-group-header:hover td:first-child {
    background: var(--color-bg-elevated);
}

.course-group-cell {
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.course-group-header.open .collapsible-chevron {
    transform: rotate(90deg);
}

/* Course group header — simple bar: logo + name left, cost + dot right */
.course-group-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.course-group-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sub-header row inside each course group */
.course-sub-header th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.course-sub-header th:hover {
    color: var(--color-primary);
}

/* Visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Course group name — flex row with checkbox, chevron, logo, name */
.course-group-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    min-width: 0;
}

a.course-group-instructor,
.course-group-instructor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3a7ca5;
    font-size: 0.625rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: auto;
    transition: opacity 0.15s;
}

a.course-group-instructor:hover {
    opacity: 0.8;
    color: #fff;
}

.course-group-runbook-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.course-group-header:hover .course-group-runbook-link {
    opacity: 1;
}

.course-group-runbook-link:hover {
    color: var(--color-link);
}

/* Prevent cost/dot cells in group headers from showing hover */
.course-group-cell.cost-cell,
.course-group-cell.dot-cell {
    pointer-events: none;
}

.course-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
}

.course-status-dot.course-status-live {
    background: var(--color-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

.course-cost {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
}

.course-select-all {
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.student-meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* GPU/CPU pills — fixed width for alignment */
.pill-gpu, .pill-cpu { min-width: 28px; text-align: center; }
.pill-gpu {
    color: var(--color-brand);
    border-color: color-mix(in srgb, var(--color-brand) 30%, transparent);
}

/* Detail Panel Tabs — Lab Details / Activity switcher */
.detail-panel-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    flex-shrink: 0;
}

.detail-tab {
    padding: 0.6rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.detail-tab:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.detail-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: color-mix(in srgb, var(--color-brand) 10%, transparent);
}

/* Activity panel content (inside detail panel) */
.detail-panel-activity {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 2rem;
}

.activity-panel-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

/* Activity icon in header */
.activity-icon {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

.activity-icon:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.06);
}

/* Indent student rows + sub-headers to align checkbox under group logo */
#students-table tr.student-row[class*="lab-group-"] > td:first-child,
#students-table tr.course-sub-header > th:first-child {
    padding-left: 3rem;
}

/* Page header with bottom margin (1.5rem) — replaces style="margin-bottom: 1.5rem;" */
.page-header-mb {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Section header with bottom margin (1rem) — replaces style="margin-bottom: 1rem;" */
.section-header-mb {
    margin-bottom: 1rem;
}

/* Table container with bottom margin (2rem) */
.table-container-mb {
    margin-bottom: 2rem;
}

/* Entity tile grid with bottom margin (2rem) */
.entity-tile-grid-mb {
    margin-bottom: 2rem;
}

/* 3-column stat grid */
.stat-cards-3 {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 2rem;
}

/* 4-column stat grid */
.stat-cards-4 {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 2rem;
}

/* Bulk toggle section */
.bulk-toggle-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* Small muted button */
.btn-muted-sm {
    font-size: 0.8125rem;
}

/* Remove button in table — small inline style variant */
.btn-remove-inline {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Table action column (fixed narrow width) */
th.action-col, td.action-col {
    width: 80px;
}

/* What's New modal list */
.whats-new-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.whats-new-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Table hyperlink — replaces style="color: var(--color-accent); text-decoration: none;" */
.table-link {
    color: var(--color-accent);
    text-decoration: none;
}

/* Small muted paragraph — replaces style="color: var(--color-text-muted); font-size: 0.875rem; margin-bottom: 2rem;" */
.text-muted-sm {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* What's New modal footer */
.modal-dismiss-footer {
    text-align: right;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* ============================================================================
   Deploy Confirmation Modal
   ============================================================================ */

.deploy-type-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.deploy-cost-indicator {
    display: flex;
    gap: 0.125rem;
}

.cost-dollar {
    color: var(--color-text-muted);
    opacity: 0.3;
    font-weight: 700;
    font-size: 0.875rem;
}

.cost-dollar-active {
    color: var(--color-success);
    opacity: 1;
}

.deploy-cost-summary {
    margin-top: 1rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ============================================================================
   Global Events Panel (Ticket #162)
   ============================================================================ */

.events-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    background: var(--color-bg-secondary);
    border-left: 1px solid var(--color-border);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
}
.events-panel.open {
    right: 0;
}
.events-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.events-panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
.events-panel-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
}
.events-panel-close:hover {
    color: var(--color-text);
}
.events-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.event-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 20px;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--color-border);
}
.event-time {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}
.event-action {
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.event-status {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.event-success { color: var(--color-success); }
.event-error { color: var(--color-error); }
.event-pending { color: var(--color-warning); }
.events-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.events-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.events-panel-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* === Ticket #159: Home Dashboard === */

.home-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Welcome banner */
.home-welcome {
    margin-bottom: 32px;
}

.home-welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.home-welcome-sub {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* Metric cards */
.home-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.home-metric-card {
    padding: 24px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0;
}

.home-metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    font-family: var(--font-mono);
}

.home-metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Two-column layout */
.home-columns {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    margin-bottom: 32px;
}

.home-section {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 24px;
}

.home-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
}

/* Activity table */
.home-activity-table {
    margin: 0;
    font-size: 0.8125rem;
}

.home-activity-table th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
    padding: 0.375rem 0.75rem;
}

.home-activity-table td {
    padding: 0.5rem 0.75rem;
    color: var(--color-text-muted);
}

.home-activity-time {
    white-space: nowrap;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* Course summary list */
.home-course-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.home-course-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.home-course-item:last-child {
    border-bottom: none;
}

.home-course-logo {
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.home-course-logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.home-course-logo svg {
    color: var(--color-icon-muted);
}

.home-course-info {
    min-width: 0;
    flex: 1;
}

.home-course-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-course-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.home-instructor-initials {
    font-weight: 600;
    color: var(--color-text-tertiary);
}

/* Empty state */
.home-empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-tertiary);
    font-size: 0.875rem;
}

.home-empty-state p {
    margin: 0;
}

/* System status strip */
.home-status-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.6875rem;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.home-status-sep {
    opacity: 0.4;
}

/* Responsive: metric cards 4 → 2 col, columns stack */
@media (max-width: 768px) {
    .home-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-columns {
        grid-template-columns: 1fr;
    }
}

/* === Ticket #163: User Dropdown Cleanup === */
.user-dropdown-item-disabled {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    opacity: 0.55;
    cursor: default;
}

/* === Ticket #166: Instructor Cards === */
.instructor-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.instructor-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.instructor-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}

.instructor-card:hover .instructor-card-actions {
    opacity: 1;
}

.instructor-card-action {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.instructor-card-action:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.instructor-card-action-danger:hover {
    color: var(--color-error);
    border-color: var(--color-error);
}

.instructor-name {
    font-weight: 600;
}

.instructor-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.instructor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.instructor-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.instructor-meta-item svg {
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

/* Inline form (add / edit) */
.instructor-inline-form {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
    margin-bottom: 0;
}

.instructor-inline-form[data-state="visible"] {
    max-height: 400px;
    opacity: 1;
    margin-bottom: 24px;
}

.instructor-inline-form-inner {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 24px;
}

.instructor-inline-form-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.instructor-inline-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.instructor-inline-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.instructor-inline-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.instructor-required {
    color: var(--color-error);
}

/* Edit form inside card */
.instructor-edit-form {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}

.instructor-edit-form[data-state="visible"] {
    max-height: 400px;
    opacity: 1;
}

.instructor-edit-form-inner {
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Delete confirmation */
.instructor-delete-confirm {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.15s ease;
}

.instructor-delete-confirm[data-state="visible"] {
    max-height: 120px;
    opacity: 1;
}

.instructor-delete-confirm-inner {
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.instructor-delete-msg {
    font-size: 0.875rem;
    color: var(--color-text);
}

.instructor-delete-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Validation error state */
.input-error {
    border-color: var(--color-error);
}

/* Responsive: stack form fields on small screens */
@media (max-width: 768px) {
    .instructor-inline-form-row {
        grid-template-columns: 1fr;
    }
    .instructor-delete-confirm-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* === Ticket #167: Company Cards === */

/* Company card — action buttons top-right */
.company-card {
    position: relative;
}

.company-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.company-card:hover .company-card-actions {
    opacity: 1;
}

.company-action-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.company-action-btn:hover {
    color: var(--color-text);
    border-color: var(--color-border);
}

.company-action-btn--danger:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

/* Company tile footer — side-by-side stats */
.company-tile-footer {
    display: flex;
    justify-content: center;
    gap: 24px;
}

/* Inline form (add/edit) */
.company-inline-form {
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.company-form-inner {
    padding: 24px;
}

.company-form-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.company-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .company-form-grid {
        grid-template-columns: 1fr;
    }
}

.company-logo-input-row {
    display: flex;
    gap: 8px;
}

.company-logo-input-row .input {
    flex: 1;
    min-width: 0;
}

.company-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* Logo search results grid */
.logo-search-results[hidden] {
    display: none;
}

.logo-search-results {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

.logo-search-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    padding: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease;
}

.logo-search-thumb:hover {
    border-color: var(--color-accent);
}

.logo-search-thumb.selected {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.3);
}

.logo-search-thumb.selected::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 8px;
    background-position: center;
    background-repeat: no-repeat;
}

.logo-search-thumb img {
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
}

.logo-search-loading,
.logo-search-empty {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    padding: 8px;
}

/* Logo preview */
.logo-preview[hidden] {
    display: none;
}

.logo-preview {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-preview img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--color-border);
    padding: 4px;
    background: var(--color-bg-tertiary);
}

/* Inline edit form inside card */
.company-edit-form {
    border-top: 1px solid var(--color-border);
    margin-top: 16px;
    padding-top: 16px;
}

.company-edit-form .company-form-inner {
    padding: 0;
}

/* Inline delete confirmation */
.company-delete-confirm {
    border-top: 1px solid var(--color-border);
    margin-top: 16px;
    padding-top: 16px;
}

.company-delete-msg {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 16px 0;
}

/* btn-sm and btn-danger already defined in Section 3 */
/* === Ticket #168: Students Page === */

.collapsible-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.students-inline-form {
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-secondary);
}

.students-inline-form-inner {
    padding: 16px;
}

.students-inline-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.students-inline-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.students-inline-form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.students-inline-form-hint {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.students-inline-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.students-actions-col {
    width: 72px;
}

.students-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.students-edit-btn,
.students-save-btn,
.students-cancel-btn,
.students-delete-btn {
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.students-edit-btn:hover,
.students-save-btn:hover {
    color: var(--color-text);
}

.students-delete-btn:hover {
    color: var(--color-danger);
}

.students-cancel-btn:hover {
    color: var(--color-text);
}

.students-edit-input {
    padding: 4px 8px;
    font-size: 0.8125rem;
}

@media (max-width: 768px) {
    .students-inline-form-row {
        grid-template-columns: 1fr;
    }
}

/* === Ticket #164: Inline Forms (Courses) === */
.course-inline-form {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
}

.course-inline-form[data-state="visible"] {
    max-height: 600px;
    opacity: 1;
    margin-bottom: 24px;
}

.course-inline-form-inner {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 24px;
}

.course-inline-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.course-inline-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.course-inline-form-field-full {
    grid-column: 1 / -1;
}

.course-inline-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text);
}

.course-required {
    color: var(--color-danger);
}

.course-inline-form-error {
    font-size: 0.75rem;
    color: var(--color-danger);
    margin-top: 4px;
    display: none;
}

.course-inline-form-error.visible {
    display: block;
}

.course-inline-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .course-inline-form-grid {
        grid-template-columns: 1fr;
    }
}
