:root {
    --bg-lab: #0a0a0c;
    --sidebar-bg: #0f0f12;
    --header-bg: #141419;

    --accent-teal: #14b8a6;
    --accent-glow: rgba(20, 184, 166, 0.4);

    --text-primary: #f0f0f0;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --border: #27272a;
    --border-glow: #3f3f46;

    --card-bg: rgba(24, 24, 27, 0.7);
    --input-bg: #18181b;
}

body {
    background: var(--bg-lab) !important;
    color: var(--text-primary);
    overflow: hidden;
}

.vision-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.lab-nav {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    z-index: 100;
}

.vision-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar Styling */
.vision-sidebar {
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section.grow {
    flex-grow: 1;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.section-header i {
    font-size: 1.25rem;
    color: var(--accent-teal);
}

/* Telemetry Grid */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.t-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 10px;
}

.t-card span {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.t-card strong {
    font-size: 1.1rem;
    color: var(--accent-teal);
}

/* Viewport Styling */
.viewport {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #111115 0%, #0a0a0c 100%);
    position: relative;
}

.canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

#vision-canvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 200px);
}

.overlay-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.switch-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    border-radius: 8px;
}

.switch-group button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.switch-group button.active {
    background: var(--accent-teal);
    color: white;
}

/* Object List */
.object-list {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 400px;
}

.obj-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    transition: background 0.2s;
}

.obj-item:hover {
    background: rgba(20, 184, 166, 0.05);
}

.obj-item .label {
    font-weight: 600;
}

.obj-item .conf {
    padding: 2px 6px;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid var(--accent-teal);
    color: var(--accent-teal);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Settings Card */
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 12px;
}

.setting-row {
    margin-bottom: 1rem;
}

.setting-row span {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-wrap input {
    flex: 1;
}

.range-wrap span {
    width: 32px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--accent-teal);
    margin: 0;
}

/* Lab Badge */
.lab-badge {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid var(--accent-teal);
    color: var(--accent-teal);
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-icon {
    width: 6px;
    height: 6px;
    background: var(--accent-teal);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(20, 184, 166, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}
