/* ClinicFlow AI — app shell styles */

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: #FFFFFF;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: #FFFFFF;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: #FFFFFF;
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--border-strong);
}
.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.sidebar-brand-mark svg { width: 100%; height: 100%; display: block; }
.sidebar-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.sidebar-brand-text small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 9px;
  color: var(--gray-400);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-section {
  padding: 16px 12px 8px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 12px 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
  position: relative;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav-item:hover {
  background: var(--purple-50);
  color: var(--ink);
}
.nav-item.active {
  background: var(--purple-50);
  color: var(--purple-600);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--purple-600);
  border-radius: 0 3px 3px 0;
}
.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav-item-badge {
  margin-left: auto;
  background: var(--purple-600);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-strong);
  font-size: 11px;
  color: var(--purple-400);
  font-weight: 500;
}
.sidebar-footer a {
  color: var(--purple-400);
  text-decoration: none;
}
.sidebar-footer a:hover { color: var(--purple-600); }

/* ---------- TOPBAR ---------- */
.topbar {
  height: 64px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  position: relative;
  transition: all var(--dur-fast);
}
.topbar-icon-btn:hover { background: var(--purple-50); color: var(--purple-600); border-color: var(--purple-200); }
.topbar-icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--purple-600);
  border-radius: 999px;
  border: 1.5px solid white;
}

.clinic-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}
.clinic-chip-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--indigo-500), var(--purple-600));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 10px;
}
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
  color: white;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* ---------- PAGE WRAPPER ---------- */
.page {
  padding: 32px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.page-header p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ---------- CARDS ---------- */
.card {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 24px;
}
.card.compact { padding: 16px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px 22px;
  transition: box-shadow var(--dur-base), border-color var(--dur-base), transform var(--dur-base);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 999px;
}
.kpi-trend.up { background: var(--success-soft); color: var(--success); }
.kpi-trend.down { background: var(--danger-soft); color: var(--danger); }
.kpi-trend.flat { background: var(--gray-100); color: var(--gray-600); }
.kpi-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray-500);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--purple-600);
  color: white;
}
.btn-primary:hover { background: var(--purple-700); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--purple-600);
  border-color: var(--purple-300);
}
.btn-ghost:hover { background: var(--purple-50); border-color: var(--purple-600); }
.btn-subtle {
  background: white;
  color: var(--gray-700);
  border-color: var(--border-strong);
}
.btn-subtle:hover { background: var(--gray-50); }
.btn-link {
  background: transparent;
  color: var(--gray-500);
  padding: 4px 6px;
  border: none;
}
.btn-link:hover { color: var(--ink); }
.btn-wa {
  background: #25D366;
  color: white;
}
.btn-wa:hover { background: #1FB755; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  background: white;
  color: var(--gray-600);
  border-color: var(--border-strong);
}
.btn-icon:hover { color: var(--purple-600); border-color: var(--purple-300); background: var(--purple-50); }
.btn-icon.wa { color: #25D366; }
.btn-icon.wa:hover { color: white; background: #25D366; border-color: #25D366; }

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }
.badge-purple { background: var(--purple-50); color: var(--purple-600); }
.badge-lavender { background: #F3F1FF; color: #6B46C1; }
.badge-blue { background: #EFF6FF; color: #2563EB; }
.badge-pink { background: #FDF2F8; color: #DB2777; }
.badge-teal { background: #F0FDFA; color: #0D9488; }
.badge-amber { background: var(--warning-soft); color: var(--warning); }

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  background: var(--purple-50);
  color: var(--purple-600);
  border-radius: 4px;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ---------- AVATARS ---------- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; font-family: var(--font-display); font-weight: 700; }

/* ---------- TABLE ---------- */
.table-card {
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 20px;
  background: #FAFAFB;
  border-bottom: 1px solid var(--border-strong);
}
.table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid #F1F3F5;
  vertical-align: middle;
  color: var(--gray-700);
  height: 56px;
}
.table tbody tr:nth-child(even) td { background: #FAFAFB; }
.table tbody tr:hover td { background: var(--purple-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table .patient-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.table .patient-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}
.table .patient-phone {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ---------- INPUTS ---------- */
.input,
.search-input {
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  background: white;
  width: 100%;
  outline: none;
  font-family: inherit;
  font-weight: 500;
}
.input:focus, .search-input:focus {
  border-color: var(--purple-600);
  box-shadow: var(--ring-brand);
}
.search-wrap {
  position: relative;
}
.search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
.search-wrap .search-input {
  padding-left: 36px;
}

/* ---------- FILTER CHIPS ---------- */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.chip:hover { background: var(--purple-50); border-color: var(--purple-300); color: var(--purple-600); }
.chip.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.chip .count {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.7;
  font-family: var(--font-mono);
}

/* ---------- TABS (underline) ---------- */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  font-family: inherit;
  transition: color var(--dur-fast);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--purple-600); font-weight: 600; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--purple-600);
  border-radius: 2px;
}

/* ---------- MONO ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
}

/* ---------- ROW LIST ---------- */
.row-list { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F1F3F5;
}
.row:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.row-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}
.row-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- AI QUEUE CARD ---------- */
.ai-card {
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-left: 3px solid var(--purple-600);
  border-radius: 12px;
  padding: 20px;
}

/* ---------- ACTIVITY FEED ---------- */
.activity-strip {
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px 24px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #F1F3F5;
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.activity-time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-400);
}

/* ---------- WA BUBBLES ---------- */
.wa-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: #F7F4F0;
  border-radius: 12px;
  min-height: 320px;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
}
.wa-day {
  align-self: center;
  font-size: 11px;
  color: var(--gray-500);
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 10px;
  border-radius: 999px;
  margin: 8px 0;
}
.wa-bubble {
  max-width: 70%;
  padding: 8px 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  position: relative;
  line-height: 1.4;
  word-wrap: break-word;
}
.wa-bubble.sent {
  background: var(--purple-600);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.wa-bubble.received {
  background: white;
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.wa-meta {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
}
.wa-bubble.sent .wa-meta { color: rgba(255,255,255,0.85); }
.wa-bubble.received .wa-meta { color: var(--gray-400); }
.wa-bubble.sent .wa-meta .ticks { color: #BCE0FD; }

/* ---------- SCROLLBARS ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #D1D5DB; }

/* ---------- ANALYTICS BANNER ---------- */
.banner-gradient {
  background: linear-gradient(135deg, var(--purple-50) 0%, var(--purple-100) 100%);
  border-radius: 16px;
  padding: 28px 32px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.banner-gradient::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, transparent 70%);
  border-radius: 999px;
  filter: blur(20px);
}
.banner-gradient h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.banner-gradient p {
  font-size: 13px;
  color: var(--purple-700);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--purple-600);
  color: white;
  border: none;
  box-shadow: var(--shadow-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all var(--dur-fast);
}
.fab:hover { background: var(--purple-700); transform: translateY(-2px); box-shadow: var(--shadow-brand-lg); }

/* ---------- FORMS / SETTINGS ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.field-hint {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 400;
}
.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.input-prefix .prefix {
  padding: 0 10px;
  color: #25D366;
  background: #F0FDF4;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  border-right: 1px solid var(--border-strong);
}
.input-prefix input {
  border: none;
  flex: 1;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-weight: 500;
}

/* ---------- DIVIDER ---------- */
.divider { height: 1px; background: var(--border-strong); margin: 16px 0; }

/* ---------- SPARKLINE ---------- */
.sparkline { width: 100%; height: 32px; }

/* ---------- PROGRESS RING WRAP ---------- */
.ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.ring-wrap .ring-value {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

/* ---------- PAGINATION ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-strong);
  background: #FAFAFB;
  font-size: 12px;
  color: var(--gray-500);
}
.pagination-pages { display: flex; gap: 4px; }
.page-btn {
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
}
.page-btn:hover { background: var(--purple-50); color: var(--purple-600); }
.page-btn.active { background: var(--purple-600); color: white; }

/* ---------- CALENDAR ---------- */
.cal {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 16px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cal-month {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.cal-toggle {
  display: inline-flex;
  background: #F3F4F6;
  border-radius: 8px;
  padding: 2px;
}
.cal-toggle button {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.cal-toggle button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.cal-week {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  gap: 1px;
  background: var(--border-strong);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
}
.cal-week > * { background: white; }
.cal-day-head {
  padding: 10px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-day-head .num {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin-top: 4px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
}
.cal-day-head.today .num { color: var(--purple-600); }
.cal-day-head.today { background: var(--purple-50); }
.cal-day-head .dot-row {
  display: inline-flex;
  gap: 2px;
  justify-content: center;
  margin-top: 4px;
}
.cal-day-head .dot-row span { width: 4px; height: 4px; border-radius: 999px; background: var(--purple-600); display:inline-block; }

.cal-time-label {
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-400);
  text-align: right;
}
.cal-cell {
  min-height: 48px;
  padding: 4px;
  position: relative;
}
.cal-cell.now { background: var(--purple-50); }

.appt-pill {
  background: var(--purple-50);
  border-left: 3px solid var(--purple-600);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.appt-pill:hover { background: var(--purple-100); }
.appt-pill.green { background: var(--success-soft); border-left-color: var(--success); }
.appt-pill.amber { background: var(--warning-soft); border-left-color: var(--warning); }
.appt-pill.red   { background: var(--danger-soft);  border-left-color: var(--danger); }
.appt-pill .who { font-weight: 600; }

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-strong);
}
.timeline-item {
  position: relative;
  padding-bottom: 18px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: white;
  border: 2px solid var(--purple-600);
}
.timeline-item.success::before { border-color: var(--success); }
.timeline-item.warning::before { border-color: var(--warning); }
.timeline-item.danger::before  { border-color: var(--danger); }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 4px;
}
.timeline-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.timeline-body {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
}

/* ---------- DONUT / CHARTS ---------- */
.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
}
.legend-row .sw {
  width: 10px; height: 10px; border-radius: 3px;
}
.legend-row .pct {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}

/* ---------- WHATSAPP HUB ---------- */
.conv-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-strong);
  overflow-y: auto;
}
.conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #F1F3F5;
  position: relative;
  transition: background var(--dur-fast);
}
.conv-row:hover { background: var(--purple-50); }
.conv-row.active { background: var(--purple-50); }
.conv-row.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--purple-600);
  border-radius: 0 3px 3px 0;
}
.conv-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.conv-preview {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: 2px;
}
.conv-time {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--gray-400);
  align-self: flex-start;
}
.conv-row .unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--purple-600);
}

/* ---------- TILE STAT (small) ---------- */
.stat-tile {
  background: #FAFAFB;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 16px;
}
.stat-tile-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stat-tile-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: -0.02em;
}

/* ---------- FOLLOWUP CARD ---------- */
.fu-card {
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.fu-card:hover { border-color: var(--purple-600); box-shadow: 0 0 0 3px rgba(124,58,237,0.06); }
.fu-card.ai {
  background: var(--purple-50);
  border-color: var(--purple-200);
  border-left: 3px solid var(--purple-600);
  padding-left: 17px;
}
.fu-card.failed { border-left: 3px solid var(--danger); padding-left: 17px; }
.fu-main { flex: 1; min-width: 0; }
.fu-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.fu-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.fu-preview {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fu-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- SCROLL CONTAINERS ---------- */
.scroll-area { overflow-y: auto; }

/* ---------- VIEW WRAP (for routing) ---------- */
.view {
  animation: viewFade 220ms var(--ease-out);
}
@keyframes viewFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* small utility */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--gray-500); }
.text-ink { color: var(--ink); }
.font-semi { font-weight: 600; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* ====================================================
   INTERACTIVE LAYERS — toasts, modals, panels, menus
   ==================================================== */

/* ---------- TOAST ---------- */
.toast-host {
  position: fixed;
  top: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: white;
  padding: 12px 16px 12px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 12px 32px -8px rgba(15,23,42,0.35);
  pointer-events: auto;
  animation: toast-in 280ms var(--ease-spring);
}
.toast.success { background: #064E3B; }
.toast.success .toast-icon { background: #10B981; }
.toast.error { background: #7F1D1D; }
.toast.error .toast-icon { background: #EF4444; }
.toast.info .toast-icon { background: var(--purple-600); }
.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--purple-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.toast-msg { flex: 1; line-height: 1.4; }
.toast-sub { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px; font-weight: 400; }
.toast-close { color: rgba(255,255,255,0.6); background: transparent; border: none; padding: 4px; cursor: pointer; }
.toast-close:hover { color: white; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

/* ---------- MODAL ---------- */
.scrim {
  position: fixed; inset: 0;
  background: rgba(12, 7, 20, 0.45);
  backdrop-filter: blur(4px);
  z-index: 60;
  animation: scrim-in 200ms var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
@keyframes scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 32px 64px -16px rgba(15,23,42,0.28);
  animation: modal-in 240ms var(--ease-spring);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal.lg { max-width: 720px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border-strong);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #FAFAFB;
  border-radius: 0 0 16px 16px;
}

/* ---------- SLIDE PANEL (notifications) ---------- */
.slide-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  background: white;
  border-left: 1px solid var(--border-strong);
  box-shadow: -16px 0 48px -16px rgba(15,23,42,0.18);
  z-index: 65;
  display: flex;
  flex-direction: column;
  animation: panel-in 280ms var(--ease-out);
}
@keyframes panel-in {
  from { transform: translateX(100%); }
  to { transform: none; }
}
.slide-panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slide-panel-body { flex: 1; overflow-y: auto; padding: 8px 0; }

/* ---------- NOTIFICATION ITEM ---------- */
.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid #F1F3F5;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.notif-item:hover { background: var(--purple-50); }
.notif-item.unread { background: var(--purple-50); }
.notif-item .notif-dot {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-item .notif-title { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.35; }
.notif-item .notif-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; line-height: 1.5; }
.notif-item .notif-time { font-family: var(--font-mono); font-size: 10px; color: var(--gray-400); margin-top: 4px; }

/* ---------- DROPDOWN MENU ---------- */
.menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(15,23,42,0.18);
  min-width: 220px;
  padding: 6px;
  z-index: 50;
  animation: menu-in 180ms var(--ease-out);
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.menu-item:hover { background: var(--purple-50); color: var(--purple-700); }
.menu-item.active { background: var(--purple-50); color: var(--purple-700); }
.menu-item .menu-icon { color: var(--gray-500); width: 16px; height: 16px; display: inline-flex; }
.menu-item:hover .menu-icon { color: var(--purple-600); }
.menu-sep { height: 1px; background: var(--border-strong); margin: 6px 4px; }
.menu-label {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- SEARCH OVERLAY ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12,7,20,0.45);
  backdrop-filter: blur(4px);
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  animation: scrim-in 200ms var(--ease-out);
}
.search-modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 32px 64px -16px rgba(15,23,42,0.28);
  overflow: hidden;
  animation: modal-in 240ms var(--ease-spring);
}
.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-strong);
}
.search-header input {
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
  font-family: inherit;
  background: transparent;
}
.search-header .kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
}
.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}
.search-result {
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.search-result:hover, .search-result.active { background: var(--purple-50); }
.search-result-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--gray-600);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.search-result:hover .search-result-icon { background: var(--purple-100); color: var(--purple-700); }

.menu-anchor { position: relative; }
.click-shield {
  position: fixed; inset: 0; z-index: 45;
}

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

/* ====================================================
   AUTH — login + clinic picker
   ==================================================== */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: white;
}
.auth-shell.solo { grid-template-columns: 1fr; }

.auth-brand {
  position: relative;
  background: linear-gradient(135deg, #1E1B4B 0%, #2E1065 55%, #4C1D95 100%);
  color: white;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.45) 0%, transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(99, 102, 241, 0.35) 0%, transparent 55%);
  pointer-events: none;
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.5;
}
.auth-brand > * { position: relative; z-index: 2; }

.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-brand-top .wm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.auth-brand-top .wm small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 9px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 2px;
}

.auth-brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 32px 0;
}
.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-300);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.auth-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--purple-300);
}
.auth-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: white;
  margin-bottom: 18px;
}
.auth-headline .grad {
  background: linear-gradient(90deg, #C4B5FD 0%, #818CF8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  line-height: 1.55;
  max-width: 440px;
}

.auth-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
}
.auth-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: white;
}
.auth-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-brand-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.auth-brand-foot a { color: rgba(255,255,255,0.75); }
.auth-brand-foot a:hover { color: white; }

.auth-form-side {
  display: flex;
  flex-direction: column;
  padding: 48px 64px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.auth-form-top {
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--gray-500);
}
.auth-form-top a { font-weight: 600; color: var(--purple-600); }

.auth-form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}
.auth-form-body h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.auth-form-body .lead {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.auth-field label a { font-weight: 500; font-size: 11px; }
.auth-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  background: white;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  font-weight: 500;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-input:focus {
  border-color: var(--purple-600);
  box-shadow: var(--ring-brand);
}
.auth-input.invalid { border-color: var(--danger); }

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 20px;
  cursor: pointer;
}
.auth-checkbox input { accent-color: var(--purple-600); }

.auth-submit {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: none;
  background: var(--purple-600);
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-submit:hover { background: var(--purple-700); box-shadow: var(--shadow-brand); }
.auth-submit:active { transform: scale(0.99); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-sep::before, .auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.auth-sso {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-strong);
  background: white;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.auth-sso:hover { background: var(--gray-50); border-color: var(--gray-300); }

.auth-form-foot {
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
  padding-top: 20px;
}

.demo-creds {
  background: var(--purple-50);
  border: 1px dashed var(--purple-300);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--purple-700);
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.demo-creds .demo-mono {
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 11px;
}
.demo-creds button {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--purple-300);
  color: var(--purple-700);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.demo-creds button:hover { background: var(--purple-100); }

/* ---------- CLINIC PICKER ---------- */
.picker-shell {
  min-height: 100vh;
  background: var(--purple-50);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(167, 139, 250, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
}
.picker-top {
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.picker-top .who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-700);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  backdrop-filter: blur(8px);
}
.picker-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.picker-card {
  width: 100%;
  max-width: 640px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 24px 56px -16px rgba(76, 29, 149, 0.18);
}
.picker-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 6px;
}
.picker-card p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}
.clinic-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--dur-fast);
  background: white;
}
.clinic-row:hover {
  border-color: var(--purple-600);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
  transform: translateY(-1px);
}
.clinic-row.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--gray-50);
}
.clinic-row.disabled:hover { transform: none; border-color: var(--border-strong); box-shadow: none; }

.clinic-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.clinic-row .meta {
  flex: 1;
  min-width: 0;
}
.clinic-row .meta .name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.clinic-row .meta .loc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.clinic-row .role {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.clinic-row .chev { color: var(--gray-400); }
.clinic-row:hover .chev { color: var(--purple-600); }

.picker-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-500);
}
.picker-foot a { color: var(--purple-600); font-weight: 600; }

/* Make sure topbar clinic switcher reflects active clinic */
.clinic-chip { transition: background var(--dur-fast); }
.clinic-chip:hover { background: var(--purple-50); border-color: var(--purple-300); }

/* ====================================================
   WELCOME LOADER — multi-layer orbital intro
   ==================================================== */
.welcome-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #07051A;
  color: white;
  overflow: hidden;
  transition: opacity 600ms var(--ease-out), visibility 600ms var(--ease-out);
}
.welcome-loader.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }

/* Gradient mesh background */
.welcome-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.32) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.28) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(76, 29, 149, 0.22) 0%, transparent 60%),
    linear-gradient(180deg, #07051A 0%, #1E1B4B 100%);
  animation: bg-drift 14s ease-in-out infinite alternate;
  filter: saturate(1.1);
}
@keyframes bg-drift {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.05) translate(-12px, 8px); }
}

/* Dot grid overlay */
.welcome-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 70%);
  opacity: 0.6;
}

/* Floating particle layer (small twinkles) */
.welcome-particles {
  position: absolute; inset: 0;
  overflow: hidden;
}
.welcome-particles span {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 999px;
  background: rgba(196, 181, 253, 0.7);
  box-shadow: 0 0 6px rgba(196, 181, 253, 0.5);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 1; transform: scale(1); }
}

/* Center stage */
.welcome-stage-wrap {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
}

/* Orbital logo */
.welcome-logo {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 32px;
}
.welcome-logo .halo {
  position: absolute;
  inset: -20%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, transparent 65%);
  filter: blur(20px);
  animation: halo-pulse 3.6s ease-in-out infinite;
}
@keyframes halo-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.12); }
}

.welcome-logo svg {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 24px rgba(139, 92, 246, 0.6));
}

/* Ring draws + spins */
.ring-base {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: ring-draw 1200ms 100ms var(--ease-out) forwards;
}
@keyframes ring-draw { to { stroke-dashoffset: 0; } }

.ring-outer {
  transform-origin: center;
  opacity: 0;
  animation: ring-fade 500ms 900ms var(--ease-out) forwards, ring-spin 18s 900ms linear infinite;
}
.ring-mid {
  transform-origin: center;
  opacity: 0;
  animation: ring-fade 500ms 1200ms var(--ease-out) forwards, ring-spin-rev 12s 1200ms linear infinite;
}
.ring-inner-arc {
  transform-origin: center;
  opacity: 0;
  animation: ring-fade 500ms 1500ms var(--ease-out) forwards, ring-spin 6s 1500ms linear infinite;
}
@keyframes ring-fade { to { opacity: 1; } }
@keyframes ring-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ring-spin-rev { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

.welcome-planet {
  transform-origin: center;
  animation: planet-pop 600ms 1100ms var(--ease-spring) backwards;
}
@keyframes planet-pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.welcome-core {
  transform-origin: center;
  animation: core-pulse 1.8s ease-in-out infinite;
}
@keyframes core-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.65; }
}

/* Satellite dot riding the outer ring */
.welcome-satellite {
  transform-origin: 32px 32px;
  animation: ring-fade 500ms 1400ms var(--ease-out) forwards, ring-spin 6s 900ms linear infinite;
  opacity: 0;
}

/* Wordmark + tagline */
.welcome-eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--purple-300);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  opacity: 0;
  animation: wm-rise 700ms 800ms var(--ease-out) forwards;
}
.welcome-eyebrow::before,
.welcome-eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-300), transparent);
}

.welcome-wm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.5vw, 52px);
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  line-height: 1;
}
.welcome-wm span {
  display: inline-block;
  opacity: 0;
  animation: wm-letter 600ms var(--ease-spring) forwards;
}
.welcome-wm .gw1 { animation-delay: 950ms; }
.welcome-wm .gw2 { animation-delay: 1080ms; }
.welcome-wm .gw3 {
  animation-delay: 1210ms;
  background: linear-gradient(120deg, #C4B5FD 0%, #A78BFA 50%, #818CF8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes wm-letter {
  from { opacity: 0; transform: translateY(14px) scale(0.95); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.welcome-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: wm-rise 700ms 1500ms var(--ease-out) forwards;
}
.welcome-tagline strong { color: rgba(255,255,255,0.85); font-weight: 600; }
@keyframes wm-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Progress section */
.welcome-progress {
  width: min(320px, 80vw);
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  opacity: 0;
  animation: wm-rise 600ms 1700ms var(--ease-out) forwards;
}
.welcome-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple-500), var(--purple-300));
  border-radius: 999px;
  animation: progress-fill 2200ms 1800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.7);
}
.welcome-progress::after {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1.6s 1900ms ease-in-out infinite;
}
@keyframes progress-fill { to { width: 100%; } }
@keyframes shimmer {
  from { left: -40%; }
  to   { left: 100%; }
}

/* System checks */
.welcome-checks {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  min-height: 88px;
  width: min(320px, 80vw);
}
.welcome-check {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: check-in 400ms var(--ease-out) forwards;
}
.welcome-check.c1 { animation-delay: 1800ms; }
.welcome-check.c2 { animation-delay: 2100ms; }
.welcome-check.c3 { animation-delay: 2400ms; }
.welcome-check.c4 { animation-delay: 2700ms; }
@keyframes check-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 0.85; transform: none; }
}
.welcome-check .tick {
  width: 14px; height: 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.welcome-check .lbl { flex: 1; text-align: left; }
.welcome-check .ms {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
}

/* Footer brand line */
.welcome-foot {
  position: absolute;
  bottom: 28px;
  z-index: 5;
  font-size: 11px;
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: wm-rise 600ms 2200ms var(--ease-out) forwards;
}
.welcome-foot .pulse-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
  animation: pulse-mini 1.6s ease-in-out infinite;
}
@keyframes pulse-mini {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.2); }
}

/* ====================================================
   CLICK SPARKS — minimal particle burst
   ==================================================== */
.spark-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.spark {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--purple-500);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.7);
  --dx: 0px;
  --dy: 0px;
  animation: spark-fly 600ms var(--ease-out) forwards;
}
@keyframes spark-fly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ====================================================
   PROFILE TABS — Consultations + Follow-ups
   ==================================================== */
.consult-card {
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}
.consult-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F3F5;
}
.consult-head .dr-pill {
  background: var(--purple-50);
  color: var(--purple-700);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.consult-section { margin-bottom: 14px; }
.consult-section:last-child { margin-bottom: 0; }
.consult-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.consult-section-body { font-size: 13px; color: var(--gray-700); line-height: 1.55; }

.attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-700);
  background: var(--gray-50);
  margin-right: 6px;
  font-weight: 500;
}
.attachment .file-ico {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--purple-50);
  color: var(--purple-600);
  display: inline-flex; align-items: center; justify-content: center;
}
.attachment .file-size {
  font-family: var(--font-mono);
  color: var(--gray-400);
  font-size: 10px;
}

/* ====================================================
   BILLING — invoices + usage
   ==================================================== */
.plan-banner {
  background: linear-gradient(135deg, var(--purple-50) 0%, var(--purple-100) 100%);
  border: 1px solid var(--purple-200);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.plan-banner .plan-mark {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple-600), var(--indigo-600));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}
.plan-banner .plan-meta { flex: 1; }
.plan-banner .plan-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.plan-banner .plan-price {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}

.usage-meter {
  margin-top: 12px;
}
.usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.usage-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-500), var(--purple-600));
  transition: width 600ms var(--ease-out);
}
.usage-fill.warn { background: linear-gradient(90deg, #F59E0B, #EF4444); }

/* ====================================================
   EMPTY STATE
   ==================================================== */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--purple-50);
  color: var(--purple-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empty-state h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.empty-state p {
  font-size: 13px;
  color: var(--gray-500);
  max-width: 360px;
  line-height: 1.5;
}

/* ====================================================
   STAFF CARD
   ==================================================== */
.staff-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px;
}
.staff-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.staff-card .staff-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.staff-card .staff-stats {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--gray-500);
}
.staff-card .staff-stat-v {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
  display: block;
  letter-spacing: -0.01em;
}

/* ====================================================
   MOBILE MENU TOGGLE (hamburger)
   ==================================================== */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: white;
  color: var(--gray-700);
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 7, 20, 0.5);
  z-index: 40;
}

/* ====================================================
   RESPONSIVE — Tablet (≤ 1024px)
   ==================================================== */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* 60/40 columns collapse */
  .app > main .page > div > div[style*="grid-template-columns: 3fr 2fr"],
  .app > main .page > div > div[style*="grid-template-columns: 35% 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Settings sub-nav goes horizontal */
  .app > main .page > div > div[style*="grid-template-columns: 220px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .app > main .page > div > div[style*="grid-template-columns: 220px 1fr"] > div:first-child {
    flex-direction: row !important;
    overflow-x: auto;
    position: static !important;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: 16px;
    gap: 4px !important;
  }
  .app > main .page > div > div[style*="grid-template-columns: 220px 1fr"] > div:first-child .nav-item {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Communications — sidebar narrower */
  .app > main .page > div[style*="grid-template-columns: 30% 70%"] {
    grid-template-columns: 35% 65% !important;
  }

  .staff-grid { grid-template-columns: 1fr !important; }

  /* Auth two-column */
  .auth-shell { grid-template-columns: 1fr !important; }
  .auth-brand {
    padding: 32px 32px !important;
    min-height: 280px;
  }
  .auth-brand-body { margin: 16px 0 !important; }
  .auth-headline { font-size: 32px !important; }
  .auth-stats { display: none; }
  .auth-form-side { padding: 32px !important; max-width: 100% !important; }
}

/* ====================================================
   RESPONSIVE — Mobile (≤ 768px)
   ==================================================== */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 280ms var(--ease-out);
    box-shadow: 8px 0 32px -8px rgba(15,23,42,0.16);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }

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

  .topbar {
    padding: 0 16px !important;
    height: 56px !important;
  }
  .topbar-title { font-size: 16px !important; }
  .topbar-right { gap: 8px !important; }
  .clinic-chip {
    padding-right: 8px !important;
    max-width: 130px;
    font-size: 12px;
  }
  .clinic-chip > :nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .page {
    padding: 20px 16px !important;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-header h1 { font-size: 22px !important; }

  /* KPIs stack on mobile (2 cols) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .kpi-card { padding: 14px 16px !important; }
  .kpi-value { font-size: 24px !important; }
  .kpi-label { font-size: 11px !important; }

  .card { padding: 18px !important; }

  /* Tables → horizontal scroll */
  .table-card { overflow-x: auto; }
  .table { min-width: 720px; }

  /* Filter row stacks */
  .filter-chips { flex-wrap: wrap; }
  .flex.items-center.justify-between { flex-wrap: wrap; gap: 12px; }

  /* Calendar adjustments */
  .cal-week { font-size: 11px; }
  .cal-day-head { padding: 6px 4px !important; }
  .cal-day-head .num { font-size: 14px !important; }
  .cal-time-label { padding: 6px 4px !important; }
  .cal-cell { min-height: 36px !important; }

  /* Communications grid */
  .app > main .page > div[style*="grid-template-columns: 30% 70%"] {
    grid-template-columns: 1fr !important;
  }
  .conv-list { display: none; }
  .conv-list.mobile-show { display: flex !important; height: calc(100vh - 64px - 32px); }
  .comms-right.mobile-hidden { display: none; }

  /* Banner */
  .banner-gradient {
    padding: 20px 20px !important;
    height: auto !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }
  .banner-gradient h1 { font-size: 22px !important; }

  /* Modal */
  .modal { max-width: 100% !important; margin: 0; max-height: 100vh; border-radius: 12px; }
  .scrim { padding: 12px !important; }
  .modal-body > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* Search overlay */
  .search-overlay { padding-top: 24px !important; }
  .search-modal { max-width: calc(100% - 24px) !important; }

  /* Slide panel */
  .slide-panel { width: 100% !important; }

  /* FAB */
  .fab { bottom: 20px !important; right: 20px !important; }

  /* Toasts */
  .toast-host { right: 12px !important; left: 12px !important; top: 70px !important; }
  .toast { min-width: 0 !important; max-width: 100% !important; }

  /* Auth */
  .auth-brand {
    min-height: 220px;
    padding: 24px !important;
  }
  .auth-headline { font-size: 24px !important; }
  .auth-form-side { padding: 24px !important; }
  .auth-form-body h1 { font-size: 24px !important; }

  /* Picker */
  .picker-top { padding: 20px 16px !important; }
  .picker-body { padding: 12px !important; }
  .picker-card { padding: 22px !important; }
  .picker-card h2 { font-size: 22px !important; }

  /* Welcome loader */
  .welcome-logo { width: 100px !important; height: 100px !important; margin-bottom: 22px !important; }
  .welcome-checks { font-size: 10px !important; }

  /* Stat tiles 2-cols */
  .stat-tile { padding: 12px !important; }
  .stat-tile-value { font-size: 20px !important; }

  /* Profile right panel — tabs stay scrollable */
  .tab-bar { white-space: nowrap; }

  /* Tweaks panel: handled by its own internal CSS — fine */
}

/* ====================================================
   RESPONSIVE — Tiny phones (≤ 420px)
   ==================================================== */
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  .clinic-chip { display: none !important; }
  .auth-eyebrow { display: none; }
  .demo-creds { flex-direction: column; align-items: flex-start; }
  .demo-creds button { margin-left: 0; margin-top: 4px; }
  .welcome-wm { font-size: 28px !important; }
}

