/* CareTrack AI - Premium Clinical Enterprise Theme */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg-app: #f8fafc;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --doctor-blue: #0284c7;
  --doctor-hover: #0369a1;
  --doctor-light: #f0f9ff;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ================= TOP NAVIGATION ================= */
.app-nav {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 0;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-pill {
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-tagline {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

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

/* Mobile Action Bar */
.mobile-action-bar {
  display: none;
  background: #1e293b;
  padding: 10px 14px;
  gap: 10px;
  border-bottom: 1px solid #334155;
}

.mobile-btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  line-height: 1.2;
}

.btn:active {
  transform: scale(0.98);
}

.btn-doctor {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.btn-doctor:hover {
  background: #0274b0;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
}

.btn-chat {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-chat:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #e2e8f0;
}

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

.btn-outline {
  background: transparent;
  color: #e2e8f0;
  border-color: #475569;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #94a3b8;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-danger-soft {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger-soft:hover {
  background: #fee2e2;
}

.w-full {
  width: 100%;
}

/* ================= LAYOUT GRID ================= */
.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 36px) 48px;
  display: grid;
  grid-template-columns: minmax(290px, 340px) 1fr;
  gap: 24px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================= CARDS ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

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

.sub-heading {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 2px;
}

h2, h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

/* ================= PATIENT DIRECTORY SIDEBAR ================= */
.patient-dir-card {
  position: sticky;
  top: 86px;
}

.stacked-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.patient-picker {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.patient-picker label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.patient-cards-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.patient-item-card {
  padding: 12px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #f8fafc;
  cursor: pointer;
  transition: all 120ms ease;
  position: relative;
}

.patient-item-card:hover {
  border-color: var(--primary);
  background: #ffffff;
}

.patient-item-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.patient-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.patient-item-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.patient-active-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
}

.patient-item-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ================= ACTIVE PATIENT HERO CARD ================= */
.patient-hero-card {
  border: 2px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
  overflow: hidden;
}

.patient-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7 0%, #2563eb 50%, #10b981 100%);
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  animation: pulse-ring 2s infinite;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.hero-info h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.hero-details {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.risk-indicator-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ml-risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 800;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
}

.ml-risk-badge.badge-critical {
  background: var(--danger-light);
  border-color: #fecaca;
  color: var(--danger);
}

.ml-risk-badge.badge-warning {
  background: var(--warning-light);
  border-color: #fef08a;
  color: #b45309;
}

.ml-risk-badge.badge-stable {
  background: var(--success-light);
  border-color: #a7f3d0;
  color: var(--success);
}

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

.ml-confidence-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-readings {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.reading-stat {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Hero CTA Banner */
.hero-cta-banner {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-text {
  display: flex;
  flex-direction: column;
}

.cta-text strong {
  font-size: 0.95rem;
  color: #0369a1;
}

.cta-text span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-cta {
  padding: 12px 20px;
  font-size: 0.95rem;
}

/* ================= STATUS CARDS ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 18px 20px;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.status-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
}

.status-pill.status-normal { background: var(--success-light); color: var(--success); }
.status-pill.status-warning { background: var(--warning-light); color: #b45309; }
.status-pill.status-danger { background: var(--danger-light); color: var(--danger); }

.stat-body strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-body small {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ================= FORMS & INPUTS ================= */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-primary);
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
  resize: vertical;
}

.col-span-2 {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.checkbox-row span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ================= SCHEDULE CARD ================= */
.legend-tags {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.legend-tag.pending { color: #b45309; }
.legend-tag.done { color: var(--success); }

.medicine-grid {
  display: grid;
  gap: 10px;
}

.med-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-subtle);
  border-left-width: 6px;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.med-card.pending {
  border-left-color: var(--warning);
}

.med-card.done {
  border-left-color: var(--success);
  background: #f8fdfa;
}

.med-info h4 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.med-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ================= HISTORY TABLE ================= */
.history-header {
  flex-wrap: wrap;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  min-width: 260px;
  min-height: 40px;
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.empty-placeholder {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}

/* ================= MODALS & DRAWERS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 1000;
}

.modal-backdrop.show {
  display: grid;
}

.modal-sheet {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: min(820px, 100%);
  animation: modal-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.doctor-badge-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doctor-avatar {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-badge-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0369a1;
  margin-bottom: 3px;
}

.doc-patient-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.tool-chip:hover {
  background: #f1f5f9;
  border-color: var(--border-hover);
}

.tool-chip.speaking {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fca5a5;
  animation: pulse-ring 1.5s infinite;
}

.doctor-body {
  overflow-y: auto;
  padding: 24px;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text-primary);
  flex: 1;
}

.doctor-body h3 {
  color: #0369a1;
  margin-top: 0;
  margin-bottom: 10px;
}

.doctor-body h4 {
  color: #0f172a;
  margin: 18px 0 8px;
  font-size: 1.05rem;
}

.doctor-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.doctor-body ul {
  padding-left: 20px;
  margin: 8px 0;
}

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

/* ================= CHAT DRAWER ================= */
.chat-sheet {
  width: min(720px, 100%);
  max-height: 92vh;
}

.chat-chips-scroll {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  overflow-x: auto;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: thin;
}

.symptom-chip {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: all 120ms ease;
}

.symptom-chip:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0284c7;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 440px;
  background: #ffffff;
}

.chat-msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: #f8fafc;
}

.chat-input-bar input {
  flex: 1;
  background: #ffffff;
}

/* ================= CSV EXPORT MODAL ================= */
.csv-sheet {
  width: min(480px, 100%);
  padding: 24px;
}

.csv-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

/* Toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 20px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: all 180ms ease;
  pointer-events: none;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 10px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================= PRINT STYLES ================= */
@media print {
  body * { visibility: hidden; }
  .doctor-sheet, .doctor-sheet * { visibility: visible; }
  .doctor-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
  }
  .modal-toolbar, .modal-footer, .btn-close { display: none !important; }
}

/* ================= RESPONSIVE ADAPTATIONS (MOBILE / TABLET / DESKTOP) ================= */
@media (max-width: 1080px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .patient-dir-card {
    position: static;
  }
}

@media (max-width: 820px) {
  .forms-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero-readings {
    grid-template-columns: repeat(3, 1fr);
  }
  .hide-mobile {
    display: none;
  }
}

@media (max-width: 640px) {
  .mobile-action-bar {
    display: flex;
  }
  .nav-actions {
    display: none;
  }
  .app-layout {
    padding: 14px 12px 36px;
    gap: 16px;
  }
  .hero-readings {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .reading-stat {
    padding: 10px 4px;
  }
  .reading-stat .stat-value {
    font-size: 1.15rem;
  }
  .grid-form {
    grid-template-columns: 1fr;
  }
  .col-span-2 {
    grid-column: 1;
  }
  .modal-sheet {
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
  }
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .chat-msg {
    max-width: 92%;
  }
}
