/* ==========================================================================
   Vial — Medicine Injection Tracker
   Strict Apple Web Design System
   ========================================================================== */

/* 1. Design Tokens & Core Variables */
:root {
  /* System Colors */
  --color-primary: #0066cc; /* Action Blue */
  --color-primary-focus: #0071e3;
  --color-primary-on-dark: #2997ff; /* Sky Link Blue */
  --color-ink: #1d1d1f; /* Near-Black Ink */
  --color-body: #1d1d1f;
  --color-body-on-dark: #ffffff;
  --color-body-muted: #cccccc;
  --color-ink-muted-80: #333333;
  --color-ink-muted-48: #7a7a7a;
  --color-divider-soft: #f0f0f0;
  --color-hairline: #e0e0e0;
  
  /* Surface Canvas Styles */
  --color-canvas: #ffffff;
  --color-canvas-parchment: #f5f5f7; /* Signature Apple Off-white */
  --color-surface-pearl: #fafafc; /* Ghost button fill */
  --color-surface-tile-1: #272729; /* Dark Tile */
  --color-surface-tile-2: #2a2a2c;
  --color-surface-tile-3: #252527;
  --color-surface-black: #000000;
  --color-surface-chip-translucent: rgba(210, 210, 215, 0.64);
  
  /* Status Text Colors */
  --color-on-primary: #ffffff;
  --color-on-dark: #ffffff;
  --color-success: #34c759;
  --color-warning: #ff9500;
  --color-danger: #ff3b30;
  
  /* Border Radius Scale */
  --rounded-none: 0px;
  --rounded-xs: 5px;
  --rounded-sm: 8px; /* Dark utility buttons */
  --rounded-md: 11px; /* Pearl buttons */
  --rounded-lg: 18px; /* Store utility cards */
  --rounded-pill: 9999px; /* Signature Apple pill */
  --rounded-full: 50%;
  
  /* Spacing Scale (8px baseline) */
  --spacing-xxs: 4px;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 17px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  --spacing-section: 80px;
}

/* 2. Global Resets & HTML Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; /* 17px default body font size for signature Apple reading pace */
  color: var(--color-ink);
  background-color: var(--color-canvas);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  background-color: var(--color-canvas);
}

/* 3. Typographic System */
h1, h2, h3, h4, .display-lg, .tagline {
  font-weight: 600;
  letter-spacing: -0.015em; /* Apple tight headline spacing substitute for Inter */
  color: var(--color-ink);
}

.display-lg {
  font-size: 40px;
  line-height: 1.1;
  margin-bottom: var(--spacing-sm);
}

.lead {
  font-size: 24px;
  font-weight: 300; /* Airy light atmosphere text */
  line-height: 1.4;
  color: var(--color-ink-muted-80);
  margin-bottom: var(--spacing-xl);
  max-width: 720px;
}

.tagline {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
  display: block;
}

/* 4. Global Navigation (Apple global-nav style) */
.global-nav {
  background-color: var(--color-surface-black);
  color: var(--color-on-dark);
  height: 44px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.02em;
}

.brand-logo {
  color: var(--color-on-dark);
}

.nav-menu {
  display: flex;
  gap: var(--spacing-xl);
}

.nav-item {
  color: #a1a1a6;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--color-on-dark);
}

.nav-actions {
  display: flex;
  align-items: center;
}

.db-indicator {
  font-size: 10px;
  text-transform: uppercase;
  background-color: #333333;
  color: #86868b;
  padding: 2px 8px;
  border-radius: var(--rounded-pill);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* 5. Sub-Navigation (Apple sub-nav-frosted style) */
.sub-nav-frosted {
  background-color: rgba(245, 245, 247, 0.85); /* 80-85% parchment opacity */
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  height: 52px;
  width: 100%;
  position: sticky;
  top: 44px;
  z-index: 99;
  border-bottom: 1px solid var(--color-hairline);
}

.sub-nav-container {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-nav-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sub-nav-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.sub-nav-stats {
  font-size: 13px;
  color: var(--color-ink-muted-48);
}

/* 6. Buttons Systems */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* System-wide active/pressed scale micro-interaction */
button:active, .weekday-chip:active, .filter-chip:active {
  transform: scale(0.95);
}

.button-primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 14px;
  font-weight: 400;
  padding: 8px 16px;
  border-radius: var(--rounded-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.button-primary:hover {
  background-color: var(--color-primary-focus);
}

.button-primary-accent {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--rounded-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--spacing-md);
  width: 100%;
}

.button-primary-accent:hover {
  background-color: var(--color-primary-focus);
}

.button-secondary-pill {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  font-size: 14px;
  font-weight: 400;
  padding: 10px 22px;
  border-radius: var(--rounded-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.button-secondary-pill:hover {
  background-color: rgba(0, 102, 204, 0.05);
}

.button-pearl-capsule {
  background-color: var(--color-surface-pearl);
  color: var(--color-ink-muted-80);
  font-size: 14px;
  font-weight: 400;
  padding: 10px 20px;
  border-radius: var(--rounded-md);
  border: 1px solid var(--color-hairline);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.button-pearl-capsule:hover {
  background-color: #f1f1f5;
  border-color: #d1d1d6;
}

.button-store-hero {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 16px;
  font-weight: 400; /* Apple-style lighter weight large buttons */
  padding: 12px 28px;
  border-radius: var(--rounded-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.button-store-hero:hover {
  background-color: var(--color-primary-focus);
}

.button-icon-circular {
  width: 44px;
  height: 44px;
  border-radius: var(--rounded-full);
  background-color: rgba(220, 220, 225, 0.5);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-icon-circular:hover {
  background-color: rgba(210, 210, 215, 0.7);
}

.btn-icon {
  stroke-width: 2.5px;
}

/* 7. Product Tiles (Alternating light and off-white layouts) */
.product-tile-light {
  background-color: var(--color-canvas);
  padding: var(--spacing-section) 0;
  display: flex;
  justify-content: center;
}

.product-tile-parchment {
  background-color: var(--color-canvas-parchment);
  padding: var(--spacing-section) 0;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
}

.tile-content {
  max-width: 1024px;
  width: 100%;
  padding: 0 var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 8. Dashboard/Hero Metric Cards */
.summary-cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  width: 100%;
  max-width: 900px;
  margin: var(--spacing-xl) 0;
}

.dashboard-metric-card {
  background-color: var(--color-surface-pearl);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-lg) var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

.dashboard-metric-card:hover {
  border-color: #b5b5ba;
}

.metric-value {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  line-height: 1;
  margin-bottom: var(--spacing-xxs);
}

.metric-label {
  font-size: 13px;
  color: var(--color-ink-muted-48);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.action-buttons-group {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

/* 9. Calendar Component (Weekly Grid) */
.calendar-tile-content {
  align-items: stretch;
  text-align: left;
}

.calendar-wrapper {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  overflow: hidden;
  margin-top: var(--spacing-xl);
}

.calendar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-hairline);
  background-color: var(--color-surface-pearl);
}

.calendar-week-range {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-ink);
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--rounded-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-ink-muted-80);
  background-color: transparent;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background-color: rgba(0,0,0,0.04);
  color: var(--color-ink);
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--color-hairline);
  gap: 1px; /* Clean border separators */
  min-height: 480px;
}

.monthly-day-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--color-surface-pearl);
  border-bottom: 1px solid var(--color-hairline);
  text-align: center;
}

.monthly-day-header-cell {
  padding: var(--spacing-md) var(--spacing-xs);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
  letter-spacing: 0.05em;
}

.monthly-day-cell {
  background-color: var(--color-canvas);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-sm) var(--spacing-xs);
  position: relative;
  transition: background-color 0.2s ease;
  overflow: hidden;
}

.monthly-day-cell.today {
  background-color: rgba(0, 102, 204, 0.015);
}

.monthly-day-cell.other-month {
  background-color: #fafafb;
  color: var(--color-ink-muted-48);
}

.monthly-day-cell-number-bubble {
  width: 26px;
  height: 26px;
  border-radius: var(--rounded-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 6px;
  align-self: flex-start;
}

.monthly-day-cell.today .monthly-day-cell-number-bubble {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.monthly-day-cell.other-month .monthly-day-cell-number-bubble {
  color: var(--color-ink-muted-48);
}

.monthly-day-cell-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
  max-height: 140px;
}

/* Weekly Injection Status styling in the Calendar Day cells */
.calendar-patient-bubble {
  background-color: var(--color-surface-pearl);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  text-align: left;
}

.calendar-patient-bubble:hover {
  border-color: #b5b5ba;
  transform: translateY(-1px);
}

.bubble-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bubble-time {
  font-size: 11px;
  color: var(--color-ink-muted-48);
  display: flex;
  align-items: center;
  gap: 3px;
}

.bubble-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.bubble-check-btn {
  width: 22px;
  height: 22px;
  border-radius: var(--rounded-full);
  border: 1px solid var(--color-hairline);
  background-color: var(--color-canvas);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.calendar-patient-bubble.pending .bubble-check-btn:hover {
  border-color: var(--color-primary);
  color: rgba(0, 102, 204, 0.3);
}

/* Completed Injection style highlight */
.calendar-patient-bubble.completed {
  background-color: rgba(52, 199, 89, 0.04);
  border-color: rgba(52, 199, 89, 0.15);
}

.calendar-patient-bubble.completed .bubble-title {
  text-decoration: line-through;
  color: var(--color-ink-muted-48);
  font-weight: 400;
}

.calendar-patient-bubble.completed .bubble-check-btn {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-on-primary);
}

.no-patients-day {
  font-size: 12px;
  color: var(--color-ink-muted-48);
  text-align: center;
  margin-top: var(--spacing-xl);
  font-style: italic;
}

/* 10. Patient Directory Grid & Search */
.database-tile-content {
  align-items: stretch;
  text-align: left;
}

.search-filter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.search-bar-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted-48);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill); /* Search input matches Apple action-pill layout */
  padding: 12px 20px 12px 46px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--color-primary-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.filter-dropdown-wrapper {
  flex-shrink: 0;
  width: 170px;
}

.filter-select {
  width: 100%;
  height: 44px;
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill);
  padding: 0 32px 0 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  transition: all 0.2s ease;
  color: var(--color-ink);
}

.filter-select:focus, .filter-select:hover {
  border-color: #b5b5ba;
  background-color: var(--color-surface-pearl);
}

.patient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  width: 100%;
  margin-top: var(--spacing-md);
  min-height: 200px;
}

.store-utility-card {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg); /* 18px corners */
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.store-utility-card:hover {
  border-color: #b5b5ba;
  transform: translateY(-2px);
}

/* Premium drop-shadow ONLY on the illustrative icon card element */
.card-ill-box {
  width: 64px;
  height: 64px;
  border-radius: var(--rounded-sm);
  background-color: var(--color-canvas-parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  box-shadow: rgba(0, 0, 0, 0.12) 2px 4px 15px; /* The one signature drop-shadow in the app */
}

/* Red shade for pending, Green shade for injected */
.card-status-pill {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--rounded-pill);
}

.card-status-pill.pending {
  background-color: rgba(255, 59, 48, 0.08);
  color: var(--color-danger);
}

.card-status-pill.completed {
  background-color: rgba(52, 199, 89, 0.08);
  color: var(--color-success);
}

.patient-card-body h3 {
  font-size: 20px;
  margin-bottom: var(--spacing-xxs);
}

.patient-card-med {
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.patient-meta-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
  margin-bottom: var(--spacing-lg);
}

.meta-item {
  font-size: 13px;
  color: var(--color-ink-muted-80);
}

.meta-label {
  color: var(--color-ink-muted-48);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-divider-soft);
  padding-top: var(--spacing-md);
  margin-top: auto;
}

.text-link {
  color: var(--color-primary);
  font-size: 14px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

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

/* Empty states */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xxl) var(--spacing-lg);
  text-align: center;
  background-color: var(--color-surface-pearl);
  border: 1px dashed var(--color-hairline);
  border-radius: var(--rounded-lg);
}

.empty-icon {
  color: var(--color-ink-muted-48);
  margin-bottom: var(--spacing-md);
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 14px;
  color: var(--color-ink-muted-48);
  margin-bottom: var(--spacing-lg);
}

/* 11. Settings & Smart Watch layouts */
.settings-tile-content {
  align-items: stretch;
  text-align: left;
}

.settings-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  width: 100%;
  margin-top: var(--spacing-xl);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.settings-icon {
  color: var(--color-primary);
}

.settings-card-desc {
  font-size: 14px;
  color: var(--color-ink-muted-80);
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

.setting-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-top: 1px solid var(--color-divider-soft);
  border-bottom: 1px solid var(--color-divider-soft);
  margin-bottom: var(--spacing-md);
}

.setting-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
}

/* iOS-Style Toggle Switch Control */
.switch-container {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-hairline);
  transition: .3s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

input:checked + .switch-slider {
  background-color: var(--color-success); /* iOS green */
}

input:checked + .switch-slider:before {
  transform: translateX(20px);
}

.notification-status-box {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 10px 14px;
  border-radius: var(--rounded-sm);
  font-size: 13px;
  font-weight: 600;
}

.notification-status-box.success {
  background-color: rgba(52, 199, 89, 0.06);
  color: var(--color-success);
}

.notification-status-box.warning {
  background-color: rgba(255, 149, 0, 0.06);
  color: var(--color-warning);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.guide-steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.guide-step {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}

.step-num {
  width: 24px;
  height: 24px;
  background-color: var(--color-surface-pearl);
  color: var(--color-primary);
  border: 1px solid var(--color-hairline);
  font-weight: 600;
  font-size: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-step p {
  font-size: 14px;
  color: var(--color-ink-muted-80);
  line-height: 1.45;
}

.guide-step p strong {
  color: var(--color-ink);
}

/* 12. Modal & Sliding Form Sheets (Apple aesthetics) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  justify-content: flex-end; /* Slide-over panel alignment */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.patient-modal-sheet {
  width: 100%;
  max-width: 580px;
  height: 100%;
  height: 100dvh;
  background-color: var(--color-canvas);
  border-left: 1px solid var(--color-hairline);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
}

.modal-overlay.active .patient-modal-sheet {
  transform: translateX(0);
}

.modal-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--color-divider-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 24px;
  font-weight: 600;
}

.modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  flex-grow: 1;
}

.modal-form-scroll-body {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-section h3 {
  font-size: 16px;
  color: var(--color-ink-muted-48);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-divider-soft);
  padding-bottom: var(--spacing-xxs);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
}

.input-hint {
  font-size: 12px;
  color: var(--color-ink-muted-48);
}

.input-row-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.form-input-text {
  width: 100%;
  height: 40px;
  background-color: var(--color-canvas-parchment);
  border: 1px solid transparent;
  border-radius: var(--rounded-sm); /* Standard small UI elements rounded.sm */
  padding: 8px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-input-text:focus {
  background-color: var(--color-canvas);
  border-color: var(--color-primary-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.form-textarea {
  width: 100%;
  height: 90px;
  background-color: var(--color-canvas-parchment);
  border: 1px solid transparent;
  border-radius: var(--rounded-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: all 0.2s ease;
}

.form-textarea:focus {
  background-color: var(--color-canvas);
  border-color: var(--color-primary-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.form-select-pill {
  width: 100%;
  height: 40px;
  background-color: var(--color-canvas-parchment);
  border: 1px solid transparent;
  border-radius: var(--rounded-pill); /* Option select uses the pill grammar */
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* Alarm-style Weekday multi-select chips */
.weekday-chips-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.weekday-chip {
  cursor: pointer;
}

.weekday-chip input {
  display: none;
}

.weekday-chip span {
  width: 100%;
  height: 42px;
  background-color: var(--color-canvas-parchment);
  color: var(--color-ink);
  border-radius: var(--rounded-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.weekday-chip input:checked + span {
  background-color: var(--color-ink);
  color: var(--color-on-dark);
}

.weekday-chip:hover span {
  border-color: var(--color-ink-muted-48);
}

.modal-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-divider-soft);
  padding: var(--spacing-lg) var(--spacing-xl);
  padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
  background-color: var(--color-canvas);
  flex-shrink: 0;
  z-index: 10;
}

.form-action-right {
  display: flex;
  gap: var(--spacing-sm);
  margin-left: auto;
}

/* Detailed display modal (Centered pop-up style) */
.patient-detail-card-sheet {
  width: 90%;
  max-width: 580px;
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  align-self: center;
  margin: 0 auto;
  overflow: hidden;
  max-height: 90%;
  max-height: 90dvh;
}

.modal-overlay.active .patient-detail-card-sheet {
  transform: scale(1);
}

/* Align modal layout to center for popup */
.modal-overlay:has(.patient-detail-card-sheet) {
  justify-content: center;
  align-items: center;
}

.detail-sheet-body {
  padding: var(--spacing-xl);
  overflow-y: auto;
  flex-grow: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.detail-sheet-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid var(--color-divider-soft);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  align-items: center;
  background-color: var(--color-canvas);
  flex-shrink: 0;
  z-index: 10;
  padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
}

/* Detail UI Grid items */
.detail-main-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.detail-patient-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--rounded-full);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
}

.detail-main-info h2 {
  font-size: 24px;
  line-height: 1.2;
}

.detail-main-info p {
  font-size: 15px;
  color: var(--color-ink-muted-48);
}

.detail-grid-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.detail-grid-item {
  background-color: var(--color-canvas-parchment);
  border-radius: var(--rounded-sm);
  padding: 6px 10px;
}

.detail-grid-item-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.detail-grid-item-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
}

.detail-notes-box {
  background-color: var(--color-surface-pearl);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-sm);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.detail-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: rgba(52, 199, 89, 0.04);
  border: 1px solid rgba(52, 199, 89, 0.1);
  border-radius: var(--rounded-xs);
  font-size: 14px;
}

.history-item-date {
  font-weight: 600;
  color: var(--color-ink);
}

.history-item-badge {
  color: var(--color-success);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.history-item.next-injection {
  background-color: rgba(255, 149, 0, 0.04);
  border: 1px solid rgba(255, 149, 0, 0.15);
}

.history-item.next-injection .history-item-badge {
  color: #ff9500;
}

/* 13. Footer Layout (Apple Footer style) */
.footer {
  background-color: var(--color-canvas-parchment);
  color: var(--color-ink-muted-80);
  border-top: 1px solid var(--color-hairline);
  padding: 64px 0 var(--spacing-xxl) 0;
}

.footer-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xxl);
  margin-bottom: var(--spacing-xl);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--spacing-xs);
}

.footer-link {
  font-size: 13px;
  color: var(--color-ink-muted-80);
  text-decoration: none;
  transition: color 0.15s ease;
  line-height: 2.1; /* Relaxed leading for footer scannability */
}

.footer-link:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.footer-static-text {
  font-size: 13px;
  color: var(--color-ink-muted-48);
  line-height: 2.1;
}

.footer-divider {
  border: 0;
  border-top: 1px solid var(--color-hairline);
  margin: var(--spacing-xl) 0;
}

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-text {
  font-size: 11px;
  color: var(--color-ink-muted-48);
  line-height: 1.4;
}

/* 14. Responsive Behavior (Adaptive Breakpoints) */

/* Large screens content lock */
@media (min-width: 1441px) {
  .nav-container, .sub-nav-container, .tile-content, .footer-container {
    max-width: 1024px;
  }
}

/* Tablet landscape / Desktop border (1024px - 1068px) */
@media (max-width: 1024px) {
  .summary-cards-container {
    max-width: 100%;
    padding: 0 var(--spacing-lg);
  }
  .patient-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet portrait transitions (833px & below) */
@media (max-width: 833px) {
  .weekly-grid {
    grid-template-columns: repeat(1, 1fr); /* Collapses calendar to vertical day-column flow */
    min-height: auto;
  }
  .day-column {
    border-right: none;
    border-bottom: 1px solid var(--color-hairline);
  }
  .day-column:last-child {
    border-bottom: none;
  }
  .day-header {
    flex-direction: row;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-surface-pearl);
  }
  .day-events {
    padding: var(--spacing-md);
    max-height: none;
  }
  .settings-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Phone screen adjustments (640px & below) */
@media (max-width: 640px) {
  .display-lg {
    font-size: 34px;
  }
  .lead {
    font-size: 18px;
  }
  .summary-cards-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  .patient-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
  }
  
  .patient-grid .store-utility-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: auto;
    gap: var(--spacing-md);
  }
  
  .patient-grid .store-utility-card .patient-card-body {
    margin: 0;
    flex-grow: 1;
  }
  
  .patient-grid .store-utility-card .patient-card-body h3 {
    margin: 0;
    font-size: 16px;
  }
  
  .patient-grid .store-utility-card .card-status-pill {
    position: static;
    order: 2;
    margin: 0;
  }
  
  .patient-grid .store-utility-card .patient-card-med,
  .patient-grid .store-utility-card .patient-meta-list,
  .patient-grid .store-utility-card .card-actions {
    display: none !important;
  }
  .search-filter-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: var(--spacing-md) !important;
    margin-bottom: var(--spacing-md) !important;
  }
  .search-bar-wrapper {
    max-width: none !important;
    flex-grow: 1 !important;
  }
  .filter-dropdown-wrapper {
    flex-shrink: 0 !important;
    width: 145px !important;
  }
  .filter-select {
    height: 40px !important;
    font-size: 13px !important;
    padding: 0 28px 0 10px !important;
    background-position: right 8px center !important;
  }
  .search-input {
    height: 40px !important;
    font-size: 14px !important;
    padding: 10px 12px 10px 38px !important;
  }
  .search-icon {
    left: 12px !important;
  }
  .tile-content {
    padding: 0 var(--spacing-sm) !important;
  }
  .agenda-wrapper {
    padding: var(--spacing-sm) !important;
    margin-top: var(--spacing-sm) !important;
    border-radius: var(--rounded-md) !important;
    width: 100% !important;
  }
  .agenda-title-group div {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 6px !important;
  }
  .agenda-date-subtitle {
    font-size: 11px !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
  }
  .agenda-date-subtitle::after {
    content: " ·" !important;
  }
  .agenda-date-title {
    font-size: 14px !important;
    white-space: nowrap !important;
  }
  .agenda-header {
    padding-bottom: var(--spacing-xs) !important;
    margin-bottom: var(--spacing-sm) !important;
  }
  .agenda-stats-pill {
    font-size: 11px !important;
    padding: 2px 8px !important;
  }
  .agenda-round-title {
    font-size: 11px !important;
    margin-bottom: var(--spacing-xs) !important;
  }
  .agenda-item {
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
    gap: 8px !important;
  }
  .agenda-item-left {
    gap: 8px !important;
    min-width: 0 !important;
    flex-grow: 1 !important;
  }
  .agenda-checkbox {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }
  .agenda-checkbox svg {
    width: 10px !important;
    height: 10px !important;
  }
  .agenda-patient-details-link {
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .agenda-item-right {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .agenda-round-badge {
    font-size: 9px !important;
    padding: 1px 5px !important;
  }
  .agenda-item-right .button-icon-circular {
    width: 26px !important;
    height: 26px !important;
  }
  .agenda-item-right .button-icon-circular svg {
    width: 12px !important;
    height: 12px !important;
  }
  #prev-day-btn, #next-day-btn {
    width: 28px !important;
    height: 28px !important;
  }
  #prev-day-btn svg, #next-day-btn svg {
    width: 14px !important;
    height: 14px !important;
  }
  .sub-nav-stats {
    display: none; /* Hide stats in sub-nav on compact screens */
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  .nav-menu {
    gap: var(--spacing-md);
  }
  .modal-form-actions, .detail-sheet-footer {
    padding: var(--spacing-sm) var(--spacing-md) !important;
    padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom)) !important;
  }
  .modal-form-actions button, .detail-sheet-footer button {
    padding: 8px 12px !important;
    font-size: 13px !important;
    height: 36px !important;
  }
  .modal-form-actions .form-action-right {
    gap: 8px !important;
  }
}

/* Small phone (419px & below) */
@media (max-width: 419px) {
  .display-lg {
    font-size: 28px;
  }
  .nav-container {
    padding: 0 var(--spacing-sm);
  }
  .nav-menu {
    display: none; /* Collapses navigation items */
  }
  .sub-nav-container {
    padding: 0 var(--spacing-sm);
  }
  .sub-nav-title {
    font-size: 16px;
  }
  .weekday-chips-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .input-row-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   15. Redesigned Mobile Drawer, Compact Calendar & Agenda Panel Styles
   ========================================================================== */

/* Hamburger Button */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-on-dark);
  cursor: pointer;
  padding: 8px;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.hamburger-btn:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  .nav-menu {
    display: none !important; /* Hide global desktop nav */
  }
}

/* Nav Drawer Slide-Over Menu (Midori ledger mobile style) */
.nav-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: -280px; /* Position off-screen exactly like Midori app to avoid WebKit touch trapping bugs */
  width: 280px;
  height: 100%;
  background-color: rgba(245, 245, 247, 0.88); /* Parchment color glassmorphism */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1001;
  transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.3s ease;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-hairline);
  visibility: hidden;
  pointer-events: none;
}

.nav-drawer.active {
  left: 0; /* Slide in smoothly */
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-hairline);
  height: 52px;
  background-color: var(--color-surface-black);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-on-dark);
}

.drawer-close-btn {
  background: none;
  border: none;
  color: #a1a1a6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.drawer-close-btn:hover {
  color: var(--color-on-dark);
}

.drawer-menu {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md) 0;
  gap: 4px;
}

.drawer-item {
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-ink-muted-80);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.drawer-item:hover, .drawer-item.active {
  background-color: rgba(0, 102, 204, 0.05);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
}

/* Compact Calendar Grid Adjustments */
.monthly-grid {
  min-height: auto; /* Allow flexible height fit */
}

.monthly-day-cell {
  min-height: 70px;
  cursor: pointer;
}

.monthly-day-cell * {
  pointer-events: none; /* Guarantee all touches inside are captured directly by the day cell listener */
}

.monthly-day-cell:hover {
  background-color: var(--color-surface-pearl);
}

.monthly-day-cell.selected-day {
  background-color: rgba(0, 102, 204, 0.04);
  box-shadow: inset 0 0 0 1.5px var(--color-primary);
}

/* Person icons container representing scheduled rounds & statuses */
.calendar-dots-container {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.calendar-patient-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.calendar-patient-icon-wrapper:hover {
  transform: scale(1.25);
}

.calendar-patient-icon {
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor; /* Ensure SVG inherits HSL colors from wrapper classes */
}

/* Dynamic Calendar Person Icon States */
.calendar-patient-icon-wrapper.green {
  color: var(--color-success); /* Injected today standard success green */
}

.calendar-patient-icon-wrapper.red {
  color: var(--color-danger); /* Preferred day (Today) active alert red */
}

.calendar-patient-icon-wrapper.yellow {
  color: #ff9500; /* Preferred day (Upcoming) warm priority amber-yellow */
}

.calendar-patient-icon-wrapper.transparent-grey {
  color: rgba(29, 29, 31, 0.18); /* General available slots / muted slots after injection */
}

/* Selected Day Agenda Panel style */
.agenda-wrapper {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  width: 100%;
  text-align: left;
  animation: slideDownFade 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

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

.agenda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.agenda-date-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
}

.agenda-date-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-ink);
}

.agenda-stats-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background-color: rgba(0, 102, 204, 0.06);
  padding: 4px 12px;
  border-radius: var(--rounded-pill);
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* Round Groups in Agenda */
.agenda-round-group {
  margin-bottom: var(--spacing-xs);
}

.agenda-round-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-muted-48);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-divider-soft);
  padding-bottom: 4px;
  margin-bottom: var(--spacing-sm);
}

/* Agenda Patient Item Row */
.agenda-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-surface-pearl);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-md);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all 0.2s ease;
  margin-bottom: var(--spacing-xs);
}

.agenda-item:hover {
  border-color: #b5b5ba;
  background-color: var(--color-canvas);
}

.agenda-item.completed {
  background-color: rgba(52, 199, 89, 0.02);
  border-color: rgba(52, 199, 89, 0.12);
}

.agenda-item-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.agenda-checkbox-container {
  display: flex;
  align-items: center;
}

/* Apple styled agenda checkbox */
.agenda-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--color-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: transparent;
  background-color: var(--color-canvas);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.agenda-checkbox:hover {
  border-color: var(--color-primary);
  background-color: rgba(0, 102, 204, 0.02);
}

.agenda-item.completed .agenda-checkbox {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-on-primary);
}

.agenda-patient-details-link {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.agenda-patient-details-link:hover {
  color: var(--color-primary);
}

.agenda-item.completed .agenda-patient-details-link {
  text-decoration: line-through;
  color: var(--color-ink-muted-48);
  font-weight: 400;
}

.agenda-item-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.agenda-round-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
  border: 1px solid var(--color-hairline);
  padding: 2px 8px;
  border-radius: var(--rounded-pill);
}

/* Redesigned Form Schedules Grid & Highlights */
.preferred-schedule-box {
  background-color: rgba(0, 102, 204, 0.02);
  border: 1.5px dashed rgba(0, 102, 204, 0.2);
  border-radius: var(--rounded-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  text-align: left;
}

.preferred-schedule-box .box-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.preferred-schedule-box .box-subtitle {
  font-size: 12px;
  color: var(--color-ink-muted-48);
}

/* Weekday Table Grid */
.availability-rounds-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-md);
  overflow: hidden;
  margin-top: var(--spacing-xs);
  background-color: var(--color-canvas);
  text-align: left;
}

.availability-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-divider-soft);
  transition: background-color 0.2s ease;
}

.availability-row:last-child {
  border-bottom: none;
}

.availability-row:hover {
  background-color: var(--color-surface-pearl);
}

.weekday-chip {
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.weekday-chip input[type="checkbox"] {
  display: none; /* Hide default checkbox */
}

.weekday-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 38px;
  background-color: var(--color-canvas-parchment);
  color: var(--color-ink);
  border-radius: var(--rounded-pill); /* Beautiful signature oval pill */
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.weekday-chip input[type="checkbox"]:checked + span {
  background-color: var(--color-primary); /* Apple Action Blue checked state */
  color: var(--color-on-primary);
}

.weekday-chip:hover span {
  border-color: var(--color-primary);
}

.availability-round-select-wrapper {
  flex-grow: 1;
  max-width: 140px;
}

.form-select-pill-sm {
  width: 100%;
  height: 32px;
  border-radius: var(--rounded-pill);
  border: 1px solid var(--color-hairline);
  background-color: var(--color-surface-pearl);
  font-size: 13px;
  padding: 0 var(--spacing-xs);
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select-pill-sm:focus {
  border-color: var(--color-primary);
  background-color: var(--color-canvas);
}

.form-select-pill-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Custom Round Times Inputs in Settings */
.round-times-configurator {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  text-align: left;
}

.round-time-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
}

.round-time-input-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-ink-muted-48);
  letter-spacing: 0.05em;
}

.round-time-input-group input[type="time"] {
  height: 38px;
  border-radius: var(--rounded-pill);
  border: 1px solid var(--color-hairline);
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 100%;
  background-color: var(--color-surface-pearl);
}

.round-time-input-group input[type="time"]:focus {
  border-color: var(--color-primary);
  background-color: var(--color-canvas);
}

/* Database operations container style */
.database-operations-box {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px dashed var(--color-hairline);
  text-align: left;
}

.database-operations-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-danger);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* Responsive adjustment for compact screens */
@media (max-width: 640px) {
  .round-times-configurator {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
  }
}

/* Secondary Treatment & Merged Box Separator Styles */
.form-box-divider {
  border-top: 1.5px dashed rgba(0, 102, 204, 0.15);
  margin: var(--spacing-md) 0;
}

.secondary-treatment-box {
  background-color: rgba(212, 160, 23, 0.02);
  border: 1.5px dashed rgba(212, 160, 23, 0.25);
  border-radius: var(--rounded-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  text-align: left;
}

.secondary-treatment-box .box-title {
  font-size: 14px;
  font-weight: 600;
  color: #b8860b;
  margin-bottom: 2px;
}


