html {
  font-size: 16px; /* Changed from 14px to prevent mobile zoom on input focus */
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
}

@media (min-width: 768px) {
  html {
    font-size: 16px; /* Keep consistent across all screen sizes */
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
  }
}

/* Prevent iOS auto-zoom on input focus while preserving pinch-to-zoom accessibility */
/* iOS Safari/Chrome auto-zoom when input font-size < 16px - this override ensures all inputs meet the threshold */
@media (max-width: 768px) {
  input,
  textarea,
  select,
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm,
  .quick-add-form .form-control,
  .quick-add-form .form-select,
  .chat-input-container .form-control {
    font-size: 16px !important;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

.card {
  margin-bottom: 1rem;
}

.card-body {
  text-align: center;
}

/* ====== Original Transparent Button ====== */
.liquid-btn{
  --radius: 18px;
  position: relative; border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 14px 22px; min-width: 220px;
  color: white; text-decoration: none; font-weight: 700; letter-spacing:.2px;
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 8px 32px rgba(0,0,0,.2);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; transition: all .3s cubic-bezier(.4,0,.2,1);
  overflow:hidden; isolation:isolate;
}
.liquid-btn:hover{ 
  transform: translateY(-2px); 
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 20px 40px rgba(0,0,0,.4); 
}
.liquid-btn:active{ transform: translateY(0); }

/* Slower Shimmer effect on hover */
.liquid-btn::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: linear-gradient(135deg, 
    transparent 30%, 
    rgba(255,255,255,.6) 50%, 
    transparent 70%);
  transform: translateX(-100%);
  transition: transform 1.2s ease;
  opacity: 0;
  z-index: 1;
}
.liquid-btn:hover::before{
  transform: translateX(100%);
  opacity: 1;
}


/* Fade-in helper */
.fade-in{ opacity:0; transform: translateY(6px) scale(.98); }
.fade-in.show{ opacity:1; transform:none; transition: opacity .28s cubic-bezier(.22,1,.36,1), transform .28s cubic-bezier(.22,1,.36,1); }

.hidden{ display:none !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .liquid-btn::before{ animation: none; }
}

/* ========================================
   🎯 DASHBOARD BAG & SIDE PANEL
   ======================================== */

/* Bag trigger hover effect */
.bag-trigger:hover img {
  transform: scale(1.1);
}

/* Side Panel */
.side-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255,255,255,0.2);
  box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto; /* Keep this for overlay panel - prevents nested scrolling inside */
}

.side-panel.open {
  right: 0;
}

.side-panel-content {
  padding: 20px;
  /* Removed height: 100% to prevent nested scrolling */
}

.side-panel-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.side-panel-header h5 {
  margin: 0;
  font-weight: 600;
  color: #2c3e50;
}

.side-panel-body {
  flex: 1;
}

/* Chat Container */
.chat-container {
  /* Removed fixed height to allow natural content flow */
  min-height: 300px; /* Minimum height for aesthetics */
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  /* Removed overflow-y and max-height - parent panel handles scrolling */
  background: rgba(248, 249, 250, 0.5);
  border-radius: 8px;
  margin-bottom: 15px;
}

.welcome-message {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid #3b82f6;
}

.welcome-message p {
  margin: 0;
  color: #374151;
  line-height: 1.5;
}

.chat-input-container {
  margin-top: auto;
  padding-top: 10px;
}

.chat-input-container .input-group {
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-input-container .form-control {
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: 25px 0 0 25px;
}

.chat-input-container .form-control:focus {
  box-shadow: none;
  border-color: transparent;
}

.chat-input-container .btn {
  border: none;
  padding: 12px 20px;
  border-radius: 0 25px 25px 0;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.chat-input-container .btn:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: none;
}

/* Chat Messages */
.message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 12px;
  max-width: 90%;
}

.user-message {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  margin-left: auto;
  text-align: right;
}

.ai-message {
  background: rgba(243, 244, 246, 0.8);
  color: #374151;
  margin-right: auto;
}

.message p {
  margin: 0;
  line-height: 1.4;
}

/* Side panel overlay */
.side-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.side-panel-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Close button */
.btn-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

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

/* ========================================
   🎨 MODERN DASHBOARD DESIGN SYSTEM
   ======================================== */

/* Design tokens for dashboard only */
.medical-dashboard {
  --ink: #2C2C2C;
  --paper: #FFFFFF;
  --paper-2: #FEFEFE;
  --sand: #F4E4BC;
  --line: rgba(44,44,44,.08);
  --muted: #6B7280;
  
  /* Rich bronze palette */
  --gold-1: #CD7F32;
  --gold-2: #B8860B;
  --gold-3: #8B4513;
  --gold-grad: linear-gradient(180deg, var(--gold-1), var(--gold-3));
  
  /* Elevation & radii */
  --r-xl: 18px; --r-lg: 16px; --r-md: 12px; --r-sm: 10px;
  --elev-1: 0 4px 12px rgba(44,44,44,.08), 0 1px 0 rgba(255,255,255,.90) inset;
  --elev-2: 0 8px 24px rgba(44,44,44,.12), 0 1px 0 rgba(255,255,255,.95) inset;
  
  /* Motion */
  --dur-fast: .12s;
  --dur: .18s;
}

/* Dashboard layout */
.medical-dashboard {
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  padding: 24px 20px 64px;
  /* max-width: 1200px; - Removed to allow full-width layout */
  /* margin: 0 auto; - No centering needed */
}

/* Legacy variables for compatibility */
:root {
  --gladstone-gold: #CD7F32;
  --gladstone-gold-light: #D2B48C;
  --gladstone-gold-dark: #8B4513;
  --gladstone-black: #0B0F14;
  --gladstone-gray: #6E7380;
}

/* Modern Dashboard Header */
.dashboard-header {
  margin-bottom: 12px;
}

.dashboard-title {
  font-size: clamp(14px, 2vw, 22px);
  font-weight: 700;
  color: var(--ink);
}

/* Date and Time Display */
.brand-name {
  font-size: 24px;
  font-weight: 700;
  color: #0ea5e9;
  letter-spacing: 0.5px;
}

.datetime-display {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--edge);
}

#currentDate {
  color: var(--edge);
}

#currentTime {
  color: #0ea5e9;
  font-variant-numeric: tabular-nums;
}

.time-separator {
  color: rgba(49, 52, 51, 0.4);
  margin: 0 4px;
}

/* Logout Button - Bottom Right */
.logout-bottom-right {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: 
    radial-gradient(120% 200% at 50% -60%, rgba(255,255,255,.24), transparent 60%),
    linear-gradient(180deg, #171B22, #0B0F14);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.24);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  z-index: 100;
}

.logout-bottom-right:hover {
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.3);
}

.logout-bottom-right i {
  font-size: 16px;
}

.logout-bottom-right span {
  font-size: 14px;
}

.brass-rule {
  height: 3px;
  border-radius: 999px;
  background: var(--edge); /* Changed to black */
}

/* Welcome text styling */
.medical-dashboard p.text-muted {
  color: var(--gladstone-black) !important;
  font-weight: 500;
  font-size: 1.1rem;
}

/* Card styling with background colors */
.medical-dashboard .card {
  background-color: #f8f9fa;
  border: 2px solid var(--gladstone-black);
  border-radius: 8px;
  box-shadow: none;
  transition: all 0.3s ease;
  position: relative;
}

.medical-dashboard .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--gladstone-gold);
}

.medical-dashboard .card:hover {
  transform: translateY(-2px);
  border-color: var(--gladstone-black);
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.2);
}

/* Card headers */
.medical-dashboard .card-header {
  background-color: #ffffff;
  border-bottom: 2px solid var(--gladstone-black);
  color: var(--gladstone-black);
  font-weight: 600;
}

/* Card titles */
.medical-dashboard .card-title {
  color: var(--gladstone-black);
  font-weight: 700;
}

/* Card text */
.medical-dashboard .card-text {
  color: var(--gladstone-gray) !important;
}

/* Glass Button styling with shimmer effects */
.medical-dashboard .btn-primary,
.medical-dashboard .btn-info,
.medical-dashboard .btn-success {
  position: relative;
  border: 2px solid rgba(44, 44, 44, 0.3);
  border-radius: 8px;
  padding: 10px 20px;
  color: var(--gladstone-black);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px) saturate(150%);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 16px rgba(44, 44, 44, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  isolation: isolate;
}

.medical-dashboard .btn-primary:hover,
.medical-dashboard .btn-info:hover,
.medical-dashboard .btn-success:hover {
  transform: translateY(-2px);
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3), 
    0 8px 24px rgba(44, 44, 44, 0.15);
}


/* Icons with gold accents */
.medical-dashboard .fa-sun {
  color: var(--gladstone-gold) !important;
}

.medical-dashboard .fa-list-ul {
  color: var(--gladstone-gold-dark) !important;
}

.medical-dashboard .fa-calculator {
  color: var(--gladstone-gold) !important;
}

.medical-dashboard .fa-calendar-day,
.medical-dashboard .fa-tasks,
.medical-dashboard .fa-dollar-sign {
  color: var(--gladstone-gold-dark) !important;
}

/* List group styling */
.medical-dashboard .list-group-item {
  border: 1px solid var(--gladstone-black);
  background-color: #ffffff;
}

/* Badge styling */
.medical-dashboard .badge {
  background-color: var(--gladstone-gold) !important;
  color: var(--gladstone-black) !important;
}

/* Icon containers */
.medical-dashboard .text-primary i,
.medical-dashboard .text-success i,
.medical-dashboard .text-info i {
  color: var(--gladstone-gold) !important;
}

/* Glass button styling for outline buttons */
.btn-outline-secondary,
.medical-dashboard .btn-outline-primary {
  position: relative;
  border: 2px solid rgba(44, 44, 44, 0.3);
  color: var(--gladstone-black);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px) saturate(150%);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
  font-weight: 500;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 16px rgba(44, 44, 44, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
}

.btn-outline-secondary:hover,
.medical-dashboard .btn-outline-primary:hover {
  transform: translateY(-2px);
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.5);
  color: var(--gladstone-black);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3), 
    0 8px 24px rgba(44, 44, 44, 0.15);
}

/* Override Bootstrap default colors */
.medical-dashboard .text-primary {
  color: var(--gladstone-black) !important;
}

.medical-dashboard .text-success {
  color: var(--gladstone-black) !important;
}

.medical-dashboard .text-info {
  color: var(--gladstone-black) !important;
}

.medical-dashboard .text-warning {
  color: var(--gladstone-gold) !important;
}

.medical-dashboard .text-muted {
  color: var(--gladstone-gray) !important;
}

/* Override card border colors */
.medical-dashboard .card.border-primary,
.medical-dashboard .card.border-info,
.medical-dashboard .card.border-success {
  border: 2px solid var(--gladstone-black) !important;
}

/* Override any remaining colored backgrounds */
.medical-dashboard .bg-light {
  background-color: #ffffff !important;
  border-bottom: 2px solid var(--gladstone-black) !important;
}

/* Make sure all headings are black */
.medical-dashboard h1,
.medical-dashboard h2,
.medical-dashboard h3,
.medical-dashboard h4,
.medical-dashboard h5,
.medical-dashboard h6 {
  color: var(--gladstone-black) !important;
}

/* Override any blue/green button states */
.medical-dashboard .btn-primary:focus,
.medical-dashboard .btn-info:focus,
.medical-dashboard .btn-success:focus {
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25) !important;
}

/* Remove any colored focus rings */
.medical-dashboard .btn:focus,
.medical-dashboard .btn:active:focus {
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25) !important;
}

/* ========================================
   🏥 MODERN DASHBOARD LAYOUT
   ======================================== */

/* Modern Dashboard Grid */
.modern-dashboard {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .modern-dashboard {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Sidebar */
.dashboard-sidebar {
  display: grid;
  gap: 16px;
}

/* Modern Buttons */
.btn-primary-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: 
    radial-gradient(120% 200% at 50% -60%, rgba(255,255,255,.24), transparent 60%),
    linear-gradient(180deg, #171B22, #0B0F14);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.24);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary-modern:hover {
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: var(--gold-3);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.85));
  border: 1px solid rgba(212,175,55,.3);
  box-shadow: 0 2px 8px rgba(44,44,44,.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-ghost:hover {
  transform: translateY(-1px);
  color: var(--gold-3);
  text-decoration: none;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(44,44,44,.12);
}

/* Small Feature Cards */
.feature-card-small {
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--elev-1);
  transition: transform var(--dur) ease, box-shadow var(--dur) ease;
}

.feature-card-small:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
}

.feature-card-small::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2), var(--gold-3));
}

.feature-card-small:hover::before {
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2) 30%, var(--gold-1) 70%, var(--gold-3));
  filter: saturate(110%);
}

.card-cta {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}

.card-cta:hover {
  text-decoration: none;
  color: inherit;
}

.card-cta h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

/* Icon Chip */
.icon-chip {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: var(--sand);
  box-shadow: 0 1px 0 rgba(255,255,255,.90) inset, 0 -1px 0 rgba(0,0,0,.03) inset, 0 3px 8px rgba(0,0,0,.06);
  border: 1px solid var(--line);
  color: var(--gold-3);
  font-size: 18px;
}

/* Modern Stats */
.stat-modern {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(44,44,44,.04);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.brass-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Task Panel */
.task-panel {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 12px rgba(44,44,44,.06);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.panel-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
}

/* Modern Tasks */
.task-modern {
  background: #fff;
  border: 1px solid rgba(12,16,20,.12);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  transition: box-shadow var(--dur) ease, transform var(--dur) ease;
}

.task-modern:hover {
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.task-content {
  flex: 1;
}

.task-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-draft-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-draft-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin: 0;
}

.ai-draft-checkbox {
  margin: 0;
  accent-color: #86efac;
}

.btn-review {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid var(--gold-3);
  background: rgba(212,175,55,.08);
  color: var(--gold-3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-review:hover {
  background: var(--gold-1);
  color: #fff;
}

/* Modern Chips */
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.chip-ai {
  background: rgba(212,175,55,.08);
  color: var(--gold-3);
  border-color: rgba(212,175,55,.25);
}

/* Task completion styling */
.task-modern.completed {
  opacity: 0.6;
}

.task-modern.completed .task-title {
  text-decoration: line-through;
  color: var(--muted);
}

/* Review Modal */
.review-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 10001;
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  z-index: 10002;
  border: 2px solid var(--gold-1);
}

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

.modal-header h3 {
  margin: 0;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  padding: 24px;
  max-height: 400px;
  overflow-y: auto;
}

.draft-content {
  background: var(--sand);
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.btn-approve {
  background: var(--gold-1);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-approve:hover {
  background: var(--gold-3);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-cancel {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  color: var(--ink);
}

/* Edit Section */
.edit-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.edit-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-edit-mode {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-mode.active,
.btn-edit-mode:hover {
  background: var(--gold-1);
  color: #fff;
  border-color: var(--gold-1);
}

.edit-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.edit-textarea:focus {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.voice-controls {
  margin: 12px 0;
  padding: 12px;
  background: var(--sand);
  border-radius: var(--r-md);
  text-align: center;
}

.btn-voice {
  padding: 8px 16px;
  margin: 0 4px;
  border: 1px solid var(--gold-3);
  background: #fff;
  color: var(--gold-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-voice:hover {
  background: var(--gold-1);
  color: #fff;
}

.voice-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* Confirmation Section */
.confirmation-section {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--r-md);
}

.confirmation-message h4 {
  margin: 0 0 8px 0;
  color: #d97706;
  font-size: 16px;
}

.confirmation-message p {
  margin: 0 0 16px 0;
  color: var(--ink);
  font-size: 14px;
}

.confirmation-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-card {
  background-color: #f8f9fa;
  border: 2px solid var(--gladstone-black);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.2);
}

.action-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.action-header i {
  color: var(--gladstone-gold);
  font-size: 1.2rem;
  margin-right: 8px;
}

.action-header h6 {
  margin: 0;
  color: var(--gladstone-black);
  font-weight: 600;
}

/* Stats Card */
.stats-card {
  background-color: #f8f9fa;
  border: 2px solid var(--gladstone-black);
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gladstone-gold-light);
}

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

.stat-label {
  color: var(--gladstone-gray);
  font-size: 0.9rem;
}

.stat-value {
  color: var(--gladstone-black);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Command Center */
.command-center {
  background-color: #f8f9fa;
  border: 2px solid var(--gladstone-black);
  border-radius: 12px;
  padding: 25px;
  min-height: 600px;
}

.command-header {
  border-bottom: 2px solid var(--gladstone-gold);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.command-header h4 {
  color: var(--gladstone-black);
  font-weight: 700;
  margin-bottom: 5px;
}

.command-header i {
  color: var(--gladstone-gold);
}

/* To-Do Container */
.todo-container {
  position: relative;
}

.todo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gladstone-black);
}

.todo-header h5 {
  color: var(--gladstone-black);
  margin: 0;
  font-weight: 600;
}

.todo-header i {
  color: var(--gladstone-gold);
}

/* To-Do List Items */
.todo-list {
  max-height: 450px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid var(--gladstone-black);
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: #ffffff;
  transition: all 0.3s ease;
}

.todo-item:hover {
  background-color: rgba(244, 231, 177, 0.1);
  border-color: var(--gladstone-gold);
}

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

.todo-checkbox {
  margin: 0;
}

.todo-checkbox input[type="checkbox"] {
  display: none;
}

.todo-checkbox label {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gladstone-black);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.todo-checkbox input[type="checkbox"]:checked + label {
  background-color: var(--gladstone-gold);
  border-color: var(--gladstone-gold);
}

.todo-checkbox input[type="checkbox"]:checked + label::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gladstone-black);
  font-weight: bold;
  font-size: 12px;
}

.todo-content {
  flex: 1;
}

.todo-text {
  display: block;
  color: var(--gladstone-black);
  font-weight: 500;
  margin-bottom: 5px;
}

.todo-priority {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.todo-priority.high {
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid #dc2626;
}

.todo-priority.medium {
  background-color: rgba(212, 175, 55, 0.1);
  color: var(--gladstone-gold-dark);
  border: 1px solid var(--gladstone-gold);
}

.todo-priority.low {
  background-color: rgba(107, 114, 128, 0.1);
  color: var(--gladstone-gray);
  border: 1px solid var(--gladstone-gray);
}


/* Quick Add Task */
.quick-add-task {
  margin-top: 20px;
  padding: 15px;
  border: 2px dashed var(--gladstone-gold);
  border-radius: 8px;
}

.quick-add-task .form-control {
  border: 1px solid var(--gladstone-black);
}

.quick-add-task .form-control:focus {
  border-color: var(--gladstone-gold);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

/* Completed tasks styling */
.todo-item.completed {
  opacity: 0.6;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--gladstone-gray);
}

/* ========================================
   🎯 NEW DASHBOARD LAYOUT WITH CENTERED BAG
   ======================================== */

/* Inline Gladstone Bag Container */
.inline-bag-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 0;
}

.gladstone-bag-inline {
  transition: transform 0.3s ease;
}

.gladstone-bag-inline:hover {
  transform: scale(1.05);
}

/* Glassmorphism Navigation Buttons - Advanced Implementation */
:root{
  --radius: 18px;

  /* Resting edge (from your design extraction) */
  --edge: #313433;

  /* Glass fill */
  --glass: rgba(255,255,255,0.10);
  --glass-hover: rgba(255,255,255,0.18);

  /* Shimmer colors */
  --teal1: #1ad0d6;
  --teal2: #3aa6ff;
}

/* Layout for the left column */
.left-nav{
  display: grid;
  gap: 14px;
}

/* Base glass button */
.glass-nav-btn{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 180px;
  min-height: 64px;
  padding: 16px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .2px;

  /* Custom gradient background */
  background: linear-gradient(
    to right,
    #0C1034 5%,
    #15215B 25%,
    #231A5A 50%,
    #272152 75%,
    #3A3350 95%
  );
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid var(--teal1);
  box-shadow: 0 4px 20px rgba(26, 208, 214, 0.2);

  color: white; /* White text for better contrast on dark gradient */
  transition: all .3s ease;
  overflow: visible;
}

/* Simple animated border on hover - DISABLED */
.glass-nav-btn::before{
  display: none;
}

/* Shimmer effect using a rotating gradient - DISABLED */
.glass-nav-btn::after{
  display: none;
}
  background: conic-gradient(
    from var(--angle, 0deg),
    #1A2B5C,
    #2A3F8F,
    #3A4A9F,
    #4A52AF,
    #5A6BBF,
    #1A2B5C
  );
  opacity: 0;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

/* Hover/focus behavior */
.glass-nav-btn:hover,
.glass-nav-btn:focus-visible{
  background: linear-gradient(
    to right,
    #0F1440 5%,
    #18256B 25%,
    #2A1E6A 50%,
    #302662 75%,
    #473A60 95%
  );
  transform: translateY(-2px);
  border-color: var(--teal2);
  color: white; /* Keep white text on hover */
  box-shadow: 
    0 8px 40px rgba(26, 208, 214, 0.5),
    0 4px 20px rgba(58, 166, 255, 0.3),
    inset 0 0 30px rgba(26, 208, 214, 0.2);
  filter: drop-shadow(0 0 20px rgba(26, 208, 214, 0.4));
}

.glass-nav-btn:hover::before{
  display: none !important;
}

.glass-nav-btn:hover::after{
  display: none !important;
}

/* Navigation Badge */
.nav-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 50%;
  min-width: 20px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(26, 208, 214, 0.4);
  border: 2px solid white;
  z-index: 10;
}

/* Keyboard accessibility */
.glass-nav-btn:focus-visible{
  outline: 2px solid var(--teal1);
  outline-offset: 2px;
}

/* Reduce motion preference respected */
@media (prefers-reduced-motion: reduce){
  .glass-nav-btn,
  .glass-nav-btn::after{
    animation: none !important;
    transition: none !important;
  }
}

@keyframes spin {
  from {
    --angle: 0deg;
  }
  to {
    --angle: 360deg;
  }
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}


/* Closed bag button */
.closed-bag-btn {
  margin-left: 16px;
  background: transparent;
  border: 3px solid rgba(26, 208, 214, 0.4);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  overflow: visible;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.closed-bag-btn::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1A2B5C,
    #2A3F8F,
    #3A4A9F,
    #4A52AF,
    #5A6BBF,
    #1A2B5C
  );
  opacity: 0.6;
  z-index: -1;
  padding: 4px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
}

.closed-bag-btn:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2)) drop-shadow(0 4px 12px rgba(26, 208, 214, 0.3));
  border-color: rgba(26, 208, 214, 0.8);
}

.closed-bag-btn:hover::after {
  opacity: 0.9;
  filter: brightness(2.5);
  animation: spin 3s linear infinite;
}

/* Open bag button (matches closed bag appearance) */
.open-bag-btn {
  margin-left: 16px;
  background: transparent;
  border: 3px solid rgba(26, 208, 214, 0.4);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  overflow: visible;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.open-bag-btn::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1A2B5C,
    #2A3F8F,
    #3A4A9F,
    #4A52AF,
    #5A6BBF,
    #1A2B5C
  );
  opacity: 0.6;
  z-index: -1;
  padding: 4px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
}

.open-bag-btn:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2)) drop-shadow(0 4px 12px rgba(26, 208, 214, 0.3));
  border-color: rgba(26, 208, 214, 0.8);
}

.open-bag-btn:hover::after {
  opacity: 0.9;
  filter: brightness(2.5);
  animation: spin 3s linear infinite;
}

/* Space below header icons for chat */
.chat-thread { margin-top: 8px; }

/* Bag notification badge */
.bag-notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: bagNotificationPulse 2s infinite;
  z-index: 15;
}

/* ---- Assistant Chat (scoped, non-intrusive) ---- */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 10px 0;
}

.chat-message {
  display: flex;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 80%;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  color: #333;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* User vs Assistant alignment and colors */
.chat-message.user { justify-content: flex-end; }
.chat-message.user .chat-bubble {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0c4a6e;
}

/* Right-rail chat panel demarcation */
.right-rail .chat-messages {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Assistant panel (Index) chat panel demarcation */
.assistant-panel .rr-thread{
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

@keyframes bagNotificationPulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 1; 
  }
  50% { 
    transform: scale(1.1); 
    opacity: 0.8; 
  }
}

/* Update modern dashboard grid for centered layout */
.modern-dashboard {
  display: flex;
  justify-content: center;
  gap: 24px;
  align-items: flex-start;
  align-items: start;
  padding: 0 16px;
  position: relative;
}

/* My List View */
.my-list-view {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
}

/* My List Title - above container */
.list-title-header {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 20px 0;
  text-align: center;
}

.list-container {
  background: var(--glass);
  border: 2px solid var(--edge);
  border-radius: calc(var(--radius) + 6px);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: 24px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

/* Category Buttons - full width */
.list-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(49, 52, 51, 0.2);
}

.list-btn {
  flex: 1; /* Make buttons use equal width */
  min-width: 0; /* Allow text to wrap if needed */
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Button count styling */
.btn-count {
  margin-left: 8px;
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* List Content Area */
.list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* List Table */
.list-table {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* Table Header */
.table-header {
  display: grid;
  grid-template-columns: 60px 10fr 90px 50px 70px;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(49, 52, 51, 0.3);
  margin-bottom: 16px;
  width: 100%;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
}

/* Name column header should be left-aligned */
.table-header .column-header:nth-child(2) {
  justify-content: flex-start;
  text-align: left;
}

.column-header:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.column-header i {
  opacity: 0.5;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

.column-header:hover i {
  opacity: 1;
}

/* Table Body */
.table-body {
  flex: 1;
  /* Removed overflow-y and max-height to allow natural content flow */
  padding-right: 8px;
}

/* Custom scrollbar styling */
.table-body::-webkit-scrollbar {
  width: 6px;
}

.table-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.table-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  border-radius: 3px;
}

.table-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--teal2), var(--teal1));
}

/* Empty State */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 18px;
  font-weight: 300;
  color: var(--edge);
  opacity: 0.6;
}

/* Table Row (for future items) */
.table-row {
  display: grid;
  grid-template-columns: 60px 10fr 90px 50px 70px;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(49, 52, 51, 0.1);
  transition: all 0.2s ease;
  width: 100%;
}

/* Center all table cell content */
.table-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Name column should be left-aligned since it has long text */
.table-row .table-cell:nth-child(2) {
  justify-content: flex-start;
  text-align: left;
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.table-cell {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-strong);
}

/* Priority text colors - no boxes */
.priority-high { color: #ff4757; font-weight: 500; }
.priority-medium { color: #ffa502; font-weight: 500; }
.priority-low { color: #26de81; font-weight: 500; }

/* Status badges */
.status-pending { color: #ffa502; }
.status-completed { color: #26de81; }
.status-overdue { color: #ff4757; }
.status-processing { color: var(--edge); font-weight: 600; }
.status-ai-draft { color: #2ed573; font-weight: 600; }

/* AI Draft Complete Button - black text like Tasks button */
.status-ai-draft-btn {
  color: var(--edge) !important;
  font-size: 10px;
  padding: 4px 8px;
  min-width: auto;
}

.status-ai-draft-btn:hover {
  color: var(--edge) !important;
}

/* Input Needed Button - similar to AI Draft but with red-orange gradient */
.status-input-needed-btn {
  color: var(--edge) !important;
  font-size: 10px;
  padding: 4px 8px;
  min-width: auto;
  position: relative;
  border-color: #ff6348 !important;
}

.status-input-needed-btn:hover {
  color: var(--edge) !important;
}

/* Custom red-orange gradient for Input Needed button */
.status-input-needed-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b35,
    #ff8500,
    #ff4757,
    #ff6348,
    #ff7675,
    #ff6b35
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.status-input-needed-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}

/* Review AI Draft Button - red-orange gradient like Input Needed */
.status-review-ai-btn {
  color: var(--edge) !important;
  font-size: 10px;
  padding: 4px 8px;
  min-width: auto;
  position: relative;
  border-color: #ff6348 !important;
}

.status-review-ai-btn:hover {
  color: var(--edge) !important;
}

.status-review-ai-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b35,
    #ff8500,
    #ff4757,
    #ff6348,
    #ff7675,
    #ff6b35
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.status-review-ai-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}
/* Send Document Button - teal gradient */
.status-send-document-btn {
  color: var(--edge) !important;
  font-size: 10px;
  padding: 4px 8px;
  min-width: auto;
  position: relative;
  border-color: #1ad0d6 !important;
}
.status-send-document-btn:hover {
  color: var(--edge) !important;
}
.status-send-document-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1ad0d6,
    #3aa6ff,
    #26c6da,
    #1ad0d6,
    #3aa6ff,
    #1ad0d6
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}
.status-send-document-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}
/* Send Email Button - teal gradient (same as Send Document) */
.status-send-email-btn {
  color: var(--edge) !important;
  font-size: 10px;
  padding: 4px 8px;
  min-width: auto;
  position: relative;
  border-color: #1ad0d6 !important;
}
.status-send-email-btn:hover {
  color: var(--edge) !important;
}
.status-send-email-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1ad0d6,
    #3aa6ff,
    #26c6da,
    #1ad0d6,
    #3aa6ff,
    #1ad0d6
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}
.status-send-email-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}

/* Finalize Note Button - teal gradient like AI Draft Complete */
.status-finalize-btn {
  color: var(--edge) !important;
  font-size: 10px;
  padding: 4px 8px;
  min-width: auto;
}

.status-finalize-btn:hover {
  color: var(--edge) !important;
}

/* Next Patient View - similar styling to My List */
.next-patient-view {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.next-patient-container {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.next-patient-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: nowrap;
}

.next-patient-btn {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  max-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.next-patient-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-placeholder {
  color: var(--text-dim);
  font-size: 16px;
}

/* Large Add Patient Button */
.add-patient-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.add-patient-btn {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  color: var(--text-strong);
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.add-patient-btn:hover {
  transform: translateY(-4px) scale(1.05);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  border-color: var(--teal1);
}

.add-patient-btn::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0% 40%,
    #3aacff 45%,
    #1ad0d6 50%,
    #1A2B5C
  );
  opacity: 0;
  z-index: -1;
  padding: 4px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.add-patient-btn:hover::after {
  opacity: 0.8;
}

/* Enhanced + Button in Navigation */
.glass-nav-btn .fa-plus {
  font-size: 20px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.7);
  text-shadow: none;
  transform: none;
  transition: all 0.3s ease;
}

.glass-nav-btn:hover .fa-plus {
  color: rgba(0, 0, 0, 0.9);
  text-shadow: none;
  transform: none;
}

.glass-nav-btn.active-tab .fa-plus {
  color: rgb(26, 208, 214);
}

/* My Billing View - similar styling to Next Patient */
.my-billing-view {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.my-billing-container {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.my-billing-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: nowrap;
}

.my-billing-btn {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  max-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.my-billing-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.billing-placeholder {
  color: var(--text-dim);
  font-size: 16px;
}

/* Billing table styling */
.billing-table-container {
  margin-top: 16px;
}

.billing-row:hover {
  background: rgba(255,255,255,0.08) !important;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.billing-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Approve & Send Button - teal gradient */
.approve-send-btn {
  color: var(--edge) !important;
  font-size: 14px;
  padding: 8px 10px;
  min-width: auto;
  position: relative;
  border-color: #1ad0d6 !important;
}

.approve-send-btn:hover {
  color: var(--edge) !important;
}

.approve-send-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1ad0d6,
    #3aa6ff,
    #26c6da,
    #1ad0d6,
    #3aa6ff,
    #1ad0d6
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.approve-send-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}

/* Revise Button - orange-red gradient */
.revise-btn {
  color: var(--edge) !important;
  font-size: 14px;
  padding: 8px 10px;
  min-width: auto;
  position: relative;
  border-color: #ff6348 !important;
}

.revise-btn:hover {
  color: var(--edge) !important;
}

.revise-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b35,
    #ff8500,
    #ff4757,
    #ff6348,
    #ff7675,
    #ff6b35
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.revise-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}

/* Additional Information Needed Button - larger orange-red gradient */
.additional-info-btn {
  color: var(--edge) !important;
  font-size: 16px;
  padding: 8px 12px;
  min-width: auto;
  position: relative;
  border-color: #ff6348 !important;
  width: 100%;
}

.additional-info-btn:hover {
  color: var(--edge) !important;
}

.additional-info-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b35,
    #ff8500,
    #ff4757,
    #ff6348,
    #ff7675,
    #ff6b35
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.additional-info-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}

/* Review and Respond Button - orange gradient */
.review-respond-btn {
  color: var(--edge) !important;
  font-size: 11px;
  padding: 6px 12px;
  min-width: auto;
  position: relative;
  border-color: #ff6348 !important;
}

.review-respond-btn:hover {
  color: var(--edge) !important;
}

.review-respond-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b35,
    #ff8500,
    #ff4757,
    #ff6348,
    #ff7675,
    #ff6b35
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.review-respond-btn:hover::after {
  opacity: 0.8 !important;
  filter: brightness(2) !important;
}

/* Rejected row styling */
.rejected-row:hover {
  background: rgba(255,99,53,0.12) !important;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Fade out animation for approved billing rows */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Start Dictation buttons - same styling as workflow buttons */
.start-dictation-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Upload options styling */
.upload-file-option:hover,
.take-picture-option:hover,
.upload-info-option:hover,
.take-patient-picture-option:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(26, 208, 214, 0.2);
}

/* Processing button - starts like Input Needed, transforms to AI Draft Complete */
.processing-button {
  position: relative;
  color: var(--edge) !important;
  border-color: #ff6348 !important;
}

.processing-button::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b35,
    #ff8500,
    #ff4757,
    #ff6348,
    #ff7675,
    #ff6b35
  ) !important;
  opacity: 0.6;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: processing-to-teal 2s ease-in-out forwards, spin 3s linear infinite;
}

@keyframes processing-to-teal {
  0% {
    background: conic-gradient(
      from var(--angle, 0deg),
      #ff6b35,
      #ff8500,
      #ff4757,
      #ff6348,
      #ff7675,
      #ff6b35
    ) !important;
  }
  50% {
    background: conic-gradient(
      from var(--angle, 0deg),
      #ff8500,
      #ff4757,
      #1ad0d6,
      #ff6348,
      #3aa6ff,
      #ff8500
    ) !important;
  }
  100% {
    background: conic-gradient(
      from var(--angle, 0deg),
      #1ad0d6,
      #3aa6ff,
      #26c6da,
      #1ad0d6,
      #3aa6ff,
      #1ad0d6
    ) !important;
  }
}

/* Patient list styling */
.patient-list-table {
  margin-top: 16px;
}

.patient-row:hover {
  background: rgba(255,255,255,0.08) !important;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Notes table rows - 3 columns instead of 4 */
.notes-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(49, 52, 51, 0.1);
  transition: all 0.2s ease;
}

.notes-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   🎯 RIGHT RAIL ASSISTANT PANEL
   ======================================== */

/* Additional tokens for right rail */
:root{
  --text-strong: #0a0d0c;
  --text-dim: rgba(10,13,12,.7);
  --panel-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* Right rail container */
.right-rail{
  position: fixed;
  top: 120px;
  right: -520px; /* Start off-screen */
  z-index: 1000;

  min-width: 460px;
  max-width: 500px;
  height: calc(100vh - 160px);
  /* Allow full calculated height without artificial cap */
  max-height: none;

  /* glass panel wrapper look - less transparent */
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--edge);
  border-radius: calc(var(--radius) + 6px);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 8px 32px rgba(26, 208, 214, 0.1),
    var(--panel-shadow);
  overflow-y: auto; /* Changed from overflow: hidden - panel itself scrolls, not nested content */
  color: var(--text-strong);

  /* Animation */
  transition: right 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* When panel is open, slide it in */
.right-rail.open {
  right: 24px;
}

.rr-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(49,52,51,.5);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
}

.rr-title{
  margin:0; font-size: 16px; font-weight: 800; letter-spacing:.2px;
}

.bag-toggle{
  display:inline-grid; place-items:center;
  width:36px; height:36px; border-radius: 10px;
  background: rgba(255,255,255,.10);
  border: 1px solid var(--edge);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.bag-toggle:hover{ transform: translateY(-1px); background: rgba(255,255,255,.18); }
.icon-bag{ width:18px; height:18px; fill: var(--text-strong); opacity:.9; }

.right-rail.collapsed #rr-content{ display:none; }
.right-rail.collapsed .bag-toggle{ background: rgba(255,255,255,.16); }
.right-rail.collapsed{ min-width: auto; }

/* Content sections */
.rr-content{
  display:flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  /* Removed height: 100% and overflow: hidden to prevent nested scrolling */
}

.composer-wrapper {
  margin-top: auto;
  flex-shrink: 0;
}

/* Greeting Section */
.rr-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(49, 52, 51, 0.2);
  margin-bottom: 8px;
}

.greeting-text {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.3px;
}

#timeGreeting {
  color: var(--text-strong); /* Changed to black */
}

/* Quick actions (chips) */
.rr-actions{
  display:flex; flex-wrap:wrap; gap:10px;
}
.chip{
  position: relative;
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,.10);
  border: 1px solid var(--edge);
  transition: background .18s ease, transform .18s ease;
  cursor: pointer;
}
.chip:hover{ background: rgba(255,255,255,.18); transform: translateY(-1px); }

/* Glass chip shimmer (enhanced ring on hover) */
.chip--glass{
  position: relative;
  overflow: visible;
}

.chip--glass::after{
  content:"";
  position:absolute; 
  inset:-2px; 
  border-radius:inherit;
  background:
    conic-gradient(from var(--angle, 0deg),
      transparent 0 30%,
      rgba(26,208,214,0) 30% 40%,
      rgba(26,208,214,1) 45%,
      rgba(58,166,255,1) 50%,
      rgba(26,208,214,1) 55%,
      rgba(26,208,214,0) 60% 70%,
      transparent 70% 100%);
  -webkit-mask: 
    linear-gradient(#000 0 0) content-box, 
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; 
  mask-composite: exclude;
  padding: 2px; 
  opacity: 0; 
  pointer-events: none;
  z-index: -1;
  animation: none;
}

.chip--glass:hover::after{ 
  opacity: 1; 
  animation: ring-spin 2s linear infinite;
  filter: blur(0.5px);
}

.chip--glass:hover{
  background: rgba(255,255,255,.25);
  transform: translateY(-2px);
  box-shadow: 
    0 4px 20px rgba(26,208,214,.3),
    0 2px 10px rgba(58,166,255,.2);
}

/* Feed cards */
.rr-feed{ display:grid; gap:10px; max-height: 200px; overflow-y: auto; }
.feed-card{
  background: rgba(255,255,255,.08);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  padding: 10px 12px;
}
.feed-card__head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom: 6px;
}
.feed-card__time{ font-size:12px; color: var(--text-dim); }
.pill{
  padding: 2px 8px; border-radius: 999px; font-size:12px; font-weight: 800;
  border: 1px solid var(--edge); background: rgba(255,255,255,.10);
}
.pill--running{ 
  background: linear-gradient(135deg, rgba(26,208,214,.2), rgba(58,166,255,.2));
  border-color: var(--teal1);
}

.progress{
  --track: rgba(49,52,51,.55);
  position: relative; height: 6px; border-radius: 999px; margin-top: 8px;
  background: var(--track);
  overflow:hidden;
}
.progress::before{
  content:"";
  position:absolute; inset:0;
  width: calc(var(--progress, 0) * 100%);
  background: linear-gradient(90deg, var(--teal1), var(--teal2));
  border-radius: 999px;
  transition: width .25s ease;
}

/* Thread messages */
.rr-thread{
  display:block;
  flex: 1 1 auto;
  /* Removed overflow-y: auto - parent .right-rail panel handles scrolling */
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(49,52,51,.1);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}

/* Make the right-rail chat interface a white panel */
.right-rail .rr-thread{
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

/* Chat card panel */
.chat-card{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}
.chat-header{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  color: #334155;
}
.chat-card .chat-messages{
  flex: 1 1 auto;
  /* Removed overflow-y: auto - parent container handles scrolling */
  padding: 12px;
  border: none;
  box-shadow: none;
}
.chat-composer{
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
/* Textarea variant keeps bottom composer compact but expandable */
.chat-composer .composer-textarea{
  flex: 1 1 auto;
  min-height: 48px;
  max-height: 40vh;
  resize: vertical;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
/* Make textarea fill the entire right rail content area */


/* Ensure prompt blocks fill the panel width in right rail */
.right-rail .suggested-prompts { 
  margin-top: 10px; 
}
.right-rail .prompt-item { 
  width: 100%; 
}
.ne-options{ display:flex; flex-direction: column; gap: 10px; }
.rr-icon-btn{
  display:inline-grid; place-items:center;
  width:36px; height:36px; border-radius:10px;
  background:#fff; border:1px solid #e5e7eb; cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.rr-icon-btn i{ color:#334155; }
.rr-icon-btn:hover{ transform: translateY(-1px); box-shadow:0 2px 8px rgba(0,0,0,.12); }
/* keep compatibility for previous selector */
.rr-actions-icons .rr-icon-btn{ display:inline-grid; }

/* Inline panel spacing */
.rr-inline-panel{ margin-bottom: 8px; }

/* Chat composer - textarea variant to fill rail */
.chat-composer .composer-textarea{
  flex:1 1 auto; width:100%;
  min-height:90px; max-height:40vh; resize:vertical;
  border:1px solid #e5e7eb; border-radius:8px; padding:10px 12px; font-size:14px;
}
.msg{ display:grid; gap:4px; }
.msg__bubble{
  display:inline-block; max-width: 85%;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.10);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  font-size: 14px;
  line-height: 1.4;
}
.msg--assistant .msg__bubble{
  background: rgba(255,255,255,.12);
}
.msg--user{ justify-items: end; }
.msg--user .msg__bubble{
  background: rgba(26,208,214,.12);
  border-color: rgba(26,208,214,.45);
}
.msg__time{ font-size: 11px; color: var(--text-dim); }

/* Composer Wrapper */
.composer-wrapper {
  margin-bottom: 12px;
}

/* Inline Suggested Actions - Same style as left nav */
.rr-actions-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  justify-content: space-between;
}

.chip-inline {
  position: relative;
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid var(--teal1);
  box-shadow: 0 4px 20px rgba(26, 208, 214, 0.2);
  color: var(--edge);
  transition: all .3s ease;
  overflow: visible;
  cursor: pointer;
}


/* Glass inline chip - shimmer effect like left nav */
.chip--glass-inline::after{
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1A2B5C,
    #2A3F8F,
    #3A4A9F,
    #4A52AF,
    #5A6BBF,
    #1A2B5C
  );
  opacity: 0;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.chip-inline:hover,
.chip-inline:focus-visible {
  transform: translateY(-2px);
  border-color: var(--teal2);
  color: var(--edge);
  box-shadow: 
    0 8px 40px rgba(26, 208, 214, 0.5),
    0 4px 20px rgba(58, 166, 255, 0.3),
    inset 0 0 30px rgba(26, 208, 214, 0.2);
  filter: drop-shadow(0 0 20px rgba(26, 208, 214, 0.4));
}

.chip--glass-inline:hover::after {
  opacity: 0.8;
  filter: brightness(2);
}
}

/* Composer */
.rr-composer{
  display:grid; gap:8px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 10px;
}

/* Dictation Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

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

@keyframes rotateShimmer {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#composer-input{
  width:100%; border:1px solid var(--edge); border-radius: 10px;
  background: rgba(255,255,255,.08); color: var(--text-strong);
  padding: 8px 12px; resize: vertical;
  font-family: inherit;
  font-size: 13px;
  min-height: 60px;
  max-height: 80px;
}
#composer-input:focus{ outline:2px solid var(--teal1); outline-offset: 2px; }
.composer-actions{ display:flex; gap:10px; justify-content:end; }
.rr-composer .btn-ghost,
.rr-composer .btn-primary {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid var(--teal1);
  box-shadow: 0 4px 20px rgba(26, 208, 214, 0.2);
  color: var(--edge);
  transition: all .3s ease;
  overflow: visible;
  cursor: pointer;
}

.rr-composer .btn-ghost::after,
.rr-composer .btn-primary::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: var(--radius);
  background: conic-gradient(
    from var(--angle, 0deg),
    #1A2B5C,
    #2A3F8F,
    #3A4A9F,
    #4A52AF,
    #5A6BBF,
    #1A2B5C
  );
  opacity: 0;
  z-index: -1;
  padding: 3px;
  mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(white 0 0) content-box, linear-gradient(white 0 0);
  -webkit-mask-composite: xor;
  transition: opacity 0.3s ease;
  animation: spin 3s linear infinite;
}

.rr-composer .btn-ghost:hover,
.rr-composer .btn-primary:hover {
  transform: translateY(-2px);
  border-color: var(--teal2);
  color: var(--edge);
  box-shadow: 
    0 8px 40px rgba(26, 208, 214, 0.5),
    0 4px 20px rgba(58, 166, 255, 0.3),
    inset 0 0 30px rgba(26, 208, 214, 0.2);
  filter: drop-shadow(0 0 20px rgba(26, 208, 214, 0.4));
}

.rr-composer .btn-ghost:hover::after,
.rr-composer .btn-primary:hover::after {
  opacity: 0.8;
  filter: brightness(2);
}

/* Shared animation for ring spin */
@keyframes ring-spin { to { transform: rotate(360deg); } }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .chip::after{ animation: none !important; }
  .bag-toggle, .chip{ transition: none !important; }
  .progress::before{ transition: none !important; }
}

/* ========================================
   🎯 PRIORITY FEATURES FOR TASKS (Updated)
   ======================================== */

/* Priority badges */
.priority-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 4px;
}

/* Table priority styles - override with !important */
.table-cell.priority-high {
  background: none !important;
  color: #ff4757 !important;
  box-shadow: none !important;
  border: none !important;
  padding: 8px 12px !important;
  font-weight: 500 !important;
}

.table-cell.priority-medium {
  background: none !important;
  color: #ffa502 !important;
  box-shadow: none !important;
  border: none !important;
  padding: 8px 12px !important;
  font-weight: 500 !important;
}

.table-cell.priority-low {
  background: none !important;
  color: #26de81 !important;
  box-shadow: none !important;
  border: none !important;
  padding: 8px 12px !important;
  font-weight: 500 !important;
}

/* Task priority styling */
.task-high-priority {
  border-left: 6px solid #dc2626 !important;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.02)) !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1) !important;
}

.task-low-priority {
  border-left: 6px solid #6b7280 !important;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.05), rgba(107, 114, 128, 0.02)) !important;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.1) !important;
}

.task-priority {
  margin-top: 6px;
}

/* Priority selector in form */
.priority-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.priority-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  min-width: 55px;
}

.priority-select {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
}

.priority-select:focus {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 2px rgba(205, 127, 50, 0.2);
}

/* Task form styling */
.task-form {
  padding: 16px;
}

.task-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.task-form-actions .btn {
  font-size: 12px;
  padding: 6px 12px;
}

/* Run the List Flow - Right panel slides to center */
.right-rail.run-list-mode {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, 90vw);
  height: 100vh;
  max-height: 100vh;
  z-index: 1500;
  border-radius: 0;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.run-list-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1400;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.run-list-backdrop.active {
  opacity: 1;
}

.right-rail.run-list-mode .rr-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.right-rail.run-list-mode .rr-greeting {
  flex-shrink: 0;
  border-bottom: 1px solid var(--edge);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.right-rail.run-list-mode .run-list-content {
  flex: 1;
  /* Removed overflow-y: auto - parent .right-rail handles scrolling */
  padding: 0 8px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .right-rail.run-list-mode { 
    transition: none !important; 
  }
  .run-list-backdrop {
    transition: none !important;
  }
}

/* Type badges for the All view */
.type-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-task {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
  color: rgb(59, 130, 246);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.type-note {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  color: rgb(34, 197, 94);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.type-document {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  color: rgb(168, 85, 247);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.type-correspondence {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
  color: rgb(245, 158, 11);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Active state for list buttons */
.list-btn.active {
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.2), rgba(26, 208, 214, 0.1));
  border-color: rgba(26, 208, 214, 0.4);
  color: rgb(26, 208, 214);
}

/* Chrome-style tab navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 0;
  margin-bottom: 0;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.nav-left {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.nav-right {
  display: flex;
  align-items: flex-end;
}

.glass-nav-btn {
  position: relative;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(26, 208, 214, 0.3);
  border-bottom: 1px solid rgba(26, 208, 214, 0.3);
  margin-bottom: 0;
  color: rgba(0, 0, 0, 0.7);
  flex: 1;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-nav-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  color: rgba(0, 0, 0, 0.9);
}

.glass-nav-btn.active-tab {
  background: rgba(255, 255, 255, 1);
  border: 1px solid rgba(26, 208, 214, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 1);
  position: relative;
  z-index: 3;
  padding-bottom: 11px;
  color: rgb(26, 208, 214);
}

.glass-nav-btn.active-tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: rgba(255, 255, 255, 1);
  z-index: 4;
}

/* Tab content container - precisely aligned with button edges */
.tab-content-container {
  background: rgba(255, 255, 255, 1);
  border: 1px solid rgba(26, 208, 214, 0.3);
  border-radius: 0 0 12px 12px;
  /* Removed fixed height and overflow to allow natural content flow */
  min-height: 400px; /* Minimum height for aesthetics */
  position: relative;
  z-index: 2;
  margin-top: -1px;
  padding: 20px 0;
  /* Match the exact span of the navigation - from outer edge of + button to outer edge of bag border */
  width: calc(100% + 60px) !important;
  max-width: none !important;
  margin-left: -30px !important;
  margin-right: -30px !important;
  /* Extend content to align with button outer edges */
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* When + button (first tab) is active */
.tab-content-container.first-tab-active {
  border-radius: 0 8px 12px 12px;
}

/* When My Billing (middle tab) is active */
.tab-content-container.middle-tab-active {
  border-radius: 8px 8px 12px 12px;
}

/* When My List (last tab) is active - default state */
.tab-content-container.last-tab-active {
  border-radius: 8px 0 12px 12px;
}

/* Update existing containers to fit within tab content */
.list-container, .next-patient-container, .my-billing-container {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 20px;
}

/* Patient separators for All view */
.patient-separator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin: 20px 0 8px 0;
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.08), rgba(26, 208, 214, 0.04));
  border-left: 4px solid rgba(26, 208, 214, 0.6);
  border-radius: 8px;
  position: relative;
}

.patient-separator:first-child {
  margin-top: 0;
}

.patient-name {
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.5px;
}

.patient-count {
  font-size: 12px;
  font-weight: 600;
  color: rgba(26, 208, 214, 0.8);
  background: rgba(26, 208, 214, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(26, 208, 214, 0.2);
}

/* Optimized 5-column layout with large name field */
.list-table .table-header {
  grid-template-columns: 60px 10fr 90px 50px 70px;
}

.list-table .table-row {
  grid-template-columns: 60px 10fr 90px 50px 70px;
}

/* Keep the default layout for now, will be overridden by JavaScript for specific views */
.list-content .table-body {
  padding: 0 8px;
}

/* Patient separator with date beside name */
.patient-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.patient-name {
  font-weight: 600;
  color: var(--ink);
}

.patient-date {
  color: #6B7280;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Special ALL tab list view styling */
.list-table.all-tab-view .table-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(49, 52, 51, 0.08);
  grid-template-columns: none;
  transition: all 0.2s ease;
}

.list-table.all-tab-view .table-row:hover {
  background: rgba(26, 208, 214, 0.05);
  border-left: 3px solid rgba(26, 208, 214, 0.4);
  padding-left: 13px;
}

/* Hide individual date cells in ALL view */
.list-table.all-tab-view .table-row .table-cell:nth-child(3) {
  display: none;
}

/* Style first cell (type) as an icon */
.list-table.all-tab-view .table-row .table-cell:first-child {
  flex: 0 0 auto;
  padding: 0;
}

/* Style second cell (item name) to take most space */
.list-table.all-tab-view .table-row .table-cell:nth-child(2) {
  flex: 1;
  padding: 0;
  font-weight: 500;
}

/* Style priority cell */
.list-table.all-tab-view .table-row .table-cell:nth-child(4) {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

/* Style status cell */
.list-table.all-tab-view .table-row .table-cell:last-child {
  flex: 0 0 auto;
  padding: 0;
  margin-left: auto;
}

/* Enhanced patient separator for ALL view */
.list-table.all-tab-view .patient-separator {
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.05), rgba(26, 208, 214, 0.02));
  padding: 12px 16px;
  margin: 8px 0;
  border-left: 3px solid rgba(26, 208, 214, 0.3);
  border-radius: 0 8px 8px 0;
}

/* Compact type badges for ALL view */
.list-table.all-tab-view .type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.list-table.all-tab-view .type-badge.type-task {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
}

.list-table.all-tab-view .type-badge.type-document {
  background: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}

.list-table.all-tab-view .type-badge.type-note {
  background: rgba(34, 197, 94, 0.1);
  color: rgb(34, 197, 94);
}

.list-table.all-tab-view .type-badge.type-correspondence {
  background: rgba(168, 85, 247, 0.1);
  color: rgb(168, 85, 247);
}

/* Priority badges in ALL view */
.list-table.all-tab-view .priority-high {
  background: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}

.list-table.all-tab-view .priority-medium {
  background: rgba(251, 191, 36, 0.1);
  color: rgb(245, 158, 11);
}

.list-table.all-tab-view .priority-low {
  background: rgba(34, 197, 94, 0.1);
  color: rgb(34, 197, 94);
}

/* ========================================
   ALL TAB DATE-BASED STRUCTURE
   ======================================== */

.date-separator-all {
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.08), rgba(26, 208, 214, 0.03));
  border-left: 3px solid rgba(26, 208, 214, 0.5);
  margin: 20px 0 15px 0;
  padding: 12px 16px;
  border-radius: 8px;
}

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

.date-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2b5c;
  letter-spacing: 0.3px;
}

.date-patient-count {
  font-size: 0.85rem;
  color: rgba(26, 208, 214, 0.8);
  font-weight: 600;
  background: rgba(26, 208, 214, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
}

.patient-subsection {
  margin-left: 16px;
  margin-bottom: 16px;
  padding-left: 0;
}

.patient-header-compact {
  display: flex;
  align-items: center;
  padding: 6px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(26, 208, 214, 0.15);
}

.patient-name-compact {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.patient-name-text {
  font-weight: 700;
  color: #1a2b5c;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.patient-item-count {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

/* Better alignment for rows under patient names */
.patient-subsection .all-tab-item {
  margin-left: 12px;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-subsection .all-tab-item:hover {
  border-left-color: rgba(26, 208, 214, 0.4);
  background: rgba(26, 208, 214, 0.03);
}

/* Ensure proper icon alignment */
.patient-subsection .all-tab-item .table-cell:first-child {
  flex: 0 0 auto;
  min-width: auto;
  margin-right: 8px;
}

.patient-subsection .all-tab-item .table-cell:nth-child(2) {
  flex: 1;
  padding-left: 8px;
}

/* Priority column is hidden in ALL tab */
.patient-subsection .all-tab-item .table-cell:nth-child(4) {
  display: none !important;
}

.patient-subsection .all-tab-item .table-cell:last-child {
  flex: 0 0 auto;
  min-width: 160px;
}

/* Pill-shaped type badges like patient count */
.patient-subsection .type-badge,
.all-tab-view .type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  border-radius: 20px;
  text-transform: uppercase;
  white-space: nowrap;
  height: 22px;
  min-width: fit-content;
}

/* Specific badge colors with pill shape */
.all-tab-view .type-badge.type-task {
  background: rgba(59, 130, 246, 0.15);
  color: rgb(59, 130, 246);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.all-tab-view .type-badge.type-document {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(239, 68, 68);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.all-tab-view .type-badge.type-note {
  background: rgba(34, 197, 94, 0.15);
  color: rgb(34, 197, 94);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.all-tab-view .type-badge.type-correspondence {
  background: rgba(168, 85, 247, 0.15);
  color: rgb(168, 85, 247);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ========================================
   DICTATION MODAL STYLES
   ======================================== */

/* Compact Modal (for bag hold) */
.dictation-modal-compact {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.dictation-modal-content-compact {
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(26, 208, 214, 0.3);
  border-radius: 16px;
  padding: 24px;
  width: 450px;
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(26, 208, 214, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: dictationModalSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dictationModalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-30px) translateX(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
  }
}

/* Full-Screen Modal (for clinic list) */
.dictation-modal-full {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dictation-overlay-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dictation-modal-content-full {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(26, 208, 214, 0.3);
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(26, 208, 214, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: dictationModalSlideIn 0.3s ease-out;
}

@keyframes dictationModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dictation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(26, 208, 214, 0.2);
}

.dictation-header h3 {
  margin: 0;
  color: #1a2b5c;
  font-size: 1.3rem;
  font-weight: 700;
}

.dictation-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #666;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: recordingPulse 1.5s infinite;
}

.status-indicator.recording {
  background: #ef4444;
}

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

.dictation-body {
  margin-bottom: 24px;
}

/* Compact modal body */
.dictation-modal-content-compact .dictation-body {
  margin-bottom: 24px;
}

/* Full modal body */
.dictation-modal-content-full .dictation-body {
  margin-bottom: 32px;
}

.waveform-container {
  position: relative;
  background: #f8fafc;
  border: 2px solid rgba(26, 208, 214, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
}

/* Full modal waveform - larger */
.dictation-modal-content-full .waveform-container {
  padding: 20px;
  margin-bottom: 24px;
  min-height: 140px;
}

/* Bar waveform container for compact modal */
.waveform-container-bars {
  position: relative;
  background: #f8fafc;
  border: 2px solid rgba(26, 208, 214, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 112px;
}

.wave-bar-compact {
  width: 4px;
  height: 4px;
  background: rgba(26, 208, 214, 0.8);
  border-radius: 2px;
  transition: height 0.2s ease;
}

#waveformCanvas {
  display: block;
  max-width: 100%;
}

.waveform-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.recording-pulse {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(26, 208, 214, 0.3);
  border-radius: 50%;
  animation: waveformPulse 2s infinite;
}

/* Full modal pulse - larger */
.dictation-modal-content-full .recording-pulse {
  width: 60px;
  height: 60px;
}

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

.transcription-container {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(26, 208, 214, 0.2);
  border-radius: 8px;
  padding: 20px;
  min-height: 80px;
}

.transcription-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcription-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #1a2b5c;
  font-weight: 500;
  min-height: 1.6em;
  word-wrap: break-word;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: rgba(26, 208, 214, 0.8);
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}

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

.dictation-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dictation-footer .btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.dictation-footer .btn-secondary {
  background: rgba(107, 114, 128, 0.1);
  border: 1px solid rgba(107, 114, 128, 0.3);
  color: #374151;
}

.dictation-footer .btn-secondary:hover {
  background: rgba(107, 114, 128, 0.2);
  border-color: rgba(107, 114, 128, 0.5);
}

.dictation-footer .btn-primary {
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.9), rgba(26, 208, 214, 0.7));
  border: 1px solid rgba(26, 208, 214, 0.5);
  color: white;
}

.dictation-footer .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(26, 208, 214, 1), rgba(26, 208, 214, 0.8));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 208, 214, 0.3);
}

.dictation-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================================
   CHAT MESSAGE STYLES FOR BAG PANEL
   ======================================== */

.chat-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.chat-message.user {
  align-items: flex-end;
}

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

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  position: relative;
  word-wrap: break-word;
}

.user-message {
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.9), rgba(26, 208, 214, 0.7));
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant-message {
  background: rgba(255, 255, 255, 0.9);
  color: #1a2b5c;
  border: 1px solid rgba(26, 208, 214, 0.2);
  border-bottom-left-radius: 4px;
}

.message-content p {
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.message-content p:last-of-type {
  margin-bottom: 0;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.assistant-message .message-time {
  text-align: left;
}

.ai-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.btn-small.btn-primary {
  background: rgba(26, 208, 214, 0.8);
  color: white;
}

.btn-small.btn-primary:hover {
  background: rgba(26, 208, 214, 1);
  transform: translateY(-1px);
}

.btn-small.btn-secondary {
  background: rgba(107, 114, 128, 0.1);
  color: #374151;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.btn-small.btn-secondary:hover {
  background: rgba(107, 114, 128, 0.2);
  border-color: rgba(107, 114, 128, 0.3);
}

.btn-small.btn-success {
  background: rgba(34, 197, 94, 0.9);
  color: white;
  border: 1px solid rgba(34, 197, 94, 0.5);
  cursor: default;
}

.btn-small.btn-success:hover {
  background: rgba(34, 197, 94, 0.9);
  transform: none;
}

.btn-small:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

/* ====== New Dashboard Split Screen Layout ====== */
.split-screen-container {
  display: flex;
  /* Removed fixed height and overflow to allow natural content flow */
  min-height: 500px; /* Minimum height for aesthetics */
  gap: 2px;
}

.left-panel {
  width: 35%;
  max-width: 35%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  /* Removed overflow: hidden to allow natural content flow */
  transition: width 0.3s ease, max-width 0.3s ease;
}

.right-panel {
  width: auto;
  min-width: 80px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.bag-container {
  position: fixed;
  top: 120px;
  right: 20px;
  z-index: 1000;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  transition: right 0.3s ease;
}

.bag-container.open {
  right: 430px;
}



/* Stack of Circles Icon */
.stack-circles {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(26, 208, 214, 0.8);
  border: 1px solid rgba(26, 208, 214, 0.4);
}

.circle-1 {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.circle-2 {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.circle-3 {
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
}
.circle-2 {
  top: 13px;
  left: 20%;
}

.circle-3 {
  top: 13px;
  right: 20%;
}

/* Left Panel Specific Styles */
.left-panel .list-container {
  flex: 1;
  /* Removed overflow: hidden to allow natural content flow */
  display: flex;
  flex-direction: column;
}

.left-panel .list-content {
  flex: 1;
  /* Removed overflow-y: auto to allow natural content flow */
}

.left-panel .list-table {
  /* Removed fixed height to allow natural content flow */
}

.left-panel .table-body {
  /* Removed max-height and overflow-y to allow natural content flow */
}

/* Right Panel Specific Styles */
.right-panel {
  position: relative;
}

.right-panel .right-rail {
  position: relative;
  width: 100%;
  /* Removed fixed height to allow natural content flow */
  min-height: 400px; /* Minimum height for aesthetics */
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.right-panel .right-rail.open {
  transform: none;
}

.right-panel .rr-content {
  /* Removed fixed height to allow natural content flow */
  display: flex;
  flex-direction: column;
}

.right-panel .rr-thread {
  flex: 1;
  /* Removed overflow-y: auto to prevent nested scrolling */
  margin: 20px 0;
}

.right-panel .composer-wrapper {
  margin-top: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .split-screen-container {
    flex-direction: column;
    height: auto;
  }
  
  .left-panel, .right-panel {
    min-height: 400px;
  }
}


/* ====== Simplified Patient Card Styles ====== */
.patient-card {
  padding: 24px;
  margin: 20px;
  background: white;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  backdrop-filter: none;
}

.patient-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.patient-name {
  color: #1f2937;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.encounter-date {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 400;
}

.task-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.task-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a8d96;
  flex-shrink: 0;
}

/* ===== Mobile shell (namespaced styles) ===== */
.mobile-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 10px 10px 84px;
  background: #fff;
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding-top: 8px;
}

.patient-strip-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  padding: 0 8px 4px;
}

.patient-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 6px;
}

.patient-chip,
.patient-chip.add-chip {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid rgba(26, 208, 214, 0.35);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(26, 208, 214, 0.1);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.patient-chip .chip-initials {
  color: #000;
}

.patient-chip.active {
  border-color: var(--teal2);
  box-shadow: 0 6px 22px rgba(26, 208, 214, 0.25);
}

.patient-chip.add-chip span {
  font-size: 28px;
  color: rgba(0, 0, 0, 0.8);
}

.mobile-encounter-card .encounter-header h5 {
  font-weight: 800;
}

.mobile-encounter-card .enc-title {
  font-weight: 700;
  margin: 8px 0 6px;
  color: #1a2b5c;
}

.mobile-encounter-card .task-items,
.mobile-encounter-card .note-items,
.mobile-encounter-card .billing-items,
.mobile-encounter-card .requisition-items {
  min-height: 24px;
}

.mobile-shell .mobile-transcript {
  margin-top: 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mobile-shell .mobile-transcript .transcript-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

.mobile-shell .mobile-transcript .transcript-content {
  max-height: 160px;
  overflow-y: auto;
}

.mobile-shell .dictation-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: #fff;
  border: 2px solid rgba(26, 208, 214, 0.35);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(26, 208, 214, 0.12);
  padding: 12px;
  z-index: 50;
}

.mobile-shell .dictation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mobile-shell .dictation-status {
  font-weight: 700;
  color: #313433;
}

/* Old mobile-specific slide CSS removed - using universal .slide-track and .slide-knob styles instead */
/* Device toggle buttons removed - auto mode handles responsive switching */

.is-mobile .right-rail {
  display: none !important;
}

.task-text {
  color: #374151;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

/* ===== SASSY MOBILE UI WITH SLIDE-TO-RECORDING ===== */

/* CSS Variables for layout calculations */
:root {
  --recording-pane-height: 200px; /* Approximate height of fixed recording pane */
  --mobile-header-height: 92px; /* Height of mobile header (updated for 2-row center content) */
}

/* Mobile Header (Fixed at top - visible only in mobile mode) */
.mobile-header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  display: none; /* Hidden by default - shown in mobile mode */
}

.mobile-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
}

.mobile-header-left {
  display: flex;
  flex-direction: column; /* Stack vertically: logo on top, text underneath */
  align-items: center;
  gap: 2px; /* Reduced gap for vertical stack */
  flex: 1;
  min-width: 0;
}

.mobile-logo {
  width: 24px; /* Slightly smaller for stacked layout */
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.mobile-brand {
  font-size: 0.7rem; /* Smaller for vertical stack */
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.5px; /* Slightly wider spacing for readability */
  text-transform: uppercase; /* Makes smaller text more readable */
}

.mobile-header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.mobile-datetime {
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
}

.mobile-date {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 2px;
}

.mobile-time {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.mobile-displaying {
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  touch-action: manipulation;
}

.mobile-displaying:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.mobile-displaying:active {
  transform: scale(0.97);
}

.mobile-displaying.showing-past {
  background: rgba(255, 193, 7, 0.3);
  color: #fff;
}

.mobile-displaying.showing-future {
  background: rgba(13, 202, 240, 0.3);
  color: #fff;
}

.mobile-header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.btn-mobile-note-type {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-right: 8px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-mobile-note-type:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

.btn-mobile-logout {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.btn-mobile-logout:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* Mobile Shell - 3-Zone Flexbox Layout */
.mobile-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8f9fa;
  padding: 0;
  padding-top: var(--mobile-header-height); /* Space for fixed header */
  padding-bottom: var(--recording-pane-height); /* Space for fixed recording pane */
  overflow-y: auto; /* Single scrollable container for all content */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* TOP ZONE: Other Encounters (Naturally Expanding List) */
.other-encounters-zone {
  padding: 12px;
  padding-bottom: 8px;
  /* No flex or overflow - let it naturally expand within parent's scrollable container */
}

.encounters-header {
  background: rgba(26, 208, 214, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.encounters-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Encounter Chip List */
.encounter-chip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.encounter-chip {
  background: #fff;
  border: 2px solid rgba(26, 208, 214, 0.2);
  border-left: 4px solid rgba(26, 208, 214, 0.4);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.encounter-chip:active {
  transform: scale(0.98);
}

.encounter-chip {
  touch-action: manipulation;
}

/* Smooth transitions for processing status badges */
.processing-status-badge {
  transition: all 0.3s ease;
}

/* Purple processing badge - matches desktop "Gladstone is thinking" style */
.badge-processing-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
  animation: processingPulse 2s ease-in-out infinite;
}

.badge-processing-purple i {
  color: #ffffff;
}

/* Pulse animation matching desktop */
@keyframes processingPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.6);
    transform: scale(1.02);
  }
}

.encounter-chip.active {
  border-color: var(--teal2);
  border-left-color: var(--teal1);
  background: rgba(26, 208, 214, 0.04);
  box-shadow: 0 4px 12px rgba(26, 208, 214, 0.15);
}

/* Selected Active Chip - highlighted in list for active encounters */
.selected-active-chip {
  border: 3px solid var(--teal1) !important;
  border-left: 6px solid var(--teal1) !important;
  background: rgba(26, 208, 214, 0.12) !important;
  box-shadow: 0 8px 24px rgba(26, 208, 214, 0.35) !important;
  cursor: default !important;
  transform: scale(1.01);
  animation: subtlePulse 2.5s ease-in-out infinite;
  font-weight: 600;
}

/* Make the selected chip's patient name bold */
.selected-active-chip .chip-patient {
  font-weight: 700 !important;
  color: #0d9ea3 !important;
}

/* Expanded Completed Chip - accordion style expansion with same highlight */
.encounter-chip.expanded-completed {
  max-height: 2000px !important; /* Allow expansion */
  overflow: visible !important;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding-bottom: 16px !important;
}

/* Expanded content wrapper */
.expanded-content-wrapper {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid rgba(26, 208, 214, 0.2);
  animation: expandFadeIn 0.35s ease-out;
}

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

/* Expanded sections styling */
.expanded-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Subtle pulse animation for selected active chip */
@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(26, 208, 214, 0.35);
  }
  50% {
    box-shadow: 0 10px 32px rgba(26, 208, 214, 0.45);
  }
}

.chip-main {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  touch-action: manipulation;
}

.chip-status {
  font-size: 12px;
  line-height: 1;
}

.chip-patient {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
}

.chip-time {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state i {
  font-size: 48px;
  opacity: 0.3;
}

/* Mobile Loading Spinner */
.mobile-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.mobile-loading-spinner i {
  color: var(--teal2);
  margin-bottom: 12px;
}

.mobile-loading-spinner p {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Slide Animation Classes */
.encounter-chip.moving-to-selected,
.encounter-chip.moving-to-list {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 200;
  box-shadow: 0 12px 32px rgba(26, 208, 214, 0.4);
  will-change: transform;
}

.encounter-chip-placeholder {
  transition: all 0.3s ease;
}

/* MIDDLE ZONE: Selected Encounter (just above recording pane) */
.selected-encounter-zone {
  flex-shrink: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  background: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 16px rgba(26, 208, 214, 0.15);
  margin: 0 12px;
}

.selected-encounter-zone.expanded {
  max-height: 60vh;
  opacity: 1;
  overflow-y: auto;
}

.expanded-encounter-card {
  padding: 16px;
  animation: expandIn 0.25s ease;
}

@keyframes expandIn {
  from {
    opacity: 0;
    transform: scaleY(0.95);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.expanded-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(26, 208, 214, 0.2);
  margin-bottom: 16px;
}

.expanded-header h6 {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.btn-collapse {
  background: rgba(26, 208, 214, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #1a8d96;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.btn-collapse:active {
  background: rgba(26, 208, 214, 0.2);
}

.expanded-content {
  /* Content container */
}

.detail-section {
  margin-bottom: 16px;
}

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

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.section-label i {
  color: var(--teal2);
}

.task-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
  color: #374151;
}

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

.note-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(26, 208, 214, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(26, 208, 214, 0.2);
}

/* BOTTOM ZONE: Recording Pane (FIXED at screen bottom) */
.dictation-bar-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid rgba(26, 208, 214, 0.3);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 100;
}

/* Patient Context Bar (Attached to top of recording panel) */
.patient-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: -12px -12px 16px -12px; /* Extend to edges of parent */
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.08), rgba(26, 208, 214, 0.05));
  border-bottom: 2px solid rgba(26, 208, 214, 0.2);
  border-radius: 0; /* No border radius since it's flush with panel */
}

.patient-context-bar .context-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.patient-context-bar .context-patient-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

.patient-context-bar .context-encounter-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.patient-context-bar .context-date {
  color: #6b7280;
  font-weight: 500;
}

.patient-context-bar .context-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.patient-context-bar .context-status-badge.active {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.patient-context-bar .context-status-badge.complete {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.patient-context-bar .context-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.patient-context-bar .context-delete-btn,
.patient-context-bar .context-close-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 208, 214, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--teal2);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.patient-context-bar .context-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: translateY(-2px);
}

.patient-context-bar .context-delete-btn:active {
  transform: scale(0.95);
  background: rgba(239, 68, 68, 0.25);
}

.patient-context-bar .context-close-btn:hover {
  background: rgba(26, 208, 214, 0.2);
  transform: translateY(-2px);
}

.patient-context-bar .context-close-btn:active {
  transform: scale(0.95);
}

.dictation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dictation-status {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

#dictationStopBtn {
  min-width: 80px;
  padding: 6px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* Slide Track for Recording */
.slide-track {
  position: relative;
  height: 60px;
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.08), rgba(26, 208, 214, 0.15));
  border-radius: 30px;
  border: 2px solid rgba(26, 208, 214, 0.3);
  overflow: hidden;
  margin-bottom: 12px;
  touch-action: none;
  user-select: none;
}

.slide-knob {
  position: absolute;
  left: 4px;
  top: 2px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(26, 208, 214, 0.4);
  transition: all 0.2s ease;
  cursor: grab;
  z-index: 2;
}

.slide-knob:active {
  cursor: grabbing;
  /* Don't override transform - let JavaScript handle positioning */
}

/* Transcript Display */
.mobile-transcript {
  max-height: 150px;
  overflow-y: auto;
  background: rgba(26, 208, 214, 0.04);
  border: 1px solid rgba(26, 208, 214, 0.2);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.transcript-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.transcript-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1f2937;
}

#transcriptInterim {
  opacity: 0.6;
  font-style: italic;
}

/* Mobile Actions (bottom buttons) */
.mobile-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-mobile-action {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgba(26, 208, 214, 0.3);
  background: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-mobile-action:active {
  transform: scale(0.97);
}

.btn-mobile-primary {
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  color: #fff;
  border-color: var(--teal2);
}

.btn-mobile-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: #059669;
}

.btn-mobile-success:active {
  transform: scale(0.97);
}

.btn-mobile-success:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast Notifications */
.mobile-toast {
  position: fixed;
  bottom: calc(var(--recording-pane-height) + 8px); /* Just above recording panel */
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease, bottom 0.3s ease;
  z-index: 10000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: calc(100% - 32px); /* Prevent overflow on small screens */
}

.mobile-toast.show {
  opacity: 1;
}

.mobile-toast.toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.mobile-toast.toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* Mobile Clinical Note Card */
.mobile-note-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

.mobile-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #1f2937;
  font-weight: 600;
}

.mobile-note-title {
  font-size: 1rem;
}

.mobile-note-time {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 400;
}

.mobile-note-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
}

.mobile-note-excerpt,
.mobile-note-full {
  margin-bottom: 12px;
}

.mobile-note-expand-btn {
  background: none;
  border: none;
  color: var(--teal2);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-note-expand-btn:active {
  transform: scale(0.98);
}

.mobile-note-expand-btn .expand-icon {
  transition: transform 0.3s ease;
}

/* Mobile Card Shared Styles */
.mobile-corr-card,
.mobile-req-card {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

.mobile-corr-card:active,
.mobile-req-card:active {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.mobile-card-header {
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: manipulation;
}

.mobile-card-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
}

.mobile-toggle-icon {
  font-size: 0.7rem;
  color: #9ca3af;
  transition: transform 0.3s ease;
}

.mobile-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 28px;
}

.mobile-card-content {
  padding: 0 16px 16px;
  display: none;
  animation: slideDown 0.3s ease;
}

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

.mobile-corr-body,
.mobile-req-body {
  background: rgba(26, 208, 214, 0.04);
  border-left: 3px solid var(--teal2);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
}

.mobile-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mobile-card-actions .btn {
  min-height: 36px;
  touch-action: manipulation;
}

/* Mobile Correspondence Specific */
.mobile-corr-card {
  border-left: 4px solid #3b82f6;
}

/* Mobile Requisition Specific */
.mobile-req-card {
  border-left: 4px solid #10b981;
}

/* Search/Add Patient Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
}

.search-modal.show .search-modal-backdrop {
  opacity: 1;
}

.search-modal.show .search-modal-content {
  transform: translateY(0);
}

.search-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-modal-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.search-modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  color: #fff;
  border-radius: 20px 20px 0 0;
}

.search-modal-header h5 {
  font-weight: 700;
  margin: 0;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
  line-height: 1;
}

.btn-modal-close i {
  display: block;
  line-height: 1;
}

.btn-modal-close:active {
  background: rgba(255, 255, 255, 0.3);
}

.search-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Search Input */
.search-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 12px 12px 42px;
  border: 2px solid rgba(26, 208, 214, 0.3);
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--teal2);
  box-shadow: 0 0 0 3px rgba(26, 208, 214, 0.1);
}

/* Search Results */
.search-results,
.recent-patients-section {
  margin-bottom: 24px;
}

.search-results-label,
.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.recent-patients-list,
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-patient-item,
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 56px;
  touch-action: manipulation;
}

.recent-patient-item:active,
.search-result-item:active {
  transform: scale(0.98);
  background: rgba(26, 208, 214, 0.04);
  border-color: var(--teal2);
}

.patient-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.patient-info {
  flex: 1;
}

.patient-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
  margin-bottom: 2px;
}

.patient-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Quick Add Form */
.quick-add-section {
  background: rgba(26, 208, 214, 0.04);
  border: 2px solid rgba(26, 208, 214, 0.2);
  border-radius: 12px;
  padding: 16px;
}

.quick-add-form {
  margin-top: 12px;
}

.quick-add-form .form-control,
.quick-add-form .form-select {
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.quick-add-form .form-control:focus,
.quick-add-form .form-select:focus {
  border-color: var(--teal2);
  box-shadow: 0 0 0 3px rgba(26, 208, 214, 0.1);
}

.quick-add-form button[type="submit"] {
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  border: none;
  padding: 12px;
  font-weight: 600;
  border-radius: 10px;
  transition: transform 0.2s ease;
}

.quick-add-form button[type="submit"]:active {
  transform: scale(0.98);
}

/* Date Filter Modal - Quick Navigation */
.date-quick-nav {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.date-quick-nav .btn {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
  border: 2px solid;
}

.date-quick-nav .btn-primary {
  background: linear-gradient(135deg, var(--teal1), var(--teal2));
  border-color: var(--teal2);
}

.date-quick-nav .btn-outline-primary {
  background: transparent;
  border-color: var(--teal2);
  color: var(--teal2);
}

.date-quick-nav .btn-outline-primary:hover,
.date-quick-nav .btn-outline-primary:active {
  background: rgba(26, 208, 214, 0.1);
  border-color: var(--teal2);
  color: var(--teal2);
}

.date-quick-nav .btn:active {
  transform: scale(0.96);
}

/* Date Picker Wrapper */
.date-picker-wrapper {
  margin-top: 20px;
  padding: 16px;
  background: rgba(26, 208, 214, 0.04);
  border: 2px solid rgba(26, 208, 214, 0.15);
  border-radius: 12px;
}

.date-picker-wrapper input[type="date"] {
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
}

.date-picker-wrapper input[type="date"]:focus {
  border-color: var(--teal2);
  box-shadow: 0 0 0 3px rgba(26, 208, 214, 0.1);
}

/* Note Type Selector Modal */
.note-type-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-type-option {
  background: #fff;
  border: 2px solid rgba(26, 208, 214, 0.2);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.note-type-option:hover {
  border-color: rgba(26, 208, 214, 0.4);
  background: rgba(26, 208, 214, 0.02);
}

.note-type-option:active {
  transform: scale(0.98);
}

.note-type-option.selected {
  background: linear-gradient(135deg, rgba(26, 208, 214, 0.08), rgba(26, 208, 214, 0.05));
  border-color: var(--teal2);
  border-width: 3px;
}

.note-type-option-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.note-type-icon {
  font-size: 1.8rem;
  color: var(--teal2);
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.note-type-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.note-type-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
}

.note-type-description {
  font-size: 0.85rem;
  color: #6b7280;
}

.note-type-check {
  font-size: 1.3rem;
  color: var(--teal2);
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.note-type-option.selected .note-type-check {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mobile-shell {
    min-height: 100vh;
  }

  .search-modal-content {
    max-height: 90vh;
  }
}
/* ====== Updated Panel Sizing and Layout ====== */
.left-panel, .right-panel {
  flex: 1;
  background: white;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  /* Removed overflow: hidden and max-height to allow natural content flow */
  min-height: 600px;
}


.panel-title {
  margin: 0;
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Update patient card to remove extra styling since panel handles it */
.patient-card {
  padding: 24px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
}

/* Right panel adjustments */
.right-panel .closed-bag-btn {
  background: none;
  border: none;
  padding: 0;
  position: relative;
}

.right-panel .closed-bag-btn img {
  width: 50px !important;
  height: 50px !important;
}


/* ====== AI Assistant Content Styling ====== */
.ai-assistant-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 20px;
}

.ai-greeting {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 15px;
}

.ai-greeting .greeting-text {
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

.ai-chat-thread {
  flex: 1;
  /* Removed overflow-y: auto - parent panel handles scrolling */
  padding: 10px 0;
  min-height: 200px;
}

.welcome-message {
  margin-bottom: 15px;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 8px;
}

.ai-message {
  background: #f3f4f6;
  color: #374151;
  border-bottom-left-radius: 4px;
}

.ai-message p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.quick-action-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.message-composer {
  margin-top: auto;
}

.composer-form {
  width: 100%;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px;
}

.input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 0.9rem;
  color: #374151;
  padding: 8px;
  font-family: inherit;
}

.input-wrapper textarea::placeholder {
  color: #9ca3af;
}

.composer-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mic-btn, .send-btn {
  background: #1a8d96;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mic-btn:hover, .send-btn:hover {
  background: #147c85;
}

.mic-btn i, .send-btn i {
  color: white;
  font-size: 0.85rem;
}




.panel-spacer {
  flex: 1;
}

.panel-icon-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.panel-icon-right .closed-bag-btn {
  background: none;
  border: none;
  padding: 0;
  position: relative;
}

.panel-icon-right .closed-bag-btn img {
  width: 50px !important;
  height: 50px !important;
}


/* ====== Remove Bag Button Outline ====== */
.panel-icon-right .bag-btn, 
.panel-icon-right .open-bag-btn {
  background: none;
  border: none;
  padding: 0;
  outline: none;
  position: relative;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.panel-icon-right .bag-btn:hover,
.panel-icon-right .open-bag-btn:hover {
  transform: translateY(-2px) scale(1.05);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2)) drop-shadow(0 4px 12px rgba(26, 208, 214, 0.3));
}

.panel-icon-right .bag-btn:focus, 
.panel-icon-right .open-bag-btn:focus {
  outline: none;
  box-shadow: none;
}

.panel-icon-right .bag-btn:active, 
.panel-icon-right .open-bag-btn:active {
  outline: none;
  transform: translateY(-1px) scale(1.02);
}


/* ====== Separate Panel Layout ====== */
.document-viewer-panel {
  width: 60%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  /* Removed all height/overflow constraints - let content flow naturally */
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateX(-50%) scale(0.95);
  opacity: 0;
  position: fixed;
  top: 160px;
  left: 50%;
  z-index: 1000;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
}

.document-viewer-panel.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.document-viewer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.document-viewer-backdrop.show {
  opacity: 1;
}

.ai-chat-panel {
  width: 400px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  /* Changed to overflow-y: auto so panel itself scrolls */
  overflow-y: auto;
  max-height: calc(100vh - 160px); /* Use max-height instead of height for flexibility */
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateX(100%);
  opacity: 0;
  position: fixed;
  top: 80px;
  right: 10px;
  z-index: 900;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 600;
}

.ai-chat-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ai-chat-thread {
  flex: 1;
  padding: 20px;
  /* Removed overflow-y: auto - parent panel handles scrolling */
}

.welcome-message {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border-left: 4px solid #3b82f6;
}

.message-bubble {
  background: rgba(243, 244, 246, 0.8);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.message-bubble p {
  margin: 0;
  color: #374151;
  line-height: 1.4;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 20px;
}

.quick-action-btn {
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 0.9rem;
}

.quick-action-btn:hover {
  background: #e5e7eb;
  border-color: rgba(0, 0, 0, 0.2);
}

.message-composer {
  padding: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.composer-form {
  background: white;
  border-radius: 25px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
}

#composer-input-new {
  flex: 1;
  border: none;
  padding: 12px 16px;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
}

.composer-buttons {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.mic-btn, .send-btn {
  background: #3b82f6;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mic-btn:hover, .send-btn:hover {
  background: #2563eb;
}

.close-doc-btn {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.close-doc-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* ====== Document Viewer Styling ====== */
.document-viewer-content {
  display: flex;
  flex-direction: column;
  /* Removed height: 100% to allow natural content flow */
  background: white;
}

.document-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.document-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 600;
}

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

.doc-action-btn {
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 8px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-action-btn:hover {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.2);
  color: #374151;
}

.document-display {
  /* No flex or height constraints - content flows naturally */
  padding: 24px;
  background: white;
  /* Content loaded via fetch will expand as needed */
}

/* Dashboard container - ensure natural flow */
.dashboard-container {
  display: flex;
  gap: 20px;
  /* No height constraints - content flows naturally */
}

/* Left sidebar */
.left-sidebar {
  flex-shrink: 0;
  width: 350px;
  /* No height constraints */
}

/* Main content area - expands to fit content */
.main-content {
  flex: 1;
  /* No height constraints - content flows naturally */
}

/* Document viewer - in normal page flow, not a modal */
.document-viewer {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  /* Allow natural content flow - no height constraints */
}

/* No iframe-specific styling needed - content loaded via fetch flows naturally */

.no-document-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 16px;
}

.no-document-message p {
  margin: 0;
  font-size: 1rem;
}

/* Medical Document Styling */
.medical-document {
  max-width: 100%;
  font-family: 'Times New Roman', serif;
  line-height: 1.6;
  color: #1f2937;
}

.document-header-section {
  border-bottom: 2px solid #1f2937;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.document-header-section h2 {
  margin: 0 0 12px 0;
  color: #1f2937;
  font-size: 1.8rem;
  font-weight: bold;
}

.patient-info {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 4px solid #1a8d96;
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.document-section h3 {
  color: #1a8d96;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}

.document-section p {
  margin: 0 0 12px 0;
  text-align: justify;
}

.document-section ul {
  margin: 8px 0;
  padding-left: 20px;
}

.document-section li {
  margin: 6px 0;
}

.document-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Clickable Task Item Styling */
.task-item.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 -12px;
}

.task-item.clickable:hover {
  background: rgba(26, 141, 150, 0.1);
  transform: translateX(4px);
}

.task-item.clickable.active {
  background: rgba(26, 141, 150, 0.15);
  border-left: 3px solid #1a8d96;
  padding-left: 9px;
}

.task-item.clickable.active .task-bullet {
  background: #1a8d96;
  box-shadow: 0 0 8px rgba(26, 141, 150, 0.4);
}

/* ====== Tab Navigation Styling ====== */
.tab-nav {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px 8px 0 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px 8px 0 0;
  min-width: 120px;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #374151;
}

.tab-btn.active {
  background: white;
  color: var(--teal1);
  border-bottom: 2px solid var(--teal1);
}

.tab-content {
  flex: 1;
  overflow: hidden;
  background: white;
  border-radius: 0 0 12px 12px;
}

.tab-pane {
  display: none;
  /* Removed height: 100% and overflow-y: auto to allow natural content flow */
  background: white;
}

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


/* ====== Billing Content ====== */
.billing-content {
  padding: 20px;
}

.billing-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--teal1);
}

.billing-item .code {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: var(--teal1);
  margin-right: 16px;
  min-width: 60px;
}

.billing-item .description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* ====== Database Icon Styling ====== */
.database-icon {
  display: block;
  object-fit: contain;
  filter: brightness(1) contrast(1);
}

/* ====== MOBILE UI PREMIUM STYLES ====== */

/* Mobile Section Structure - Premium Card Style */
.mobile-section {
    margin: 12px 16px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
    transition: box-shadow 0.2s, transform 0.1s !important;
    border-bottom: none !important;
}

.mobile-section:active {
    transform: scale(0.98);
}

.mobile-section-header {
    padding: 14px 16px !important;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    user-select: none;
    background: white !important;
    touch-action: manipulation;
}

.mobile-section-header:hover {
    background-color: #fafafa !important;
}

.mobile-section-header:active {
    background-color: #f0f0f0 !important;
}

.mobile-section.empty .mobile-section-header {
    opacity: 0.6;
}

.mobile-section-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #2c3e50 !important;
    flex: 1 !important;
    margin: 0 !important;
}

.mobile-section-title span {
    color: #2c3e50 !important;
}

.mobile-section-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 13px !important;
    color: #CD7F32 !important;
    flex-shrink: 0 !important;
}

.mobile-section-chevron.expanded {
    transform: rotate(180deg) !important;
}

.mobile-section-icon {
    font-size: 17px !important;
    color: #CD7F32 !important;
    width: 22px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

.mobile-section.empty .mobile-section-title span {
    color: #95a5a6 !important;
}

.mobile-section.empty .mobile-section-icon {
    opacity: 0.5 !important;
}

.mobile-section.empty .mobile-section-chevron {
    color: #95a5a6 !important;
}

.mobile-section-content {
    padding: 0 !important;
    background: #fafafa !important;
}

.mobile-section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #CD7F32;
    flex-shrink: 0;
}

/* Selected Encounter Zone - Fixed Drawer (Above Note Selector & Recording Panel) */
.selected-encounter-zone {
    /* Flow layout - sits naturally below other-encounters-zone in mobile-shell */
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: transparent !important;
    padding-bottom: 12px !important;
}

.selected-encounter-zone.expanded {
    max-height: 2000px !important; /* Large enough for any encounter card, naturally expands */
    /* Parent (.mobile-shell) handles scrolling, no overflow here */
}

/* Expanded Encounter Card - Drawer Style */
.expanded-encounter-card {
    background: white !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(100%) !important;
    opacity: 0 !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-bottom: -1px !important; /* Overlap 1px to ensure flush connection with note selector */
}

.selected-encounter-zone.expanded .expanded-encounter-card {
    transform: translateY(0) !important;
    opacity: 1 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.16) !important;
}

.expanded-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 18px 20px !important;
    background: white !important;
    border-bottom: 1px solid #e9ecef !important;
}

.expanded-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
}

.expanded-header-left h6 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    line-height: 1.3 !important;
}

.btn-collapse {
    background: none !important;
    border: none !important;
    color: #CD7F32 !important;
    font-size: 20px !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: transform 0.2s !important;
    flex-shrink: 0 !important;
}

.btn-collapse:hover {
    transform: scale(1.1) !important;
}

.btn-collapse i {
    color: #CD7F32 !important;
}

.encounter-status-badge {
    padding: 6px 14px !important;
    border-radius: 14px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    align-self: center !important;
}

.encounter-status-badge.active {
    background: rgba(205, 127, 50, 0.12) !important;
    color: #CD7F32 !important;
}

.encounter-status-badge.complete {
    background: rgba(40, 167, 69, 0.12) !important;
    color: #28a745 !important;
}

.expanded-content {
    padding-bottom: 16px !important;
}

/* Mobile Content Items */
.mobile-content-item {
    padding: 14px 16px !important;
    border-bottom: 1px solid #e9ecef !important;
    display: flex !important;
    align-items: flex-start !important;
    font-size: 14px !important;
    color: #2c3e50 !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    background: white !important;
}

.mobile-content-item:last-child {
    border-bottom: none !important;
}

.mobile-content-item:hover {
    background-color: #f8f9fa !important;
}

.mobile-content-item:active {
    background-color: #f0f0f0 !important;
}

.mobile-content-item i {
    margin-right: 10px !important;
    margin-top: 2px !important;
    color: #CD7F32 !important;
    flex-shrink: 0 !important;
}

.mobile-content-item span {
    color: #2c3e50 !important;
    line-height: 1.5 !important;
}

/* Collapsible Item Cards (correspondence, requisitions) */
.mobile-collapsible-card {
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    border-radius: 0 !important;
    overflow: hidden !important;
}

.mobile-collapsible-card:last-child {
    border-bottom: none !important;
}

.mobile-card-header {
    padding: 14px 16px !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: white !important;
    transition: background-color 0.2s ease !important;
    user-select: none !important;
    touch-action: manipulation !important;
}

.mobile-card-header:hover {
    background-color: #f8f9fa !important;
}

.mobile-card-header:active {
    background-color: #f0f0f0 !important;
}

.mobile-card-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-weight: 500 !important;
    color: #2c3e50 !important;
    font-size: 14px !important;
    flex: 1 !important;
}

.mobile-card-title i {
    color: #CD7F32 !important;
    flex-shrink: 0 !important;
}

.mobile-item-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 11px !important;
    color: #CD7F32 !important;
    flex-shrink: 0 !important;
}

.mobile-item-chevron.expanded {
    transform: rotate(180deg) !important;
}

.mobile-card-body {
    padding: 16px !important;
    border-top: 1px solid #e9ecef !important;
    background: #fafafa !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #2c3e50 !important;
    /* Scrollable container for long correspondence */
    max-height: 400px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.mobile-card-body p {
    margin: 0 0 12px 0 !important;
    color: #2c3e50 !important;
}

.mobile-card-body p:last-child {
    margin-bottom: 0 !important;
}

/* ====== MOBILE CONTENT CARDS (Clinical Notes & Correspondence) ====== */

/* Mobile content cards - clinical notes and correspondence */
.mobile-content-card {
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
}

.mobile-content-preview,
.mobile-content-full {
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Scrollable container for expanded full content */
.mobile-content-full {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    background: #fafafa;
    border-radius: 6px;
    margin: 8px 0;
    /* Smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

/* Expand button styling */
.mobile-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: rgba(26, 208, 214, 0.1);
    border: none;
    border-radius: 6px;
    color: var(--teal1);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-expand-btn:hover {
    background: rgba(26, 208, 214, 0.2);
}

.mobile-expand-btn:active {
    background: rgba(26, 208, 214, 0.25);
    transform: scale(0.98);
}

.mobile-expand-btn .expand-icon {
    transition: transform 0.2s ease;
}

/* Timestamp styling */
.mobile-content-timestamp {
    margin-top: 8px;
    font-size: 12px;
    color: #95a5a6;
    text-align: right;
}

/* ====== MOBILE RECORDING BUTTON (Replaces slide-to-lock) ====== */
.record-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: calc(100% - 32px);
    margin: 12px 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1ad0d6, #00a8b5);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(26, 208, 214, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.record-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 208, 214, 0.25);
}

.record-button:active {
    transform: scale(0.97);
}

.record-button i {
    font-size: 1.3rem;
}

.record-button .record-text {
    font-size: 1rem;
    font-weight: 600;
}

/* Recording state */
.record-button.recording {
    background: linear-gradient(135deg, #dc3545, #bd2130);
    animation: recording-pulse 1.5s infinite;
    will-change: transform, box-shadow; /* GPU acceleration for smooth animation */
}

.record-button.recording i {
    animation: pulse-icon 1.5s infinite;
}

.record-button.recording .record-text {
    animation: none;
}

/* Pulse animation for recording */
@keyframes recording-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(220, 53, 69, 0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(220, 53, 69, 0.35);
        transform: scale(1.01);
    }
}

@keyframes pulse-icon {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.08);
    }
}

/* Recording indicator (for desktop compatibility) */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 12px;
    margin: 12px 16px;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: #dc3545;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

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

.recording-time {
    font-size: 1rem;
    font-weight: 700;
    color: #dc3545;
}

.recording-status {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Hide/show record button based on state */
.record-button.hidden {
    display: none !important;
}

/* Hide slide-track on mobile when using button */
@media (max-width: 768px) {
    .record-button:not(.hidden) {
        display: flex !important;
    }

    .slide-track.d-none {
        display: none !important;
    }
}

/* Show slide-track on desktop (backward compatibility) */
@media (min-width: 769px) {
    .record-button {
        display: none;
    }

    .slide-track {
        display: block !important;
    }
}


.slide-knob.locked {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: locked-pulse 2s infinite;
}

@keyframes locked-pulse {
  0%,
  100% {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.6);
  }
}

/* Bootstrap Modal Fixes - Override custom modal styles */
/* Bootstrap modals use .modal.fade structure, not .modal-overlay */
.modal.fade .modal-backdrop,
.modal-backdrop.fade {
  z-index: 1050 !important;
  position: fixed !important;
}

.modal.fade,
.modal.show {
  z-index: 1055 !important;
  position: fixed !important;
}

.modal.fade .modal-dialog {
  z-index: 1056 !important;
  position: relative;
}

.modal.fade .modal-content,
.modal.show .modal-content {
  z-index: auto !important;
  position: relative;
}

/* Ensure Bootstrap modal backdrop is properly styled */
body > .modal-backdrop {
  z-index: 1050 !important;
  position: fixed !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

/* Ensure patient management modal is on top */
#patientManagementModal,
#deleteConfirmModal {
  z-index: 1055 !important;
}

#patientManagementModal ~ .modal-backdrop,
#deleteConfirmModal ~ .modal-backdrop {
  z-index: 1050 !important;
}

