/* ── Reset & Variables (Premium Dark Glassmorphism Theme) ────── */
:root {
    --bg: #0B0E14;             /* Deep space background */
    --bg-surface: rgba(255, 255, 255, 0.03); /* Frosted Glass Fill */
    --bg-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.1); 
    --border-strong: rgba(255, 255, 255, 0.15);
    
    /* Vibrant Neon Palette */
    --accent: #38BDF8;         /* Cyan */
    --accent-glow: rgba(56, 189, 248, 0.4);
    
    --success: #10B981;        /* Neon Green */
    --warn: #FBBF24;           /* Amber */
    --danger: #F43F5E;         /* Rose/Magenta */
    --info: #8B5CF6;           /* Purple */
    
    --text: #F8FAFC;           /* Bright White */
    --muted: #94A3B8;          /* Slate Gray */
    
    --font: 'Outfit', system-ui, sans-serif;
    
    --radius: 12px;
    --radius-lg: 20px;
    --sidebar: 260px;
    --navbar-height: 70px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Animated Background Orbs ──────────────────────────── */
.glass-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0B0E14 0%, #05070A 100%);
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}
.orb-1 { width: 400px; height: 400px; background: var(--accent); top: -100px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: var(--info); bottom: -150px; right: -100px; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: var(--danger); top: 40%; left: 30%; opacity: 0.3; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 30px) scale(1.1); }
    100% { transform: translate(-30px, 60px) scale(0.9); }
}

/* ── Layout ────────────────────────────────────────────── */
.app-container { 
    display: flex; 
    min-height: 100vh; 
    padding-top: var(--navbar-height);
}

/* ── Top Navbar (Glassmorphism) ────────────────────────── */
.top-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-height);
    background: rgba(11, 14, 20, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    z-index: 100;
}

.nav-left .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}
.logo i { color: var(--danger); filter: drop-shadow(0 0 10px var(--danger)); }
.logo .highlight { font-weight: 300; color: var(--accent); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 30px;
}
.search-box i { color: var(--muted); }
.search-box input {
    background: transparent;
    border: none;
    color: var(--text);
    outline: none;
    font-family: var(--font);
    width: 200px;
}
.btn-icon {
    background: transparent; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; transition: color .2s;
}
.btn-icon:hover { color: var(--text); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    cursor: pointer;
}
.user-profile img {
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent);
}

/* ── Sidebar (Glassmorphism) ───────────────────────────── */
.sidebar {
    width: var(--sidebar);
    position: fixed;
    top: var(--navbar-height); left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 32px 0;
    background: rgba(11, 14, 20, 0.4); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    z-index: 50;
}

.nav-links { list-style: none; flex: 1; padding: 0 20px; }

.nav-links li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .3s ease;
    border: 1px solid transparent;
}
.nav-links li i { width: 22px; font-size: 1.2rem; flex-shrink: 0; }
.nav-links li:hover { color: var(--text); background: var(--bg-hover); border-color: var(--border); }
.nav-links li.active {
    color: #fff;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.sidebar-footer { padding: 0 32px; color: var(--muted); font-size: 0.85rem; }
.sidebar-footer p { color: var(--text); font-weight: 600; font-size: 1rem; margin-bottom: 4px; }

/* ── Main Content ──────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar);
    flex: 1;
    padding: 40px 48px;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
}

.header-titles h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.header-titles .subtitle { 
    color: var(--muted); 
    font-size: 1rem; 
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, #1D4ED8 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .3s;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6); }
.btn-sm { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer; transition: .2s; }
.btn-sm:hover { background: var(--accent); border-color: var(--accent); }

/* ── Views ─────────────────────────────────────────────── */
.view { display: none; flex-direction: column; gap: 24px; }
.view.active-view { display: flex; }
.view.animate-enter { animation: fadeUp .5s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Glass Cards ───────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 24px;
    transition: transform .3s, border-color .3s;
}
.glass-card:hover { border-color: rgba(255,255,255,0.25); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #fff;
}

.accent { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }

/* ── Badges ────────────────────────────────────────────── */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.badge.warn    { background: rgba(251,191,36,0.15); color: #FCD34D; border: 1px solid rgba(251,191,36,0.3); }
.badge.danger  { background: rgba(244,63,94,0.15);  color: #FDA4AF; border: 1px solid rgba(244,63,94,0.3); }
.badge.info    { background: rgba(139,92,246,0.15);  color: #C4B5FD; border: 1px solid rgba(139,92,246,0.3); }
.badge.success { background: rgba(16,185,129,0.15); color: #6EE7B7; border: 1px solid rgba(16,185,129,0.3); }

/* ── Charts ────────────────────────────────────────────── */
.chart-box { position: relative; height: 280px; width: 100%; }

/* ── Grids ─────────────────────────────────────────────── */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin: 32px 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

/* ── Insight Banner ────────────────────────────────────── */
.insight-banner {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 32px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(255,255,255,0.02));
    border-left: 4px solid var(--accent);
}
.banner-icon i { font-size: 2.2rem; color: var(--warn); filter: drop-shadow(0 0 10px rgba(251,191,36,0.5)); }
.banner-content p { font-size: 1.05rem; line-height: 1.5; color: var(--text); }
.banner-content .action-text { color: var(--accent); margin-top: 8px; font-weight: 500; }

/* ── Heatmap ───────────────────────────────────────────── */
.heatmap-wrap { overflow-x: auto; }
.heatmap-wrap table { width: 100%; border-collapse: separate; border-spacing: 3px; }
.heatmap-wrap th { padding: 8px; color: var(--muted); font-size: .8rem; font-weight: 500; text-transform: uppercase; }
.heatmap-wrap td {
    padding: 8px;
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
    border-radius: 6px;
    transition: transform .2s, box-shadow .2s;
    cursor: default;
}
.heatmap-wrap td:hover { transform: scale(1.15); box-shadow: 0 0 15px rgba(255,255,255,0.2); z-index: 2; position: relative; }

/* ── Stats Row ─────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
}
.stat-card .icon-wrap { 
    font-size: 1.6rem; 
    color: var(--accent);
    background: rgba(255,255,255,0.05);
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.stat-card .icon-wrap.success { color: var(--success); }
.stat-card .icon-wrap.info { color: var(--info); }
.stat-card .icon-wrap.warn { color: var(--warn); }
.stat-num { font-size: 2.2rem; font-weight: 600; color: #fff; line-height: 1; }
.stat-label { font-size: .9rem; color: var(--muted); margin-top: 6px; }

/* ── Staff Directory ───────────────────────────────────── */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.staff-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all .3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}
.staff-card:hover, .staff-card.selected {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2);
}
.staff-icon { font-size: 2rem; color: var(--accent); margin-bottom: 8px; filter: drop-shadow(0 0 8px var(--accent-glow)); }
.staff-name { font-weight: 600; font-size: 1.1rem; color: #fff; }
.staff-role, .staff-dept { font-size: .85rem; color: var(--muted); }
.staff-dept { color: var(--accent); font-weight: 500; }

/* ── Detail Panels ─────────────────────────────────────── */
.detail-panel {
    padding: 24px 32px;
    margin-top: 24px;
}
.detail-panel h3 { color: #fff; margin-bottom: 20px; font-size: 1.2rem; display: flex; align-items: center; gap: 12px; }
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; padding-right: 8px; }
.detail-list li {
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background .2s;
}
.detail-list li:hover { background: rgba(255,255,255,0.05); }
.detail-list .meds { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ── Patient Journey Detail Panel ──────────────────────── */
.journey-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.journey-item { display: flex; flex-direction: column; gap: 4px; }
.journey-item .j-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; }
.journey-item .j-val { font-weight: 500; font-size: 1.05rem; color: #fff; }
.med-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.med-tag { background: rgba(139,92,246,0.15); color: #C4B5FD; border: 1px solid rgba(139,92,246,0.3); font-size: .8rem; padding: 4px 12px; border-radius: 20px; }

/* ── Data Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.data-table td {
    padding: 14px 18px;
    font-size: .95rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background .2s;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.05); }
.data-table tbody tr.row-selected td { background: rgba(56, 189, 248, 0.15); }

/* ── Recommendations ───────────────────────────────────── */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.rec-card {
    position: relative;
    padding: 32px 28px;
    overflow: hidden;
}
.rec-num {
    font-size: 4rem;
    font-weight: 700;
    color: rgba(255,255,255,0.03);
    position: absolute;
    top: 10px; right: 10px;
    line-height: 1;
}
.rec-card h3 { font-size: 1.2rem; margin-bottom: 16px; color: #fff; }
.rec-evidence { color: var(--muted); font-size: .95rem; line-height: 1.6; min-height: 70px; }
.glow-line { height: 1px; width: 100%; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 20px 0; }
.rec-action { color: var(--accent); font-weight: 500; font-size: .95rem; line-height: 1.6; display: flex; gap: 8px; }

/* ── Animations ────────────────────────────────────────── */
.animate-up { animation: fadeUp .6s cubic-bezier(.16,1,.3,1) both; animation-delay: var(--d, 0s); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1200px) {
    .grid-2col { grid-template-columns: 1fr; }
    .rec-grid  { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 24px; }
    .stats-row { grid-template-columns: 1fr; }
}
