/* ===========================================
   Admin Drawers (Fluent Design)
   =========================================== */

.admin-drawer-scrim {
    position: fixed;
    inset: 0;
    background: var(--colorNeutralBackgroundOverlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease, background 220ms ease;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}

.admin-drawer-scrim.open {
    opacity: 1;
    visibility: visible;
}

.admin-drawer {
    width: 640px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-shell);
    display: grid;
    grid-template-rows: auto 1fr auto;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.06), -2px 0 6px rgba(0, 0, 0, 0.04);
    transform: translateX(100%);
    transition: transform 220ms ease;
    overflow: hidden;
}

.admin-drawer-scrim.open .admin-drawer {
    transform: translateX(0);
}

.admin-drawer.sm {
    width: 480px;
}

.admin-drawer.xs {
    width: 400px;
}

.admin-drawer.lg {
    width: 800px;
}

.admin-drawer.xl {
    width: 960px;
}

/* ===========================================
   NeoConfirmDialog (Fluent Modal)
   ===========================================
   z-index dialog = 1100, between drawers (1000) and toasts (1200).
   Uses :root var(--z-dialog) for consistency.
   =========================================== */

@keyframes neo-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes neo-scale-in {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.neo-confirm-scrim {
    position: fixed;
    inset: 0;
    background: var(--colorNeutralBackgroundOverlay);
    z-index: var(--z-dialog, 1100);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: neo-fade-in 220ms ease;
}

@keyframes neo-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.neo-confirm-scrim.open {
    opacity: 1;
    pointer-events: auto;
}

.neo-confirm-scrim.open .neo-confirm-dialog {
    animation: neo-scale-in 220ms ease;
}

.neo-confirm-dialog {
    background: var(--bg-shell, #fff);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow4);
    max-width: 480px;
    width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.neo-confirm-dialog-header strong {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.neo-confirm-dialog-message {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary, #555);
    line-height: 1.5;
}

.neo-confirm-dialog-body {
    font-size: 14px;
}

.neo-confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.neo-confirm-dialog-header-dismiss {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-confirm-modal-scrim {
    position: fixed;
    inset: 0;
    z-index: var(--z-dialog, 1300);
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: neo-fade-in 160ms ease;
}

.admin-confirm-modal {
    width: min(440px, 100%);
    background: var(--colorNeutralBackground1, #fff);
    border: 1px solid var(--colorNeutralStroke2, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    padding: 22px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    animation: neo-scale-in 160ms ease;
}

.admin-confirm-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a3700;
    background: #fff4ce;
}

.admin-confirm-modal-icon.danger {
    color: #c50f1f;
    background: #fde7e9;
}

.admin-confirm-modal-icon.success {
    color: #107c10;
    background: #dff6dd;
}

.admin-confirm-modal-icon.info {
    color: #005a9e;
    background: #deecf9;
}

.admin-confirm-modal-icon .app-icon,
.admin-confirm-modal-icon svg {
    width: 22px;
    height: 22px;
}

.admin-confirm-modal-content {
    min-width: 0;
}

.admin-confirm-modal-content.no-icon {
    grid-column: 1 / -1;
}

.admin-confirm-modal-content strong {
    display: block;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 8px;
}

.admin-confirm-modal-content p {
    margin: 0;
    color: var(--text-secondary, #4b5563);
    font-size: 14px;
    line-height: 1.5;
}

.admin-confirm-modal-body {
    margin-top: 14px;
    font-size: 14px;
}

.admin-confirm-modal-error {
    margin-top: 12px !important;
    color: #c50f1f !important;
    font-weight: 500;
}

.admin-confirm-modal-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

/* Drawer Header */
.admin-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.admin-drawer-head strong {
    display: block;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
}

.admin-drawer-kicker {
    display: inline-block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 2px;
}

.admin-drawer-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    color: var(--colorStatusDangerForeground1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background 120ms ease, color 120ms ease;
}

.admin-drawer-close:hover {
    background: var(--colorStatusDangerBackground1);
    color: var(--colorStatusDangerForeground1);
}

.admin-drawer-close .app-icon {
    width: 18px;
    height: 18px;
}

/* Drawer Body */
.admin-drawer-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
}

/* Prevent form-grid gap + field-group margin from compounding in drawers */
.admin-drawer-body .form-grid .field-group {
    margin-bottom: 0;
}

/* Drawer Footer */
.admin-drawer-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
    flex: 0 0 auto;
}

.admin-drawer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.admin-drawer-error {
    color: var(--error-text);
    font-size: 0.85rem;
    margin: 0;
}

.admin-drawer-actions .solid {
    min-width: 120px;
}

.admin-drawer-stacked-scrim {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: 640px;
    background: var(--colorNeutralBackgroundOverlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
    z-index: 1100;
    display: flex;
    justify-content: flex-end;
}

.admin-drawer-stacked-scrim.sm {
    width: 480px;
}

.admin-drawer-stacked-scrim.xs {
    width: 400px;
}

.admin-drawer-stacked-scrim.lg {
    width: 800px;
}

.admin-drawer-stacked-scrim.open {
    opacity: 1;
    visibility: visible;
}

.admin-drawer-stacked-scrim .admin-drawer {
    transform: translateX(100%);
    transition: transform 220ms ease;
}

.admin-drawer-stacked-scrim.open .admin-drawer {
    transform: translateX(0);
}

.admin-drawer-tertiary-scrim {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: 640px;
    background: var(--colorNeutralBackgroundOverlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
}

.admin-drawer-tertiary-scrim.sm {
    width: 480px;
}

.admin-drawer-tertiary-scrim.xs {
    width: 400px;
}

.admin-drawer-tertiary-scrim.lg {
    width: 800px;
}

.admin-drawer-tertiary-scrim.open {
    opacity: 1;
    visibility: visible;
}

.admin-drawer-tertiary-scrim .admin-drawer {
    transform: translateX(100%);
    transition: transform 220ms ease;
}

.admin-drawer-tertiary-scrim.open .admin-drawer {
    transform: translateX(0);
}

/* Stacked drawer: main drawer slides left + scrim darkens */
.admin-drawer-stack.stacked-open .admin-drawer-scrim {
    background: rgba(0, 0, 0, 0.55);
}

.admin-drawer-stack.stacked-open .admin-drawer-scrim.open .admin-drawer {
    transform: translateX(-80px);
}

.admin-drawer-stack.tertiary-open .admin-drawer-stacked-scrim.open .admin-drawer {
    transform: translateX(-80px);
}

/* Drawer responsive */
@media (max-width: 720px) {
    .admin-drawer {
        width: 100vw !important;
    }

    .admin-drawer-head {
        padding: 14px 16px 12px;
    }

    .admin-drawer-body {
        padding: 12px 16px 16px;
    }

    .admin-drawer-footer {
        padding: 12px 16px 16px;
    }

    .lab-student-vm-grid-main,
    .lab-student-flat-grid {
        grid-template-columns: 1fr;
    }

    .participant-instructor-grid {
        grid-template-columns: 1fr;
    }
}

/* Lab Drawer (tracking) */
.lab-drawer-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lab-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 0;
}

.lab-drawer-console {
    flex: 1;
    overflow: hidden;
    border-top: 1px solid var(--line);
    background: #f5f5f5;
    min-height: 0;
}

.lab-drawer-section {
    margin-bottom: 20px;
}

.lab-drawer-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}

.lab-drawer-person {
    margin-bottom: 12px;
}

.lab-drawer-person-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.lab-drawer-person-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.lab-drawer-person-row:hover {
    background: var(--bg-hover);
}

.lab-drawer-person-row.selected {
    background: var(--bg-selected);
}

.lab-drawer-vm-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--brand);
}

.lab-drawer-vm-name {
    flex: 1;
    font-size: 0.85rem;
}

.lab-drawer-vm-status {
    flex-shrink: 0;
}

.lab-drawer-view-btn {
    flex-shrink: 0;
}

.lab-drawer-empty {
    display: grid;
    place-items: center;
    padding: 32px;
    color: var(--muted);
    text-align: center;
    gap: 8px;
}

.lab-drawer-empty .app-icon {
    width: 36px;
    height: 36px;
    opacity: 0.4;
}

.lab-drawer-console-frame {
    width: 100%;
    height: 100%;
    border: 0;
}

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

@keyframes loading-progress-slide {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(42%);
    }
}
