diff --git a/dashboard.css b/dashboard.css index b2775cf..f2079a5 100644 --- a/dashboard.css +++ b/dashboard.css @@ -21,6 +21,31 @@ border-right: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2); z-index: 100; + overflow: hidden; +} + +.sidebar-footer { + margin-top: auto; + padding-top: 1.5rem; + border-top: 1px solid rgba(255, 255, 255, 0.1); + flex-shrink: 0; +} + +.sidebar-footer .user-profile { + margin-top: 0; + padding-top: 0; + border-top: none; +} + +.sidebar-footer .logout-btn { + margin-top: 0.75rem; + padding: 0.75rem 1rem; +} + +.build-tag { + font-size: 0.65rem; + color: #94a3b8; + margin-top: 0.25rem; } .dashboard-main { @@ -30,86 +55,6 @@ min-height: 100vh; } -.dash-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 2.5rem; - gap: 2rem; -} - -.search-bar { - flex: 1; - max-width: 600px; - position: relative; - display: flex; - align-items: center; -} - -.search-icon { - position: absolute; - left: 1.25rem; - color: var(--text-muted); - font-size: 1.1rem; - pointer-events: none; - z-index: 1; -} - -.search-bar input { - width: 100%; - padding: 1rem 1.5rem 1rem 3rem; - border-radius: 16px; - border: 1px solid var(--border); - background: var(--surface); - font-size: 0.95rem; - transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02); -} - -.search-bar input:focus { - outline: none; - border-color: var(--secondary); - background: white; - box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1); - transform: translateY(-2px); -} - -.header-actions { - display: flex; - align-items: center; - gap: 1.25rem; -} - -.date-picker-group { - display: flex; - align-items: center; - gap: 0.75rem; - background: var(--surface); - padding: 0.65rem 1.25rem; - border-radius: 14px; - border: 1px solid var(--border); - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02); - transition: all 0.2s; -} - -.date-picker-group:hover { - border-color: var(--secondary); - transform: translateY(-1px); -} - -.calendar-icon { - font-size: 1.1rem; -} - -.date-input { - border: none; - font-family: 'Inter', sans-serif; - font-weight: 600; - color: var(--text-main); - outline: none; - background: transparent; - cursor: pointer; -} .logo { display: flex; align-items: center; @@ -145,6 +90,9 @@ display: flex; flex-direction: column; gap: 0.5rem; + flex: 1; + min-height: 0; + overflow-y: auto; } .side-nav a { @@ -166,9 +114,6 @@ } .user-profile { - margin-top: auto; - padding-top: 2rem; - border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; gap: 0.75rem; @@ -223,12 +168,7 @@ color: #FCA5A5; } -.sidebar > .logout-btn { - margin-top: auto; - padding: 0.75rem 1rem; -} - -.sidebar > .logout-btn:hover { +.sidebar-footer .logout-btn:hover { background: rgba(239, 68, 68, 0.12); } @@ -281,6 +221,8 @@ .action-center { display: flex; + flex-wrap: wrap; + align-items: center; gap: 0.5rem; background: transparent; padding: 0; @@ -417,8 +359,8 @@ display: flex; flex-wrap: wrap; justify-content: space-between; - align-items: flex-start; - gap: 1.5rem; + align-items: center; + gap: 1.25rem; margin-bottom: 2rem; } @@ -446,18 +388,32 @@ .search-bar { flex: 1; min-width: 220px; - max-width: 480px; + max-width: 520px; + position: relative; + display: flex; + align-items: center; +} + +.search-icon { + position: absolute; + left: 1rem; + color: var(--text-muted); + font-size: 1rem; + pointer-events: none; + z-index: 1; + line-height: 1; } .search-bar input { width: 100%; - padding: 0.875rem 1.25rem; + padding: 0.875rem 1.25rem 0.875rem 2.75rem; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); font-size: 0.95rem; color: var(--text-main); transition: var(--transition); + box-shadow: var(--shadow-sm); } .search-bar input::placeholder { @@ -476,6 +432,15 @@ gap: 0.5rem; font-size: 0.875rem; color: var(--text-muted); + background: var(--surface); + padding: 0.5rem 0.85rem; + border-radius: var(--radius-md); + border: 1px solid var(--border); +} + +.calendar-icon { + font-size: 1rem; + line-height: 1; } .date-input { @@ -567,6 +532,17 @@ gap: 1rem; } +.table-scroll { + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + border-radius: var(--radius-md); +} + +.table-scroll .queue-table { + min-width: 720px; +} + .queue-table { width: 100%; border-collapse: collapse; @@ -814,9 +790,11 @@ background: var(--bg); } -.pipeline-item.next { +.pipeline-item.next, +.pipeline-item.active { border-color: var(--secondary); - background: rgba(37, 99, 235, 0.05); + background: rgba(37, 99, 235, 0.06); + box-shadow: inset 3px 0 0 var(--secondary); } .p-token { @@ -1317,21 +1295,24 @@ /* --- WORLD-CLASS ZEN 4.0 ADD-ONS --- */ .patient-banner-inner { background: white; - padding: 0.75rem 1.25rem; - border-radius: 12px; - box-shadow: 0 2px 8px rgba(0,0,0,0.02); + padding: 1rem 1.25rem; + border-radius: var(--radius-md); + box-shadow: var(--shadow-sm); border: 1px solid var(--border); display: flex; - flex-direction: column; - align-items: stretch; - gap: 0.5rem; - margin-bottom: 0.25rem; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.75rem 1rem; + margin-bottom: 0.5rem; } .patient-identity-row { display: flex; + flex-wrap: wrap; justify-content: space-between; align-items: center; + gap: 0.75rem; width: 100%; } @@ -1351,11 +1332,23 @@ .zen-layout-3col { display: grid; - grid-template-columns: 180px minmax(400px, 2.5fr) minmax(280px, 1.2fr); - gap: 1.5rem; - align-items: start; - padding: 1rem; - height: calc(100vh - 120px); /* Fill screen height perfectly without overflow strings */ + grid-template-columns: minmax(160px, 200px) minmax(0, 2.5fr) minmax(240px, 320px); + gap: 1.25rem; + align-items: stretch; + padding: 0; + min-height: calc(100vh - 8rem); +} + +.zen-sidebar-right { + display: flex; + flex-direction: column; + gap: 1rem; + min-width: 0; +} + +.zen-sidebar-right .insight-card, +.zen-sidebar-right .ai-nudge-box { + flex-shrink: 0; } .zen-layout-3col.collapsed-queue { @@ -1399,19 +1392,22 @@ .zen-workspace-soap { display: flex; flex-direction: column; - gap: 1.5rem; + gap: 1rem; + min-width: 0; + min-height: 0; } .soap-container { display: flex; flex-direction: column; gap: 1.25rem; - overflow-y: auto; /* Allow independent scrolling for documentation */ - max-height: 100%; + overflow-y: auto; + flex: 1; + min-height: 0; background: white; - border-radius: 30px; - padding: 2.5rem; - box-shadow: 0 10px 40px rgba(0,0,0,0.02); + border-radius: var(--radius-lg); + padding: 1.5rem; + box-shadow: var(--shadow-sm); border: 1px solid var(--border); } @@ -1442,13 +1438,17 @@ font-size: 0.95rem; line-height: 1.5; padding: 0.75rem; - border: 1px solid #cbd5e1; - border-radius: 6px; - transition: border-color 0.2s ease; - background: #F8FAFC; + border: 1px solid var(--border); + border-radius: var(--radius-sm); + transition: border-color 0.2s ease, box-shadow 0.2s ease; + background: var(--bg); color: var(--text-main); } +.zen-textarea-small::placeholder { + color: var(--text-muted); +} + .zen-textarea-small:focus { border-color: #3b82f6; outline: none; @@ -1499,6 +1499,91 @@ } } +/* Lab watcher & shared form utilities */ +.insights-box { + margin-top: 1rem; + color: var(--text-muted); + font-size: 0.9rem; + line-height: 1.55; +} + +.insights-box p { + margin-bottom: 0.75rem; +} + +.lab-watcher-card { + margin-top: 1.25rem; +} + +.lab-watcher-form { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + align-items: center; + margin-top: 1rem; +} + +.form-input { + flex: 1 1 200px; + min-width: 0; + padding: 0.75rem 1rem; + border: 1px solid var(--border); + border-radius: var(--radius-md); + background: var(--bg); + color: var(--text-main); + font-family: inherit; + font-size: 0.95rem; + transition: var(--transition); +} + +.form-input:focus { + outline: none; + border-color: var(--secondary); + background: var(--surface); + box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); +} + +.lab-result-section { + margin-top: 1.25rem; + padding-top: 1.25rem; + border-top: 1px solid var(--border); +} + +.lab-result-input { + flex: 1 1 280px; +} + +.lab-alerts-container { + margin-top: 1.25rem; +} + +.lab-alert-card { + background: #fee2e2; + border-left: 4px solid var(--urgent); + padding: 0.75rem 1rem; + margin-bottom: 0.75rem; + border-radius: var(--radius-sm); +} + +.lab-alert-card strong { + color: #991b1b; +} + +.lab-alert-card p { + margin: 0.35rem 0 0; + color: #7f1d1d; + font-size: 0.9rem; +} + +#labWatcherStatusBadge.badge-active { + background: rgba(16, 185, 129, 0.12); + color: var(--accent); +} + +.section-container { + animation: fadeIn 0.35s ease-out forwards; +} + /* Mobile sidebar */ .sidebar-mobile-toggle { display: none; @@ -1517,15 +1602,61 @@ box-shadow: var(--shadow); } +.sidebar-backdrop { + display: none; + position: fixed; + inset: 0; + background: rgba(15, 23, 42, 0.45); + z-index: 1040; +} + +.sidebar-backdrop.visible { + display: block; +} + +@media (max-width: 1200px) { + .queue-section { + grid-template-columns: 1fr; + } + + .zen-layout-3col { + grid-template-columns: minmax(140px, 180px) minmax(0, 1fr); + } + + .zen-sidebar-right { + grid-column: 1 / -1; + flex-direction: row; + flex-wrap: wrap; + } + + .zen-sidebar-right .insight-card, + .zen-sidebar-right .ai-nudge-box { + flex: 1 1 280px; + } +} + @media (max-width: 1024px) { - .queue-section, + .dashboard-main { + padding: 2rem 1.5rem; + } + .zen-layout, .zen-grid { grid-template-columns: 1fr; } +} - .revenue-grid { - grid-template-columns: 1fr; +@media (min-width: 769px) { + .sidebar-mobile-toggle { + display: none !important; + } + + .sidebar { + transform: translateX(0) !important; + } + + .sidebar-backdrop { + display: none !important; } } @@ -1544,29 +1675,79 @@ transform: translateX(0); } + .sidebar.compact-rail { + width: var(--sidebar-width); + padding: 2.5rem 1.5rem; + align-items: stretch; + } + + .sidebar.compact-rail .logo-text, + .sidebar.compact-rail .user-profile .info, + .sidebar.compact-rail .nav-text { + display: block !important; + } + + .sidebar.compact-rail .side-nav a { + width: auto; + height: auto; + padding: 0.75rem 1rem; + justify-content: flex-start; + } + + .sidebar.compact-rail + .dashboard-main, .dashboard-main { margin-left: 0; padding: 1.25rem; - padding-top: 4rem; + padding-top: 4.5rem; } .dash-header { flex-direction: column; + align-items: stretch; + } + + .header-actions { + width: 100%; + } + + .header-actions .btn-primary { + width: 100%; } .search-bar { max-width: none; + width: 100%; } .zen-layout-3col { grid-template-columns: 1fr !important; - height: auto; + min-height: auto; + gap: 1rem; } - + + .zen-sidebar-right { + flex-direction: column; + } + .zen-pipeline.full-height { height: auto; + max-height: none; position: static; } + + .patient-identity-row { + flex-direction: column; + align-items: flex-start; + } + + .patient-identity-row .allergy-tag { + align-self: stretch; + text-align: center; + } + + .soap-container { + padding: 1rem; + } } /* Utility Hidden */ diff --git a/dashboard.html b/dashboard.html index 086c1e0..6ce2b33 100644 --- a/dashboard.html +++ b/dashboard.html @@ -4,16 +4,17 @@ Dashboard | Curio - - - + + + - + +
@@ -228,7 +231,7 @@
In Queue

12 Patients

- ↑ 4 since last hour + ↑ 4 since last hour
Current Slot (10:00-10:30) @@ -260,6 +263,7 @@ Walk-ins
+
@@ -306,6 +310,7 @@
+
@@ -327,6 +332,7 @@

Patient Records

+
@@ -349,6 +355,7 @@
+
@@ -365,6 +372,7 @@
Total Inventory Value

₹4,25,000

Daily Sales (GST)

₹12,450

+
@@ -382,6 +390,7 @@
M03Cough SyrupS881Apr 20264₹85
+
@@ -391,6 +400,7 @@

🔬 Laboratory Orders

4 New Orders +
@@ -406,32 +416,32 @@
LAB-101Rahul VermaCBC (Complete Blood Count)HighSample Awaited
+
- -
+

🤖 AI Lab Anomaly Watcher

Offline
-
+

The AI Watcher runs continuously in the background using Temporal to monitor patient lab results for dangerous drug interactions or baseline anomalies.

-
- - - +
+ + +
-
@@ -451,7 +461,7 @@ Record consultation @@ -515,12 +525,12 @@ - +
- +
@@ -533,7 +543,7 @@
- + diff --git a/dashboard.js b/dashboard.js index 5577290..980582e 100644 --- a/dashboard.js +++ b/dashboard.js @@ -289,7 +289,10 @@ window.showSection = (sectionId) => { setActiveNavLink(sectionId); if (window.innerWidth <= 768) { - document.getElementById('sidebar')?.classList.remove('open'); + const sidebar = document.getElementById('sidebar'); + sidebar?.classList.remove('open'); + document.getElementById('sidebarBackdrop')?.classList.remove('visible'); + document.getElementById('sidebarMenuBtn')?.setAttribute('aria-expanded', 'false'); } return false; @@ -456,11 +459,17 @@ window.switchPatientContext = (name, token, triage) => { if (patientHeading) { patientHeading.innerHTML = `${name} (28y, M)`; } + + document.querySelectorAll('.pipeline-item').forEach(item => { + const itemToken = item.querySelector('.p-token')?.textContent?.trim(); + item.classList.toggle('next', itemToken === token); + item.classList.toggle('active', itemToken === token); + }); }; // 5. Global Helpers & Modal Handlers window.openHistory = () => { - const heading = document.querySelector(".patient-identity h1"); + const heading = document.querySelector(".patient-identity-row h1, .patient-identity h1"); const name = heading ? heading.innerText.split(' (')[0] : 'Patient'; alert(`📂 Loading History for ${name}...\n\n- Visit (05/12/26): Chronic Gastritis`); }; @@ -476,7 +485,12 @@ window.openConsultation = () => { window.shareSummary = () => alert("📤 Summary sent to Patient's WhatsApp."); window.printSummary = () => alert("🖨️ Printing Handover Note..."); window.toggleSidebar = () => { - document.getElementById('sidebar')?.classList.toggle('open'); + const sidebar = document.getElementById('sidebar'); + const backdrop = document.getElementById('sidebarBackdrop'); + const menuBtn = document.getElementById('sidebarMenuBtn'); + const isOpen = sidebar?.classList.toggle('open'); + backdrop?.classList.toggle('visible', !!isOpen); + if (menuBtn) menuBtn.setAttribute('aria-expanded', isOpen ? 'true' : 'false'); }; function closeRxModal() { @@ -644,7 +658,7 @@ if (startWatcherBtn) { if (data.success) { activeWatcherPatientId = patientId; labWatcherStatusBadge.innerText = "Active (Monitoring)"; - labWatcherStatusBadge.style.backgroundColor = "var(--success-color)"; + labWatcherStatusBadge.classList.add('badge-active'); labResultInputSection.classList.remove("hidden"); startWatcherBtn.innerText = "Watcher Running"; @@ -729,10 +743,10 @@ function renderAlerts(alerts) { alerts.forEach((alert, index) => { if (alert.is_dangerous) { html += ` -
- Alert #${index + 1} -

${alert.danger_explanation}

-

Action: ${alert.recommended_action}

+
+ Alert #${index + 1} +

${alert.danger_explanation}

+

Action: ${alert.recommended_action}

`; } diff --git a/globals.css b/globals.css index 6fad271..4ba8ba7 100644 --- a/globals.css +++ b/globals.css @@ -6,6 +6,7 @@ --secondary-hover: #1D4ED8; --accent: #059669; /* Darker green for accessibility */ --accent-hover: #047857; + --success-color: #059669; --urgent: #EF4444; --warning: #F59E0B;