* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: #0f172a;
    color: #f8fafc;
    min-height: 100vh;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

.glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #334155;
    background: #0f172a;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.form-group input:focus {
    border-color: #6366f1;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.5rem;
    border: none;
    background: #6366f1;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #334155;
    background: #1e293b;
    color: #cbd5e1;
    cursor: pointer;
}

.btn-primary-sm {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    background: #6366f1;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.btn-danger-sm {
    padding: 0.25rem 0.6rem;
    border-radius: 0.25rem;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
}

.error-alert {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Dashboard styles */
#app-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

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

.header-brand h2 {
    font-size: 1.125rem;
    font-weight: 700;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
}

.tab-btn.active {
    background: #334155;
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-admin {
    background: #6366f1;
    color: #fff;
}

.badge-supervisor {
    background: #059669;
    color: #fff;
}

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

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

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.device-card, .supervisor-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.online {
    background: #22c55e;
}

.card-body p {
    font-size: 0.875rem;
    color: #cbd5e1;
    margin-bottom: 0.35rem;
}

.card-footer {
    margin-top: 1rem;
}

.btn-connect {
    display: block;
    text-align: center;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 0.6rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-connect:hover {
    background: #1d4ed8;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
}

.modal-card h3 {
    margin-bottom: 1.25rem;
}

.btn-secondary-sm {
    padding: 0.25rem 0.6rem;
    border-radius: 0.25rem;
    border: 1px solid #334155;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 0.75rem;
    cursor: pointer;
    margin-right: 0.35rem;
}

.checkbox-list {
    margin: 1.25rem 0;
    max-height: 240px;
    overflow-y: auto;
}

.checkbox-item {
    margin-bottom: 0.75rem;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}

/* Viewer styles */
.viewer-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#toolbar {
    height: 48px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 10;
}

#display-container {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#overlay-msg {
    position: absolute;
    color: #94a3b8;
    font-size: 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
}
