:root {
    --bg-main: #020617;
    --bg-card: rgba(15, 23, 42, 0.7);
    --border-card: rgba(51, 65, 85, 0.5);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    
    --glow-emerald: 0 0 15px rgba(16, 185, 129, 0.3);
    --glow-red: 0 0 20px rgba(239, 68, 68, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    background-image: radial-gradient(circle at top right, #0f172a, #020617);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nav-bar {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-card);
}

.brand {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span { color: var(--accent-red); text-shadow: var(--glow-red); }

/* Intake Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 8px; }

input, select {
    width: 100%;
    background: #1e293b;
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 12px;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

input:focus { border-color: var(--accent-blue); }

.btn {
    background: var(--accent-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Fitzpatrick Picker */
.fitz-swatches { display: flex; gap: 8px; margin-top: 8px; }
.swatch {
    width: 32px; height: 32px; border-radius: 4px; cursor: pointer; border: 2px solid transparent;
}
.swatch.active { border-color: white; box-shadow: 0 0 10px rgba(255,255,255,0.5); }
.f1 { background: #f3cfbb; } .f2 { background: #e7c1b8; } .f3 { background: #c69383; }
.f4 { background: #ad7852; } .f5 { background: #915a3a; } .f6 { background: #402c25; }

/* Dashboard Specifics */
.monitor-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px;
    flex-grow: 1;
}

.video-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: black;
    aspect-ratio: 16/9;
}

#camera-view { width: 100%; height: 100%; object-fit: cover; }

.vitals-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vital-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vital-label { color: var(--text-muted); font-size: 0.9rem; }
.vital-value { font-family: 'JetBrains Mono', monospace; font-size: 2.2rem; font-weight: 700; }
.vital-unit { font-size: 0.9rem; color: var(--text-muted); margin-left: 4px; }

/* Pulse Animation */
@keyframes heart-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    15% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}
.pulse-icon {
    width: 12px; height: 12px; background: var(--accent-red); border-radius: 50%;
    box-shadow: var(--glow-red);
    display: inline-block;
    margin-right: 10px;
}
.pulse-active { animation: heart-pulse 0.8s infinite; }

/* SNR Gauge */
.snr-container { width: 100%; height: 4px; background: #1e293b; border-radius: 2px; margin-top: 8px; position: relative; }
.snr-bar { height: 100%; border-radius: 2px; transition: width 0.3s, background-color 0.3s; }

.badge {
    padding: 4px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.badge-valid { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.badge-marginal { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.badge-discard { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); border: 1px solid var(--accent-red); }
