/* ============================================
   Acting Intern - EPIC-Style Theme
   ============================================ */

/* CSS Variables for theming */
:root {
    /* Primary Colors - EPIC-inspired blue palette */
    --primary-dark: #1a365d;
    --primary: #2c5282;
    --primary-light: #4299e1;
    --primary-lighter: #bee3f8;

    /* Background Colors */
    --bg-dark: #1a202c;
    --bg-medium: #2d3748;
    --bg-light: #edf2f7;
    --bg-white: #ffffff;
    --bg-hover: #e2e8f0;

    /* Text Colors */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-white: #ffffff;
    --text-link: #3182ce;

    /* Status Colors */
    --status-critical: #c53030;
    --status-critical-bg: #fed7d7;
    --status-high: #dd6b20;
    --status-high-bg: #feebc8;
    --status-low: #3182ce;
    --status-low-bg: #bee3f8;
    --status-normal: #38a169;
    --status-normal-bg: #c6f6d5;

    /* Allergy Colors */
    --allergy-banner: #fc8181;
    --allergy-text: #742a2a;

    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-dark: #a0aec0;

    /* Spacing */
    --header-height: 48px;
    --allergy-banner-height: 28px;
    --sidebar-width: 200px;

    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--bg-light);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   Top Header Bar
   ============================================ */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0 16px;
    color: var(--text-white);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 1;
    min-width: 0;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-ai {
    color: #4fc3f7;
    font-weight: 800;
}

/* --- Logo "AI" reveal animation --- */

.logo-animated {
    display: inline-flex;
    align-items: baseline;
    cursor: default;
}

.logo-animated .logo-rest {
    display: inline-block;
    max-width: 80px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
}

.logo-animated .logo-ai {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                font-size 0.4s ease;
}

/* Collapsed state: only "AI" visible */
.logo-animated.ai-reveal .logo-rest {
    max-width: 0;
    opacity: 0;
}

.logo-animated.ai-reveal .logo-ai {
    transform: scale(1.15);
}

/* On light backgrounds, use a deeper blue for the AI accent */
.ai-empty .logo-ai,
.copilot-content .logo-ai {
    color: #0288d1;
}

.patient-search {
    position: relative;
}

.patient-search input {
    width: 160px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    color: var(--text-white);
    font-size: 12px;
}

.patient-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.patient-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.search-dropdown.active {
    display: block;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item:last-child {
    border-bottom: none;
}

.header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.patient-info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    white-space: nowrap;
}

.patient-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.patient-details {
    display: flex;
    gap: 12px;
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
}

.patient-detail-item {
    display: flex;
    gap: 4px;
}

.patient-detail-label {
    opacity: 0.7;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.current-user {
    opacity: 0.9;
}

.current-time {
    font-family: var(--font-mono);
    opacity: 0.8;
}

/* ============================================
   Allergy Banner
   ============================================ */
.allergy-banner {
    display: flex;
    align-items: center;
    height: var(--allergy-banner-height);
    background: var(--allergy-banner);
    color: var(--allergy-text);
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.allergy-banner.no-allergies {
    background: var(--status-normal-bg);
    color: #276749;
}

.allergy-label {
    margin-right: 8px;
    text-transform: uppercase;
    font-size: 11px;
}

.allergy-list {
    display: flex;
    gap: 12px;
}

.allergy-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.allergy-reaction {
    font-weight: 400;
    opacity: 0.8;
}

/* ============================================
   Main Container & Layout
   ============================================ */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-medium);
    color: var(--text-white);
    overflow-y: auto;
    flex-shrink: 0;
}

.nav-section {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-section-title {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-white);
    font-weight: 500;
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

/* ============================================
   Main Content Area
   ============================================ */
.content {
    flex: 1;
    background: var(--bg-white);
    overflow-y: auto;
    padding: 20px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 12px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

/* ============================================
   Cards & Panels
   ============================================ */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: 6px 6px 0 0;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 16px;
}

/* ============================================
   Tables (Labs, Medications, etc.)
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-medium);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr.clickable {
    cursor: pointer;
}

/* Lab Result Flags */
.lab-value {
    font-weight: 500;
    font-family: var(--font-mono);
}

.lab-value.critical-high,
.lab-value.critical-low {
    color: var(--status-critical);
    font-weight: 700;
}

.lab-value.high {
    color: var(--status-high);
    font-weight: 600;
}

.lab-value.low {
    color: var(--status-low);
    font-weight: 600;
}

.lab-flag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
}

.lab-flag.critical {
    background: var(--status-critical);
    color: white;
}

.lab-flag.high {
    background: var(--status-high-bg);
    color: var(--status-high);
}

.lab-flag.low {
    background: var(--status-low-bg);
    color: var(--status-low);
}

.reference-range {
    color: var(--text-muted);
    font-size: 11px;
}

/* Simulated Lab Styles */
.sim-lab-row {
    background: #f0fdf4 !important;
}

.sim-lab-badge {
    display: inline-block;
    background: #22c55e;
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================
   Notes Display
   ============================================ */
.notes-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

.notes-list {
    width: 350px;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-list-header {
    padding: 12px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.notes-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.notes-filter select,
.notes-filter input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-size: 12px;
}

.notes-list-body {
    flex: 1;
    overflow-y: auto;
}

.note-list-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s ease;
}

.note-list-item:hover {
    background: var(--bg-hover);
}

.note-list-item.selected {
    background: var(--primary-lighter);
    border-left: 3px solid var(--primary);
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.note-type {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 12px;
}

.note-ai-badge {
    font-size: 10px;
    font-weight: 600;
    color: #7c3aed;
    background: #ede9fe;
    padding: 1px 6px;
    border-radius: 4px;
}

.note-list-item.ai-generated {
    border-left: 3px solid #7c3aed;
}

.note-date {
    color: var(--text-muted);
    font-size: 11px;
}

.note-author {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.note-preview {
    font-size: 11px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-viewer {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.note-viewer-header {
    padding: 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.note-viewer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.note-viewer-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.note-viewer-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
}

.note-section {
    margin-bottom: 20px;
}

.note-section-title {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.note-section-content {
    white-space: pre-wrap;
}

/* ============================================
   Chart Review Dashboard
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
}

.dashboard-widget {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.widget-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

.widget-body {
    padding: 12px 16px;
    max-height: 300px;
    overflow-y: auto;
}

.widget-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.widget-item:last-child {
    border-bottom: none;
}

.widget-item-label {
    color: var(--text-secondary);
}

.widget-item-value {
    font-weight: 500;
    text-align: right;
}

/* ============================================
   Problem List
   ============================================ */
.problem-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.problem-item:last-child {
    border-bottom: none;
}

.problem-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.problem-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-muted);
}

.problem-icd {
    font-family: var(--font-mono);
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 3px;
}

.problem-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.problem-status.active {
    background: var(--status-critical-bg);
    color: var(--status-critical);
}

.problem-status.resolved {
    background: var(--status-normal-bg);
    color: var(--status-normal);
}

/* ============================================
   Medications
   ============================================ */
.med-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.med-name {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.med-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.med-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Vitals Flowsheet
   ============================================ */
.vitals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.vitals-table th,
.vitals-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.vitals-table th {
    background: var(--bg-light);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.vitals-table th:first-child,
.vitals-table td:first-child {
    text-align: left;
    font-weight: 600;
    background: var(--bg-light);
    position: sticky;
    left: 0;
}

.vital-abnormal {
    color: var(--status-critical);
    font-weight: 600;
}

/* Simulation Vital Styles */
.sim-vital-header {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%) !important;
    position: relative;
}

.sim-badge {
    display: inline-block;
    background: #22c55e;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-bottom: 4px;
    animation: pulse 2s infinite;
}

.sim-vital {
    background: #f0fdf4 !important;
    font-weight: 600;
}

/* ============================================
   Filters & Controls
   ============================================ */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
}

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

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.filter-select,
.filter-input {
    padding: 6px 10px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-white);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   Charts & Graphs
   ============================================ */
.chart-container {
    position: relative;
    height: 250px;
    margin: 16px 0;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 16px;
}

.tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1200px) {
    .notes-container {
        flex-direction: column;
        height: auto;
    }

    .notes-list {
        width: 100%;
        max-height: 300px;
    }

    .note-viewer {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 60px;
    }

    .nav-section-title,
    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .patient-details {
        display: none;
    }
}

/* ============================================
   Global Search Modal
   ============================================ */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.search-modal.active {
    display: block;
}

.search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    margin: 80px auto;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-light);
}

.search-modal-header input {
    flex: 1;
    border: none;
    background: none;
    font-size: 18px;
    padding: 8px 0;
    outline: none;
    color: var(--text-primary);
}

.search-modal-header input::placeholder {
    color: var(--text-muted);
}

.search-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.search-close-btn:hover {
    color: var(--text-primary);
}

.search-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
}

.search-hint {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-shortcuts {
    margin-top: 16px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.search-shortcuts kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-light);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    margin: 0 2px;
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-category {
    margin-bottom: 8px;
}

.search-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-category-icon {
    font-size: 14px;
}

.search-result-item {
    padding: 12px 16px;
    margin: 2px 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-hover);
}

.search-result-item.selected {
    background: var(--primary-lighter);
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-result-title mark {
    background: #fef3c7;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.search-result-type {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.search-result-preview,
.search-result-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Order Category Badges
   ============================================ */
.order-category {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.category-lab {
    background: #e9d8fd;
    color: #553c9a;
}

.category-imaging {
    background: #bee3f8;
    color: #2c5282;
}

.category-med {
    background: #c6f6d5;
    color: #276749;
}

.category-proc {
    background: #feebc8;
    color: #c05621;
}

.category-consult {
    background: #fed7d7;
    color: #c53030;
}

.priority-urgent {
    color: var(--status-critical);
    font-weight: 700;
}

/* ============================================
   Loading Spinner
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
}

.toast {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    background: var(--status-normal);
}

.toast.error {
    background: var(--status-critical);
}

.toast.warning {
    background: var(--status-high);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Keyboard Shortcut Hint
   ============================================ */
.keyboard-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 11px;
    margin-left: 12px;
}

.keyboard-hint kbd {
    background: rgba(255, 255, 255, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

/* ============================================
   Data Statistics Bar
   ============================================ */
.stats-bar {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Timeline View
   ============================================ */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-white);
}

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 12px;
}

/* ============================================
   Enhanced Table Styles
   ============================================ */
.data-table.striped tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.data-table.compact td,
.data-table.compact th {
    padding: 6px 10px;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background: var(--bg-hover);
}

.sort-indicator {
    margin-left: 4px;
    font-size: 10px;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 12px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   About Page
   ============================================ */

.header-about-link {
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-about-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ---- About Modal Overlay ---- */

.about-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
}

.about-modal {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.about-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
    z-index: 1;
}

.about-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.about-modal-body {
    overflow-y: auto;
    padding: 0 36px 28px;
}

.about-modal-body .about-page {
    padding: 0;
}

.about-modal-body .about-hero {
    padding-top: 28px;
}

/* ---- About: Get Started / API Key Section ---- */

.about-setup-section {
    margin-top: 32px;
    padding: 24px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}

.about-setup-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    border-bottom: none;
    display: block;
    padding-bottom: 0;
}

.about-setup-section p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.about-api-key-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.about-api-key-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-white);
}

.about-api-key-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.about-api-key-btn {
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 13px;
}

.about-api-key-btn.saved {
    background: #16a34a;
    border-color: #16a34a;
}

.about-api-key-hint {
    font-size: 12px !important;
    margin-bottom: 0 !important;
}

.about-api-key-hint a {
    color: var(--primary);
    text-decoration: none;
}

.about-api-key-hint a:hover {
    text-decoration: underline;
}

.about-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 0;
}

.about-hero {
    text-align: center;
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.about-hero-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.about-hero-title .logo-ai {
    color: var(--primary);
    font-weight: 800;
}

.about-hero-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 540px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 32px;
}

.about-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.about-section p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-section ul,
.about-section ol {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 24px;
}

.about-section li {
    margin-bottom: 4px;
}

.about-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-section em {
    font-style: italic;
}

/* ---- About: Feature Cards ---- */

.about-features {
    margin-top: 28px;
    margin-bottom: 8px;
}

.about-features h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.about-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.about-feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.about-feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.08);
}

.about-feature-icon {
    font-size: 24px;
    margin-bottom: 8px;
    line-height: 1;
}

.about-feature-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.about-feature-card p {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- About: Read More Toggle ---- */

.about-more-toggle {
    text-align: center;
    margin: 20px 0 4px;
}

.about-read-more-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.about-read-more-btn:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.06);
}

.about-more-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.about-more-content.expanded {
    max-height: 2000px;
}

.about-loading-more {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px;
}

/* ---- About: Enter Button ---- */

.about-enter-btn {
    display: inline-block;
    padding: 12px 36px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    border-radius: 8px;
}

.about-footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}

.about-footer p {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- About: Tour Button ---- */

.about-tour-btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.15s, color 0.15s;
}

.about-tour-btn:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   Tutorial / Walkthrough
   ============================================ */

.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    pointer-events: none;
}

.tutorial-spotlight {
    position: fixed;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    z-index: 10002;
    pointer-events: none;
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-tooltip {
    position: fixed;
    z-index: 10004;
    background: white;
    border-radius: 14px;
    padding: 24px 28px 20px;
    max-width: 360px;
    width: 360px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    opacity: 0;
    animation: tutorialFadeIn 0.3s ease forwards;
    animation-delay: 0.15s;
}

.tutorial-tooltip.centered {
    max-width: 420px;
    width: 420px;
    text-align: center;
}

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

.tutorial-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tutorial-tooltip-icon {
    font-size: 22px;
    line-height: 1;
}

.tutorial-tooltip-step {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.centered .tutorial-tooltip-header {
    justify-content: center;
}

.tutorial-tooltip-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.tutorial-tooltip-desc {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

/* Step indicator dots */

.tutorial-tooltip-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-medium);
    transition: background 0.2s, transform 0.2s;
}

.tutorial-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

.tutorial-dot.completed {
    background: var(--primary);
    opacity: 0.5;
}

/* Action buttons */

.tutorial-tooltip-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.centered .tutorial-tooltip-actions {
    justify-content: center;
}

.tutorial-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 7px;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.tutorial-btn-next {
    background: var(--primary);
    color: white;
    padding: 8px 20px;
}

.tutorial-btn-next:hover {
    background: #2563eb;
}

.tutorial-btn-back {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

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

.tutorial-btn-skip {
    background: transparent;
    color: var(--text-muted);
    margin-right: auto;
    padding: 8px 10px;
    font-size: 12px;
}

.tutorial-btn-skip:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .top-header,
    .sidebar,
    .allergy-banner,
    .search-modal,
    .toast-container {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .main-container {
        display: block;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .data-table {
        font-size: 10px;
    }

    .btn, .filters-bar {
        display: none;
    }

    .ai-panel {
        display: none !important;
    }
}

/* ============================================
   Order Entry Modal
   ============================================ */
.order-entry-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.order-entry-modal.active {
    display: block;
}

.order-entry-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.order-entry-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    margin: 60px auto;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.order-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary);
    color: var(--text-white);
}

.order-entry-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.order-entry-close {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

.order-entry-close:hover {
    opacity: 1;
}

.order-entry-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.order-entry-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

/* Order Type Selection Grid */
.order-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.order-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.order-type-card:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.order-type-card.selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.2);
}

.order-type-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.order-type-label {
    font-weight: 600;
    color: var(--text-primary);
}

/* Order Form */
.order-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.order-form-icon {
    font-size: 24px;
}

.order-form-type {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

.order-form .form-group {
    margin-bottom: 16px;
}

.order-form .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.order-form .form-label .required {
    color: var(--status-critical);
    margin-left: 2px;
}

.order-form .form-input,
.order-form .form-select,
.order-form .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-form .form-input:focus,
.order-form .form-select:focus,
.order-form .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.order-form .form-textarea {
    resize: vertical;
    min-height: 80px;
}

.order-form .conditional-field.hidden {
    display: none;
}

/* Multiselect for order forms */
.multiselect-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    background: var(--bg-white);
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.multiselect-option:hover {
    background: var(--bg-hover);
}

.multiselect-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.multiselect-option input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

/* Order Review */
.order-review {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
}

.order-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.order-review-badge {
    margin-left: auto;
    background: var(--status-normal);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.order-review-content {
    display: grid;
    gap: 12px;
}

.order-review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.order-review-item:last-child {
    border-bottom: none;
}

.order-review-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
}

.order-review-value {
    text-align: right;
    color: var(--text-primary);
    max-width: 60%;
}

/* ============================================
   AI Side Panel
   ============================================ */
:root {
    --ai-panel-width: 320px;
}

.ai-panel {
    width: var(--ai-panel-width);
    background: var(--bg-white);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
    position: relative;
}

.ai-panel.resizing {
    transition: none;
    user-select: none;
}

.ai-panel.collapsed {
    width: 0;
    border-left: none;
    opacity: 0;
}

/* Resize handle on left edge of AI panel */
.ai-panel-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}

.ai-panel-resize-handle:hover,
.ai-panel-resize-handle.active {
    background: var(--primary);
    opacity: 0.4;
}

/* Top bar */
.ai-panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}

.ai-panel-topbar-title {
    font-size: 13px;
}

/* Tab Switcher */
.ai-panel-tabs {
    display: flex;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-medium);
    flex-shrink: 0;
}

.ai-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.ai-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.ai-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-white);
}

/* Tab notification badges */
.tab-badge {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
}

.tab-badge.visible {
    display: inline-block;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

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

/* Tab Content */
.ai-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.ai-tab-content.active {
    display: flex;
}

/* Copilot tab body (scrollable) */
#assistant-tab-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Chat tab header */
.chat-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.chat-tab-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-tab-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-chat-btn-sm {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    padding: 2px 4px;
    border-radius: 3px;
}

.clear-chat-btn-sm:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* AI Panel Header Actions (topbar buttons) */
.ai-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-settings-btn-header {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease;
}

.ai-settings-btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* AI Panel Content */
.ai-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    gap: 8px;
    max-width: 90%;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    border: 2px solid #6366f1;
}

/* Patient avatar - blue/purple theme */
#patient-chat .chat-message.assistant .chat-avatar {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Nurse avatar - green theme */
#nurse-chat .chat-message.assistant .chat-avatar {
    background: #dcfce7;
    border-color: #22c55e;
}

.chat-message.user .chat-avatar {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message.user .chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-light);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Chat Input Area */
.chat-input-area {
    padding: 12px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--font-family);
    resize: none;
    max-height: 100px;
    line-height: 1.4;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.chat-send-btn:disabled {
    background: var(--border-medium);
    cursor: not-allowed;
}

/* Voice Controls */
.voice-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.voice-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.voice-btn:hover {
    background: var(--bg-hover);
}

.voice-btn.active {
    background: var(--status-critical-bg);
    border-color: var(--status-critical);
    color: var(--status-critical);
}

.voice-btn.speaking {
    background: var(--status-normal-bg);
    border-color: var(--status-normal);
    color: var(--status-normal);
}

.voice-indicator {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Settings Panel */
.ai-settings {
    padding: 16px;
}

.ai-settings-group {
    margin-bottom: 16px;
}

.ai-settings-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.ai-settings-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--font-mono);
}

.ai-settings-input:focus {
    outline: none;
    border-color: var(--primary);
}

.ai-settings-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* AI Panel Toggle Button (when collapsed) */
.ai-panel-toggle-btn {
    position: fixed;
    right: 16px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    transition: transform 0.15s ease;
}

.ai-panel-toggle-btn:hover {
    transform: scale(1.05);
}

/* Floating AI Panel Button */
.ai-panel-floating-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(44, 82, 130, 0.4);
    z-index: 1000;
    transition: all 0.2s ease;
    font-size: 18px;
}

.ai-panel-floating-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(44, 82, 130, 0.5);
}

.ai-panel-floating-btn .btn-label {
    font-size: 13px;
    font-weight: 600;
}

.ai-panel-floating-btn.visible {
    display: flex;
}

/* Empty State for Chat */
.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}

.chat-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.chat-empty-text {
    font-size: 14px;
    margin-bottom: 8px;
}

.chat-empty-hint {
    font-size: 12px;
}

/* Responsive AI Panel */
@media (max-width: 1400px) {
    :root {
        --ai-panel-width: 500px;
    }
}

@media (max-width: 1200px) {
    :root {
        --ai-panel-width: 440px;
    }
}

@media (max-width: 1024px) {
    :root {
        --ai-panel-width: 480px;
    }

    .ai-panel {
        position: fixed;
        right: 0;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        z-index: 1000;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .ai-panel.collapsed {
        right: calc(-1 * var(--ai-panel-width));
        width: var(--ai-panel-width);
        opacity: 1;
    }

    .ai-panel-toggle-btn {
        display: flex;
    }

    .ai-panel:not(.collapsed) ~ .ai-panel-toggle-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --ai-panel-width: 100%;
    }

    .order-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ai-panel-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease;
}

.ai-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-panel.collapsed .ai-panel-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* Chat Header Bar with Clear Button */
.chat-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-light);
}

.chat-header-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.clear-chat-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-chat-btn:hover {
    background: #fef2f2;
    border-color: var(--danger);
    color: var(--danger);
}

.clear-chat-btn span {
    font-size: 12px;
}

/* Chat Welcome State */
.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.chat-welcome .welcome-avatar {
    font-size: 48px;
    margin-bottom: 16px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border: 3px solid #3b82f6;
}

/* Patient welcome avatar */
#patient-chat .chat-welcome .welcome-avatar {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Nurse welcome avatar */
#nurse-chat .chat-welcome .welcome-avatar {
    background: #dcfce7;
    border-color: #22c55e;
}

.chat-welcome h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.chat-welcome p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Chat Input Wrapper */
.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.voice-output-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.voice-output-btn:hover {
    background: var(--bg-hover);
}

.voice-output-btn.muted {
    opacity: 0.5;
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.send-btn:hover {
    background: var(--primary-dark);
}

/* Chat Message Avatar */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: var(--primary);
    color: white;
}

.message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    max-width: calc(100% - 40px);
}

.chat-message.user .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
    background: var(--bg-light);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Settings Panel */
.ai-settings-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.ai-settings-panel.open {
    transform: translateY(0);
}

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

.settings-header h3 {
    margin: 0;
    font-size: 16px;
}

.settings-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.settings-close:hover {
    color: var(--text-primary);
}

.settings-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.settings-group input,
.settings-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
}

.settings-group input:focus,
.settings-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.settings-group small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-group {
    margin-bottom: 16px;
}

.settings-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.settings-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.settings-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* AI Panel Header Actions */
.ai-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* AI Settings Button (in header) */
.ai-settings-btn-header {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.15s ease;
}

.ai-settings-btn-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ============================================
   Simulation Controls
   ============================================ */
.sim-controls {
    position: relative;
    margin-right: 16px;
}

.sim-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sim-status:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sim-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
}

.sim-indicator.stopped {
    background: #888;
}

.sim-indicator.running {
    background: #22c55e;
    animation: pulse 1.5s infinite;
}

.sim-indicator.paused {
    background: #f59e0b;
}

.sim-time {
    font-weight: 600;
    font-size: 13px;
    min-width: 60px;
}

.sim-label {
    font-size: 11px;
    opacity: 0.8;
}

/* Simulation Panel Dropdown */
.sim-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    margin-top: 8px;
}

.sim-panel.expanded {
    display: block;
}

.sim-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border-radius: 8px 8px 0 0;
}

.sim-panel-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.sim-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
}

.sim-close:hover {
    opacity: 1;
}

.sim-panel-body {
    padding: 16px;
}

.sim-scenario {
    margin-bottom: 16px;
}

.sim-scenario label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.sim-scenario select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 13px;
}

/* Time Display */
.sim-time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 16px;
}

.sim-clock {
    text-align: center;
}

.sim-clock .clock-date {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.sim-clock .clock-time {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.sim-elapsed {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Speed Controls */
.sim-speed {
    margin-bottom: 16px;
}

.sim-speed label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.speed-buttons {
    display: flex;
    gap: 4px;
}

.speed-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-medium);
    background: var(--bg-white);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.speed-btn:hover {
    background: var(--bg-hover);
}

.speed-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Control Buttons */
.sim-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.sim-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sim-btn.sim-start,
.sim-btn.sim-resume {
    background: #22c55e;
    color: white;
}

.sim-btn.sim-start:hover,
.sim-btn.sim-resume:hover {
    background: #16a34a;
}

.sim-btn.sim-pause {
    background: #f59e0b;
    color: white;
}

.sim-btn.sim-pause:hover {
    background: #d97706;
}

.sim-btn.sim-reset {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.sim-btn.sim-reset:hover {
    background: var(--bg-hover);
}

.sim-btn.sim-debrief {
    background: #6366f1;
    color: white;
}

.sim-btn.sim-debrief:hover {
    background: #4f46e5;
}

/* Vitals Preview */
.sim-vitals-preview {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.sim-vitals-preview h5 {
    margin: 0 0 10px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

.vital-item {
    text-align: center;
    padding: 6px;
    background: var(--bg-white);
    border-radius: 4px;
}

.vital-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.vital-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Status Text */
.sim-status-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* ============================================
   Live Vitals Banner
   ============================================ */
.live-vitals-banner {
    display: none;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.live-vitals-banner.visible {
    display: block;
}

.live-vitals-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.live-vitals-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.live-indicator {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.live-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.8;
}

.live-time {
    font-size: 14px;
    font-weight: 600;
}

.live-vitals-grid {
    display: flex;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.live-vital {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.3s ease;
}

.live-vital .vital-icon {
    font-size: 14px;
    opacity: 0.8;
}

.live-vital .vital-name {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.7;
    min-width: 30px;
}

.live-vital .vital-val {
    font-size: 14px;
    font-weight: 700;
    min-width: 55px;
}

/* Vital status colors */
.vital-val.normal {
    color: #86efac;
}

.vital-val.low {
    color: #93c5fd;
}

.vital-val.high {
    color: #fcd34d;
}

.vital-val.critical {
    color: #fca5a5;
    animation: blink 1s infinite;
}

.vital-val.improving {
    color: #86efac;
}

.vital-val.worsening {
    color: #fcd34d;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Trajectory */
.live-vitals-trajectory {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.trajectory-label {
    font-size: 11px;
    opacity: 0.7;
}

.trajectory-value {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.trajectory-value.improving {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.trajectory-value.stable {
    background: rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

.trajectory-value.worsening {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Rhythm Display */
.live-vitals-rhythm {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.rhythm-label {
    font-size: 11px;
    opacity: 0.7;
}

.rhythm-value {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

.rhythm-value.critical {
    background: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    animation: rhythmPulse 1s infinite;
}

@keyframes rhythmPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.view-ekg-btn {
    background: rgba(59, 130, 246, 0.8);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.view-ekg-btn:hover {
    background: rgba(59, 130, 246, 1);
}

/* Active Interventions in Banner */
.live-vitals-interventions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.active-intervention {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 11px;
}

.intervention-name {
    font-weight: 600;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intervention-progress {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.intervention-progress .progress-bar {
    height: 100%;
    background: #22c55e;
    transition: width 0.5s ease;
}

.intervention-status {
    font-size: 10px;
    opacity: 0.7;
}

/* Intervention flash animation */
.live-vitals-banner.intervention-flash {
    animation: flash 0.5s ease;
}

@keyframes flash {
    0%, 100% { background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%); }
    50% { background: linear-gradient(135deg, #22543d 0%, #276749 100%); }
}

/* Responsive */
@media (max-width: 1024px) {
    .live-vitals-container {
        justify-content: center;
    }

    .live-vitals-status {
        border-right: none;
        padding-right: 0;
    }

    .live-vitals-trajectory {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .live-vitals-grid {
        flex-wrap: wrap;
        justify-content: center;
    }

    .live-vital {
        padding: 4px 8px;
    }

    .live-vital .vital-name {
        display: none;
    }
}

/* ============================================
   Simulation Log Panel
   ============================================ */
.sim-log-panel {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: var(--ai-panel-width);
    background: var(--bg-white);
    border-top: 1px solid var(--border-medium);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    max-height: 300px;
    transition: transform 0.3s ease;
}

.sim-log-panel.visible {
    display: block;
}

.sim-log-panel.collapsed {
    transform: translateY(calc(100% - 44px));
}

.sim-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.sim-log-tabs {
    display: flex;
    gap: 4px;
}

.log-tab {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.log-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.log-tab.active {
    background: var(--primary);
    color: white;
}

.sim-log-toggle {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}

.sim-log-body {
    max-height: 240px;
    overflow-y: auto;
}

.log-tab-content {
    display: none;
    padding: 12px 16px;
}

.log-tab-content.active {
    display: block;
}

.log-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px;
}

/* Log Entries */
.log-entries {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 12px;
}

.log-entry.alert {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.log-entry.intervention {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.log-entry.lab {
    background: #d1fae5;
    border-left: 3px solid #10b981;
}

.log-entry.trigger {
    background: #fce7f3;
    border-left: 3px solid #ec4899;
}

.log-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.log-time {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 70px;
}

.log-message {
    flex: 1;
    color: var(--text-primary);
}

/* Intervention Cards */
.interventions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intervention-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid var(--primary);
}

.intervention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

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

.intervention-phase {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.intervention-phase.onset {
    background: #dbeafe;
    color: #1d4ed8;
}

.intervention-phase.peak {
    background: #d1fae5;
    color: #047857;
}

.intervention-phase.wearing-off {
    background: #fef3c7;
    color: #b45309;
}

.intervention-dose {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.intervention-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.intervention-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.intervention-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #22c55e 100%);
    transition: width 0.5s ease;
}

.intervention-time {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

.intervention-effects {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.effect-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Lab Status */
.labs-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
}

.labs-section-title:first-child {
    margin-top: 0;
}

.lab-status-card {
    background: var(--bg-light);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
}

.lab-status-card.completed {
    cursor: pointer;
}

.lab-status-card.completed:hover {
    background: var(--bg-hover);
}

.lab-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.lab-status-card .lab-name {
    font-weight: 600;
    font-size: 13px;
}

.lab-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.lab-status-badge.ordered {
    background: #e0e7ff;
    color: #4338ca;
}

.lab-status-badge.collected {
    background: #dbeafe;
    color: #1d4ed8;
}

.lab-status-badge.in-progress {
    background: #fef3c7;
    color: #b45309;
}

.lab-time {
    font-size: 11px;
    color: var(--text-muted);
}

.lab-progress-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.lab-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}

.lab-abnormals {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.abnormal-result {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.abnormal-result.high {
    background: #fef2f2;
    color: #b91c1c;
}

.abnormal-result.low {
    background: #eff6ff;
    color: #1d4ed8;
}

.lab-normal {
    font-size: 11px;
    color: var(--text-muted);
}

/* Lab Results Modal */
.lab-results-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.lab-results-modal.visible {
    display: flex;
}

.lab-results-content {
    background: var(--bg-white);
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lab-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--primary);
    color: white;
}

.lab-results-header h3 {
    margin: 0;
    font-size: 16px;
}

.lab-results-header button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.lab-results-meta {
    display: flex;
    gap: 20px;
    padding: 10px 20px;
    background: var(--bg-light);
    font-size: 11px;
    color: var(--text-muted);
}

.lab-results-table {
    width: 100%;
    border-collapse: collapse;
}

.lab-results-table th,
.lab-results-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.lab-results-table th {
    background: var(--bg-light);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lab-results-table tr.high {
    background: #fef2f2;
}

.lab-results-table tr.low {
    background: #eff6ff;
}

.result-value {
    font-weight: 600;
}

.result-flag {
    font-weight: 700;
}

.lab-results-table tr.high .result-flag {
    color: #b91c1c;
}

.lab-results-table tr.low .result-flag {
    color: #1d4ed8;
}

/* Simulation Debrief Modal */
.debrief-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.debrief-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.debrief-modal {
    background: var(--bg-white);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.debrief-modal-overlay.visible .debrief-modal {
    transform: scale(1);
}

.debrief-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.debrief-header h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
}

.debrief-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.debrief-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.debrief-section {
    margin-bottom: 24px;
}

.debrief-section:last-child {
    margin-bottom: 0;
}

.debrief-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-lighter);
}

.debrief-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.debrief-metric {
    background: var(--bg-subtle);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.debrief-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.debrief-metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.debrief-outcome {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.debrief-outcome.success {
    background: #ecfdf5;
    border: 1px solid #10b981;
}

.debrief-outcome.partial {
    background: #fffbeb;
    border: 1px solid #f59e0b;
}

.debrief-outcome.failure {
    background: #fef2f2;
    border: 1px solid #ef4444;
}

.debrief-outcome-icon {
    font-size: 28px;
}

.debrief-outcome-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.debrief-outcome-text p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.debrief-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debrief-timeline li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.debrief-timeline li:last-child {
    border-bottom: none;
}

.debrief-timeline-time {
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
}

.debrief-timeline-event {
    flex: 1;
    color: var(--text-primary);
}

.debrief-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debrief-suggestions li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.debrief-suggestions li:last-child {
    margin-bottom: 0;
}

.debrief-suggestion-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Performance Scores */
.debrief-scores {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.debrief-score-overall {
    flex-shrink: 0;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid;
}

.score-circle.score-excellent {
    background: #ecfdf5;
    border-color: #22c55e;
}

.score-circle.score-good {
    background: #f0fdf4;
    border-color: #84cc16;
}

.score-circle.score-fair {
    background: #fffbeb;
    border-color: #f59e0b;
}

.score-circle.score-poor {
    background: #fef2f2;
    border-color: #ef4444;
}

.score-circle .score-value {
    font-size: 28px;
    font-weight: 700;
}

.score-circle .score-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.debrief-score-categories {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.score-category {
    background: var(--bg-subtle);
    border-radius: 8px;
    padding: 12px;
}

.score-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.score-category-name {
    font-weight: 600;
    font-size: 13px;
}

.score-category-value {
    font-weight: 700;
    font-size: 14px;
}

.score-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.score-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-progress-fill.score-excellent {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.score-progress-fill.score-good {
    background: linear-gradient(90deg, #84cc16, #65a30d);
}

.score-progress-fill.score-fair {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.score-progress-fill.score-poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.score-details {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    font-size: 11px;
}

.score-details li {
    padding: 3px 0;
    color: var(--text-secondary);
}

.score-details li.earned {
    color: #16a34a;
}

.score-details li.missed {
    color: #dc2626;
}

.score-details li.neutral {
    color: var(--text-muted);
}

.score-grade {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
    color: var(--text-primary);
}

/* Safety alerts in debrief */
.debrief-safety-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.safety-alert-item {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc2626;
    padding: 12px 16px;
    border-radius: 4px;
    color: #991b1b;
    font-size: 13px;
}

/* Clinical Challenge Banner */
.simulation-challenge-banner {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 0;
    margin: 0;
    border-bottom: 2px solid #1d4ed8;
    animation: bannerSlideDown 0.5s ease-out;
}

@keyframes bannerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.challenge-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    max-width: 100%;
}

.challenge-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.challenge-banner-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.challenge-banner-text strong {
    font-size: 14px;
}

.challenge-banner-dismiss {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 18px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.challenge-banner-dismiss:hover {
    background: rgba(255,255,255,0.3);
}

/* Allergy Warning Modal */
.allergy-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.allergy-warning-modal {
    background: white;
    border-radius: 12px;
    width: 500px;
    max-width: 90vw;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 3px solid #dc2626;
}

.allergy-warning-header {
    background: #dc2626;
    color: white;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.allergy-warning-icon {
    font-size: 24px;
}

.allergy-warning-body {
    padding: 24px;
}

.allergy-warning-body p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
}

.allergy-warning-detail {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.allergy-severity-severe {
    color: #dc2626;
    font-weight: 700;
    text-transform: uppercase;
}

.allergy-severity-moderate {
    color: #d97706;
    font-weight: 600;
}

.allergy-warning-message {
    color: #991b1b;
    font-weight: 500;
}

.allergy-warning-note {
    color: #6b7280;
    font-size: 12px !important;
    font-style: italic;
}

.allergy-warning-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.allergy-btn-cancel {
    background: #059669;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.allergy-btn-cancel:hover {
    background: #047857;
}

.allergy-btn-override {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.allergy-btn-override:hover {
    background: #b91c1c;
}

.debrief-footer {
    padding: 16px 24px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.debrief-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.debrief-btn-secondary {
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.debrief-btn-secondary:hover {
    background: var(--bg-hover);
}

.debrief-btn-primary {
    background: var(--primary);
    border: none;
    color: white;
}

.debrief-btn-primary:hover {
    background: var(--primary-dark);
}

/* Critical Decisions Section */
.debrief-critical-decisions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.debrief-decision {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid;
}

.debrief-decision.success {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.debrief-decision.error {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.debrief-decision.partial {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.debrief-decision-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.debrief-decision-content h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.debrief-decision.error .debrief-decision-content h4 {
    color: #dc2626;
}

.debrief-decision.success .debrief-decision-content h4 {
    color: #16a34a;
}

.debrief-decision-content p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.debrief-decision-content p:last-child {
    margin-bottom: 0;
}

.debrief-teaching-point {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px !important;
}

/* Scenario Start Message */
.scenario-start-message {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 8px 12px;
    font-size: 13px;
}

.scenario-start-message .message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.scenario-start-message .message-body {
    color: var(--text-primary);
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 1024px) {
    .sim-log-panel {
        left: 0;
        right: 0;
    }

    .debrief-modal {
        max-width: 95%;
        max-height: 90vh;
    }

    .debrief-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Clinical Images Modal
   ============================================ */
.clinical-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.clinical-image-modal.visible {
    display: flex;
}

.clinical-image-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.clinical-image-content {
    position: relative;
    background: var(--bg-white);
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.clinical-image-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary);
    color: white;
}

.clinical-image-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.clinical-image-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.clinical-image-close:hover {
    opacity: 1;
}

.clinical-image-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.clinical-image-container {
    position: relative;
    background: #000;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clinical-image-container img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
}

.clinical-image-loading {
    position: absolute;
    color: white;
    font-size: 14px;
}

.clinical-image-details {
    padding: 16px 20px;
}

.clinical-image-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.clinical-image-findings {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.clinical-image-findings h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.clinical-image-findings ul {
    margin: 0;
    padding-left: 20px;
}

.clinical-image-findings li {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.clinical-image-interpretation {
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.clinical-image-interpretation h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #065f46;
}

.clinical-image-interpretation p {
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
}

.clinical-image-credit {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.clinical-image-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

/* Imaging Section - View Image Buttons */
.view-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.view-image-btn:hover {
    background: var(--primary);
}

.view-image-btn .btn-icon {
    font-size: 14px;
}

@media (max-width: 768px) {
    .clinical-image-content {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .clinical-image-container img {
        max-height: 300px;
    }
}

/* ============================================
   AI Assistant Panel (Integrated Sidebar Tab)
   ============================================ */

/* Assistant Tab Container */
.assistant-tab-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.assistant-tab-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Assistant Toolbar */
.assistant-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.assistant-toolbar-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    white-space: nowrap;
}

.assistant-toolbar-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Sections (in sidebar tab) */
.ai-section {
    margin-bottom: 0;
    padding: 10px;
    border-bottom: 1px solid var(--border-light);
}

.ai-section:last-child {
    border-bottom: none;
}

.section-count {
    font-weight: 400;
    color: var(--text-muted);
}

.ai-section-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-section-header .icon {
    font-size: 12px;
}

/* Flags Section (Safety Critical) */
.flags-section {
    background: #fef2f2;
}

.flags-section .ai-section-header {
    color: #b91c1c;
}

.ai-flag {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
}

.ai-flag.critical {
    border-color: #ef4444;
    border-width: 2px;
}

.ai-flag .flag-text {
    flex: 1;
    color: #991b1b;
    line-height: 1.4;
}

.ai-flag .flag-dismiss {
    background: #dcfce7;
    border: none;
    color: #166534;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
}

.ai-flag .flag-dismiss:hover {
    background: #bbf7d0;
}

/* Context Section */
.context-section {
    background: #f0f9ff;
}

.context-section .ai-section-header {
    color: #0369a1;
}

.ai-context {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Reviewed Section */
.reviewed-section .ai-section-header {
    color: #166534;
}

.ai-reviewed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ai-reviewed-item {
    background: #dcfce7;
    color: #166534;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* Doctor's Dictation Section */
.dictation-section {
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    border-bottom: 2px solid #d946ef;
}

.dictation-section .ai-section-header {
    color: #a21caf;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
    padding: 2px 6px;
}

.section-edit-btn:hover {
    opacity: 1;
    background: rgba(162, 28, 175, 0.1);
    border-radius: 4px;
}

.ai-dictation {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
    background: white;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #d946ef;
    margin-top: 8px;
}

.dictation-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.summary-section .ai-section-header {
    color: #0369a1;
}

.ai-summary {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Thinking Section */
.thinking-section {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}

.thinking-section .ai-section-header {
    color: #854d0e;
}

.ai-thinking {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
    font-style: italic;
}

/* Suggested Actions Section */
.actions-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.actions-section .ai-section-header {
    color: #166534;
}

.ai-actions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-suggested-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.ai-suggested-action:hover {
    border-color: #22c55e;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.15);
}

.ai-suggested-action .action-text {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.ai-suggested-action .action-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.action-do-btn {
    background: #22c55e;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-do-btn:hover {
    background: #16a34a;
    transform: scale(1.02);
}

.action-dismiss-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-dismiss-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

/* Observations Section */
.observations-section .ai-section-header {
    color: #6b7280;
}

.ai-observation {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
}

.ai-observation:last-child {
    border-bottom: none;
}

.ai-observation .obs-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.4;
}

.ai-observation .obs-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    opacity: 0.5;
}

.ai-observation:hover .obs-dismiss {
    opacity: 1;
}

/* Open Items Section */
.open-section .ai-section-header {
    color: #9333ea;
}

.ai-open-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    font-size: 12px;
}

.ai-open-item .open-text {
    flex: 1;
    color: var(--text-secondary);
}

.ai-open-item .open-done {
    background: #f3e8ff;
    border: none;
    color: #7c3aed;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    opacity: 0.6;
}

.ai-open-item:hover .open-done {
    opacity: 1;
}

/* Tasks Section */
.tasks-section .ai-section-header {
    color: var(--primary);
}

.ai-task {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 5px 0;
    font-size: 12px;
}

.ai-task input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.ai-task .task-text {
    flex: 1;
    color: var(--text-primary);
}

.ai-task.done .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-actions,
.open-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ai-task:hover .task-actions,
.ai-open-item:hover .open-actions {
    opacity: 1;
}

.ai-task .task-remove,
.open-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
}

.ai-task .task-remove:hover {
    color: #b91c1c;
    background: #fee2e2;
}

/* ============================================
   Copilot Sections (New Tabbed Layout)
   ============================================ */

/* Generic copilot section */
.copilot-section {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.copilot-section:last-child {
    border-bottom: none;
}

.copilot-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

/* Collapsible section headers */
.copilot-section-header.collapsible-header {
    cursor: pointer;
    padding: 6px 12px;
    margin: 0;
    border-bottom: 1px solid var(--border-light);
    user-select: none;
    transition: background 0.15s;
}

.copilot-section-header.collapsible-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.collapse-chevron {
    font-size: 8px;
    width: 12px;
    display: inline-block;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.copilot-section-header .section-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.section-action-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.section-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.copilot-section-body {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
}

.progress-overall {
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

/* ---- ALERT BAR (sticky top, critical safety) ---- */
.copilot-alert-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fef2f2;
    border-bottom: 2px solid #fca5a5;
}

.copilot-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
}

.copilot-alert:last-child {
    border-bottom: none;
}

.copilot-alert.critical {
    background: #fee2e2;
    color: #7f1d1d;
    font-weight: 600;
}

.copilot-alert.warning {
    background: #fffbeb;
    color: #92400e;
    border-bottom-color: #fde68a;
}

.alert-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
    line-height: 1.3;
}

.alert-dismiss {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.alert-dismiss:hover {
    opacity: 1;
    background: rgba(255,255,255,0.5);
}

/* ---- CLINICAL SUMMARY (3 sentences) ---- */
.clinical-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-light);
}

.clinical-summary > .copilot-section-body {
    padding: 8px 12px;
}

.clinical-summary-header {
    margin-bottom: 6px;
}

.summary-patient-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

.summary-sentence {
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.45;
    padding: 2px 0;
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.summary-sentence strong {
    color: var(--primary-dark);
}

.summary-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.sentence-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 60px;
}

.summary-allergies {
    font-size: 10px;
    color: #b91c1c;
    font-weight: 500;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* ---- PROBLEM LIST SECTION ---- */
.problem-list-section {
    padding-bottom: 4px;
}

.insight-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.problem-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 10px 0;
    text-align: center;
}

.problem-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.problem-item:last-child {
    border-bottom: none;
}

.problem-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.problem-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    width: 16px;
    flex-shrink: 0;
}

.problem-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.problem-urgency {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.urgency-urgent {
    background: #fef2f2;
    color: #991b1b;
}

.urgency-active {
    background: #eff6ff;
    color: #1d4ed8;
}

.urgency-monitoring {
    background: #f0fdf4;
    color: #166534;
}

.problem-ddx {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    padding-left: 21px;
    margin-top: 2px;
    line-height: 1.35;
}

.problem-plan {
    font-size: 11px;
    color: var(--text-primary);
    padding-left: 21px;
    margin-top: 2px;
    line-height: 1.35;
}

.problem-analyze-hint {
    text-align: center;
    padding: 8px 0 4px;
}

.analyze-btn-sm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 14px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.analyze-btn-sm:hover {
    background: var(--primary-dark);
}

/* ---- SUGGESTED ACTIONS SECTION ---- */
.actions-section .copilot-section-body {
    padding: 4px 0;
}

.action-category {
    padding: 4px 12px;
}

.action-category + .action-category {
    border-top: 1px solid rgba(0,0,0,0.04);
}

.action-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.action-cat-icon {
    font-size: 12px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.action-cat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.action-items {
    padding-left: 24px;
    padding-bottom: 2px;
}

.action-item {
    font-size: 11px;
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    line-height: 1.4;
}

.action-item:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--primary);
}

.action-item::before {
    content: '• ';
    color: var(--text-muted);
}

/* Executable action items — AI-suggested orders that open OrderEntry */
.action-item.action-executable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 2px solid transparent;
    transition: background 0.1s, border-color 0.15s;
}

.action-item.action-executable:hover {
    border-left-color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
}

.action-item.action-executable::before {
    content: '▸ ';
    color: var(--primary);
}

.action-execute-icon {
    font-size: 9px;
    opacity: 0;
    margin-left: 6px;
    color: var(--primary);
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.action-item.action-executable:hover .action-execute-icon {
    opacity: 0.7;
}

.action-text {
    flex: 1;
}

/* Chat action items — communication and med change actions that open chat */
.action-item.action-chat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 2px solid transparent;
    transition: background 0.1s, border-color 0.15s;
}

.action-item.action-chat:hover {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, 0.06);
}

.action-item.action-chat::before {
    content: '• ';
    color: #22c55e;
}

.action-chat-icon {
    font-size: 11px;
    opacity: 0;
    margin-left: 6px;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.action-item.action-chat:hover .action-chat-icon {
    opacity: 0.7;
}

.action-note-btn {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    margin: 2px 3px 2px 0;
}

.action-note-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---- CONVERSATION THREAD ---- */
.conversation-section {
    border-top: 1px solid var(--border-light);
}

.conversation-thread {
    padding: 8px 12px;
}

.thread-divider {
    text-align: center;
    margin-bottom: 8px;
}

.thread-divider span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    background: white;
    padding: 0 8px;
    position: relative;
}

.thread-msg {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.thread-msg-user {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

.thread-msg-ai {
    background: #f8fafc;
    border: 1px solid var(--border-light);
}

.thread-msg-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.thread-msg-text {
    color: var(--text-primary);
}

.thread-msg-text strong {
    color: var(--primary-dark);
}

/* ---- AI LIVE STATUS LINE ---- */
.copilot-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f0f7f0, #f5f8f5);
    border-bottom: 1px solid rgba(76, 175, 80, 0.15);
    min-height: 28px;
}

.status-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-pulse.live {
    background: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
    animation: statusPulse 2.5s ease-in-out infinite;
}

.status-pulse.thinking {
    background: #FF9800;
    box-shadow: 0 0 4px rgba(255, 152, 0, 0.5);
    animation: statusPulse 1s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.status-line-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
    font-style: italic;
}

/* ---- INLINE INPUT ---- */
.copilot-inline-input {
    padding: 8px 12px;
    border-top: 1px solid var(--border-light);
    background: #fafafa;
    position: sticky;
    bottom: 0;
}

.inline-chips {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.suggestion-chip {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.suggestion-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.inline-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    margin-bottom: 6px;
}

.inline-textarea {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: inherit;
    resize: none;
    line-height: 1.4;
    min-height: 34px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.15s;
}

.inline-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.inline-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.inline-send-btn:hover {
    background: var(--primary-dark);
}

.inline-action-bar {
    display: flex;
    gap: 4px;
    position: relative;
}

.inline-action-btn {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s;
}

.inline-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.inline-more-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 4px;
    margin-bottom: 4px;
    z-index: 10;
}

.inline-more-menu.visible {
    display: block;
}

.inline-more-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border: none;
    background: none;
    font-size: 11px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.inline-more-menu button:hover {
    background: var(--bg-hover);
}

/* ---- COPILOT CONTENT AREA ---- */
.copilot-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#assistant-tab-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ---- OLD SNAPSHOT (kept for backward compat) ---- */
.copilot-snapshot {
    padding: 10px 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-light);
}

.snapshot-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.snapshot-patient {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

.snapshot-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.snapshot-dx {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.3;
}

.snapshot-placeholder-dx {
    color: var(--text-muted);
    font-style: italic;
}

.snapshot-placeholder {
    color: var(--text-muted);
    font-size: 11px;
}

.snapshot-vitals {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

/* Vital badges */
.vital-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid;
}

.vital-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.75;
}

.vital-value {
    font-weight: 600;
}

.vital-critical {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    animation: vital-pulse 2s ease-in-out infinite;
}

.vital-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.vital-normal {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.vital-muted {
    background: #f8fafc;
    color: var(--text-muted);
    border-color: var(--border-light);
}

@keyframes vital-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.snapshot-trend-row {
    margin-top: 4px;
    margin-bottom: 2px;
}

.snapshot-trend {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.trend-bad {
    background: #fee2e2;
    color: #991b1b;
}

.trend-good {
    background: #f0fdf4;
    color: #166534;
}

.trend-stable {
    background: #f8fafc;
    color: var(--text-muted);
}

.snapshot-allergies {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
    font-size: 11px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.allergy-label {
    font-weight: 600;
    color: #b91c1c;
    font-size: 10px;
}

.allergy-chip {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid #fecaca;
}

/* ---- PROGRESS TRACKER ---- */
.progress-section {
    background: #fafafa;
}

.progress-bars {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.progress-bar-track {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.bar-good {
    background: #22c55e;
}

.bar-mid {
    background: #f59e0b;
}

.bar-low {
    background: #ef4444;
}

.bar-na {
    background: #d1d5db;
}

.progress-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.progress-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Temporal nudges */
.temporal-nudges {
    margin-bottom: 6px;
}

.temporal-nudge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.temporal-nudge.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.temporal-nudge.critical {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.temporal-nudge.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Priority nudges */
.priority-nudges {
    border-top: 1px solid var(--border-light);
    padding-top: 6px;
}

.nudges-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.priority-nudge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    font-size: 11px;
    transition: background 0.15s ease;
}

.priority-nudge:hover {
    background: var(--bg-hover);
}

.nudge-domain {
    font-size: 9px;
    font-weight: 600;
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nudge-text {
    flex: 1;
    color: var(--text-primary);
}

.nudge-pts {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ---- CHART REVIEW PROGRESS (Non-Simulation) ---- */
.chart-review-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-bottom: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.15s ease;
}

.checklist-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
    color: var(--text-primary);
}

.checklist-done .checklist-icon {
    color: #22c55e;
    font-weight: 700;
}

.checklist-pending .checklist-icon {
    color: #d1d5db;
}

.checklist-done .checklist-name {
    color: var(--text-primary);
}

.checklist-pending .checklist-name {
    color: var(--text-muted);
}

.review-suggestion {
    font-size: 10px;
    color: var(--text-muted);
    padding: 4px 6px;
    background: #eff6ff;
    border-radius: 4px;
    margin-bottom: 6px;
}

.review-suggestion .suggestion-icon {
    font-size: 12px;
}

.session-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-top: 1px solid var(--border-light);
    padding-top: 6px;
}

.stat-chip {
    font-size: 10px;
    color: var(--text-secondary);
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 10px;
}

/* ---- CLINICAL REASONING ---- */
.reasoning-section {
    background: #fffbf0;
}

.reasoning-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}

.reasoning-loading .typing-indicator {
    display: inline-flex;
}

.reasoning-placeholder {
    text-align: center;
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.reasoning-placeholder p {
    margin: 0 0 4px;
}

.reasoning-block {
    margin-bottom: 10px;
}

.reasoning-block:last-child {
    margin-bottom: 0;
}

.reasoning-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.reasoning-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
}

.reasoning-considerations {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.consideration {
    font-size: 12px;
    line-height: 1.4;
    padding: 3px 0;
}

.consideration-critical {
    color: #991b1b;
    font-weight: 600;
}

.consideration-important {
    color: #92400e;
    font-weight: 500;
}

.dictation-block {
    background: #f0f9ff;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    margin-top: 8px;
}

.dictation-text {
    font-style: italic;
    color: var(--text-secondary);
}

/* ---- NEXT STEPS ---- */
.nextsteps-section {
    background: white;
}

.nextsteps-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nextstep-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    border-radius: 4px;
    font-size: 11px;
    transition: background 0.15s ease;
}

.nextstep-item:hover {
    background: var(--bg-hover);
}

.nextstep-domain {
    font-size: 9px;
    font-weight: 600;
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nextstep-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.3;
}

.nextstep-do,
.nextstep-dismiss,
.nextstep-go {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    opacity: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nextstep-item:hover .nextstep-do,
.nextstep-item:hover .nextstep-dismiss,
.nextstep-item:hover .nextstep-go {
    opacity: 1;
}

.nextstep-do:hover,
.nextstep-go:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary);
}

.nextstep-dismiss:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* ---- AI RESPONSE (from Ask) ---- */
.response-section {
    background: #f0f9ff;
    border-left: 3px solid var(--primary);
}

.response-section .copilot-section-header {
    color: var(--primary);
}

.ai-response-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* ---- QUICK ACTIONS BAR (sticky bottom) ---- */
.copilot-quick-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: white;
    border-top: 1px solid var(--border-medium);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.quick-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.quick-action-btn:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.quick-action-btn span:first-child {
    font-size: 16px;
}

/* ---- SCORE SUMMARY OVERLAY ---- */
.score-summary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-summary-modal {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.score-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.score-summary-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.score-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.score-close-btn:hover {
    color: var(--text-primary);
}

.score-overall {
    text-align: center;
    margin-bottom: 20px;
}

.score-number {
    display: block;
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.score-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-domains {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.score-domain-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-domain-label {
    font-size: 11px;
    color: var(--text-secondary);
    width: 110px;
    flex-shrink: 0;
}

.score-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-domain-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.score-actions {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* Ask Claude Button */
.ask-claude-btn {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ask-claude-btn:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    transform: scale(1.05);
}

/* Claude Helper Modal extras */
.claude-helper-options {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.claude-option-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.claude-option-btn:hover {
    background: #f1f5f9;
    border-color: var(--primary);
}

.claude-option-btn .option-icon {
    font-size: 24px;
}

.claude-option-btn .option-text {
    font-size: 12px;
    font-weight: 500;
}

.claude-prompt-preview {
    margin-top: 12px;
}

.claude-prompt-preview label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.claude-prompt-preview textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    background: #f8fafc;
    resize: none;
}

/* (Legacy AI Response Section - moved to copilot section styles) */

/* Empty State */
.ai-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
}

.ai-empty .empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.ai-empty .empty-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.ai-empty .empty-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Old floating panel footer/toggle - removed (now integrated in sidebar) */

/* Modal Styles */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ai-modal.visible {
    display: flex;
}

.ai-modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    width: 420px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-modal-content.small {
    width: 320px;
}

/* Note Editor Modal - large for editing notes */
.note-editor-modal {
    width: 700px;
    max-width: 95%;
    height: 80vh;
}

.note-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.note-editor-textarea {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 14px 16px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    resize: none;
    background: var(--bg-main);
    color: var(--text-primary);
}

.note-editor-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.note-generating {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.response-question {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 12px;
}

.ai-response-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    background: var(--bg-main);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Debug Modal - larger for viewing prompts */
.ai-debug-modal .ai-debug-content {
    width: 800px;
    max-width: 95%;
    height: 80vh;
}

.ai-debug-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.debug-tabs {
    display: flex;
    gap: 4px;
    padding: 10px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.debug-tab {
    padding: 8px 16px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.debug-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.debug-tab.active {
    background: var(--primary);
    color: white;
}

.debug-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-light);
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.debug-panel-content {
    flex: 1;
    padding: 12px;
    overflow: hidden;
}

.debug-textarea {
    width: 100%;
    height: 100%;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    resize: none;
    background: #1e1e1e;
    color: #d4d4d4;
}

.debug-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.debug-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

.debug-actions .btn {
    flex: 1;
}

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

.ai-modal-header h3 {
    margin: 0;
    font-size: 15px;
}

.ai-modal-header button {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.ai-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.ai-modal-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.ai-modal-body textarea,
.ai-modal-body input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.ai-modal-body textarea:focus,
.ai-modal-body input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ai-quick-asks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ai-quick-asks button {
    background: #f3f4f6;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-quick-asks button:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

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

/* Dictation Modal */
.dictation-modal {
    width: 500px;
}

.dictation-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.voice-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #a21caf 0%, #d946ef 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(162, 28, 175, 0.3);
}

.voice-btn.recording {
    background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}

.voice-icon {
    font-size: 18px;
}

.dictation-or {
    color: var(--text-muted);
    font-size: 12px;
}

.dictation-history-toggle {
    margin-top: 12px;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
}

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

.dictation-history {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 8px;
    background: var(--bg-light);
}

.dictation-history.hidden {
    display: none;
}

.history-entry {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.history-entry:last-child {
    border-bottom: none;
}

.history-time {
    color: var(--text-muted);
    font-size: 10px;
    margin-bottom: 4px;
}

.history-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.no-history {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}

/* Note Writing Modal */
.note-modal {
    width: 560px;
}

.note-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.note-type-option {
    cursor: pointer;
}

.note-type-option input {
    display: none;
}

.note-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.15s ease;
}

.note-type-option input:checked + .note-type-card {
    border-color: var(--primary);
    background: #eff6ff;
}

.note-type-card:hover {
    border-color: var(--primary-light);
}

.note-type-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.note-type-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.note-type-desc {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.note-data-sources {
    margin-bottom: 16px;
}

.data-sources-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.data-source-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.data-source-checks label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.data-source-checks input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.note-additional {
    margin-top: 12px;
}

.note-additional label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ============================================
   Prompt Editor Modal
   ============================================ */

.prompt-editor-modal .ai-modal-content {
    width: 90vw;
    max-width: 1200px;
    height: 80vh;
}

.prompt-editor-body {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.prompt-editor-sidebar {
    width: 240px;
    min-width: 240px;
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    padding: 8px 0;
    background: #fafbfc;
}

.prompt-sidebar-category {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.prompt-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    transition: all 0.15s ease;
}

.prompt-sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.prompt-sidebar-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
    border-right: 2px solid var(--primary);
}

.prompt-sidebar-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-custom-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Main editor area */
.prompt-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prompt-editor-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.prompt-header-title h4 {
    margin: 0 0 2px;
    font-size: 14px;
    color: var(--text-primary);
}

.prompt-editor-description {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    max-width: 600px;
    line-height: 1.4;
}

.prompt-header-badges {
    flex-shrink: 0;
}

.prompt-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.prompt-badge-default {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.prompt-badge-custom {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

/* Textarea */
.prompt-editor-textarea {
    flex: 1;
    margin: 0;
    padding: 16px;
    border: none;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: white;
    color: var(--text-primary);
    tab-size: 2;
    overflow-y: auto;
}

.prompt-editor-textarea:focus {
    box-shadow: inset 0 0 0 2px rgba(66, 153, 225, 0.15);
}

.prompt-editor-textarea::placeholder {
    color: var(--text-muted);
}

/* Actions bar */
.prompt-editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    background: #fafbfc;
    flex-shrink: 0;
}

.prompt-editor-actions-left,
.prompt-editor-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-char-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* ============================================
   Floating Chat Windows (Patient & Nurse)
   ============================================ */

/* Trigger buttons - positioned at sidebar edge (overridden at bottom of file) */
/* Legacy styles kept for reference — active styles are in UX Improvements section */

.patient-trigger {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #93c5fd;
}

.patient-trigger:hover,
.patient-trigger.active {
    background: #bfdbfe;
    border-color: #3b82f6;
}

.nurse-trigger {
    background: #dcfce7;
    color: #166534;
    border: 2px solid #86efac;
}

.nurse-trigger:hover,
.nurse-trigger.active {
    background: #bbf7d0;
    border-color: #22c55e;
}

.trigger-icon {
    font-size: 18px;
    line-height: 1;
}

.trigger-label {
    font-size: 13px;
}

/* Floating chat container */
#floating-chat-container {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1001;
    pointer-events: none;
}

/* Individual chat windows */
.floating-chat-window {
    position: fixed;
    bottom: 70px;
    width: 400px;
    height: 520px;
    border-radius: 12px;
    background: var(--bg-white);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* Position the patient chat on the left */
/* Position chat windows centered — patient left of center, nurse right */
.patient-chat-window {
    right: calc(50% + 10px);
}

.nurse-chat-window {
    left: calc(50% + 10px);
}

/* Chat header */
.floating-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    flex-shrink: 0;
}

.patient-chat-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.nurse-chat-header {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.floating-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-chat-icon {
    font-size: 22px;
    line-height: 1;
}

.floating-chat-title-group {
    display: flex;
    flex-direction: column;
}

.floating-chat-title {
    font-size: 14px;
    font-weight: 700;
}

.floating-chat-subtitle {
    font-size: 11px;
    opacity: 0.85;
}

.floating-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.floating-chat-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease;
}

.floating-chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.floating-chat-action-btn.active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.floating-chat-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s ease;
}

.floating-chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Chat message body */
.floating-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafbfc;
}

/* Reuse existing chat-message, chat-bubble, chat-avatar styles */
.floating-chat-body .chat-message {
    display: flex;
    gap: 8px;
    max-width: 90%;
}

.floating-chat-body .chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.floating-chat-body .chat-message.assistant {
    align-self: flex-start;
}

.floating-chat-body .chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.patient-chat-window .chat-message.assistant .chat-avatar {
    background: #dbeafe;
    border: 2px solid #3b82f6;
}

.nurse-chat-window .chat-message.assistant .chat-avatar {
    background: #dcfce7;
    border: 2px solid #22c55e;
}

.floating-chat-body .chat-message.user .chat-avatar {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary-dark);
}

.floating-chat-body .chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.floating-chat-body .chat-message.user .chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.floating-chat-body .chat-message.assistant .chat-bubble {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 4px;
}

/* Typing indicator inside floating chat */
.floating-chat-body .chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.floating-chat-body .chat-typing-dot {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.floating-chat-body .chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.floating-chat-body .chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Welcome message in floating chat */
.floating-chat-body .chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.floating-chat-body .chat-welcome .welcome-avatar {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}

.floating-chat-body .chat-welcome h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.floating-chat-body .chat-welcome p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Chat input area */
.floating-chat-input-area {
    padding: 10px 12px;
    background: white;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.floating-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.floating-chat-input {
    flex: 1;
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: var(--font-family);
    resize: none;
    outline: none;
    line-height: 1.4;
    max-height: 100px;
    transition: border-color 0.15s ease;
}

.floating-chat-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.floating-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.floating-chat-send-btn:hover {
    background: var(--primary-dark);
}

/* Responsive - stack chat windows on small screens */
@media (max-width: 900px) {
    .patient-chat-window {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .nurse-chat-window {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .floating-chat-window {
        width: calc(100vw - 40px);
        height: 60vh;
        left: 20px !important;
        right: auto !important;
        transform: none !important;
    }
}


/* ============================================
   UX Improvements — Feb 2026
   ============================================ */

/* --- Imaging: "View Report" affordance --- */
.note-item-action {
    font-size: 11px;
    color: var(--primary, #2980b9);
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-top: 4px;
    font-weight: 500;
}
.note-list-item:hover .note-item-action {
    opacity: 1;
}
.note-list-item:hover {
    background: #e8f4fd;
}

/* --- Scenario Briefing Modal --- */
.scenario-briefing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.scenario-briefing-modal.visible {
    display: flex;
}
.briefing-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}
.briefing-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: briefingSlideIn 0.3s ease;
}
@keyframes briefingSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.briefing-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 0;
}
.briefing-icon {
    font-size: 32px;
}
.briefing-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a5276;
}
.briefing-body {
    padding: 16px 24px;
}
.briefing-scenario-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}
.briefing-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}
.briefing-one-liner {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-bottom: 12px;
}
.briefing-details {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.briefing-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    background: #eaf2f8;
    color: #2980b9;
}
.briefing-objectives {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.briefing-objectives h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #1a5276;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.briefing-objectives ol {
    margin: 0;
    padding-left: 20px;
}
.briefing-objectives li {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 4px;
}
.briefing-instructions {
    font-size: 13px;
    color: #666;
    background: #fffbea;
    border-radius: 8px;
    padding: 10px 14px;
    border-left: 3px solid #f0c040;
}
.briefing-instructions p {
    margin: 0;
}
.briefing-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
}
.briefing-start-btn {
    font-size: 14px !important;
    padding: 10px 24px !important;
}

/* --- Challenge Banner: minimized state --- */
.simulation-challenge-banner.minimized {
    padding: 0;
    background: #f0f7ff;
    border-bottom: 1px solid #d4e6f1;
}
.challenge-banner-minimized {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 12px;
    color: #2c3e50;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.challenge-banner-minimized:hover {
    opacity: 1;
}
.challenge-minimized-icon {
    font-size: 14px;
}
.challenge-minimized-text {
    font-weight: 500;
}
.challenge-expand-icon {
    font-size: 10px;
    margin-left: auto;
}

/* --- Activity Log: alert flash & badge --- */
.log-tab.tab-flash {
    animation: tabFlash 0.5s ease 4;
}
@keyframes tabFlash {
    0%, 100% { background: transparent; }
    50% { background: #fff3cd; color: #856404; }
}
.log-alert-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.sim-log-toggle {
    position: relative;
}

/* --- Chat Buttons: repositioned to sidebar edge --- */
.chat-trigger-buttons {
    position: fixed;
    bottom: 60px;
    left: var(--sidebar-width, 200px);
    transform: none;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
    padding: 0;
    display: flex;
}
.chat-trigger-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 12px;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    color: #fff;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}
.chat-trigger-btn:hover {
    transform: translateX(2px);
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.2);
}
.chat-trigger-btn.active {
    transform: translateX(2px);
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.25);
}
.chat-trigger-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 0 6px 6px 0;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    transition: all 0.2s;
}
.chat-trigger-collapse:hover {
    background: #e9ecef;
    color: #333;
}

/* Collapsed state: icon only */
.chat-trigger-buttons.collapsed .trigger-label {
    display: none;
}
.chat-trigger-buttons.collapsed .chat-trigger-btn {
    padding: 8px;
    border-radius: 0 6px 6px 0;
}

/* --- Image unavailable fallback --- */
.image-unavailable {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}
