/* ==========================================================================
   ACCU-VIS CLINICAL WORKSTATION DESIGN SYSTEM
   Platform: Web / Laptop Desktop Application
   Theme: Modern Maroon & Soft Warm Cream Aesthetic (from mockups)
   Primary Maroon:       #4A0E17
   Dark Maroon:          #35080E
   Hover Maroon:         #5E141F
   Subtle Maroon:        rgba(74, 14, 23, 0.08)
   Soft Warm Cream:      #FAF0CA
   Soft Cream Light:     #FDF8E1
   Soft Cream Deep:      #F3E6B2
   Card White:           #FFFFFF
   Pill Input Gray:      #F0EAE8
   Accent Gold:          #E5A93C
   Accent Green:         #2D8A4E
   Accent Red:           #C92A2A
   ========================================================================== */

:root {
  /* Brand Palette */
  --primary-maroon: #4A0E17;
  --primary-maroon-dark: #35080E;
  --primary-maroon-light: #5E141F;
  --primary-maroon-subtle: rgba(74, 14, 23, 0.08);
  --primary-maroon-glow: rgba(74, 14, 23, 0.25);
  
  --bg-cream: #FAF0CA;
  --bg-cream-soft: #FDF8E1;
  --bg-cream-deep: #F3E6B2;
  
  --card-white: #FFFFFF;
  --card-border: rgba(74, 14, 23, 0.10);
  --card-shadow: 0 4px 18px rgba(74, 14, 23, 0.07);
  --card-shadow-hover: 0 8px 24px rgba(74, 14, 23, 0.12);
  
  --input-bg: #F0EAE8;
  --input-border: #E2DADA;
  --input-focus: #4A0E17;
  
  --text-maroon: #4A0E17;
  --text-dark: #2A1417;
  --text-muted: #7E6A6D;
  --text-light: #FAF0CA;
  --text-white: #FFFFFF;
  
  --accent-gold: #E5A93C;
  --accent-green: #2D8A4E;
  --accent-red: #C92A2A;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 9999px;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-cream-soft);
  color: var(--text-dark);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow: hidden;
}

/* ==========================================================================
   DESKTOP WORKSTATION LAYOUT (SIDEBAR + WORKSPACE)
   ========================================================================== */

.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-cream-soft);
}

/* ==========================================================================
   LEFT CLINICAL SIDEBAR (DEEP MAROON #4A0E17)
   ========================================================================== */

/* Logged-Out State: hide clinical chrome, show only the login/auth view */
html.logged-out .app-sidebar,
html.logged-out .top-clinical-bar {
  display: none;
}

html.logged-out .app-view.active {
  display: none;
}

html.logged-out #view-login {
  display: block;
}

.app-sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  background-color: var(--primary-maroon);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 4px 0 24px rgba(53, 8, 14, 0.18);
  z-index: 100;
  user-select: none;
}

/* Sidebar Brand Header */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.sidebar-brand:hover {
  opacity: 0.92;
}

.sidebar-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #FFFFFF;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #FFFFFF;
  line-height: 1.1;
}

.sidebar-brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--bg-cream);
  letter-spacing: 0.3px;
  opacity: 0.9;
}

/* Sidebar Nav Menu */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 18px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
  transform: translateX(3px);
}

.nav-item.active {
  background: rgba(250, 240, 202, 0.15);
  color: var(--bg-cream);
  font-weight: 700;
  border-left: 3.5px solid var(--accent-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-icon {
  flex-shrink: 0;
  stroke: currentColor;
}

.nav-label {
  flex: 1;
}

/* Sidebar Footer (Doctor Bea Profile & DB Status) */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.doctor-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.doctor-profile-badge:hover {
  background: rgba(255, 255, 255, 0.15);
}

.doctor-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 2px solid var(--bg-cream);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  background: #2a050b;
}

.doctor-meta-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.welcome-sub-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--bg-cream);
  line-height: 1.1;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doctor-name-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doctor-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-maroon-dark);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.sidebar-db-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  display: inline-block;
}

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

/* ==========================================================================
   WORKSPACE CONTAINER (TOP CLINICAL BAR + MAIN BODY)
   ========================================================================== */

.app-workspace {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-cream-soft);
}

/* ==========================================================================
   TOP CLINICAL BAR (WHITE WITH PILL SEARCH & TELEMETRY)
   ========================================================================== */

.top-clinical-bar {
  height: 66px;
  min-height: 66px;
  background-color: var(--card-white);
  border-bottom: 1px solid rgba(74, 14, 23, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 2px 10px rgba(74, 14, 23, 0.04);
  z-index: 90;
}

/* Pill Search Bar (Matching Mockup) */
.topbar-search-wrap {
  position: relative;
  width: 380px;
  max-width: 420px;
}

.topbar-search-wrap .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-maroon);
  pointer-events: none;
}

.topbar-search-wrap input {
  width: 100%;
  height: 42px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 0 18px 0 46px;
  font-size: 13.5px;
  font-family: var(--font-main);
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s ease;
}

.topbar-search-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-search-wrap input:focus {
  background: #FFFFFF;
  border-color: var(--primary-maroon);
  box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.12);
}

/* Right Header Deck */
.topbar-right-deck {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Active Patient Chip */
.active-patient-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-cream-soft);
  border: 1px solid rgba(74, 14, 23, 0.15);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.active-patient-chip:hover {
  background: var(--bg-cream);
  border-color: var(--primary-maroon);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-green);
}

.chip-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.chip-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-maroon-dark);
}

.chip-mrn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(74, 14, 23, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Telemetry Chips */
.telemetry-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #FFFFFF;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
}

.telemetry-label {
  color: var(--text-muted);
  font-weight: 600;
}

.telemetry-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary-maroon);
}

.telemetry-badge-green {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(45, 138, 78, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--primary-maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-btn:hover {
  background: var(--primary-maroon);
  color: #FFFFFF;
  border-color: var(--primary-maroon);
}

/* Mobile-only hamburger button & sidebar drawer backdrop (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--primary-maroon);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
}

/* ==========================================================================
   SCROLLABLE WORKSPACE BODY
   ========================================================================== */

.workspace-body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 36px 40px;
  background-color: var(--bg-cream);
}

.app-view {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
}

.app-view.active {
  display: block;
}

.optotype-e {
  display: inline-block;
  font-family: var(--font-main);
  font-weight: 800;
  color: #000000;
  line-height: 1;
  transition: transform 0.15s ease;
}

.orientation-right { transform: rotate(0deg); }
.orientation-down  { transform: rotate(90deg); }
.orientation-left  { transform: rotate(180deg); }
.orientation-up    { transform: rotate(270deg); }

/* View Header */
.desktop-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.desktop-view-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  line-height: 1.2;
}

.desktop-view-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   VIEW 1: DASHBOARD
   ========================================================================== */

/* Welcome Banner */
.dashboard-banner {
  background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 24px 30px;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  box-shadow: 0 6px 20px rgba(74, 14, 23, 0.22);
}

.banner-welcome-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.15);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.banner-greeting-title {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.banner-subtext {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.82);
}

.btn-banner-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-cream);
  color: var(--primary-maroon);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.btn-banner-primary:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

/* Categories Section */
.dashboard-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
}

.section-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.categories-grid-desktop {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.category-card-desktop {
  background: var(--card-white);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.category-card-desktop:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(74, 14, 23, 0.25);
}

.category-icon-desktop {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--bg-cream-soft);
  color: var(--primary-maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(74, 14, 23, 0.10);
}

.category-content-desktop {
  flex: 1;
}

.category-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  margin-bottom: 4px;
}

.category-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.category-arrow-btn {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-maroon);
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.category-card-desktop:hover .category-arrow-btn {
  opacity: 1;
  transform: translateX(3px);
}

.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.dashboard-catalog-panel {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.panel-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-link-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-maroon);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.panel-link-btn:hover {
  background: var(--input-bg);
}

/* Product Tiles Desktop Grid */
.products-grid-desktop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.product-tile-desktop {
  background: var(--bg-cream-soft);
  border: 1px solid rgba(74, 14, 23, 0.10);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-tile-desktop:hover {
  transform: translateY(-2px);
  background: #FFFFFF;
  border-color: var(--primary-maroon);
  box-shadow: 0 4px 14px rgba(74, 14, 23, 0.10);
}

.product-thumb-container {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.product-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}

.product-tile-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-maroon-dark);
}

.product-type-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--input-bg);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}

/* Recent Patients Desktop List */
.recent-patients-desktop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.patient-desktop-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-cream-soft);
  border: 1px solid rgba(74, 14, 23, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.patient-desktop-card:hover {
  background: #FFFFFF;
  border-color: var(--primary-maroon);
  transform: translateX(3px);
  box-shadow: 0 3px 10px rgba(74, 14, 23, 0.08);
}

.patient-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  background: #E8DFDC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-maroon);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.patient-card-info {
  flex: 1;
  min-width: 0;
}

.patient-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-maroon-dark);
  margin-bottom: 2px;
}

.patient-card-demographics {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.patient-card-visit {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.star-icon-gold {
  color: var(--accent-gold);
}

.btn-select-patient {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  border: none;
  color: var(--primary-maroon);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.patient-desktop-card:hover .btn-select-patient {
  background: var(--primary-maroon);
  color: #FFFFFF;
}

/* ==========================================================================
   VIEW 2: PATIENT INTAKE FORM (2-COLUMN WORKSTATION)
   ========================================================================== */

.intake-desktop-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.intake-summary-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intake-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.intake-avatar-circle {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-pill);
  background: var(--primary-maroon);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(74, 14, 23, 0.25);
}

.intake-patient-display-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  margin-bottom: 4px;
}

.intake-patient-mrn-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-cream);
  color: var(--primary-maroon);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.intake-checklist-box {
  width: 100%;
  background: var(--bg-cream-soft);
  border: 1px solid rgba(74, 14, 23, 0.10);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: left;
  margin-bottom: 18px;
}

.checklist-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-maroon-dark);
  margin-bottom: 10px;
}

.checklist-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-items li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.intake-preset-box {
  width: 100%;
  text-align: left;
}

.preset-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.preset-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-pill {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-maroon);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  background: var(--primary-maroon);
  color: #FFFFFF;
}

/* Intake Form Card */
.intake-form-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-pill-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-pill-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-maroon-dark);
}

.form-pill-input {
  width: 100%;
  height: 44px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 0 18px;
  font-size: 13.5px;
  font-family: var(--font-main);
  color: var(--text-dark);
  outline: none;
  transition: all 0.15s ease;
}

.form-pill-input:focus {
  background: #FFFFFF;
  border-color: var(--primary-maroon);
  box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.12);
}

.form-field-help {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.form-select-wrap {
  position: relative;
  width: 100%;
}

.form-select-wrap select {
  width: 100%;
  height: 44px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 0 36px 0 18px;
  font-size: 13.5px;
  font-family: var(--font-main);
  color: var(--text-dark);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.form-select-wrap select:focus {
  background: #FFFFFF;
  border-color: var(--primary-maroon);
  box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.12);
}

.select-arrow-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-maroon);
  pointer-events: none;
  font-size: 10px;
}

/* Eye Protocol Selector Pills */
.eye-protocol-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.eye-protocol-pill {
  height: 42px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eye-protocol-pill:hover {
  border-color: var(--primary-maroon);
  color: var(--primary-maroon);
}

.eye-protocol-pill.active {
  background: var(--primary-maroon);
  border-color: var(--primary-maroon);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(74, 14, 23, 0.20);
}

/* Jaeger's Chart J1-J7 Level Selector */
.jaeger-level-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.jaeger-level-btn {
  height: 40px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.jaeger-level-btn:hover {
  border-color: var(--primary-maroon);
  color: var(--primary-maroon);
}

.jaeger-level-btn.active {
  background: var(--primary-maroon);
  border-color: var(--primary-maroon);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(74, 14, 23, 0.20);
}

/* Color Vision Multiple-Choice Grid */
.cv-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.cv-choice-btn {
  height: 56px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--primary-maroon-dark);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cv-choice-btn:hover:not(:disabled) {
  border-color: var(--primary-maroon);
  transform: translateY(-1px);
}

.cv-choice-btn.correct {
  background: rgba(45, 138, 78, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.cv-choice-btn.incorrect {
  background: rgba(201, 42, 42, 0.12);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.cv-choice-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin: 10px 0 24px;
}

.form-checkbox-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary-maroon);
}

.form-actions-desktop {
  display: flex;
  justify-content: flex-end;
}

.btn-maroon-pill-large {
  height: 48px;
  background: var(--primary-maroon);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 32px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px rgba(74, 14, 23, 0.25);
}

.btn-maroon-pill-large:hover {
  background: var(--primary-maroon-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(74, 14, 23, 0.35);
}

.btn-outline-maroon {
  height: 40px;
  background: transparent;
  color: var(--primary-maroon);
  border: 1.5px solid var(--primary-maroon);
  border-radius: var(--radius-pill);
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline-maroon:hover {
  background: var(--primary-maroon);
  color: #FFFFFF;
}

.btn-maroon-pill {
  height: 40px;
  background: var(--primary-maroon);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-maroon-pill:hover {
  background: var(--primary-maroon-light);
  transform: translateY(-1px);
}

/* ==========================================================================
   VIEW 3: AUTOMATED STEPPER DOT TEST & EYE TRACKER (NPC)
   ========================================================================== */

.stage-tag-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary-maroon);
  background: rgba(74, 14, 23, 0.08);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 4px;
}

.dot-desktop-stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Fixation Target Stage */
.dot-target-stage-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
}

.stage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stage-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
}

.stage-badge-maroon {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-maroon);
  background: var(--bg-cream);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.target-canvas-stage-box {
  flex: 1;
  min-height: 280px;
  background: radial-gradient(circle at center, #FFFFFF 0%, #F5EDE0 100%);
  border: 2px solid var(--primary-maroon);
  border-radius: var(--radius-lg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Concentric Fixation Target Rings */
.fixation-target-core {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.target-ring {
  position: absolute;
  border-radius: var(--radius-pill);
  border: 2.5px solid var(--primary-maroon);
}

.target-ring.ring-3 {
  width: 130px;
  height: 130px;
  opacity: 0.25;
}

.target-ring.ring-2 {
  width: 90px;
  height: 90px;
  opacity: 0.55;
}

.target-ring.ring-1 {
  width: 50px;
  height: 50px;
  opacity: 0.9;
}

.target-center-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-maroon);
  box-shadow: 0 0 10px rgba(74, 14, 23, 0.5);
  z-index: 10;
}

/* Crosshair Reticle Lines */
.dot-crosshair-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ch-line {
  position: absolute;
  background: rgba(74, 14, 23, 0.12);
}

.ch-h {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
}

.ch-v {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
}

/* Distance readout above the camera view */
.distance-readout-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-cream-soft);
  border: 1px solid rgba(74, 14, 23, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 12px;
}

.distance-readout-bar .hud-number {
  font-size: 34px;
}

/* Distance HUD */
.dot-distance-hud {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(74, 14, 23, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.hud-digital-readout {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hud-number {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-maroon);
  line-height: 1;
}

.hud-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.hud-mm-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Eye Tracking PIP Card */
.dot-camera-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
}

.pip-header-desktop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.pip-title-col {
  display: flex;
  flex-direction: column;
}

.pip-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
}

.pip-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.pip-controls-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pip-btn {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-maroon);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pip-btn:hover {
  background: var(--primary-maroon);
  color: #FFFFFF;
}

.pip-btn-calibrate {
  background: var(--primary-maroon);
  color: #FFFFFF;
  border-color: var(--primary-maroon);
  font-weight: 700;
}

.pip-btn-calibrate:hover {
  background: var(--primary-maroon-light);
}

/* Camera Source Toggle (This Device vs. Remote Phone Camera) */
.pip-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.camera-source-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.camera-source-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.camera-source-btn.active {
  background: var(--primary-maroon);
  color: #FFFFFF;
  border-color: var(--primary-maroon);
  font-weight: 700;
}

.remote-camera-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-red);
  background: rgba(201, 42, 42, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.remote-camera-banner.connected {
  color: var(--accent-green);
  background: rgba(45, 138, 78, 0.1);
}

.tracker-mode-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--input-bg);
}

.tracker-mode-chip.ready {
  color: var(--accent-green);
  background: rgba(45, 138, 78, 0.1);
}

.tracker-mode-chip.basic {
  color: #A66A0A;
  background: rgba(229, 169, 60, 0.18);
}

.remote-camera-banner.hidden {
  display: none;
}

.webrtc-pairing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.webrtc-pairing-row.hidden {
  display: none;
}

.webrtc-code-input {
  width: 100px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  color: var(--primary-maroon-dark);
}

.webrtc-status-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.webrtc-status-text.connected {
  color: var(--accent-green);
}

.remote-camera-url {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--primary-maroon);
  background: rgba(74, 14, 23, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Dual Viewports (Live Eye Macro + 3D Eyeball Model) */
.pip-dual-viewport-desktop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
}

.pip-subpanel {
  background: #0D0406;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(74, 14, 23, 0.25);
  display: flex;
  flex-direction: column;
}

.pip-panel-tag-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-badge-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--bg-cream);
  background: rgba(74, 14, 23, 0.7);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.panel-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
}

.canvas-aspect-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
}

.canvas-aspect-wrapper canvas {
  width: 100%;
  height: 100%;
  max-height: 190px;
  object-fit: contain;
  display: block;
}

.camera-hidden-pipeline {
  display: none !important;
}

/* PIP Footer */
.pip-footer-desktop {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--input-border);
}

.pip-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pip-metric-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.pip-metric-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-green);
}

.pip-metric-bar {
  width: 100%;
  height: 6px;
  background: var(--input-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 8px;
}

.pip-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-pill);
  transition: width 0.2s ease;
}

.pip-telemetry-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pip-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--input-bg);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Linear Stepper Motor Full-Width Control Deck */
.dot-control-deck-desktop {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.rail-track-visualizer {
  margin-bottom: 18px;
}

.rail-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rail-track-groove {
  position: relative;
  width: 100%;
  height: 10px;
  background: var(--input-bg);
  border-radius: var(--radius-pill);
  border: 1px solid var(--input-border);
}

.rail-track-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold) 0%, var(--primary-maroon) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.08s linear;
}

.rail-carriage-cursor {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--primary-maroon);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(74, 14, 23, 0.4);
  transition: left 0.08s linear;
}

.stepper-actions-row-desktop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.stepper-buttons-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-stepper-primary {
  height: 44px;
  background: var(--primary-maroon);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 24px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 3px 12px rgba(74, 14, 23, 0.25);
}

.btn-stepper-primary:hover {
  background: var(--primary-maroon-light);
  transform: translateY(-1px);
}

.btn-stepper-stop {
  height: 44px;
  background: var(--accent-red);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stepper-stop:hover {
  background: #A82020;
}

.btn-stepper-reset {
  height: 44px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  color: var(--primary-maroon);
  border-radius: var(--radius-pill);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stepper-reset:hover {
  border-color: var(--primary-maroon);
  background: #FFFFFF;
}

.stepper-options-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stepper-speed-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speed-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.speed-pill {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-pill.active {
  background: var(--primary-maroon);
  border-color: var(--primary-maroon);
  color: #FFFFFF;
}

.auto-stop-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.auto-stop-label input {
  accent-color: var(--primary-maroon);
}

/* ==========================================================================
   VIEW 4: VISUAL ACUITY EXAM
   ========================================================================== */

.exam-desktop-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.optotype-stimulus-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.optotype-display-box {
  width: 100%;
  min-height: 360px;
  background: #FFFFFF;
  border: 2px solid var(--primary-maroon);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.optotype-char {
  font-size: 110px;
  font-family: var(--font-main);
  font-weight: 800;
  color: #000000;
  line-height: 1;
}

.optotype-meta-footer {
  position: absolute;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.exam-keypad-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.keypad-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  margin-bottom: 4px;
}

.keypad-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.dpad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.dpad-middle-row {
  display: flex;
  gap: 16px;
}

.dpad-btn {
  width: 84px;
  height: 44px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--primary-maroon);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dpad-btn:hover {
  background: var(--primary-maroon);
  border-color: var(--primary-maroon);
  color: #FFFFFF;
}

.exam-summary-box {
  width: 100%;
  background: var(--bg-cream-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  justify-content: space-around;
  border: 1px solid rgba(74, 14, 23, 0.10);
}

.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-maroon);
}

/* ==========================================================================
   VIEW 5: PRODUCTS & TEST CHARTS CATALOG
   ========================================================================== */

.products-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.catalog-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(74, 14, 23, 0.25);
}

.catalog-thumb-box {
  width: 100%;
  height: 180px;
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--card-border);
}

.catalog-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-thumb-box img {
  transform: scale(1.04);
}

.catalog-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  margin-bottom: 6px;
}

.catalog-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
  flex: 1;
}

.catalog-btn {
  align-self: flex-start;
  background: var(--bg-cream-soft);
  color: var(--primary-maroon);
  border: 1.5px solid var(--primary-maroon);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.catalog-card:hover .catalog-btn {
  background: var(--primary-maroon);
  color: #FFFFFF;
}

/* ==========================================================================
   VIEW 6: DATABASE RECORDS
   ========================================================================== */

.database-table-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.table-search-bar {
  margin-bottom: 18px;
}

.table-search-bar input {
  max-width: 450px;
}

/* Measurement Results Log Table */
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.logs-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--card-border);
  white-space: nowrap;
}

.logs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
  white-space: nowrap;
}

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

.logs-table .log-test-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  color: var(--primary-maroon);
  font-size: 11px;
  font-weight: 700;
}

.logs-table .log-empty-row td {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  white-space: normal;
}

/* ==========================================================================
   VIEW 7: SPLASH & WELCOME SCREEN
   ========================================================================== */

.view-splash-container-desktop {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.splash-brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.splash-logo-img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: #FFFFFF;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(74, 14, 23, 0.2);
  margin-bottom: 16px;
}

.splash-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--primary-maroon-dark);
}

.splash-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
}

.welcome-overlay-sheet-desktop {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  max-width: 620px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
}

.welcome-sheet-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  margin-bottom: 12px;
}

.welcome-sheet-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 26px;
}

/* ==========================================================================
   MODALS & TOASTS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(53, 8, 14, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  background: var(--card-white);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.2s ease forwards;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
}

/* Clinical Verdict Badges (Measurement Result Modals) */
.status-badge-green,
.status-badge-orange,
.status-badge-red {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.status-badge-green {
  background: rgba(45, 138, 78, 0.15);
  color: var(--accent-green);
}

.status-badge-orange {
  background: rgba(229, 169, 60, 0.18);
  color: #A66A0A;
}

.status-badge-red {
  background: rgba(201, 42, 42, 0.14);
  color: var(--accent-red);
}

/* Rail Hardware Connection Status (ESP8266 real motor integration) */
.rail-hw-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.rail-hw-status.idle {
  background: rgba(107, 114, 128, 0.15);
  color: #6B7280;
}

.rail-hw-status.ok {
  background: rgba(45, 138, 78, 0.15);
  color: var(--accent-green);
}

.rail-hw-status.warn {
  background: rgba(229, 169, 60, 0.18);
  color: #A66A0A;
}

.rail-hw-status.error {
  background: rgba(201, 42, 42, 0.14);
  color: var(--accent-red);
}

.btn-close-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--primary-maroon);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-circle:hover {
  background: var(--primary-maroon);
  color: #FFFFFF;
}

/* Floating Toast */
.app-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast-item {
  background: var(--primary-maroon-dark);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.2s ease forwards;
}

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

/* ==========================================================================
   VIEW 0: AUTHENTICATION & LOGIN (MATCHING IMAGES 1, 3, 4)
   ========================================================================== */

.btn-logout-mini {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s ease;
}

.btn-logout-mini:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

.auth-page-container {
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-split-card {
  display: grid;
  grid-template-columns: 360px 480px;
  background: var(--card-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 10px 36px rgba(74, 14, 23, 0.18);
  border: 1px solid var(--card-border);
  width: 100%;
  max-width: 860px;
}

@media (max-width: 960px) {
  .auth-split-card {
    grid-template-columns: 1fr;
  }
  .auth-hero-pane {
    display: none;
  }
}

/* Left Brand Hero */
.auth-hero-pane {
  background: linear-gradient(150deg, var(--primary-maroon) 0%, var(--primary-maroon-dark) 100%);
  color: #FFFFFF;
  padding: 38px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-hero-logo-box {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-hero-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.auth-hero-subtitle {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-gold);
  display: block;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-hero-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.5;
  margin-bottom: 24px;
}

.auth-quick-preset-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.preset-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bg-cream);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}

.preset-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-demo-login {
  background: rgba(250, 240, 202, 0.12);
  border: 1px solid rgba(229, 169, 60, 0.4);
  color: var(--bg-cream);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.btn-demo-login:hover {
  background: var(--bg-cream);
  color: var(--primary-maroon);
  border-color: var(--bg-cream);
  transform: translateX(3px);
}

/* Right Auth Form */
.auth-form-pane {
  padding: 38px 36px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-tab-content {
  display: none;
}

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

.auth-header-row {
  margin-bottom: 22px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-maroon-dark);
  margin-bottom: 4px;
}

.auth-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-pill-group {
  margin-bottom: 14px;
}

.auth-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.auth-field-icon {
  position: absolute;
  left: 16px;
  color: var(--primary-maroon);
  pointer-events: none;
  opacity: 0.85;
}

.auth-pill-input {
  width: 100%;
  height: 46px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 0 44px 0 46px;
  font-size: 13.5px;
  font-family: var(--font-main);
  color: var(--text-dark);
  outline: none;
  transition: all 0.15s ease;
}

.auth-pill-input:focus {
  background: #FFFFFF;
  border-color: var(--primary-maroon);
  box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.12);
}

.auth-pill-input.no-icon {
  padding: 0 18px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.btn-toggle-pwd:hover {
  color: var(--primary-maroon);
}

.auth-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-checkbox-label input {
  accent-color: var(--primary-maroon);
  width: 15px;
  height: 15px;
}

.auth-link {
  color: var(--primary-maroon);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link-bold {
  color: var(--primary-maroon);
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 4px;
}

.auth-switch-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Forgot Password Shield Banner */
.auth-shield-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.auth-shield-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-pill);
  background: var(--bg-cream);
  color: var(--primary-maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(74, 14, 23, 0.12);
  border: 1px solid rgba(74, 14, 23, 0.12);
}

.auth-sub-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

/* ==========================================================================
   PHONE / SMALL-SCREEN RESPONSIVE LAYOUT
   ========================================================================== */

@media (max-width: 768px) {
  /* Sidebar becomes an off-canvas drawer instead of eating the whole screen */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 10px 0 32px rgba(0, 0, 0, 0.35);
  }

  body.mobile-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 4, 7, 0.55);
    z-index: 290;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: flex;
  }

  /* Topbar: tighter padding, let search flex, hide secondary telemetry */
  .top-clinical-bar {
    padding: 0 12px;
    gap: 10px;
  }

  .topbar-search-wrap {
    width: auto;
    max-width: none;
    flex: 1;
    min-width: 0;
  }

  .telemetry-chip {
    display: none;
  }

  .active-patient-chip .chip-label,
  .active-patient-chip .chip-mrn {
    display: none;
  }

  .topbar-right-deck {
    gap: 8px;
  }

  .workspace-body {
    padding: 16px 14px 28px;
  }

  /* View headers stack instead of squeezing side by side */
  .desktop-view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-action-group {
    flex-wrap: wrap;
  }

  /* Dashboard */
  .dashboard-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .categories-grid-desktop {
    grid-template-columns: 1fr;
  }

  /* Patient Intake */
  .intake-desktop-grid {
    grid-template-columns: 1fr;
  }

  .form-row-2col {
    grid-template-columns: 1fr;
  }

  .eye-protocol-row {
    grid-template-columns: 1fr;
  }

  /* NPC / NPA Stepper Rail */
  .dot-desktop-stage-grid {
    grid-template-columns: 1fr;
  }

  .stepper-options-group {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Near VA / Jaeger's Chart exam layout */
  .exam-desktop-grid {
    grid-template-columns: 1fr;
  }

  .optotype-stimulus-card,
  .exam-keypad-card {
    padding: 20px;
  }

  .optotype-display-box {
    min-height: 260px;
  }

  .jaeger-level-row {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  }

  /* Test Catalog */
  .products-catalog-grid {
    grid-template-columns: 1fr;
  }

  /* Auth / Login */
  .auth-form-pane {
    padding: 30px 22px;
  }

  /* Modals */
  .modal-card {
    padding: 20px;
  }
}
