:root {
    --mega-red: #dc3545;
    --mega-ink: #17202a;
    --mega-muted: #687381;
    --mega-panel: #f7f9fb;
}

body {
    background: #eef2f6;
    color: var(--mega-ink);
}

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

.metric {
    background: #fff;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    padding: 1rem;
}

.metric-label {
    color: var(--mega-muted);
    font-size: .875rem;
}

.metric-value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
}

.content-panel {
    background: #fff;
    border: 1px solid #dce3ea;
    border-radius: 8px;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.student-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1rem;
    min-height: calc(100vh - 150px);
}

.remote-frame-wrap {
    min-height: 560px;
    background: #111827;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    border: 1px solid #243041;
    border-top: 0;
}

.remote-frame {
    width: 100%;
    height: 100%;
    min-height: 560px;
    border: 0;
    background: #0b1020;
}

.remote-placeholder {
    min-height: 560px;
    display: grid;
    place-items: center;
    color: #cbd5e1;
    text-align: center;
    padding: 2rem;
}

.instructions-panel {
    background: #fff;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    padding: 1rem;
    overflow: auto;
}

.timer-box {
    border: 1px solid #dce3ea;
    border-radius: 8px;
    background: #fff;
    padding: .75rem 1rem;
}

.lab-console {
    background: #111827;
    border-radius: 8px;
    box-shadow: 0 16px 50px rgba(15, 23, 42, .18);
}

.lab-console-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem;
    background: #111827;
    border: 1px solid #243041;
    border-bottom: 1px solid #334155;
    border-radius: 8px 8px 0 0;
}

.lab-console-tabs .nav {
    min-width: 0;
}

.lab-machine-tab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: .45rem;
    min-width: 136px;
    min-height: 48px;
    padding: .45rem .7rem;
    color: #cbd5e1;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #1f2937;
    text-align: left;
}

.lab-machine-tab i {
    grid-row: 1 / span 2;
    font-size: 1.2rem;
}

.lab-machine-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
}

.lab-machine-tab small {
    color: #94a3b8;
    font-size: .72rem;
    line-height: 1;
}

.lab-machine-tab.nav-link:hover,
.lab-machine-tab.nav-link:focus {
    color: #fff;
    border-color: #64748b;
}

.lab-machine-tab.nav-link.active {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}

.lab-machine-tab.nav-link.active small {
    color: #ffe4e6;
}

.lab-machine-tab:disabled {
    color: #64748b;
    background: #111827;
    border-color: #1f2937;
    opacity: 1;
}

@media (max-width: 992px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .student-shell {
        grid-template-columns: 1fr;
    }

    .instructions-panel {
        max-height: none;
    }

    .lab-console-tabs {
        align-items: stretch;
        flex-direction: column;
    }

    .lab-console-tabs .nav {
        width: 100%;
    }

    .lab-machine-tab {
        min-width: 150px;
    }

    #openConnectionLink {
        width: 100%;
    }
}
