+ {/* Left Cluster: Hospital Brand & Clinic Identity */}
+
+
+
+ +M
+
+
+
+ MEDIUSA CLINIC OS
+
+ v2.5
+
+
+
+
+ https://{activeTenant.domain}
+
+
+
+
+ {/* Clinic Dropdown Selector */}
+
+ handleSwitchTenant(e.target.value)}
+ className="appearance-none bg-slate-50 hover:bg-slate-100 border border-slate-300 text-slate-800 text-xs font-bold rounded-lg pl-2.5 pr-7 py-1.5 cursor-pointer focus:outline-none focus:border-sky-500 transition shadow-2xs max-w-[190px] sm:max-w-[240px] truncate"
+ title="Switch Clinic Location / Practice"
+ >
+ {tenants.map((t) => (
+
+ 🏥 {t.name}
+
+ ))}
+
+
+
- {/* Quick Command Palette Trigger (Cmd+K) */}
-
{
- clinicalAudio.playClick();
- setIsCommandPaletteOpen(true);
- }}
- className="hidden xl:flex items-center gap-2 px-3 py-1.5 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-lg text-slate-500 text-xs transition shadow-2xs"
- >
-
- Search patients or actions...
-
- ⌘K
-
-
-
- {/* Audio Toggle Button */}
-
- {audioEnabled ? : }
-
-
- {/* Court & HIPAA Compliance Vault Trigger Button */}
-
{
- clinicalAudio.playClick();
- setIsCourtVaultOpen(true);
- }}
- className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-slate-900 hover:bg-slate-800 text-white text-xs font-bold transition shadow-xs border border-slate-700"
- title="21 CFR Part 11 Court Defense Audit Trail, Non-Repudiation Seal & BAA"
- >
-
- Court & HIPAA Vault
- Vault
-
-
- {/* Quick Terminal Lockout Button (HIPAA 45 CFR § 164.312(a)(2)(iii)) */}
-
{
- clinicalAudio.playClick();
- setIsTerminalLocked(true);
- }}
- className="flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-slate-100 hover:bg-rose-50 border border-slate-200 hover:border-rose-300 text-slate-700 hover:text-rose-700 text-xs font-bold transition shadow-2xs"
- title="Lock Clinical Terminal (Cmd+L / 45 CFR § 164.312(a)(2)(iii))"
- >
-
- Lock
-
-
- {/* Clinic Dropdown */}
-
- handleSwitchTenant(e.target.value)}
- className="appearance-none bg-slate-50 hover:bg-slate-100 border border-slate-300 text-slate-800 text-xs font-bold rounded-lg px-3 py-1.5 pr-8 cursor-pointer focus:outline-none focus:border-sky-500 transition shadow-2xs"
- >
- {tenants.map((t) => (
-
- 🏥 {t.name}
-
- ))}
-
-
-
-
- {/* Staff Role Switcher (RBAC) */}
-
-
Role:
+ {/* Center: Command Palette / Search Bar (Responsive) */}
+
{
clinicalAudio.playClick();
- setStaffRole('doctor');
- addToast('info', 'Role: Attending Doctor (D.C.)', 'Full clinical SOAP, 2D spine & telehealth unlocked');
+ setIsCommandPaletteOpen(true);
}}
- className={`px-2 py-1 rounded text-xs font-bold transition ${
- staffRole === 'doctor'
- ? 'bg-white text-sky-800 shadow-2xs border border-slate-200'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- title="Full Doctor Clinical Access"
+ className="w-full flex items-center justify-between px-3 py-1.5 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-lg text-slate-500 text-xs transition shadow-2xs group"
>
- Doctor (D.C.)
-
-
{
- clinicalAudio.playClick();
- setStaffRole('front_desk');
- if (clinicTab === 'charting' || clinicTab === 'telehealth') {
- setClinicTab('calendar');
- }
- addToast('alert', 'Role: Front Desk (HIPAA Safe)', 'Protected medical notes locked for privacy');
- }}
- className={`px-2 py-1 rounded text-xs font-bold transition ${
- staffRole === 'front_desk'
- ? 'bg-amber-100 text-amber-900 shadow-2xs border border-amber-200'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- title="HIPAA-Safe: Hides Clinical Notes, Shows Schedule, Retail & Billing"
- >
- Front Desk
-
-
{
- clinicalAudio.playClick();
- setStaffRole('billing_admin');
- addToast('info', 'Role: Billing Administrator', 'Superbill claims and memberships prioritized');
- }}
- className={`px-2 py-1 rounded text-xs font-bold transition ${
- staffRole === 'billing_admin'
- ? 'bg-white text-emerald-800 shadow-2xs border border-slate-200'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- title="Financial & Billing Administrator"
- >
- Billing Admin
+
+
+ Search patients, charts, or actions...
+
+
+ ⌘K
+
-
- {/* Portal Switcher Tabs */}
-
-
{
- clinicalAudio.playClick();
- setPortalMode('clinic');
- }}
- className={`px-3 py-1.5 rounded-md flex items-center gap-1.5 transition ${
- portalMode === 'clinic'
- ? 'bg-sky-700 text-white font-bold shadow-xs'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Doctor & Practice OS
-
+ {/* Right Cluster: Quick Tools + Role Switcher + Portal Switcher */}
+
+ {/* Search button on small screens where full bar is hidden */}
+
{
+ clinicalAudio.playClick();
+ setIsCommandPaletteOpen(true);
+ }}
+ className="md:hidden p-1.5 rounded-lg border border-slate-200 bg-slate-50 hover:bg-slate-100 text-slate-600 shadow-2xs"
+ title="Search patients (⌘K)"
+ >
+
+
-
{
- clinicalAudio.playClick();
- setPortalMode('patient');
- }}
- className={`px-3 py-1.5 rounded-md flex items-center gap-1.5 transition ${
- portalMode === 'patient'
- ? 'bg-sky-700 text-white font-bold shadow-xs'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Patient Booking & Intake
-
+ {/* Utility & Security Actions Cluster */}
+
+ {/* Audio Toggle */}
+
+ {audioEnabled ? : }
+
- setPortalMode('superadmin')}
- className={`px-3 py-1.5 rounded-md flex items-center gap-1.5 transition ${
- portalMode === 'superadmin'
- ? 'bg-slate-900 text-white font-bold shadow-xs'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Mediusa Super-Admin
-
+ {/* Court Vault Button */}
+ {
+ clinicalAudio.playClick();
+ setIsCourtVaultOpen(true);
+ }}
+ className="flex items-center gap-1 px-2 py-1 rounded-md text-slate-700 hover:text-slate-950 hover:bg-white text-xs font-semibold transition"
+ title="21 CFR Part 11 Court Defense Audit Vault & BAA Non-Repudiation Seal"
+ >
+
+ Vault
+
- {
- clinicalAudio.playClick();
- setPortalMode('onboarding');
- }}
- className={`px-3 py-1.5 rounded-md flex items-center gap-1.5 transition ${
- portalMode === 'onboarding'
- ? 'bg-emerald-700 text-white font-bold shadow-xs'
- : 'text-emerald-700 hover:text-emerald-900 bg-emerald-50/70 hover:bg-emerald-100/70 border border-emerald-200/60'
- }`}
- >
-
- + Onboard Doctor (BAA)
-
+ {/* Terminal Lock Button */}
+ {
+ clinicalAudio.playClick();
+ setIsTerminalLocked(true);
+ }}
+ className="flex items-center gap-1 px-2 py-1 rounded-md text-slate-700 hover:text-rose-700 hover:bg-rose-50 text-xs font-semibold transition"
+ title="Lock Clinical Terminal (HIPAA 45 CFR § 164.312(a)(2)(iii))"
+ >
+
+ Lock
+
+
+
+ {/* Staff Role Switcher (RBAC) */}
+
+ {
+ clinicalAudio.playClick();
+ setStaffRole('doctor');
+ addToast('info', 'Role: Attending Doctor (D.C.)', 'Full clinical SOAP, 2D spine & telehealth unlocked');
+ }}
+ className={`px-2 py-1 rounded-md text-[11px] font-bold transition ${
+ staffRole === 'doctor'
+ ? 'bg-white text-sky-800 shadow-2xs border border-slate-200'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ title="Full Doctor Clinical Access"
+ >
+ Doctor
+
+ {
+ clinicalAudio.playClick();
+ setStaffRole('front_desk');
+ if (clinicTab === 'charting' || clinicTab === 'telehealth') {
+ setClinicTab('calendar');
+ }
+ addToast('alert', 'Role: Front Desk (HIPAA Safe)', 'Protected medical notes locked for privacy');
+ }}
+ className={`px-2 py-1 rounded-md text-[11px] font-bold transition ${
+ staffRole === 'front_desk'
+ ? 'bg-amber-100 text-amber-900 shadow-2xs border border-amber-200'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ title="HIPAA-Safe: Hides Clinical Notes, Shows Schedule, Retail & Billing"
+ >
+ Front Desk
+
+ {
+ clinicalAudio.playClick();
+ setStaffRole('billing_admin');
+ addToast('info', 'Role: Billing Administrator', 'Superbill claims and memberships prioritized');
+ }}
+ className={`px-2 py-1 rounded-md text-[11px] font-bold transition ${
+ staffRole === 'billing_admin'
+ ? 'bg-white text-emerald-800 shadow-2xs border border-slate-200'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ title="Financial & Billing Administrator"
+ >
+ Billing
+
+
+
+ {/* Portal Mode Switcher */}
+
+
{
+ clinicalAudio.playClick();
+ setPortalMode('clinic');
+ }}
+ className={`px-2.5 py-1 rounded-md flex items-center gap-1.5 transition text-[11px] ${
+ portalMode === 'clinic'
+ ? 'bg-sky-700 text-white font-bold shadow-xs'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Doctor OS
+
+
+
{
+ clinicalAudio.playClick();
+ setPortalMode('patient');
+ }}
+ className={`px-2.5 py-1 rounded-md flex items-center gap-1.5 transition text-[11px] ${
+ portalMode === 'patient'
+ ? 'bg-sky-700 text-white font-bold shadow-xs'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Patient Intake
+
+
+ {/* More Views Dropdown */}
+
+
setIsMoreMenuOpen((prev) => !prev)}
+ className={`px-2 py-1 rounded-md flex items-center gap-1 text-[11px] transition ${
+ portalMode === 'superadmin' || portalMode === 'onboarding'
+ ? 'bg-slate-900 text-white font-bold'
+ : 'text-slate-600 hover:text-slate-900 hover:bg-slate-200/60'
+ }`}
+ title="Administrative & Onboarding Views"
+ >
+ {portalMode === 'superadmin' ? 'Admin' : portalMode === 'onboarding' ? 'Onboard' : 'More'}
+
+
+
+ {isMoreMenuOpen && (
+ <>
+
setIsMoreMenuOpen(false)}
+ />
+
+
+ Administrative Views
+
+
{
+ clinicalAudio.playClick();
+ setPortalMode('superadmin');
+ setIsMoreMenuOpen(false);
+ }}
+ className={`w-full px-3 py-2 text-left text-xs font-semibold flex items-center gap-2 transition ${
+ portalMode === 'superadmin' ? 'bg-slate-100 text-slate-950 font-bold' : 'text-slate-700 hover:bg-slate-50'
+ }`}
+ >
+
+ Mediusa Super-Admin
+
+
{
+ clinicalAudio.playClick();
+ setPortalMode('onboarding');
+ setIsMoreMenuOpen(false);
+ }}
+ className={`w-full px-3 py-2 text-left text-xs font-semibold flex items-center gap-2 transition ${
+ portalMode === 'onboarding' ? 'bg-emerald-50 text-emerald-950 font-bold' : 'text-emerald-700 hover:bg-emerald-50'
+ }`}
+ >
+
+ + Onboard Doctor (BAA)
+
+
+ >
+ )}
+
+
+
{/* Pre-Launch / Pending BAA Banner */}
{portalMode === 'clinic' && activeTenant.baaStatus === 'pending' && (
-
-
-
-
{activeTenant.name}:
-
- Scheduling, calendars, and digital intake are active for testing. Ready for doctor BAA sign-off on go-live!
-
+
+
+
+
+ {activeTenant.name}:
+
+ Scheduling, calendars, and digital intake are active for testing. Ready for doctor BAA sign-off on go-live!
+
+
+
{
+ clinicalAudio.playClick();
+ setPortalMode('onboarding');
+ }}
+ className="px-3 py-1 bg-emerald-700 hover:bg-emerald-800 text-white font-bold rounded-lg transition shadow-xs flex items-center gap-1.5 shrink-0"
+ >
+ Sign BAA to Go Live
+
-
{
- clinicalAudio.playClick();
- setPortalMode('onboarding');
- }}
- className="px-3 py-1 bg-emerald-700 hover:bg-emerald-800 text-white font-bold rounded-lg transition shadow-xs flex items-center gap-1.5 shrink-0"
- >
- Sign BAA to Go Live
-
)}
- {/* Sub-Tabs for Doctor Clinic OS */}
+ {/* Tier 2: Sub-Tabs for Doctor Clinic OS (Cleanly Grouped, No Horizontal Overflow) */}
{portalMode === 'clinic' && (
-
-
setClinicTab('calendar')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'calendar'
- ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Schedule & Encounters
-
+
+
+ {/* Grouped Clinical Workspace Navigation */}
+
+ {/* Group 1: Clinical Operations */}
+
+ setClinicTab('calendar')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'calendar'
+ ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Schedule
+
- {/* Clinical Charts - Hidden if in Front Desk HIPAA-safe mode */}
- {staffRole !== 'front_desk' ? (
- setClinicTab('charting')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'charting'
- ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- SOAP Chart & Spine ({activePatient.firstName} {activePatient.lastName})
-
- ) : (
-
- HIPAA: Notes Protected
-
- )}
+ {staffRole !== 'front_desk' ? (
+ setClinicTab('charting')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'charting'
+ ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ SOAP Chart
+
+ {activePatient.firstName} {activePatient.lastName.charAt(0)}.
+
+
+ ) : (
+
+ Notes Locked
+
+ )}
- {staffRole !== 'front_desk' && (
- setClinicTab('telehealth')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'telehealth'
- ? 'bg-purple-50 text-purple-800 border border-purple-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Telehealth Virtual Room
-
- )}
+ {staffRole !== 'front_desk' && (
+ setClinicTab('telehealth')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'telehealth'
+ ? 'bg-purple-50 text-purple-800 border border-purple-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Telehealth
+
+ )}
+
-
setClinicTab('retail')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'retail'
- ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Retail & Supplement POS
-
+ {/* Group 2: Practice & Revenue */}
+
+ setClinicTab('billing')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'billing'
+ ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Superbills & Billing
+
- setClinicTab('memberships')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'memberships'
- ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Memberships & Packages
-
+ setClinicTab('retail')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'retail'
+ ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Retail POS
+
- setClinicTab('billing')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'billing'
- ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Superbills & Invoicing
-
+ setClinicTab('memberships')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'memberships'
+ ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Memberships
+
+
-
setClinicTab('retention')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'retention'
- ? 'bg-amber-50 text-amber-800 border border-amber-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Retention Radar
-
+ {/* Group 3: Patient Retention & Growth */}
+
+ setClinicTab('retention')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'retention'
+ ? 'bg-amber-50 text-amber-800 border border-amber-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Retention
+
- setClinicTab('growth')}
- className={`px-3 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition whitespace-nowrap ${
- clinicTab === 'growth'
- ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
- : 'text-slate-600 hover:text-slate-900'
- }`}
- >
-
- Growth & SEO (GSC/GA4)
-
+ setClinicTab('growth')}
+ className={`px-2.5 py-1.5 rounded-md font-semibold flex items-center gap-1.5 transition text-xs ${
+ clinicTab === 'growth'
+ ? 'bg-sky-50 text-sky-800 border border-sky-200 shadow-2xs font-bold'
+ : 'text-slate-600 hover:text-slate-900'
+ }`}
+ >
+
+ Growth & SEO
+
+
+
+
+ {/* Right: Active Clinician Presence Indicator */}
+
+
+ Active: {activeProvider.name}
+
+
)}