:root {
    --primary: #0f172a;
    --brand: #8b5cf6;
    --brand-soft: #ede9fe;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card: #ffffff;
}

* { box-sizing: border-box; font-family: 'Inter', 'Segoe UI', sans-serif; }
body { margin: 0; background: var(--bg); color: var(--primary); }

/* --- LOGIN PAGE --- */
#loginPage {
    height: 100vh; display: flex; justify-content: center; align-items: center;
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(139, 92, 246, 0.5)), 
                url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&q=80');
    background-size: cover;
}
.login-box {
    background: rgba(255, 255, 255, 0.98); padding: 40px; border-radius: 28px;
    width: 420px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.auth-link { color: var(--brand); text-decoration: none; font-weight: bold; }
.error-text { color: var(--danger); font-size: 14px; margin-top: 15px; }

/* --- LAYOUT --- */
#app { display: grid; grid-template-rows: 70px 1fr; height: 100vh; }
header { 
    background: white; padding: 0 40px; border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center; z-index: 100;
}
.header-actions { display: flex; align-items: center; gap: 20px; }
#nexus-container { display: flex; height: calc(100vh - 70px); }

/* --- SIDEBAR --- */
.sidebar { background: var(--primary); color: white; padding: 25px; width: 280px; display: flex; flex-direction: column; }
.nav-btn {
    background: transparent; color: #94a3b8; border: none; padding: 14px 18px;
    text-align: left; border-radius: 12px; cursor: pointer; transition: 0.3s;
    font-size: 0.95rem; font-weight: 500; margin-bottom: 5px;
}
.nav-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-btn.active { background: var(--brand); color: white; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.zenith-tip { background: rgba(255,255,255,0.05); padding: 15px; border-radius: 12px; font-size: 12px; margin-bottom: 15px; }
.version-tag { font-size: 11px; color: #64748b; padding: 10px; }

/* --- CONTENT --- */
.main-content { flex-grow: 1; overflow-y: auto; padding: 35px; }
.card { background: var(--card); border-radius: 20px; padding: 25px; margin-bottom: 25px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #f1f5f9; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-bottom: 25px; }

/* --- STATS --- */
.stat-card { padding: 25px; border-radius: 16px; color: white; }
.blue { background: #6366f1; }
.green { background: #10b981; }
.indigo { background: #8b5cf6; }

/* --- COMPONENTS --- */
.med-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; }
.med-table th { background: #f8fafc; padding: 15px; text-align: left; font-size: 13px; color: #64748b; }
.med-table td { padding: 15px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.category-tag { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; text-transform: uppercase; }
.cat-pain { background: #fee2e2; color: #ef4444; }
.cat-antibiotic { background: #dcfce7; color: #16a34a; }
.cat-chronic { background: #e0f2fe; color: #0284c7; }

.video-box { aspect-ratio: 16/9; background: #1e293b; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: white; position: relative; }
.video-overlay { position: absolute; bottom: 20px; display: flex; gap: 15px; }
.report-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 10px; }

.btn { padding: 12px 24px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; }
.btn-brand { background: var(--brand); color: white; }
.btn-sos { background: #fff1f2; color: var(--danger); border: 1px solid #fecaca; font-size: 12px; }
.btn-terminate { background: var(--danger); color: white; padding: 8px 18px; font-size: 13px; }
.ctrl-btn { background: #475569; border-radius: 50%; width: 50px; height: 50px; }
.ctrl-btn-end { background: var(--danger); border-radius: 50%; width: 50px; height: 50px; }

.badge { background: var(--brand); padding: 6px 16px; border-radius: 30px; color: white; font-size: 12px; font-weight: 700; }
.search-bar { width: 250px; margin: 0; }
.ai-output-box { margin-top: 20px; padding: 20px; border-radius: 15px; background: var(--brand-soft); border-left: 5px solid var(--brand); }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pay-option { border: 2px solid var(--brand-soft); padding: 20px; border-radius: 15px; text-align: center; cursor: pointer; }
.pay-option.secondary { border: 2px solid #e2e8f0; }

input, select, textarea { width: 100%; padding: 12px; margin: 8px 0; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }