/* CSS Design System - Dark Medical Tech Style */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #121824;
    --bg-tertiary: #1b2336;
    --border-color: #2b3852;
    --border-glow: #06b6d4;
    --glass-bg: rgba(18, 24, 36, 0.7);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    /* Neon Colors */
    --accent-blue: #0284c7;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-glow-cyan: 0 0 15px rgba(6, 182, 212, 0.35);
    --shadow-glow-green: 0 0 15px rgba(16, 185, 129, 0.35);
    --shadow-glow-red: 0 0 15px rgba(239, 68, 68, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

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

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Screen Transitions */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 24px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: var(--text-primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(43, 56, 82, 0.8);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, var(--accent-red));
    color: var(--text-primary);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-glow {
    position: relative;
    box-shadow: var(--shadow-glow-cyan);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

/* EMR footer button variant when arriving from Review Case */
.btn-review-mode {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 179, 8, 0.1)) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: var(--accent-orange) !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25) !important;
}

.btn-icon-only {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-review {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge-lite {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Animation utilities */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.animate-pulse-slow {
    animation: pulse 3s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bounce {
    animation: bounce 2s infinite ease-in-out;
}

/* ---------------------------------------------------- */
/* SCREEN 1: WELCOME SCREEN */
/* ---------------------------------------------------- */
#screen-welcome {
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}
.login-theme-toggle:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.login-theme-toggle i {
    width: 18px;
    height: 18px;
}
body.light-theme .login-theme-toggle {
    background: rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
    color: #475569;
}
body.light-theme .login-theme-toggle:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    text-align: center;
}

.brand-header h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 32px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 16px;
}

.brand-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.logo-glow {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(6, 182, 212, 0.15);
    border: 2px solid var(--accent-cyan);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-cyan);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-cyan);
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.input-group label i {
    width: 14px;
    height: 14px;
}

.input-group input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--accent-cyan);
    outline: none;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}

.divider {
    margin: 20px 0;
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 10px;
}

#btn-bypass {
    width: 100%;
}

#btn-login {
    width: 100%;
    margin-top: 10px;
}

/* ---------------------------------------------------- */
/* SCREEN 2: INTRO VIDEO */
/* ---------------------------------------------------- */

/* Clinician identity bar — floats right above the video container */
.video-clinician-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.video-tour-container {
    max-width: 960px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.btn-skip {
    position: absolute;
    top: -12px;
    right: 0;
    z-index: 10;
    background: rgba(18, 24, 36, 0.8);
    border-color: var(--border-color);
}

.video-frame {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    background: #000;
}

.video-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.btn-play-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-cyan);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-play-large i {
    width: 32px;
    height: 32px;
    fill: white;
}

.btn-play-large:hover {
    transform: scale(1.1);
}

.video-details {
    text-align: center;
    padding: 0 40px;
}

.video-details h2 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 8px;
}

.video-details p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px auto;
    font-size: 14px;
    line-height: 1.5;
}

/* ---------------------------------------------------- */
/* SCREEN 3: PATIENT DASHBOARD */
/* ---------------------------------------------------- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title i {
    width: 36px;
    height: 36px;
}

.text-cyan {
    color: var(--accent-cyan);
}

.header-title h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Profile Summary Card ── */
.profile-summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin: 0 0 12px 0;
    border-radius: 14px;
    flex-shrink: 0;
}
.psc-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.psc-avatar i { width: 22px; height: 22px; color: #fff; }
.psc-info {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1; min-width: 0;
}
.psc-name {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.psc-meta {
    font-size: 12px; color: var(--text-tertiary);
    display: flex; align-items: center; gap: 5px;
}
.psc-sep { opacity: 0.4; }
.psc-stats {
    display: flex; gap: 20px; align-items: center; flex-shrink: 0;
}
.psc-stat {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.psc-stat-val {
    font-size: 18px; font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-display);
}
.psc-stat-lbl {
    font-size: 10px; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.psc-stat-done .psc-stat-val { color: var(--accent-green); }
.psc-actions {
    display: flex; gap: 8px; flex-shrink: 0;
}
.psc-btn {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; padding: 8px 16px; white-space: nowrap;
}
.psc-btn i { width: 15px; height: 15px; }

/* ── Stats Bar ── */
.scenario-stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(18, 24, 36, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
}
.stat-pill i { width: 18px; height: 18px; color: var(--text-tertiary); flex-shrink: 0; }
.stat-pill-green i { color: var(--accent-green); }
.stat-pill-cyan  i { color: var(--accent-cyan); }

.stat-pill-text { display: flex; flex-direction: column; line-height: 1.2; }
.stat-pill-val  { font-size: 20px; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }
.stat-pill-lbl  { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }

.stat-pill-green .stat-pill-val { color: var(--accent-green); }
.stat-pill-cyan  .stat-pill-val { color: var(--accent-cyan); }

.scenario-progress-wrap {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 8px;
}
.scenario-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.scenario-progress-label span:last-child { color: var(--accent-cyan); }
.scenario-progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}
.scenario-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* ── Scenario Sections container ── */
.scenario-sections {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-bottom: 40px;
}

/* ── Individual section ── */
.scenario-section {}

.scenario-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(18, 24, 36, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 16px;
    user-select: none;
    transition: background 0.15s;
}
.scenario-section-header:hover {
    background: rgba(255, 255, 255, 0.04);
}
.scenario-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.scenario-section-title i { width: 20px; height: 20px; flex-shrink: 0; }
.scenario-section-title h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 8px;
}
.section-badge-cyan  { background: rgba(6, 182, 212, 0.15);  color: var(--accent-cyan);  border: 1px solid rgba(6, 182, 212, 0.3); }
.section-badge-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }

.section-chevron {
    width: 18px; height: 18px;
    color: var(--text-tertiary);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* Collapsed grid */
.scenario-grid {
    transition: opacity 0.2s, max-height 0.35s ease;
    overflow: hidden;
}
.scenario-grid.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
    margin: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding-bottom: 0;
}

.patient-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    background: rgba(18, 24, 36, 0.5);
}

.patient-card-header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.patient-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.patient-avatar-placeholder i {
    width: 24px;
    height: 24px;
}

.patient-meta h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
}

.patient-meta p {
    font-size: 12px;
    color: var(--text-secondary);
}

.patient-card-details {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.patient-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

/* ── Completed card variant ── */
.patient-card-completed {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.04);
    opacity: 0.88;
}
.patient-card-completed:hover {
    border-color: rgba(16, 185, 129, 0.4);
    opacity: 1;
}

/* Green check ring overlaid on avatar */
.completed-check-ring {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.9);
    border: 2px solid var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Completed date line */
.completed-date-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--accent-green);
    margin-top: 3px;
}
.completed-date-label i { opacity: 0.8; }

/* Score badge in card footer */
.completed-score-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--accent-green);
    font-weight: 600;
}
.completed-score-badge i { opacity: 0.85; }

/* Review Case button */
.btn-review-case {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}
.btn-review-case:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.6);
}

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
    gap: 16px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------- */
/* SCREEN 4: EMR REVIEW */
/* ---------------------------------------------------- */
.btn-back-dashboard {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.emr-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

.emr-panel {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.panel-section h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-cyan);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.demographics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 14px;
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.vital-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.vital-card i {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
}

.vital-val {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
}

.vital-lbl {
    font-size: 11px;
    color: var(--text-secondary);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.meds-probs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meds-probs-list li {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meds-probs-list li span.status-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.emr-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* ---------------------------------------------------- */
/* SCREEN 5: ACTIVE ENCOUNTER */
/* ---------------------------------------------------- */
#screen-encounter {
    padding: 0;
}

.encounter-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

.encounter-sidebar {
    width: 280px;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.encounter-sidebar.collapsed {
    width: 0;
    border-right: none;
}

.sidebar-header {
    padding: 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sb-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.sb-section ul {
    list-style: none;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sb-section li {
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.encounter-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: space-between;
}

.encounter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-patient h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

.header-patient p {
    font-size: 12px;
    color: var(--text-secondary);
}

.active-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.tts-voice-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
}

.tts-voice-badge i {
    width: 14px;
    height: 14px;
}

/* Avatar Viewport */
.avatar-portal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.avatar-glow-ring {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
}

/* Expanded / Full-pane Layout */
.avatar-glow-ring.full-pane {
    width: 100%;
    max-width: 640px;
    height: 380px;
    border-radius: 12px;
}

.avatar-glow-ring.full-pane #video-wrapper {
    border-radius: 8px !important;
}

.avatar-glow-ring.full-pane video {
    border-radius: 8px !important;
}

.avatar-glow-ring.state-listening {
    border: 3px solid var(--accent-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

.avatar-glow-ring.state-speaking {
    border: 3px solid var(--accent-green);
    box-shadow: var(--shadow-glow-green);
}

.avatar-glow-ring.state-thinking {
    border: 3px solid var(--accent-orange);
    box-shadow: 0 0 20px var(--accent-orange);
    animation: pulse-orange 1.5s infinite ease-in-out;
}

@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); border-color: rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.9); border-color: rgba(245, 158, 11, 1); }
}

.avatar-glow-ring.state-idle {
    border: 3px solid var(--border-color);
}

.avatar-thinking-spinner {
    display: none;
    position: absolute;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
    pointer-events: none;
}

.avatar-glow-ring.state-thinking .avatar-thinking-spinner {
    display: block;
}

.avatar-glow-ring video {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
}

.avatar-status-badge {
    margin-top: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-tertiary);
}

.state-listening .status-dot, .avatar-glow-ring.state-listening + .avatar-status-badge .status-dot {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 6px var(--accent-cyan);
}

.state-speaking .status-dot, .avatar-glow-ring.state-speaking + .avatar-status-badge .status-dot {
    background-color: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.state-thinking .status-dot, .avatar-glow-ring.state-thinking + .avatar-status-badge .status-dot {
    background-color: var(--accent-orange);
    box-shadow: 0 0 6px var(--accent-orange);
    animation: pulse-orange-dot 1s infinite;
}

@keyframes pulse-orange-dot {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* Visualizer */
.visualizer-wrapper {
    height: 60px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.visualizer-wrapper canvas {
    width: 100%;
    max-width: 600px;
    height: 36px;
}

.visualizer-status {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Auto Suggestions Carousel */
.suggestions-dock {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(18, 24, 36, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.suggestions-dock.inactive {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(30%);
}

.dock-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.dock-title i {
    width: 14px;
    height: 14px;
}

.suggestions-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.suggestion-prompt-card {
    flex: 0 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    max-width: 240px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.suggestion-prompt-card:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-tertiary);
}

.s-header-row {
    font-size: 9px;
    font-weight: 700;
    margin-bottom: 4px;
}

.s-type-lbl-critical { color: var(--accent-red); }
.s-type-lbl-high { color: var(--accent-orange); }
.s-type-lbl-medium { color: var(--accent-cyan); }

.s-prompt-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}

.s-rationale {
    font-size: 10px;
    color: var(--text-secondary);
}

.empty-suggestions {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    width: 100%;
}

/* Bottom Interaction Bar */
.interaction-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    width: 100%;
    max-width: 900px;
    margin: 16px auto 0 auto;
}

.btn-mic {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.btn-mic-inactive {
    background: linear-gradient(135deg, #059669, var(--accent-green)) !important;
    color: white !important;
    box-shadow: var(--shadow-glow-green) !important;
    border-color: transparent !important;
}

.btn-mic-active {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: white !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4) !important;
    border-color: transparent !important;
}

.text-input-field {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
}

.clinician-tag {
    position: absolute;
    top: -9px;
    left: 12px;
    background: #0f1522;
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: var(--accent-cyan);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(6, 182, 212, 0.3);
    pointer-events: none;
    z-index: 5;
    text-transform: uppercase;
}

.btn-end-sm {
    padding: 8px 14px !important;
    font-size: 13px !important;
    gap: 6px !important;
    border-radius: 6px !important;
}

.text-input-field textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    resize: none;
    height: 24px;
}

.btn-dictate-query i {
    width: 18px;
    height: 18px;
}

/* ---------------------------------------------------- */
/* SCREEN 6: TEMPLATE MODAL */
/* ---------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 960px;
    height: 80%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body-split {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.template-selector-panel {
    width: 260px;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.template-selector-panel h3, .template-editor-panel h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-style-btn {
    width: 100%;
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.template-style-btn:hover {
    border-color: var(--accent-cyan);
}

.template-style-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.template-editor-panel {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.syntax-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 11px;
}

.syntax-legend code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.template-editor-panel textarea {
    flex: 1;
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    color: #e6edf3;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.template-editor-panel textarea:focus {
    border-color: var(--accent-cyan);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* ---------------------------------------------------- */
/* SCREEN 7: VERBAL CLUES REVIEW */
/* ---------------------------------------------------- */
.review-split-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    flex: 1;
    overflow: hidden;
    padding-bottom: 24px;
}

.review-panel {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.review-panel h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.transcript-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 10px;
}

.transcript-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 13.5px;
    line-height: 1.5;
}

.bubble-practitioner {
    background: var(--bg-tertiary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.bubble-patient {
    background: var(--bg-secondary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.clue-highlight {
    background: rgba(245, 158, 11, 0.2);
    border-bottom: 2px dashed var(--accent-orange);
    color: #fbd38d;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 500;
}

/* Radial Score */
.score-card-radial {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.radial-progress-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
}

.radial-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.bg-circle {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.progress-circle {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease-in-out;
}

.radial-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.radial-number {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

.radial-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.alerts-summary-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.alerts-summary-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.clues-alerts-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.alert-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-card:hover {
    border-color: var(--accent-orange);
}

.ac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ac-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ac-title i {
    width: 14px;
    height: 14px;
}

.ac-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.ac-statement {
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
    border-left: 2px solid var(--border-color);
    padding-left: 8px;
}

.ac-details {
    display: none;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 4px;
    font-size: 12px;
}

.ac-details.expanded {
    display: flex;
}

.ac-suggestions ul, .ac-learning ul {
    list-style: none;
    padding-left: 4px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-suggestions li {
    color: var(--accent-green);
}

.ac-suggestions li::before {
    content: '➔ ';
}

.ac-learning li::before {
    content: '• ';
    color: var(--accent-cyan);
}

.no-alerts-placeholder {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.no-alerts-placeholder i {
    width: 24px;
    height: 24px;
}

.review-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* ---------------------------------------------------- */
/* SCREEN 8: COPILOT RESULTS & NOTE REVIEW */
/* ---------------------------------------------------- */
.results-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 24px;
    flex: 1;
    overflow: hidden;
    padding-bottom: 24px;
}

.results-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.transcript-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tr-line {
    font-size: 13px;
    line-height: 1.5;
}

.tr-timestamp {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 11px;
    margin-right: 6px;
}

.tr-speaker {
    font-weight: 600;
}

.tr-speaker-doctor { color: var(--accent-cyan); }
.tr-speaker-patient { color: var(--accent-green); }

.clinical-sections-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Expandable Section Accordions */
.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.section-card:hover {
    border-color: var(--border-color);
}

.section-card.expanded {
    border-color: rgba(6, 182, 212, 0.3);
}

.section-header-row {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-group h4 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-content-wrapper {
    display: none;
    border-top: 1px solid var(--border-color);
    padding: 16px;
}

.section-card.expanded .section-content-wrapper {
    display: block;
}

.section-text-display {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.section-editor-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.section-editor-textarea:focus {
    border-color: var(--accent-cyan);
}

.section-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.results-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* Spinner states */
.spinner-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
}

/* Sync Loading Card */
.sync-status-card {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.btn-back:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-cyan);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left-color: var(--accent-green);
}
.toast-error {
    border-left-color: var(--accent-red);
}

/* ============================================================ */
/* CLINICIAN PROFILE WIDGET & NOTIFICATIONS — Screen 3 Header   */
/* ============================================================ */

/* header-actions becomes a flex row */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* ── Notification Bell Button ── */
.clinician-notif-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}
.clinician-notif-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.notif-bell-icon {
    width: 18px;
    height: 18px;
}
.notif-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    line-height: 1;
}

/* ── Clinician Profile Widget ── */
.clinician-profile-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}
.clinician-profile-widget:hover,
.clinician-profile-widget.open {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.4);
}
.clinician-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(2, 132, 199, 0.35));
    border: 2px solid rgba(6, 182, 212, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    flex-shrink: 0;
}
.clinician-avatar i {
    width: 18px;
    height: 18px;
}
.clinician-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.clinician-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}
.clinician-role {
    font-size: 11px;
    color: var(--accent-cyan);
    white-space: nowrap;
}
.clinician-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.clinician-profile-widget.open .clinician-chevron {
    transform: rotate(180deg);
}

/* ── Profile Dropdown (global fixed, JS positions it below the active widget) ── */
.clinician-profile-dropdown {
    position: fixed;
    top: 72px;   /* overridden by JS at runtime */
    right: 24px; /* overridden by JS at runtime */
    width: 260px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-md), 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 600;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.clinician-profile-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.clinician-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    background: rgba(6, 182, 212, 0.05);
    border-bottom: 1px solid var(--border-color);
}
.clinician-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(2, 132, 199, 0.4));
    border: 2px solid rgba(6, 182, 212, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    flex-shrink: 0;
}
.clinician-avatar-lg i {
    width: 22px;
    height: 22px;
}
.clinician-dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.clinician-dropdown-role {
    font-size: 12px;
    color: var(--accent-cyan);
    margin-bottom: 1px;
}
.clinician-dropdown-dept {
    font-size: 11px;
    color: var(--text-tertiary);
}
.clinician-dropdown-stats {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.clinician-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 4px;
    border-right: 1px solid var(--border-color);
}
.clinician-stat:last-child {
    border-right: none;
}
.stat-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-display);
    line-height: 1.1;
}
.stat-lbl {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 3px;
}
.clinician-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: var(--font-sans);
}
.clinician-dropdown-item:first-of-type {
    border-top: none;
}
.clinician-dropdown-item i {
    width: 16px;
    height: 16px;
}
.clinician-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.clinician-dropdown-logout {
    color: var(--accent-red);
}
.clinician-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

/* ══════════════════════════════════════════════════════════════
   My Profile Modal
   ══════════════════════════════════════════════════════════════ */

/* Overlay */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.profile-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Modal Panel */
.profile-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -44%) scale(0.97);
    width: min(960px, 96vw);
    max-height: 92vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-md), 0 0 60px rgba(0, 0, 0, 0.7);
    z-index: 910;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    overflow: hidden;
}
.profile-modal.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: rgba(6, 182, 212, 0.04);
}
.profile-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.profile-modal-title i { width: 22px; height: 22px; }
.profile-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.profile-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.profile-modal-close i { width: 16px; height: 16px; }

/* Body */
.profile-modal-body {
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.profile-modal-body::-webkit-scrollbar { width: 5px; }
.profile-modal-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* ── Hero Card ── */
.profile-hero {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 24px;
    position: relative;
}
.profile-hero-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.profile-hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6,182,212,0.25), rgba(2,132,199,0.4));
    border: 2.5px solid rgba(6,182,212,0.7);
    box-shadow: var(--shadow-glow-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}
.profile-hero-avatar i { width: 36px; height: 36px; }
.profile-online-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-green);
    border: 2px solid var(--bg-secondary);
    box-shadow: var(--shadow-glow-green);
}
.profile-hero-info { flex: 1; }
.profile-hero-name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.profile-hero-role {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.badge-role {
    font-size: 12px;
    font-weight: 600;
    background: rgba(6,182,212,0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6,182,212,0.4);
    border-radius: 20px;
    padding: 2px 10px;
}
.profile-dept {
    font-size: 13px;
    color: var(--text-secondary);
}
.profile-hero-institution {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.profile-hero-institution i { width: 14px; height: 14px; color: var(--text-tertiary); }
.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.profile-hero-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.profile-hero-meta i { width: 13px; height: 13px; }
.profile-edit-btn {
    flex-shrink: 0;
    margin-left: auto;
    align-self: flex-start;
}

/* ── Quick Stats Row ── */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.profile-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s, transform 0.2s;
}
.profile-stat-card:hover { border-color: rgba(6,182,212,0.4); transform: translateY(-2px); }
.profile-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-stat-icon i { width: 18px; height: 18px; }
.profile-stat-icon.cyan  { background: rgba(6,182,212,0.15); color: var(--accent-cyan); }
.profile-stat-icon.green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.profile-stat-icon.blue  { background: rgba(2,132,199,0.15); color: #38bdf8; }
.profile-stat-icon.orange{ background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.profile-stat-icon.purple{ background: rgba(139,92,246,0.15); color: #a78bfa; }
.profile-stat-body { display: flex; flex-direction: column; }
.profile-stat-val {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.profile-stat-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-top: 3px;
}

/* ── Mid Grid ── */
.profile-mid-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Section common */
.profile-section { padding: 20px; }
.profile-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.profile-section-header h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}
.profile-section-header i { width: 18px; height: 18px; }
.profile-section-meta {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Overall progress */
.profile-overall-progress { margin-bottom: 16px; }
.profile-prog-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.prog-pct { font-weight: 700; }
.profile-prog-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.profile-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), #0284c7);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Specialty rows */
.profile-specialty-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.specialty-row { display: flex; align-items: center; gap: 10px; }
.specialty-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    width: 115px;
    flex-shrink: 0;
}
.specialty-name i { width: 13px; height: 13px; }
.specialty-bar-wrap {
    flex: 1;
    height: 5px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}
.specialty-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.specialty-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 32px;
    text-align: right;
}
.profile-next-due {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-secondary);
}
.profile-next-due i { width: 14px; height: 14px; flex-shrink: 0; }
.profile-next-due strong { color: var(--text-primary); }

/* Achievements */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    transition: transform 0.2s, border-color 0.2s;
}
.achievement-badge.earned:hover { transform: translateY(-3px); border-color: rgba(6,182,212,0.4); }
.achievement-badge.locked { opacity: 0.38; }
.badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.badge-icon i { width: 20px; height: 20px; }
.badge-icon.gold   { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1.5px solid rgba(245,158,11,0.4); }
.badge-icon.cyan   { background: rgba(6,182,212,0.2);  color: var(--accent-cyan); border: 1.5px solid rgba(6,182,212,0.4); }
.badge-icon.green  { background: rgba(16,185,129,0.2); color: var(--accent-green); border: 1.5px solid rgba(16,185,129,0.4); }
.badge-icon.blue   { background: rgba(2,132,199,0.2);  color: #38bdf8; border: 1.5px solid rgba(2,132,199,0.4); }
.badge-icon.muted  { background: rgba(100,116,139,0.15); color: var(--text-tertiary); border: 1.5px solid var(--border-color); }
.badge-name { font-size: 11px; font-weight: 700; color: var(--text-primary); }
.badge-desc { font-size: 10px; color: var(--text-tertiary); line-height: 1.3; }

/* ── Recent Sessions Table ── */
.profile-sessions-table-wrap { overflow-x: auto; }
.profile-sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.profile-sessions-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color);
}
.profile-sessions-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(43,56,82,0.5);
    color: var(--text-secondary);
    vertical-align: middle;
}
.profile-sessions-table tr:last-child td { border-bottom: none; }
.profile-sessions-table tr:hover td { background: rgba(255,255,255,0.02); }
.text-tertiary { color: var(--text-tertiary) !important; }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* Specialty tags */
.specialty-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}
.specialty-tag.red    { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.specialty-tag.cyan   { background: rgba(6,182,212,0.12); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.3); }
.specialty-tag.orange { background: rgba(245,158,11,0.12); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.3); }
.specialty-tag.purple { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }

/* Score badges */
.score-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
}
.score-badge.high { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.score-badge.mid  { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.score-badge.low  { background: rgba(239,68,68,0.15);  color: var(--accent-red); }

/* Doc badges */
.doc-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.doc-badge.good { background: rgba(16,185,129,0.12); color: #34d399; }
.doc-badge.warn { background: rgba(245,158,11,0.12); color: #fbbf24; }

/* Status tags */
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.status-tag.done    { background: rgba(16,185,129,0.1);  color: var(--accent-green); }
.status-tag.pending { background: rgba(245,158,11,0.1);  color: var(--accent-orange); }

/* ── Dragon Copilot Preferences ── */
.profile-prefs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}
.profile-pref-item { display: flex; flex-direction: column; gap: 6px; }
.pref-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.pref-label i { width: 13px; height: 13px; color: var(--text-tertiary); }
.pref-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    padding: 8px 12px;
    cursor: not-allowed;
    opacity: 0.8;
}
.pref-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-tertiary);
    background: rgba(100,116,139,0.08);
    border: 1px solid rgba(100,116,139,0.15);
    border-radius: 8px;
    padding: 10px 14px;
}
.pref-note i { width: 13px; height: 13px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   Settings Modal
   ══════════════════════════════════════════════════════════════ */

.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.settings-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -44%) scale(0.97);
    width: min(860px, 96vw);
    max-height: 88vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-md), 0 0 60px rgba(0, 0, 0, 0.7);
    z-index: 910;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    overflow: hidden;
}
.settings-modal.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: rgba(6, 182, 212, 0.04);
}
.settings-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.settings-modal-title i { width: 22px; height: 22px; }

/* Two-column layout */
.settings-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar nav */
.settings-nav {
    width: 190px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 12px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    width: 100%;
}
.settings-nav-item i { width: 16px; height: 16px; flex-shrink: 0; }
.settings-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.settings-nav-item.active {
    background: rgba(6,182,212,0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(6,182,212,0.25);
}

/* Tab panels */
.settings-panels {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.settings-panels::-webkit-scrollbar { width: 5px; }
.settings-panels::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.settings-tab { display: none; }
.settings-tab.active { display: block; }

.settings-section-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Group */
.settings-group {
    margin-bottom: 28px;
}
.settings-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

/* Toggle row */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(43,56,82,0.4);
    gap: 20px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info { display: flex; flex-direction: column; gap: 2px; }
.settings-row-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.settings-row-desc { font-size: 11px; color: var(--text-tertiary); }

/* Action row (button instead of toggle) */
.settings-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
}
.settings-action-btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 14px;
}
.settings-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Select row */
.settings-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(43,56,82,0.4);
    gap: 20px;
}
.settings-select-row:last-child { border-bottom: none; }
.settings-select-row label { font-size: 13px; color: var(--text-secondary); }
.settings-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: var(--font-sans);
    padding: 7px 10px;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.settings-select:focus { outline: none; border-color: var(--accent-cyan); }

/* Toggle switch */
.toggle { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
    width: 40px;
    height: 22px;
    background: var(--border-color);
    border-radius: 11px;
    transition: background 0.2s;
    position: relative;
}
.toggle input:checked ~ .toggle-track { background: var(--accent-cyan); }
.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); }

/* Footer */
.settings-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: rgba(6, 182, 212, 0.02);
}

/* ── Notifications Slide-In Panel ── */
.clinician-notif-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.6);
    z-index: 800;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.clinician-notif-panel.open {
    right: 0;
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(6, 182, 212, 0.04);
    flex-shrink: 0;
}
.notif-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.notif-panel-header h3 i {
    width: 18px;
    height: 18px;
    color: var(--accent-cyan);
}
.notif-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.notif-panel-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
}
.notif-panel-close i {
    width: 16px;
    height: 16px;
}

/* Tabs */
.notif-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}
.notif-tab {
    flex: 1;
    padding: 11px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-sans);
}
.notif-tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.06);
}
.notif-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* Scrollable list */
.notif-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.notif-panel-list::-webkit-scrollbar { width: 4px; }
.notif-panel-list::-webkit-scrollbar-track { background: transparent; }
.notif-panel-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* Group labels */
.notif-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 10px 0 4px;
    margin-top: 2px;
}

/* Notification rows */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
}
.notif-item.unread {
    background: rgba(6, 182, 212, 0.07);
    border-color: rgba(6, 182, 212, 0.18);
}
.notif-item.hidden {
    display: none;
}

/* Unread dot */
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
    transition: background 0.3s;
}
.notif-dot.red   { background: var(--accent-red); }
.notif-dot.cyan  { background: var(--accent-cyan); }
.notif-dot.green { background: var(--accent-green); }
.notif-dot.blue  { background: var(--accent-blue); }

/* Icon circle */
.notif-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-icon-wrap i { width: 16px; height: 16px; }
.notif-icon-wrap.red   { background: rgba(239, 68, 68, 0.15);  color: var(--accent-red); }
.notif-icon-wrap.cyan  { background: rgba(6, 182, 212, 0.15);  color: var(--accent-cyan); }
.notif-icon-wrap.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.notif-icon-wrap.blue  { background: rgba(2, 132, 199, 0.15);  color: var(--accent-blue); }

/* Notification text */
.notif-body {
    flex: 1;
    min-width: 0;
}
.notif-body strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.notif-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 4px;
    line-height: 1.4;
}
.notif-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Mark all read footer */
.notif-mark-read-btn {
    width: 100%;
    padding: 14px;
    background: rgba(6, 182, 212, 0.06);
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--accent-cyan);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    font-family: var(--font-sans);
}
.notif-mark-read-btn:hover {
    background: rgba(6, 182, 212, 0.13);
}

/* ── Dimming overlay ── */
.clinician-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    z-index: 700;
}
.clinician-overlay.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   Admin Contact Card (inside profile modal)
═══════════════════════════════════════════════════════════════ */
.profile-admin-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.profile-admin-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    flex-shrink: 0;
}

.profile-admin-info {
    flex: 1;
    min-width: 0;
}

.profile-admin-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.profile-admin-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-admin-role {
    font-size: 12px;
    color: #a78bfa;
    margin-bottom: 2px;
}

.profile-admin-email {
    font-size: 12px;
    color: var(--accent-cyan);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.profile-admin-email:hover {
    text-decoration: underline;
}

.profile-msg-btn {
    flex-shrink: 0;
    gap: 6px;
    font-size: 13px;
    padding: 8px 14px;
}

/* ═══════════════════════════════════════════════════════════════
   Messages Thread (inside profile modal)
═══════════════════════════════════════════════════════════════ */
.profile-messages-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-msgs-loading,
.profile-msgs-empty {
    padding: 20px 0;
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-message-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: background 0.15s;
}

.profile-message-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.profile-message-item.received {
    border-left: 3px solid rgba(6, 182, 212, 0.5);
}

.profile-message-item.sent {
    border-left: 3px solid rgba(16, 185, 129, 0.5);
}

.msg-direction-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.profile-message-item.received .msg-direction-icon {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
}

.profile-message-item.sent .msg-direction-icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.msg-body {
    flex: 1;
    min-width: 0;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.msg-from {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.msg-date {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: auto;
}

.msg-subject {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-preview {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   Compose Message Modal
═══════════════════════════════════════════════════════════════ */
.compose-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: none;
}

.compose-modal-overlay.active {
    display: block;
}

.compose-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: min(520px, 92vw);
    z-index: 1101;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.compose-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.compose-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.compose-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.compose-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.compose-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
}

.compose-to-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.compose-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    display: block;
}

.compose-to-name {
    font-weight: 600;
    color: var(--text-primary);
}

.compose-to-email {
    color: var(--accent-cyan);
    font-size: 12px;
}

.compose-field {
    display: flex;
    flex-direction: column;
}

.compose-input,
.compose-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
    resize: vertical;
}

.compose-input:focus,
.compose-textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.compose-input::placeholder,
.compose-textarea::placeholder {
    color: var(--text-tertiary);
}

/* spin animation for loading icon */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   Dev credential dots (login screen, bottom-right, prototype only)
   Two nearly-invisible circles; only insiders know to click them.
═══════════════════════════════════════════════════════════════ */
.dev-cred-dots {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 1000;
}

.dev-cred-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.2s;
}

.dev-cred-dot:hover {
    background: rgba(255, 255, 255, 0.10);
}

.dev-cred-dot.active {
    background: rgba(255, 255, 255, 0.13);
}

body.light-theme .dev-cred-dot         { background: rgba(0, 0, 0, 0.08); }
body.light-theme .dev-cred-dot:hover   { background: rgba(0, 0, 0, 0.18); }
body.light-theme .dev-cred-dot.active  { background: rgba(0, 0, 0, 0.22); }

/* ═══════════════════════════════════════════════════════════════
   LearnVantage Training Hub Modal
═══════════════════════════════════════════════════════════════ */

.lv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 800;
    align-items: center;
    justify-content: center;
}
.lv-overlay.open { display: flex; }

.lv-modal {
    width: min(980px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
}

/* Header */
.lv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.lv-brand { display: flex; align-items: center; gap: 14px; }
.lv-logo-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(139,92,246,0.25));
    border: 1px solid rgba(139,92,246,0.4);
    display: flex; align-items: center; justify-content: center;
    color: #a78bfa; flex-shrink: 0;
}
.lv-logo-icon i { width: 22px; height: 22px; }
.lv-brand-name {
    font-family: var(--font-display); font-size: 18px; font-weight: 800;
    color: var(--text-primary); letter-spacing: 0.3px;
}
.lv-brand-by { font-size: 13px; font-weight: 500; color: #a78bfa; margin-left: 6px; }
.lv-brand-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.lv-close-btn { width: 36px; height: 36px; border-radius: 50%; }

/* Tabs */
.lv-tabs {
    display: flex; gap: 4px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}
.lv-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 8px;
    border: 1px solid transparent; background: transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font-sans); transition: all 0.18s;
}
.lv-tab i { width: 15px; height: 15px; }
.lv-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.lv-tab.active {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.4);
    color: #a78bfa;
}
.lv-tab-badge {
    background: rgba(139,92,246,0.2); color: #a78bfa;
    font-size: 10px; font-weight: 700; padding: 1px 6px;
    border-radius: 99px; line-height: 1.6;
}

/* Panels */
.lv-tab-panel { display: none; flex: 1; overflow-y: auto; padding: 20px 24px; }
.lv-tab-panel.active { display: block; }

.lv-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 12px;
}

/* Video cards */
.lv-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px; margin-bottom: 4px;
}
.lv-video-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--border-color); border-radius: 12px;
    overflow: hidden; background: rgba(18,24,36,0.5);
    text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.lv-video-card:hover {
    border-color: rgba(139,92,246,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lv-video-thumb {
    position: relative; height: 110px;
    background: linear-gradient(135deg, #1b1535, #0a1628);
    display: flex; align-items: center; justify-content: center;
}
.lv-thumb-blue   { background: linear-gradient(135deg, #0c1a40, #0a2260); }
.lv-thumb-green  { background: linear-gradient(135deg, #0a2018, #0c3028); }
.lv-thumb-teal   { background: linear-gradient(135deg, #081e28, #042030); }
.lv-thumb-purple { background: linear-gradient(135deg, #180d38, #261048); }
.lv-thumb-orange { background: linear-gradient(135deg, #28180a, #3a2008); }
.lv-play-icon { width: 40px; height: 40px; color: rgba(255,255,255,0.7); transition: color 0.2s, transform 0.2s; }
.lv-video-card:hover .lv-play-icon { color: #a78bfa; transform: scale(1.15); }
.lv-yt-badge {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.65); color: #ff4e45;
    font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
    display: flex; align-items: center; gap: 4px;
}
.lv-yt-badge i { width: 11px; height: 11px; }
.lv-duration {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.7); color: var(--text-secondary);
    font-size: 10px; font-family: var(--font-mono); padding: 2px 6px; border-radius: 4px;
}
.lv-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lv-card-title { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.lv-card-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.lv-card-meta {
    display: flex; align-items: center; gap: 5px;
    font-size: 10px; color: var(--text-tertiary); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px;
}
.lv-card-meta i { width: 11px; height: 11px; }

/* Training paths */
.lv-path-list { display: flex; flex-direction: column; gap: 14px; }
.lv-path-card {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px; border: 1px solid var(--border-color);
    border-radius: 12px; background: rgba(18,24,36,0.5);
    text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.lv-path-card:hover {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.06);
    transform: translateX(3px);
}
.lv-path-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lv-path-icon i { width: 22px; height: 22px; }
.lv-icon-cyan   { background: rgba(6,182,212,0.15);  border: 1px solid rgba(6,182,212,0.35);  color: var(--accent-cyan); }
.lv-icon-green  { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.35); color: var(--accent-green); }
.lv-icon-purple { background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.35); color: #a78bfa; }
.lv-icon-blue   { background: rgba(2,132,199,0.15);  border: 1px solid rgba(2,132,199,0.35);  color: #38bdf8; }
.lv-icon-teal   { background: rgba(20,184,166,0.15); border: 1px solid rgba(20,184,166,0.35); color: #2dd4bf; }
.lv-icon-orange { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.35); color: var(--accent-orange); }
.lv-path-body { flex: 1; min-width: 0; }
.lv-path-badges { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lv-badge-provider {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    color: #a78bfa; background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.25); padding: 2px 7px; border-radius: 4px;
}
.lv-badge-role {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--accent-cyan); background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.25); padding: 2px 7px; border-radius: 4px;
}
.lv-badge-green  { color: var(--accent-green); background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); }
.lv-badge-purple { color: #a78bfa; background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.25); }
.lv-path-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.lv-path-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.lv-path-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.lv-path-meta span { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.lv-path-meta i { width: 12px; height: 12px; }
.lv-path-cta { color: var(--text-tertiary); flex-shrink: 0; transition: color 0.2s, transform 0.2s; }
.lv-path-cta i { width: 20px; height: 20px; }
.lv-path-card:hover .lv-path-cta { color: #a78bfa; transform: translateX(4px); }

/* Documentation cards */
.lv-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.lv-doc-card {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px; border: 1px solid var(--border-color); border-radius: 12px;
    background: rgba(18,24,36,0.5); text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.lv-doc-card:hover {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.05);
    transform: translateY(-2px);
}
.lv-doc-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lv-doc-icon i { width: 18px; height: 18px; }
.lv-doc-body { flex: 1; min-width: 0; }
.lv-doc-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: 4px; }
.lv-doc-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; line-height: 1.3; }
.lv-doc-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.lv-doc-ext { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; margin-top: 3px; transition: color 0.2s; }
.lv-doc-card:hover .lv-doc-ext { color: #a78bfa; }

/* ── Dashboard screen-level tabs ── */
.dashboard-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    align-items: center;
}
.dashboard-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.dashboard-tab i { width: 15px; height: 15px; }
.dashboard-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}
.dashboard-tab.active {
    color: var(--accent-cyan, #22d3ee);
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15), inset 0 1px 0 rgba(34, 211, 238, 0.1);
    font-weight: 600;
}
.dashboard-tab-panel { display: none; overflow-y: auto; flex: 1; }
.dashboard-tab-panel.active { display: block; }

/* LearnVantage trigger button */
.btn-learnvantage {
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(109,40,217,0.15));
    border: 1px solid rgba(139,92,246,0.45) !important;
    color: #c4b5fd !important;
    transition: all 0.2s;
}
.btn-learnvantage:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(109,40,217,0.3));
    border-color: rgba(139,92,246,0.7) !important;
    color: #ede9fe !important;
    box-shadow: 0 0 16px rgba(139,92,246,0.3);
    transform: translateY(-1px);
}
.btn-learnvantage i { width: 16px; height: 16px; }

/* Light theme overrides */
body.light-theme .lv-video-card,
body.light-theme .lv-path-card,
body.light-theme .lv-doc-card { background: rgba(255,255,255,0.85); border-color: #e2e8f0; }
body.light-theme .lv-video-card:hover,
body.light-theme .lv-path-card:hover,
body.light-theme .lv-doc-card:hover { border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.04); }
body.light-theme .lv-modal { background: #f8fafc; }
body.light-theme .lv-modal-header,
body.light-theme .lv-tabs { border-color: #e2e8f0; }

/* ============================================================ */
/* LIGHT THEME OVERRIDES                                         */
/* Applied when <body class="light-theme"> is set               */
/* ============================================================ */

body.light-theme {
    --bg-primary:    #f8fafc;
    --bg-secondary:  #ffffff;
    --bg-tertiary:   #f1f5f9;
    --border-color:  #e2e8f0;
    --text-primary:  #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

/* Glass & card backgrounds (hard-coded rgba → light overrides) */
body.light-theme .patient-card             { background: rgba(255, 255, 255, 0.8); }
body.light-theme .scenario-stats-bar       { background: rgba(241, 245, 249, 0.9); }
body.light-theme .scenario-section-header  { background: rgba(241, 245, 249, 0.8); }
body.light-theme .scenario-section-header:hover { background: rgba(226, 232, 240, 0.9); }
body.light-theme .suggestions-dock        { background: rgba(241, 245, 249, 0.7); }
body.light-theme .suggestion-prompt-card  { background: #ffffff; }
body.light-theme .suggestion-prompt-card:hover { background: #f1f5f9; }
body.light-theme .stat-pill               { background: rgba(255, 255, 255, 0.8); }
body.light-theme .section-header-row      { background: rgba(0, 0, 0, 0.02); }
body.light-theme .bubble-practitioner     { background: #e2e8f0; }
body.light-theme .bubble-patient          { background: #f1f5f9; }
body.light-theme .clinician-profile-dropdown { background: #ffffff; }
body.light-theme .clinician-dropdown-header  { background: rgba(6, 182, 212, 0.06); }
body.light-theme .profile-modal           { background: #ffffff; }
body.light-theme .settings-modal          { background: #ffffff; }
body.light-theme .compose-modal           { background: #ffffff; }

/* Input fields */
body.light-theme .input-group input {
    background: #ffffff;
    color: var(--text-primary);
}
body.light-theme .text-input-field {
    background: #ffffff;
}
body.light-theme .text-input-field textarea {
    color: var(--text-primary);
}

/* Settings modal selects */
body.light-theme .settings-select {
    background: #ffffff;
    color: var(--text-primary);
}

/* Clinician tag (hardcoded dark bg) */
body.light-theme .clinician-tag {
    background: #ffffff;
    border-color: rgba(6, 182, 212, 0.4);
}

/* Skip button (hardcoded dark bg) */
body.light-theme .btn-skip {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

/* Template editor */
body.light-theme .template-editor-panel textarea {
    background: #f8fafc;
    color: #1e293b;
}

/* Modal backdrop overlay */
body.light-theme .modal {
    background: rgba(0, 0, 0, 0.5);
}

/* Spinner */
body.light-theme .spinner,
body.light-theme .avatar-thinking-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent-cyan);
}

/* Settings nav hover */
body.light-theme .settings-nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
body.light-theme .settings-nav-item.active {
    background: rgba(6, 182, 212, 0.08);
}

/* Section card */
body.light-theme .section-card {
    background: #ffffff;
}

/* Vital cards */
body.light-theme .vital-card {
    background: #f8fafc;
}

/* Transcript bubbles */
body.light-theme .sb-section li {
    background: #f8fafc;
}

/* Template style buttons */
body.light-theme .template-style-btn {
    background: #f8fafc;
    color: var(--text-primary);
}
body.light-theme .template-style-btn.active {
    background: rgba(6, 182, 212, 0.1);
}

/* Meds/problems list items */
body.light-theme .meds-probs-list li {
    background: #f8fafc;
}

/* Theme toggle visual feedback in settings */
body.light-theme .settings-modal-header {
    background: rgba(6, 182, 212, 0.04);
}

/* ── Light theme: hover / state backgrounds ──────────────────────────────── */
body.light-theme .clinician-notif-btn          { background: rgba(0, 0, 0, 0.04); }
body.light-theme .clinician-profile-widget     { background: rgba(0, 0, 0, 0.04); }
body.light-theme .clinician-dropdown-item:hover { background: rgba(0, 0, 0, 0.04); }
body.light-theme .notif-item:hover             { background: rgba(0, 0, 0, 0.04); }
body.light-theme .notif-tab:hover:not(.active) { background: rgba(0, 0, 0, 0.04); }
body.light-theme .profile-modal-close          { background: rgba(0, 0, 0, 0.06); }
body.light-theme .profile-modal-close:hover    { background: rgba(0, 0, 0, 0.08); }
body.light-theme .notif-panel-close            { background: rgba(0, 0, 0, 0.06); }
body.light-theme .btn-icon-only:hover          { background: rgba(0, 0, 0, 0.06); }
body.light-theme .profile-message-item         { background: rgba(0, 0, 0, 0.02); }
body.light-theme .profile-message-item:hover   { background: rgba(0, 0, 0, 0.04); }
body.light-theme .compose-to-row               { background: rgba(0, 0, 0, 0.04); }
body.light-theme .compose-input,
body.light-theme .compose-textarea             { background: #f8fafc; color: var(--text-primary); }

/* ── Light theme: dark borders ───────────────────────────────────────────── */
body.light-theme .profile-sessions-table td   { border-bottom: 1px solid var(--border-color); }
body.light-theme .settings-row                { border-bottom: 1px solid var(--border-color); }
body.light-theme .settings-select-row         { border-bottom: 1px solid var(--border-color); }

/* ── Light theme: button hover ───────────────────────────────────────────── */
body.light-theme .btn-secondary:hover          { background: rgba(0, 0, 0, 0.08); }

/* ── Light theme: progress track ─────────────────────────────────────────── */
body.light-theme .scenario-progress-track      { background: rgba(0, 0, 0, 0.08); }

/* ═══════════════════════════════════════════════════════════════════════════
   Entra ID SSO — Microsoft button + clinician-link modal
   ═══════════════════════════════════════════════════════════════════════════ */

.sso-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-microsoft:hover { background: #f3f3f3; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

body.dark-theme .btn-microsoft  { background: #2a2a2a; color: #fff; border-color: rgba(255,255,255,0.15); }
body.dark-theme .btn-microsoft:hover { background: #333; }

.sso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted, rgba(255,255,255,0.4));
    font-size: 0.8rem;
}
.sso-divider::before,
.sso-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color, rgba(255,255,255,0.1));
}
body.light-theme .sso-divider { color: rgba(0,0,0,0.4); }

/* ── Clinician-link modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-card {
    background: var(--card-bg, #1a1a2e);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}
.modal-header .modal-icon { width: 36px; height: 36px; color: var(--accent-cyan, #22d3ee); margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }
.modal-header h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 8px; }
.modal-header p  { font-size: 0.875rem; color: var(--text-muted, rgba(255,255,255,0.55)); margin: 0; }

.sso-user-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.sso-user-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    width: 100%;
    text-align: left;
    color: inherit;
    font-family: inherit;
}
.sso-user-item:hover { background: rgba(34,211,238,0.08); border-color: rgba(34,211,238,0.3); }

.sso-user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #0284c7);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

.sso-user-info  { flex: 1; }
.sso-user-name  { font-size: 0.938rem; font-weight: 600; }
.sso-user-meta  { font-size: 0.8rem; color: var(--text-muted, rgba(255,255,255,0.5)); margin-top: 2px; }
.sso-user-arrow { width: 16px; height: 16px; color: var(--text-muted, rgba(255,255,255,0.35)); flex-shrink: 0; }

.sso-link-note { font-size: 0.775rem; color: var(--text-muted, rgba(255,255,255,0.35)); text-align: center; margin: 0; }
.sso-error     { color: #f87171; text-align: center; font-size: 0.875rem; }

/* ── My Learning ── */
.ml-wrap { max-width: 860px; margin: 0 auto; padding: 8px 4px 40px; }
.ml-empty { color: var(--text-secondary); text-align: center; padding: 40px 12px; font-size: 14px; }
.ml-summary { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 14px; font-size: 14px; }
.ml-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-tertiary); overflow: hidden; }
.ml-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #06b6d4, #8b5cf6); transition: width .3s; }
.ml-pct { font-weight: 700; min-width: 40px; text-align: right; }
.ml-card { display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 10px; border: 1px solid var(--border-color);
           border-radius: 12px; background: var(--bg-secondary); }
.ml-card.ml-next { border-color: rgba(139,92,246,0.6); box-shadow: 0 0 0 1px rgba(139,92,246,0.25); }
.ml-card.ml-done { opacity: .75; }
.ml-card.ml-overdue { border-color: rgba(239,68,68,0.5); }
.ml-num { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
          background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 700; font-size: 13px; }
.ml-next .ml-num { background: #8b5cf6; color: #fff; }
.ml-done .ml-num { background: #10b981; color: #fff; }
.ml-body { flex: 1; min-width: 0; }
.ml-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ml-type-icon { width: 18px; height: 18px; color: var(--text-secondary); flex-shrink: 0; }
.ml-title { font-weight: 600; font-size: 15px; }
.ml-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.ml-chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--bg-tertiary); color: var(--text-secondary); }
.ml-chip-next { background: rgba(139,92,246,0.2); color: #a78bfa; font-weight: 600; }
.ml-progress .ml-status { background: rgba(6,182,212,0.18); color: #22d3ee; }
.ml-done .ml-status { background: rgba(16,185,129,0.18); color: #34d399; }
.ml-due { font-size: 11px; color: var(--text-secondary); }
.ml-due-late { color: #f87171; font-weight: 600; }
.ml-desc { margin-top: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.ml-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ml-btn { font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 8px; cursor: pointer; text-decoration: none;
          border: 1px solid var(--border-color); background: transparent; color: var(--text-primary); }
.ml-btn:hover { border-color: var(--text-secondary); }
.ml-btn-primary { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.ml-btn-primary:hover { background: #7c3aed; border-color: #7c3aed; }
