/* ==========================================================================
   IMPECCABLE DESIGN SYSTEM - СКАНДИНАВСКИЙ СВЕТЛЫЙ ПРЕМИУМ «АИ-БОЛИТ»
   Clean Light Nordic Aesthetics: Soft Off-white, Emerald Sage & Slate Navy
   ========================================================================== */

:root {
  /* Brand Colors (Nordic Medical Emerald & Slate Navy) */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-dark: #047857;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(16, 185, 129, 0.25);

  --secondary: #0f172a;
  --secondary-light: #f1f5f9;

  --accent: #0284c7;
  --accent-light: #f0f9ff;
  --accent-glow: rgba(2, 132, 199, 0.2);

  --success: #10b981;
  --success-light: #d1fae5;
  --success-dark: #065f46;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-dark: #b45309;

  --danger: #f43f5e;
  --danger-light: #fff1f2;
  --danger-dark: #9f1239;

  /* Surfaces & Canvases (Ultra Clean Light) */
  --bg-app-dark: #f8fafc;
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.95);

  /* Typography Colors */
  --text-heading: #0f172a;
  --text-main: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Borders & Dividers */
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;

  /* Radii & Elevation */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -1px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(16, 185, 129, 0.1);
  --shadow-xl: 0 20px 40px -8px rgba(15, 23, 42, 0.08);

  /* Font Families */
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: #f8fafc;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(2, 132, 199, 0.04) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* TOP APPLICATION NAVIGATION BAR (CLEAN LIGHT HEADER) */
.demo-control-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 1000;
  position: sticky;
  top: 0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.demo-brand .logo-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.role-switcher-group {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.role-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.role-btn:hover {
  color: var(--text-heading);
  background: rgba(255, 255, 255, 0.6);
}

.role-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.demo-tools-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-tool-btn {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.demo-tool-btn:hover {
  background: #f8fafc;
  border-color: var(--border-color-hover);
}

.api-status-badge {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.api-status-badge.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.api-status-badge.mock {
  background: var(--warning-light);
  color: var(--warning-dark);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

/* WORKSPACE CONTAINER */
.main-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  min-height: calc(100vh - 70px);
}

/* MOBILE PWA SIMULATOR CONTAINER (LIGHT SILVER TITANIUM CHASSIS) */
.phone-simulator-container {
  width: 100%;
  max-width: 420px;
  height: 860px;
  max-height: 92vh;
  background: #ffffff;
  border-radius: 44px;
  box-shadow: 
    0 20px 60px rgba(15, 23, 42, 0.12), 
    0 0 0 10px #e2e8f0,
    0 0 0 12px #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.phone-notch {
  width: 130px;
  height: 28px;
  background: #e2e8f0;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-notch-speaker {
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
}

.phone-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 28px;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
}

/* DESKTOP WORKSPACE CONTAINER */
.desktop-container {
  width: 100%;
  max-width: 1380px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-height: 820px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: fadeIn 0.3s ease-out;
}

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

/* PATIENT PWA COMPONENT STYLES */
.patient-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.patient-profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.patient-name-box h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.patient-name-box p {
  font-size: 0.72rem;
  opacity: 0.85;
}

.patient-nav-tabs {
  display: flex;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 8px 6px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  justify-content: space-around;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
}

.patient-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.patient-tab-btn svg {
  width: 22px;
  height: 22px;
}

.patient-tab-btn.active {
  color: var(--primary-dark);
  background: var(--primary-light);
}

.patient-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* CHAT MESSAGES & TYPING */
.disclaimer-banner {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  color: var(--warning-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
}

.emergency-alert-banner {
  background: var(--danger-light);
  border: 2px solid var(--danger);
  color: var(--danger-dark);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.chat-bubble {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.chat-bubble.bot {
  background: #ffffff;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.chat-bubble.user {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  box-shadow: var(--shadow-md);
}

.chat-bubble .timestamp {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-top: 4px;
  text-align: right;
}

.ai-typing-indicator {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: var(--radius-md);
  align-self: flex-start;
  border: 1px solid var(--border-color);
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  background: #ffffff;
  padding: 6px 6px 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
}

.chat-input-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.chat-input-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  background: transparent;
  font-family: inherit;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.quick-symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* DOCTOR RECOMMENDATION CARD */
.doctor-recommendation-card {
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--shadow-md);
}

.ai-summary-pill {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
}

.doctor-profile-preview {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.doctor-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #e2e8f0;
}

.doctor-meta h5 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-heading);
}

.doctor-meta p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.doctor-rating-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-light);
  color: var(--warning-dark);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  margin-top: 4px;
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.slot-btn {
  background: #ffffff;
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  padding: 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.slot-btn:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px var(--primary-glow);
}

/* DESKTOP WORKSPACE STYLES */
.desktop-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.desktop-title h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-heading);
}

.desktop-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.desktop-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* DOCTOR WORKSTATION AI HIGHLIGHT BOX */
.ai-highlight-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
}

.ai-highlight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.ai-highlight-text {
  font-size: 0.92rem;
  color: #065f46;
  line-height: 1.55;
  font-weight: 500;
}

.patient-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.patient-queue-item:hover, .patient-queue-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.waiting { background: var(--warning-light); color: var(--warning-dark); }
.status-badge.in_cabinet { background: var(--primary-light); color: var(--primary-dark); }
.status-badge.completed { background: var(--success-light); color: var(--success-dark); }
.status-badge.no_show { background: var(--danger-light); color: var(--danger-dark); }

/* RECEPTION TIMELINE GRID */
.timeline-matrix {
  display: grid;
  grid-template-columns: 120px repeat(4, 1fr);
  gap: 1px;
  background: var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.matrix-header {
  background: #f8fafc;
  padding: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-heading);
}

.matrix-cell {
  background: #ffffff;
  min-height: 70px;
  padding: 8px;
  font-size: 0.8rem;
  position: relative;
}

.matrix-time-label {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-muted);
}

.appointment-chip {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}

.appointment-chip:hover {
  transform: translateY(-1px);
}

/* EXECUTIVE DASHBOARD & KPI CARDS */
.kpi-card {
  background: #ffffff;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-heading);
}

.kpi-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.alert-item {
  background: var(--danger-light);
  border: 1px solid #fecdd3;
  border-left: 5px solid var(--danger);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--danger-dark);
  font-size: 0.9rem;
}

/* BUTTONS & CONTROLS */
.btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.btn-danger:hover {
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-success:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* FORMS & MODALS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  max-height: 90vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* AI MEDICAL SCRIBE & CLINIC NAVIGATOR STYLES */
.ai-scribe-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.ai-scribe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ai-scribe-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: #065f46;
}

.scribe-presets-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.scribe-preset-btn {
  background: #ffffff;
  border: 1px solid #6ee7b7;
  color: #047857;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.scribe-preset-btn:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  transform: translateY(-1px);
}

.scribe-preset-btn.active {
  background: #047857;
  color: #ffffff;
  border-color: #047857;
}

.audio-wave-anim {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.audio-wave-bar {
  width: 4px;
  height: 100%;
  background: #10b981;
  border-radius: 2px;
  animation: wavePulse 1s infinite ease-in-out alternate;
}

.audio-wave-bar:nth-child(2) { animation-delay: 0.2s; }
.audio-wave-bar:nth-child(3) { animation-delay: 0.4s; }
.audio-wave-bar:nth-child(4) { animation-delay: 0.6s; }

@keyframes wavePulse {
  0% { height: 4px; opacity: 0.4; }
  100% { height: 18px; opacity: 1; }
}

.scribe-transcript-box {
  background: #ffffff;
  border: 1px dashed #6ee7b7;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
  color: #1e293b;
  min-height: 54px;
  max-height: 90px;
  overflow-y: auto;
  line-height: 1.4;
  position: relative;
}

.scribe-autofill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 10px;
  animation: fadeIn 0.3s ease-out;
}

/* CLINIC MAP MODAL STYLES */
.clinic-map-container {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.clinic-floor-svg {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.03);
}

.map-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.map-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-main);
  background: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.map-step-num {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.qr-code-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-svg {
  width: 120px;
  height: 120px;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE ADAPTATIONS (MOBILE, TABLET, DESKTOP)
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .demo-control-bar {
    padding: 10px 16px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .desktop-container {
    min-height: auto;
  }

  .desktop-body {
    padding: 16px;
  }

  .desktop-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .timeline-matrix-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .timeline-matrix {
    min-width: 720px;
  }
}

/* Medium Tablets & Large Phones (max-width: 768px) */
@media (max-width: 768px) {
  .demo-control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .demo-brand {
    justify-content: space-between;
  }

  .role-switcher-group {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .role-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    flex-shrink: 0;
  }

  .demo-tools-group {
    justify-content: space-between;
    width: 100%;
  }

  .main-wrapper {
    padding: 12px 8px;
  }

  .modal-content {
    padding: 20px;
    max-width: 95%;
    border-radius: var(--radius-md);
  }

  .scribe-presets-group {
    flex-direction: column;
  }

  .scribe-preset-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Small Smartphones (max-width: 480px) */
@media (max-width: 480px) {
  .phone-simulator-container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  .phone-notch {
    display: none;
  }

  .phone-screen {
    padding-top: 0;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-value {
    font-size: 1.4rem;
  }

  .clinic-floor-svg {
    height: 170px;
  }

  .qr-svg {
    width: 90px;
    height: 90px;
  }
/* PRINT MEDIA STYLES FOR MEDICAL CERTIFICATES & RECORDS */
@media print {
  body * {
    visibility: hidden;
  }
  .modal-backdrop, .modal-backdrop * {
    visibility: visible;
  }
  .modal-backdrop {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: transparent !important;
    padding: 0 !important;
  }
  .modal-content {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .btn, .modal-content > div:first-child > span:last-child {
    display: none !important;
  }
}


