:root {
    --labsa-proctor-blue: #0d6efd;
    --labsa-proctor-navy: #0b2f63;
    --labsa-proctor-green: #16a34a;
    --labsa-proctor-red: #dc2626;
    --labsa-proctor-border: #dbe6f4;
    --labsa-proctor-bg: #f4f7fc;
}

#labsa-proctor-manual-camera-button {
    position: fixed;
    top: 15px;
    right: 190px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    color: #fff;
    background: #f59e0b;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.3);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    z-index: 2001;
}

#labsa-proctor-manual-camera-button i {
    font-size: 21px;
}

#labsa-proctor-manual-camera-button b {
    width: 9px;
    height: 9px;
    background: #fff;
    border-radius: 50%;
}

#labsa-proctor-manual-camera-button[data-state="loading"] b {
    animation: labsa-camera-pulse 1s infinite;
}

#labsa-proctor-manual-camera-button[data-state="error"] {
    background: #dc2626;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.3);
}

#labsa-proctor-manual-camera-button[data-state="error"] b {
    background: #fecaca;
}

@keyframes labsa-camera-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.7); }
}

#labsa-proctor-camera-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-right: 10px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    cursor: pointer;
    z-index: 1060;
}

#labsa-proctor-camera-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

#labsa-proctor-camera-button i {
    font-size: 24px;
}

#labsa-proctor-camera-button .labsa-proctor-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    background: var(--labsa-proctor-red);
    border: 2px solid #fff;
    border-radius: 50%;
}

#labsa-proctor-camera-button.is-live .labsa-proctor-dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

#labsa-proctor-camera-button.labsa-proctor-floating-control {
    position: fixed;
    top: 16px;
    right: 16px;
    margin: 0;
    background: var(--labsa-proctor-blue);
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.28);
}

.labsa-proctor-preview {
    position: fixed;
    top: 80px;
    right: 18px;
    width: min(270px, calc(100vw - 36px));
    overflow: hidden;
    background: #111827;
    border: 3px solid #22c55e;
    border-radius: 12px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.34);
    z-index: 1055;
}

.labsa-proctor-preview.is-collapsed {
    width: 190px;
}

.labsa-proctor-preview.is-collapsed video {
    display: none;
}

.labsa-proctor-preview video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    object-fit: cover;
    transform: scaleX(-1);
}

.labsa-proctor-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 6px 9px;
    color: #fff;
    background: rgba(15, 23, 42, 0.96);
    font-size: 12px;
}

.labsa-proctor-preview-bar strong {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.labsa-proctor-preview-bar strong::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: #22c55e;
    border-radius: 50%;
}

.labsa-proctor-preview-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 23px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    border-radius: 6px;
}

.labsa-proctor-permission {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 18, 39, 0.86);
    backdrop-filter: blur(5px);
    z-index: 20000;
}

.labsa-proctor-permission-card {
    width: min(500px, 100%);
    padding: 34px;
    text-align: center;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.labsa-proctor-permission-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    margin-bottom: 18px;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #22a6f2);
    border-radius: 24px;
    box-shadow: 0 14px 30px rgba(13, 110, 253, 0.25);
}

.labsa-proctor-permission-icon i {
    font-size: 42px;
}

.labsa-proctor-permission h3 {
    margin: 0 0 10px;
    color: #102a4c;
    font-weight: 700;
}

.labsa-proctor-permission p {
    margin: 0 0 20px;
    color: #64748b;
    line-height: 1.6;
}

.labsa-proctor-permission-message {
    display: none;
    margin-bottom: 16px;
    padding: 11px 14px;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 9px;
    font-size: 13px;
}

.labsa-proctor-permission-message.is-visible {
    display: block;
}

.labsa-proctor-start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 220px;
    padding: 12px 22px;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #1594e8);
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(13, 110, 253, 0.22);
}

.labsa-proctor-start-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.labsa-proctor-admin-shell {
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    left: 230px;
    overflow: auto;
    padding: 24px;
    background: var(--labsa-proctor-bg);
    z-index: 900;
}

.wrapper.toggled + .labsa-proctor-admin-shell {
    left: 70px;
}

.labsa-proctor-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--labsa-proctor-border);
    border-radius: 14px;
    box-shadow: 0 7px 22px rgba(15, 46, 87, 0.07);
}

.labsa-proctor-admin-title {
    display: flex;
    align-items: center;
    gap: 13px;
}

.labsa-proctor-admin-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #1aa3ed);
    border-radius: 12px;
}

.labsa-proctor-admin-title-icon i {
    font-size: 26px;
}

.labsa-proctor-admin-title h4,
.labsa-proctor-admin-title p {
    margin: 0;
}

.labsa-proctor-admin-title h4 {
    color: #102a4c;
    font-weight: 700;
}

.labsa-proctor-admin-title p {
    margin-top: 3px;
    color: #718096;
    font-size: 13px;
}

.labsa-proctor-admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.labsa-proctor-search {
    width: min(260px, 34vw);
    min-height: 40px;
    padding: 8px 13px;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #d8e2ef;
    border-radius: 9px;
    outline: none;
}

.labsa-proctor-search:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.labsa-proctor-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 13px;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.labsa-proctor-count::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.labsa-proctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.labsa-proctor-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--labsa-proctor-border);
    border-radius: 14px;
    box-shadow: 0 9px 25px rgba(15, 46, 87, 0.09);
}

.labsa-proctor-video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #101827;
}

.labsa-proctor-video-wrap video {
    display: block;
    width: 100%;
    height: 100%;
    background: #101827;
    object-fit: cover;
}

.labsa-proctor-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #b8c6d9;
    text-align: center;
}

.labsa-proctor-video-placeholder i {
    font-size: 42px;
}

.labsa-proctor-video-placeholder small {
    max-width: 220px;
}

.labsa-proctor-card.has-stream .labsa-proctor-video-placeholder {
    display: none;
}

.labsa-proctor-live-badge,
.labsa-proctor-visibility-badge {
    position: absolute;
    top: 10px;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    color: #fff;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.labsa-proctor-live-badge {
    left: 10px;
    gap: 5px;
    background: rgba(22, 163, 74, 0.9);
}

.labsa-proctor-live-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
}

.labsa-proctor-visibility-badge {
    right: 10px;
    background: rgba(220, 38, 38, 0.9);
}

.labsa-proctor-visibility-badge[hidden] {
    display: none;
}

.labsa-proctor-fullscreen {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    z-index: 2;
}

.labsa-proctor-card-body {
    padding: 13px 15px 15px;
}

.labsa-proctor-card-body strong,
.labsa-proctor-card-body small {
    display: block;
}

.labsa-proctor-card-body strong {
    overflow: hidden;
    color: #172b4d;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.labsa-proctor-card-body small {
    overflow: hidden;
    margin-top: 3px;
    color: #718096;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.labsa-proctor-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    color: #64748b;
    border-top: 1px solid #edf2f7;
    font-size: 11px;
}

.labsa-proctor-empty,
.labsa-proctor-error {
    display: flex;
    min-height: 360px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: #6b7c93;
    text-align: center;
    background: #fff;
    border: 1px dashed #bdcce0;
    border-radius: 15px;
}

.labsa-proctor-empty i,
.labsa-proctor-error i {
    color: #8fa8c5;
    font-size: 58px;
}

.labsa-proctor-empty h5,
.labsa-proctor-empty p,
.labsa-proctor-error h5,
.labsa-proctor-error p {
    margin: 0;
}

.labsa-proctor-error {
    color: #991b1b;
    background: #fff7f7;
    border-color: #fecaca;
}

@media (max-width: 1024px) {
    .labsa-proctor-admin-shell {
        left: 0;
    }
}

@media (max-width: 720px) {
    #labsa-proctor-manual-camera-button {
        top: 10px;
        right: 10px;
    }

    .labsa-proctor-preview {
        top: 72px;
        right: 10px;
        width: 190px;
    }

    .labsa-proctor-admin-shell {
        top: 60px;
        padding: 14px;
    }

    .labsa-proctor-admin-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .labsa-proctor-admin-actions {
        width: 100%;
    }

    .labsa-proctor-search {
        width: 100%;
        flex: 1;
    }

    .labsa-proctor-grid {
        grid-template-columns: 1fr;
    }

    .labsa-proctor-permission-card {
        padding: 26px 20px;
    }
}
