/* ═══════════════════════════════════════════════════════════
   CMD ADMIN PORTAL — Design System
   Centre for Modern Dentistry
   Colors extracted from official CMD logo
═══════════════════════════════════════════════════════════ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
  /* Brand — CMD Blue refined */
  --cmd-blue: #1E8FD5;
  --cmd-blue-dark: #1366A8;
  --cmd-blue-deeper: #0B2E5A;
  --cmd-blue-light: #EBF6FF;
  --cmd-blue-mid: #C9E8FF;
  --cmd-grey: #8DA3B8;
  --cmd-grey-light: #F0F5FA;

  /* Surfaces — warm off-white, feels premium not sterile */
  --bg: #F4F7FB;
  --bg-secondary: #EBF1F9;
  --card: #FFFFFF;
  --card-elevated: #FAFCFF;
  --card-shadow: 0 2px 12px rgba(14, 42, 80, 0.07), 0 1px 3px rgba(14, 42, 80, 0.04);
  --card-shadow-lg: 0 8px 32px rgba(14, 42, 80, 0.12), 0 2px 8px rgba(14, 42, 80, 0.06);

  /* Text — ink-like, not harsh black */
  --text-primary: #0E1F38;
  --text-secondary: #3D5A7A;
  --text-muted: #8DA3B8;
  --text-inverse: #FFFFFF;

  /* Status colors — vivid, accessible */
  --status-show: #10B981;
  --status-show-bg: #D1FAE5;
  --status-show-text: #065F46;
  --status-noshow: #EF4444;
  --status-noshow-bg: #FEE2E2;
  --status-noshow-text: #991B1B;
  --status-tentative: #F59E0B;
  --status-tentative-bg: #FEF3C7;
  --status-tentative-text: #92400E;
  --status-cancel: #94A3B8;
  --status-cancel-bg: #F1F5F9;
  --status-cancel-text: #475569;

  /* PIN keypad */
  --key-bg: #FFFFFF;
  --key-hover: #F0F8FF;
  --key-active: #D6EEFF;
  --key-shadow: 0 2px 10px rgba(30, 143, 213, 0.14);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Font */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-md: 15px;
  --font-size-lg: 18px;
  --font-size-xl: 22px;
  --font-size-2xl: 28px;

  /* Transitions */
  --trans-fast: 100ms ease;
  --trans-normal: 200ms ease;
  --trans-slow: 360ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Safe area (iPhone notch / Android gesture bar) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* CRITICAL: Ensure [hidden] always wins over display:flex/grid etc. */
[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

/* ═══════════════════════════════════════════════
   SCREEN SYSTEM
   .screen — base for every full-screen view
   .active  — the visible screen
═══════════════════════════════════════════════ */
.screen {
  display: none;
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════ */
.screen-login {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  padding-top: calc(var(--safe-top) + var(--space-lg));
  padding-bottom: calc(var(--safe-bottom) + var(--space-lg));
  overflow: hidden;
  background: linear-gradient(160deg, #E8F4FD 0%, #F0F7FF 40%, #EAF3FB 100%);
}

/* Decorative background blobs */
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-blob {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(60px);
  opacity: 0.35;
}

.login-blob-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #2196D3 0%, transparent 70%);
  top: -80px;
  right: -80px;
}

.login-blob-2 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #1565A8 0%, transparent 70%);
  bottom: -60px;
  left: -60px;
}

/* Login Card */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

/* Logo & Header */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.login-logo-wrap {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  background: var(--card);
  box-shadow: var(--card-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
}

.login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-full);
}

.login-clinic-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--cmd-blue-deeper);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--cmd-blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── PIN Dot Display ── */
.pin-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: var(--space-md) var(--space-xl);
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  width: 100%;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--cmd-blue-mid);
  background: transparent;
  transition: background var(--trans-fast), border-color var(--trans-fast),
    transform var(--trans-slow);
}

.pin-dot.filled {
  background: var(--cmd-blue);
  border-color: var(--cmd-blue);
  transform: scale(1.15);
}

/* PIN shake animation (wrong PIN) */
@keyframes pin-shake {
  0% {
    transform: translateX(0);
  }

  15% {
    transform: translateX(-8px);
  }

  30% {
    transform: translateX(8px);
  }

  45% {
    transform: translateX(-6px);
  }

  60% {
    transform: translateX(6px);
  }

  75% {
    transform: translateX(-3px);
  }

  90% {
    transform: translateX(3px);
  }

  100% {
    transform: translateX(0);
  }
}

.pin-display.shake {
  animation: pin-shake 420ms ease;
}

.pin-dot.error {
  border-color: #EF4444;
  background: #EF4444;
}

/* PIN hint text */
.pin-hint {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  min-height: 20px;
  transition: color var(--trans-normal);
}

.pin-hint.error {
  color: #EF4444;
}

/* ── Keypad ── */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.key-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: manipulation;
  justify-content: center;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--key-bg);
  box-shadow: var(--key-shadow);
  font-size: var(--font-size-xl);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
  transition: background var(--trans-fast), transform var(--trans-fast),
    box-shadow var(--trans-fast);
  -webkit-user-select: none;
  user-select: none;
  /* Large tap target */
  min-height: 56px;
}

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

.key-btn:active {
  background: var(--key-active);
  transform: scale(0.93);
  box-shadow: none;
}

/* Letter sub-label on keys (like iPhone) */
.key-sub {
  display: block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Backspace key */
.key-backspace {
  color: var(--text-secondary);
}

/* Empty grid cell (bottom-left placeholder) */
.key-empty {
  height: 64px;
}

/* ── Lockout Banner ── */
.lockout-banner {
  width: 100%;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: #B91C1C;
  font-weight: 500;
}

/* ── Loading spinner (shown while verifying PIN) ── */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pin-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--cmd-blue-mid);
  border-top-color: var(--cmd-blue);
  border-radius: var(--radius-full);
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════
   APP SHELL — Top Bar
═══════════════════════════════════════════════ */
.screen-app {
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-md);
  padding-top: calc(var(--safe-top) + 12px);
  background: var(--card);
  border-bottom: 1px solid rgba(30, 143, 213, 0.10);
  box-shadow: 0 1px 0 rgba(14, 42, 80, 0.06), 0 4px 16px rgba(14, 42, 80, 0.04);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(30, 143, 213, 0.15);
}

.top-bar-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.top-bar-doctor {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--cmd-blue-deeper);
  line-height: 1;
}

.top-bar-date {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.top-bar-logout {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--trans-fast), color var(--trans-fast);
}

.top-bar-logout:hover {
  background: var(--cmd-blue-light);
  color: var(--cmd-blue);
}

/* ═══════════════════════════════════════════════
   APP MAIN CONTENT AREA
═══════════════════════════════════════════════ */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* ── Content column (wraps top-bar + app-main + fab) ── */
.content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.app-view {
  display: none;
}

.app-view.active-view {
  display: block;
}


.coming-soon {
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-md);
}

/* ═══════════════════════════════════════════════
   STAT STRIP — Today summary row
═══════════════════════════════════════════════ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px var(--space-md) 10px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 8px 10px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(14, 42, 80, 0.07);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

/* coloured top accent line */
.stat-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cmd-blue);
  border-radius: 3px 3px 0 0;
}

.stat-pill--green::before {
  background: #10B981;
}

.stat-pill--amber::before {
  background: #F59E0B;
}

.stat-pill--red::before {
  background: #EF4444;
}

.stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-pill--green .stat-num {
  color: #059669;
}

.stat-pill--amber .stat-num {
  color: #D97706;
}

.stat-pill--red .stat-num {
  color: #DC2626;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ═══════════════════════════════════════════════
   APPOINTMENT LIST & CARDS
═══════════════════════════════════════════════ */
.appt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px var(--space-md) var(--space-md);
}

/* Section date label */
.appt-date-header {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 12px 4px 6px;
}

/* Skeleton loaders */
@keyframes skeleton-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.appt-skeleton {
  height: 72px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #EBF1F9 0%, #F4F7FB 50%, #EBF1F9 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  margin-bottom: 8px;
}

/* Appointment Card */
.appt-card {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid rgba(14, 42, 80, 0.07);
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--trans-normal), transform var(--trans-fast);
  cursor: pointer;
  position: relative;
}

.appt-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cmd-blue);
  border-radius: 3px 0 0 3px;
}

.appt-card:active {
  transform: scale(0.99);
  box-shadow: 0 1px 4px rgba(14, 42, 80, 0.06);
}

.appt-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--space-md) 14px 18px;
  min-height: 68px;
}

.appt-time-col {
  flex-shrink: 0;
  width: 46px;
  text-align: center;
}

.appt-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--cmd-blue);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.appt-time-ampm {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.appt-divider {
  width: 1px;
  height: 36px;
  background: var(--cmd-blue-mid);
  flex-shrink: 0;
}

.appt-info {
  flex: 1;
  min-width: 0;
}

.appt-name {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.appt-treatment {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Status Badge — tap to change */
.status-badge {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  transition: opacity var(--trans-fast), transform var(--trans-fast);
  white-space: nowrap;
  text-transform: uppercase;
}

.status-badge:active {
  opacity: 0.7;
  transform: scale(0.93);
}

.badge-show {
  background: var(--status-show-bg);
  color: var(--status-show-text);
}

.badge-noshow {
  background: var(--status-noshow-bg);
  color: var(--status-noshow-text);
}

.badge-tentative {
  background: var(--status-tentative-bg);
  color: var(--status-tentative-text);
}

.badge-confirmed {
  background: rgba(33, 150, 243, 0.1);
  color: #1976D2;
}

.badge-cancel {
  background: var(--status-cancel-bg);
  color: var(--status-cancel-text);
}

/* Expanded card detail */
.appt-detail {
  border-top: 1px solid var(--cmd-blue-light);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--cmd-blue-light);
  animation: slide-down 180ms ease;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.detail-phone a {
  color: var(--cmd-blue);
  font-weight: 600;
  text-decoration: none;
}

.detail-notes {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-style: italic;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: 2px;
}

.btn-detail {
  padding: 8px 24px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 1.5px solid var(--cmd-blue-mid);
  background: var(--card);
  color: var(--cmd-blue);
  transition: background var(--trans-fast), color var(--trans-fast);
  cursor: pointer;
  text-align: center;
}

.btn-detail:active {
  background: var(--cmd-blue);
  color: white;
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  gap: var(--space-sm);
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  line-height: 1;
}

.empty-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.empty-sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   FAB — Floating Action Button
═══════════════════════════════════════════════ */
.fab {
  position: fixed;
  right: var(--space-lg);
  bottom: calc(72px + var(--safe-bottom) + var(--space-md));
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--cmd-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(33, 150, 211, 0.40);
  border: none;
  cursor: pointer;
  z-index: 90;
  transition: transform var(--trans-slow), box-shadow var(--trans-normal), background var(--trans-fast);
}

.fab:hover {
  background: var(--cmd-blue-dark);
  box-shadow: 0 6px 20px rgba(33, 150, 211, 0.50);
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(33, 150, 211, 0.30);
}

/* ═══════════════════════════════════════════════
   BOTTOM NAVIGATION
═══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(14, 42, 80, 0.07);
  box-shadow: 0 -4px 24px rgba(14, 42, 80, 0.08);
  padding-bottom: var(--safe-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--trans-normal);
  min-height: 56px;
  position: relative;
}

.nav-btn.active {
  color: var(--cmd-blue);
}

/* Active indicator pill */
.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2.5px;
  background: var(--cmd-blue);
  border-radius: 0 0 4px 4px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.7;
  transition: stroke-width var(--trans-fast), transform var(--trans-fast);
}

.nav-btn.active .nav-icon {
  stroke-width: 2.2;
  transform: translateY(-1px);
}

.nav-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   BOTTOM SHEETS (Modals)
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 24, 50, 0.5);
  display: flex;
  align-items: flex-end;
  animation: overlay-in 180ms ease;
}

@keyframes overlay-in {
  from {
    background: rgba(8, 24, 50, 0);
  }

  to {
    background: rgba(8, 24, 50, 0.5);
  }
}

.bottom-sheet {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-sm) var(--space-lg) calc(var(--space-xl) + var(--safe-bottom));
  animation: sheet-up 300ms cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(14, 42, 80, 0.18);
}

.bottom-sheet--sm {
  padding-bottom: calc(var(--space-lg) + var(--safe-bottom));
}

@keyframes sheet-up {
  from {
    transform: translateY(60%);
    opacity: 0.6;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: #E2E8F0;
  margin: 0 auto 18px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

/* ── Form elements inside sheet ── */
.sheet-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  padding: 12px 14px;
  border: 1.5px solid var(--cmd-blue-mid);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  background: var(--card);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--cmd-blue);
  box-shadow: 0 0 0 3px rgba(33, 150, 211, 0.12);
}

/* Doctor toggle */
.doctor-toggle {
  display: flex;
  gap: var(--space-sm);
}

.doctor-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--cmd-blue-mid);
  background: var(--card);
  font-family: var(--font);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.doctor-btn.active {
  background: var(--cmd-blue);
  border-color: var(--cmd-blue);
  color: white;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--cmd-blue);
  color: white;
  font-family: var(--font);
  font-size: var(--font-size-md);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background var(--trans-fast), transform var(--trans-fast);
  margin-top: var(--space-sm);
}

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

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

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Status picker sheet ── */
.status-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.status-opt {
  padding: 16px 10px;
  border-radius: var(--radius-lg);
  font-family: var(--font);
  font-size: var(--font-size-md);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity var(--trans-fast), transform var(--trans-fast);
}

.status-opt:active {
  opacity: 0.8;
  transform: scale(0.96);
}

.status-opt--green {
  background: var(--status-show-bg);
  color: var(--status-show-text);
}

.status-opt--blue {
  background: rgba(33, 150, 243, 0.1);
  color: #1976D2;
}

.status-opt--amber {
  background: var(--status-tentative-bg);
  color: var(--status-tentative-text);
}

.status-opt--red {
  background: var(--status-noshow-bg);
  color: var(--status-noshow-text);
}

.status-opt--grey {
  background: var(--status-cancel-bg);
  color: var(--status-cancel-text);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Login: tablet/desktop card
═══════════════════════════════════════════════ */
@media (min-width: 480px) {
  .login-logo-wrap {
    width: 100px;
    height: 100px;
  }

  .login-clinic-name {
    font-size: var(--font-size-xl);
  }

  .key-btn {
    height: 70px;
    font-size: 24px;
  }

  .key-empty {
    height: 70px;
  }
}

@media (min-width: 768px) {
  .screen-login {
    background: linear-gradient(135deg, #1366A8 0%, #1E8FD5 50%, #42A5F5 100%);
  }

  .login-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: 0 20px 60px rgba(13, 62, 110, 0.30);
    max-width: 420px;
  }

  .login-bg {
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════
   DESKTOP SIDEBAR LAYOUT  (≥ 900px)
   Left sidebar nav + right content area.
   Bottom nav hidden. Top bar is in content col.
═══════════════════════════════════════════════ */
@media (min-width: 900px) {

  /* App shell becomes a horizontal flex row */
  .screen-app {
    flex-direction: row;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
  }

  /* ── Sidebar ── */
  .bottom-nav {
    position: static;
    flex-direction: column;
    align-items: stretch;
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    height: 100%;
    border-top: none;
    border-right: 1px solid rgba(14, 42, 80, 0.08);
    box-shadow: 2px 0 16px rgba(14, 42, 80, 0.05);
    padding: 0 0 var(--space-lg);
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--card);
    transform: none;
  }

  /* Sidebar "CMD Portal" label */
  .bottom-nav::before {
    content: 'CMD Portal';
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 28px var(--space-md) 14px;
    border-bottom: 1px solid rgba(14, 42, 80, 0.06);
    margin-bottom: 8px;
  }

  /* Each nav button becomes a full-width sidebar row */
  .nav-btn {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    min-height: 46px;
    border-radius: var(--radius-md);
    margin: 2px 10px;
    width: auto;
    transition: background var(--trans-fast), color var(--trans-fast);
  }

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

  .nav-btn.active {
    background: var(--cmd-blue-light);
    color: var(--cmd-blue);
  }

  /* Remove top indicator — sidebar uses bg highlight */
  .nav-btn.active::before {
    display: none;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .nav-btn.active .nav-icon {
    transform: none;
  }

  .nav-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
  }

  /* ── Right content column ── */
  .app-main {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding-bottom: 0;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Top bar at top of content column */
  .top-bar {
    position: sticky;
    top: 0;
    max-width: none;
    margin: 0;
    border-radius: 0;
    z-index: 50;
  }

  /* FAB inside content column */
  .fab {
    right: var(--space-xl);
    bottom: var(--space-xl);
  }

  /* Modals still cover whole viewport */
  .modal-overlay {
    position: fixed;
    inset: 0;
  }

  /* Active views fill column height */
  .app-view.active-view {
    flex: 1;
  }
}

/* ═══════════════════════════════════════════════
   TABLET — icon-only narrow sidebar (600–899px)
═══════════════════════════════════════════════ */
@media (min-width: 600px) and (max-width: 899px) {
  .screen-app {
    flex-direction: row;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
  }

  .bottom-nav {
    position: static;
    flex-direction: column;
    align-items: center;
    width: 68px;
    min-width: 68px;
    flex-shrink: 0;
    height: 100%;
    border-top: none;
    border-right: 1px solid rgba(14, 42, 80, 0.08);
    padding: var(--space-md) 0;
    gap: 4px;
    overflow-y: auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--card);
    box-shadow: 2px 0 12px rgba(14, 42, 80, 0.06);
    transform: none;
  }

  .nav-btn {
    flex-direction: column;
    justify-content: center;
    padding: 10px 4px;
    width: 52px;
    border-radius: var(--radius-md);
    min-height: unset;
  }

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

  .nav-btn.active {
    background: var(--cmd-blue-light);
  }

  .nav-btn.active::before {
    display: none;
  }

  .nav-label {
    font-size: 8.5px;
    text-transform: uppercase;
  }

  .app-main {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding-bottom: 0;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .top-bar {
    position: sticky;
    top: 0;
    max-width: none;
    margin: 0;
    border-radius: 0;
  }

  .fab {
    right: var(--space-lg);
    bottom: var(--space-lg);
  }
}

/* ============================================================================
   TODAY REDESIGN — aligned with the Dashboard Figma states
   ============================================================================ */
:root {
  --dashboard-bg: #f7f8fa;
  --dashboard-blue: #176fe5;
  --dashboard-ink: #202124;
  --dashboard-muted: #74777e;
  --dashboard-line: #edf0f4;
}

.screen-app {
  background: var(--dashboard-bg);
  color: var(--dashboard-ink);
}

.sidebar-brand {
  display: none;
}

.sidebar-account {
  display: none;
}

.mobile-menu,
.top-bar-actions {
  display: none;
}

.top-bar {
  height: 64px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--dashboard-line);
  box-shadow: none;
}

.top-bar-left {
  gap: 14px;
}

.top-bar-logo {
  display: none;
}

.top-bar-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #202124;
}

.top-bar-date {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: #777b84;
  margin-top: 2px;
}

.top-bar-doctor {
  color: #202124;
}

.today-intro {
  display: none;
}

.stat-strip {
  padding: 24px 0 20px;
  gap: 16px;
}

.stat-pill {
  min-height: 94px;
  align-items: flex-start;
  padding: 20px 24px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 3px 13px rgba(31, 44, 61, .07);
}

.stat-pill::before {
  display: none;
}

.stat-num {
  font-size: 32px;
}

.stat-label {
  font-size: 11px;
  letter-spacing: .06em;
}

.stat-pill::after {
  content: '◫';
  position: absolute;
  right: 22px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #edf4ff;
  color: var(--dashboard-blue);
  font-size: 18px;
}

.stat-pill--green::after {
  content: '✓';
  background: #eefaf3;
  color: #159447;
}

.stat-pill--amber::after {
  content: '◷';
  background: #fff9e7;
  color: #bd8100;
}

.stat-pill--red::after {
  content: '×';
  background: #fff0f1;
  color: #e5282d;
}

.stat-pill--green .stat-num,
.stat-pill--amber .stat-num,
.stat-pill--red .stat-num {
  color: var(--dashboard-ink);
}

.app-main {
  max-width: 1000px;
  width: calc(100% - 48px);
  margin: 0 auto;
  padding-bottom: 32px;
}

.appointments-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 13px rgba(31, 44, 61, .07);
  overflow: hidden;
}

.appointments-heading {
  display: flex;
  flex-direction: column;
  padding: 12px 24px;
  border-bottom: 1px solid var(--dashboard-line);
  gap: 0;
}

.appointments-heading h2 {
  font-size: 16px;
  margin: 0;
}

.appointments-heading h2 span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 6px;
  background: #eaf2ff;
  color: var(--dashboard-blue);
  font-size: 12px;
}

.doctor-filters {
  display: flex;
  gap: 6px;
  padding: 8px 0 4px;
}

.doctor-filter {
  border: 1px solid #e5e8ee;
  border-radius: 9px;
  background: #fff;
  padding: 5px 11px;
  color: #6b707a;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}

.doctor-filter.active {
  color: #fff;
  background: #2d5fa6;
  border-color: #2d5fa6;
}

.appointment-filters {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.appointment-filters button {
  border: 1px solid #e5e8ee;
  border-radius: 9px;
  background: #fff;
  padding: 6px 12px;
  color: #6b707a;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.appointment-filters button.active {
  color: white;
  background: var(--dashboard-blue);
  border-color: var(--dashboard-blue);
}

.appointments-heading small {
  display: none;
}

.appointment-table-head {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 110px 100px 104px;
  gap: 16px;
  padding: 13px 24px;
  color: #777b84;
  background: #fcfcfd;
  border-bottom: 1px solid var(--dashboard-line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.appointment-table-head span:nth-child(3) {
  text-align: center;
  /* perfectly centers the header above the badge */
}

.appointment-table-head span:nth-child(4) {
  text-align: right;
  padding-right: 18px;
}

.appt-list {
  padding: 0;
}

.appt-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--dashboard-line);
  box-shadow: none;
}

.appt-card::before {
  display: none;
}

.appt-card-main {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto auto 32px;
  gap: 8px;
  padding: 14px 16px;
  min-height: 72px;
}

.appt-time-col {
  width: auto;
  text-align: left;
}

.appt-doctor {
  display: flex;
  justify-content: center;
  align-items: center;
}




.appt-time {
  color: var(--dashboard-ink);
  font-size: 14px;
}

.appt-time-ampm {
  display: inline;
  margin-left: 3px;
  color: var(--dashboard-ink);
  font-size: 14px;
}

.appt-divider {
  height: 38px;
  background: var(--dashboard-line);
}

.patient-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.patient-avatar--blue {
  background: #4b9cf1;
}

.patient-avatar--purple {
  background: #7762e9;
}

.patient-avatar--coral {
  background: #ff7479;
}

.patient-avatar--green {
  background: #31ac57;
}

.patient-avatar--orange {
  background: #ff9800;
}

.patient-avatar--cyan {
  background: #4bb9e8;
}

.appt-info {
  align-self: center;
}

.appt-name {
  font-size: 14px;
  color: #202124;
}

.appt-treatment {
  font-size: 12px;
  color: #858991;
}

.status-badge {
  justify-self: end;
  align-self: center;
  padding: 5px 11px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.badge-show {
  color: #159447;
}

.badge-tentative {
  color: #1669d8;
  background: #edf4ff;
}

.badge-noshow {
  color: #e5282d;
}

.appt-view,
.appt-more {
  align-self: center;
  border: 1px solid #e3e7ed;
  background: #fff;
  color: #202124;
  border-radius: 9px;
  height: 34px;
  cursor: pointer;
}

.appt-view {
  font-size: 12px;
}

.appt-more {
  font-size: 19px;
  line-height: 1;
}

.appt-detail {
  grid-column: 1 / -1;
  margin: 0 24px 14px;
  border-radius: 8px;
}

.filtered-empty {
  padding: 34px 20px;
  color: #858991;
  text-align: center;
  font-size: 13px;
}

.fab {
  width: 60px;
  height: 60px;
  right: 28px;
  bottom: 28px;
  background: var(--dashboard-blue);
}

@media (min-width: 900px) {
  .bottom-nav {
    width: 220px;
    min-width: 220px;
    padding: 0 8px 14px;
    background: #fff;
    box-shadow: none;
  }

  .bottom-nav::before {
    display: none;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--dashboard-line);
  }

  .sidebar-brand img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
  }

  .sidebar-brand strong,
  .sidebar-brand span {
    display: block;
  }

  .sidebar-brand strong {
    font-size: 16px;
  }

  .sidebar-brand span {
    font-size: 9px;
    color: #777b84;
    white-space: nowrap;
  }

  .nav-btn {
    min-height: 40px;
    margin: 2px 0;
    padding: 9px 12px;
  }

  .nav-btn.active {
    background: var(--dashboard-blue);
    color: #fff;
  }

  .nav-btn.active .nav-icon {
    stroke-width: 2;
  }

  .sidebar-account {
    display: block;
    margin-top: auto;
    padding: 15px 4px 0;
    border-top: 1px solid var(--dashboard-line);
  }

  .account-summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 4px 12px;
  }

  .account-summary strong,
  .account-summary small {
    display: block;
  }

  .account-summary strong {
    font-size: 13px;
  }

  .account-summary small {
    color: #80838a;
    font-size: 10px;
    margin-top: 3px;
  }

  .account-avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background: var(--dashboard-blue);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
  }

  .sidebar-logout {
    width: 100%;
    height: 38px;
    border: 1px solid #ffc6c8;
    color: #ed373c;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
  }

  .sidebar-logout span {
    font-size: 18px;
    margin-right: 5px;
  }

  .top-bar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .notification-btn,
  .profile-btn {
    border: 1px solid #e7eaf0;
    background: #fff;
    cursor: pointer;
  }

  .notification-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 20px;
  }

  .notification-btn i {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f04444;
  }

  .profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 5px;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
  }

  .profile-btn .account-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 10px;
  }
}

@media (max-width: 899px) {
  .screen-app {
    background: #f7f8fa;
  }

  .top-bar {
    height: 60px;
    padding: 0 16px;
    justify-content: center;
  }

  .top-bar-left {
    position: relative;
    justify-content: center;
    gap: 7px;
  }

  .top-bar-logo {
    display: block;
    width: 28px;
    height: 28px;
    box-shadow: none;
  }

  .top-bar-title {
    font-size: 0;
  }

  .top-bar-title::after {
    content: 'Today';
    font-size: 15px;
  }

  .top-bar-date {
    position: absolute;
    top: 22px;
    left: 36px;
    font-size: 10px;
  }

  .top-bar-actions {
    display: block;
    position: absolute;
    right: 16px;
  }

  .notification-btn,
  .profile-btn {
    display: none;
  }

  .mobile-menu {
    display: none;
  }

  .top-bar-left::after {
    content: 'DM';
    position: absolute;
    left: calc(100vw - 46px);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dashboard-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
  }

  .app-main {
    width: 100%;
    margin: 0;
    padding: 0 16px calc(78px + var(--safe-bottom));
  }

  .today-intro {
    display: block;
    padding: 20px 0 10px;
  }

  .today-intro p {
    margin: 0 0 8px;
    color: #70747d;
    font-size: 14px;
  }

  .today-intro h1 {
    margin: 0;
    font-size: 20px;
  }

  .stat-strip {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 8px 0 20px;
    margin-right: -16px;
    scrollbar-width: none;
  }

  .stat-strip::-webkit-scrollbar {
    display: none;
  }

  .stat-pill {
    flex: 0 0 141px;
    min-height: 90px;
    padding: 14px;
  }

  .stat-num {
    font-size: 25px;
  }

  .stat-pill::after {
    right: 12px;
    top: 14px;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .stat-label {
    font-size: 10px;
  }

  .appointments-panel {
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .appointments-heading {
    padding: 0 0 10px;
    background: transparent;
    border: 0;
  }

  .appointments-heading h2 {
    font-size: 16px;
  }

  .appointment-filters,
  .appointment-table-head {
    display: none;
  }

  .appointments-heading-bottom {
    gap: 6px;
  }

  .appointments-heading small {
    display: block;
    margin-left: auto;
    color: #777b84;
    font-size: 10px;
  }

  .appt-list,
  .schedule-day-section {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .appt-card {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 3px 10px rgba(31, 44, 61, .07);
    overflow: hidden;
  }

  .appt-card-main {
    display: grid;
    grid-template-columns: 64px 1px 30px minmax(80px, 1fr) auto 12px;
    gap: 8px;
    min-height: 73px;
    padding: 12px 12px 12px 15px;
  }

  .appt-time {
    font-size: 16px;
    color: var(--dashboard-blue);
    text-align: center;
  }

  .appt-time-ampm {
    display: block;
    margin: 1px 0 0;
    text-align: center;
    font-size: 9px;
  }

  .appt-divider {
    height: 38px;
  }

  .patient-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .appt-name {
    font-size: 14px;
  }

  .appt-treatment {
    font-size: 11px;
  }

  .status-badge {
    padding: 5px 8px;
    font-size: 11px;
  }

  .appt-view,
  .appt-more {
    display: none;
  }

  .appt-card-main::after {
    content: '›';
    color: #c8ccd3;
    font-size: 22px;
    align-self: center;
  }

  .appt-detail {
    grid-column: 1 / -1;
    margin: 0 12px 12px;
  }

  .fab {
    width: 54px;
    height: 54px;
    right: 16px;
    bottom: calc(70px + var(--safe-bottom));
  }
}

/* ═══════════════════════════════════════════════
   Patients — Figma responsive layout
═══════════════════════════════════════════════ */
.patients-page-head {
  height: 86px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-sizing: border-box;
}

.patients-page-head h1 {
  margin: 0;
  font-size: 20px;
  line-height: 26px;
  color: #1c1c1e;
  letter-spacing: -.4px;
}

.patients-page-head p {
  margin: 2px 0 0;
  color: #6e6e73;
  font-size: 13px;
}

.patients-head-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.patients-search-box {
  width: 380px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.patients-search-box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #9ca3af;
  stroke-width: 1.8;
  flex: none;
}

.patients-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202124;
  font: 500 13px inherit;
}

.patients-search-box button {
  border: 0;
  background: none;
  color: #8b929b;
  font-size: 20px;
  cursor: pointer;
}

.patients-add-btn,
.patients-mobile-add {
  border: 0;
  border-radius: 8px;
  height: 38px;
  padding: 0 18px;
  background: #1a73e8;
  color: #fff;
  font: 700 13px inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

.patients-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.patients-list-panel {
  width: 380px;
  flex: 0 0 380px;
  background: #f7f8fa;
  border-right: 1px solid #e5e7eb;
  overflow: auto;
  padding: 12px 14px 16px;
  box-sizing: border-box;
}

.patient-filter-row {
  display: flex;
  gap: 6px;
}

.patient-filter {
  padding: 6px 13px;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  background: #fff;
  color: #6e6e73;
  font: 600 12px inherit;
  cursor: pointer;
}

.patient-filter.active {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.patient-count {
  padding: 14px 0 10px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
}

.patient-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patient-card {
  width: 100%;
  min-height: 68px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 30, 50, .06);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  font-family: inherit;
}

.patient-card:hover,
.patient-card.selected {
  border-color: #1a73e8;
  background: #edf4ff;
}

.patient-card-avatar,
.patient-detail-avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
}

.patient-card-avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.patient-card-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.patient-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #202124;
  font-size: 14px;
  font-weight: 700;
}

.patient-card-copy small {
  color: #777b84;
  font-size: 11px;
}

.patient-status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #2cad63;
  box-shadow: 0 0 0 3px #e6f6eb;
}

.patient-status-dot.inactive {
  background: #9ca3af;
  box-shadow: 0 0 0 3px #eef0f3;
}

.patient-status-dot.new {
  background: #1a73e8;
  box-shadow: 0 0 0 3px #e6efff;
}

.patient-card-chevron {
  color: #a3a9b0;
  font-size: 23px;
  line-height: 1;
}

.patients-empty-list {
  padding: 40px 16px;
  text-align: center;
  color: #9ca3af;
}

.patients-empty-list strong,
.patients-empty-list span {
  display: block;
}

.patients-empty-list span {
  margin-top: 5px;
  font-size: 12px;
}

.patient-detail-panel {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: #fff;
}

.patient-detail-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #556070;
}

.patient-detail-empty span {
  color: #a4acb8;
  font-size: 13px;
}

.patient-empty-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #f1f3f6;
  color: #1a73e8;
  font-size: 38px;
}

.patient-detail-hero {
  min-height: 157px;
  padding: 28px;
  display: flex;
  gap: 20px;
  border-bottom: 1px solid #edf0f3;
  box-sizing: border-box;
}

.patient-detail-avatar {
  width: 80px;
  height: 80px;
  font-size: 26px;
  box-shadow: 0 4px 12px rgba(30, 40, 60, .15);
}

.patient-detail-identity {
  flex: 1;
  min-width: 0;
}

.patient-detail-identity>div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-detail-identity h2 {
  margin: 0;
  color: #1c1c1e;
  font-size: 25px;
  letter-spacing: -.7px;
}

.patient-detail-identity p {
  margin: 8px 0 10px;
  color: #6e6e73;
  font-size: 13px;
}

.patient-status {
  padding: 5px 10px;
  border-radius: 8px;
  background: #eaf8ef;
  color: #19934a;
  font-size: 11px;
  font-weight: 700;
}

.patient-status.inactive {
  background: #f0f1f3;
  color: #7d8490;
}

.patient-status.new {
  background: #e9f1ff;
  color: #1a73e8;
}

.patient-detail-actions {
  display: flex;
  gap: 10px;
}

.patient-detail-actions button {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font: 600 13px inherit;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background: #1a73e8;
  color: #fff;
}

.secondary-action,
.more-action {
  border: 1px solid #e0e4ea;
  background: #fff;
  color: #30343b;
}

.more-action {
  width: 38px;
  padding: 0 !important;
}

.patient-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 28px;
  background: #fff;
}

.patient-stat-cards>div {
  min-height: 88px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(25, 35, 50, .08);
  box-sizing: border-box;
}

.patient-stat-cards small {
  color: #777b84;
  font-size: 10px;
  letter-spacing: .08em;
}

.patient-stat-cards strong {
  color: #202124;
  font-size: 23px;
}

.patient-stat-cards span {
  color: #8c939d;
  font-size: 12px;
}

.patient-stat-cards .balance-clear {
  color: #20934d;
}

.patient-detail-tabs {
  height: 46px;
  display: flex;
  align-items: flex-end;
  gap: 30px;
  padding: 0 28px;
  border-bottom: 1px solid #e5e7eb;
}

.patient-detail-tabs button {
  height: 46px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #6e6e73;
  font: 500 13px inherit;
  cursor: pointer;
}

.patient-detail-tabs button.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  font-weight: 700;
}

.patient-detail-body {
  padding: 28px;
  background: #f7f8fa;
  min-height: 300px;
}

.detail-section-title {
  margin: 2px 0 12px;
  color: #202124;
  font-size: 13px;
  font-weight: 700;
}

.detail-section-title em {
  margin-left: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: #e9f1ff;
  color: #1a73e8;
  font-size: 11px;
  font-style: normal;
}

.past-title {
  margin-top: 24px;
}

.detail-visit-row {
  min-height: 60px;
  margin-bottom: 10px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 14px;
  align-items: center;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 30, 50, .06);
  box-sizing: border-box;
}

.detail-visit-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-visit-row strong {
  font-size: 12px;
}

.detail-visit-row small,
.detail-visit-row span {
  color: #777b84;
  font-size: 12px;
}

.visit-status {
  padding: 5px 9px;
  border-radius: 7px;
  background: #eaf8ef;
  color: #20934d;
  font-size: 11px;
}

.detail-no-data,
.detail-loading {
  padding: 30px;
  color: #9ca3af;
  text-align: center;
}

.treatment-timeline article {
  position: relative;
  margin-left: 16px;
  padding: 0 0 20px 32px;
  border-left: 1px solid #dce1e8;
}

.treatment-timeline article>i {
  position: absolute;
  left: -8px;
  top: 0;
  width: 14px;
  height: 14px;
  border: 2px solid #1a73e8;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
}

.treatment-timeline article>div {
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 30, 50, .07);
}

.treatment-timeline strong {
  font-size: 14px;
}

.treatment-timeline time {
  float: right;
  color: #8c939d;
  font-size: 11px;
}

.treatment-timeline p {
  margin: 10px 0 5px;
  color: #777b84;
  font-size: 12px;
}

.treatment-timeline small {
  color: #7b8490;
  font-size: 11px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.file-grid>div {
  min-height: 150px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 30, 50, .07);
  color: #1a73e8;
  font-size: 26px;
}

.file-grid strong {
  color: #202124;
  font-size: 12px;
}

.file-grid small {
  color: #8c939d;
  font-size: 11px;
}

.file-grid button {
  margin-top: auto;
  height: 30px;
  border: 1px solid #e1e5eb;
  border-radius: 7px;
  background: #fff;
  color: #6e6e73;
}

.patients-mobile-add {
  display: none;
}

.add-patient-sheet {
  width: min(626px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  padding: 28px 30px 30px;
  border-radius: 18px;
  background: #fff;
  box-sizing: border-box;
}

.add-patient-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid #edf0f3;
}

.add-patient-heading h2 {
  margin: 0;
  font-size: 22px;
}

.add-patient-heading p {
  margin: 4px 0 0;
  color: #777b84;
  font-size: 13px;
}

.add-patient-heading button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6e6e73;
  font-size: 24px;
  cursor: pointer;
}

.add-patient-sheet form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  padding-top: 24px;
}

.add-patient-sheet label,
.add-patient-sheet fieldset {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #30343b;
  font-size: 12px;
  font-weight: 700;
}

.add-patient-sheet label:first-child {
  grid-column: 1/-1;
}

.add-patient-sheet input {
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  outline: 0;
  font: 500 14px inherit;
  box-sizing: border-box;
}

.add-patient-sheet input:focus {
  border-color: #1a73e8;
}

.add-patient-sheet fieldset {
  grid-column: 1/-1;
  border: 0;
  padding: 0;
  margin: 0;
}

.add-patient-sheet legend {
  padding: 0;
}

.gender-options {
  display: flex;
  gap: 8px;
}

.gender-options button {
  flex: 1;
  height: 40px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #fff;
  color: #6e6e73;
  font: 600 12px inherit;
  cursor: pointer;
}

.gender-options button.selected {
  border-color: #1a73e8;
  background: #e9f1ff;
  color: #1a73e8;
}

.save-patient-btn {
  grid-column: 1/-1;
  height: 46px;
  border: 0;
  border-radius: 9px;
  background: #1a73e8;
  color: #fff;
  font: 700 14px inherit;
  cursor: pointer;
}

@media (max-width:899px) {
  .patients-page-head {
    height: 56px;
    padding: 0 16px;
  }

  .patients-page-head>div:first-child p {
    display: none;
  }

  .patients-page-head h1 {
    font-size: 17px;
  }

  .patients-head-actions {
    width: 40px;
  }

  .patients-search-box {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    background: #fff;
  }

  .patients-search-box input,
  .patients-search-box button,
  .patients-add-btn {
    display: none;
  }

  .patients-search-box svg {
    width: 17px;
  }

  .patients-workspace {
    display: block;
    overflow: auto;
  }

  .patients-list-panel {
    width: 100%;
    border: 0;
    padding: 10px 16px 108px;
    background: #f7f8fa;
  }

  .patient-filter-row {
    gap: 8px;
  }

  .patient-filter {
    min-height: 32px;
    padding: 6px 14px;
  }

  .patient-count {
    padding: 10px 0 5px;
  }

  .patient-card {
    min-height: 72px;
    padding: 10px 14px;
  }

  .patient-card-avatar {
    width: 48px;
    height: 48px;
    font-size: 15px;
  }

  .patient-card-copy strong {
    font-size: 15px;
  }

  .patient-card-copy small {
    font-size: 12px;
  }

  .patient-detail-panel {
    display: none;
  }

  .patients-mobile-add {
    display: block;
    position: fixed;
    z-index: 20;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    height: 48px;
    border-radius: 999px;
    padding: 0 28px;
    box-shadow: 0 4px 18px rgba(26, 115, 232, .35);
  }

  .add-patient-sheet {
    width: 100%;
    max-height: calc(100vh - 74px);
    padding: 22px 20px 32px;
    border-radius: 22px 22px 0 0;
  }

  .add-patient-heading {
    padding-bottom: 18px;
  }

  .add-patient-heading h2 {
    font-size: 18px;
  }

  .add-patient-sheet form {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 18px;
  }

  .add-patient-sheet label:first-child {
    grid-column: auto;
  }

  .add-patient-sheet fieldset,
  .save-patient-btn {
    grid-column: auto;
  }

  .add-patient-sheet input {
    height: 47px;
  }

  .patient-detail-tabs {
    gap: 22px;
    overflow: auto;
    padding: 0 16px;
  }

  .patient-detail-body {
    padding: 16px;
  }

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

/* Desktop sidebar states from the two dashboard Figma frames. */
.sidebar-toggle {
  display: none;
}

.toggle-collapsed {
  display: none;
}

@media (min-width: 900px) {
  .sidebar-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-right: 16px;
    border: 1px solid #e7eaf0;
    border-radius: 9px;
    background: #fff;
    color: #6e747d;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
  }

  .sidebar-toggle .toggle-expanded {
    transform: translateY(-1px);
  }

  .screen-app.sidebar-collapsed .bottom-nav {
    width: 72px;
    min-width: 72px;
    padding-left: 8px;
    padding-right: 8px;
    align-items: center;
  }

  .screen-app.sidebar-collapsed .sidebar-brand {
    width: 56px;
    padding: 20px 9px;
    justify-content: center;
  }

  .screen-app.sidebar-collapsed .sidebar-brand div,
  .screen-app.sidebar-collapsed .nav-label,
  .screen-app.sidebar-collapsed .sidebar-account strong,
  .screen-app.sidebar-collapsed .sidebar-account small {
    display: none;
  }

  .screen-app.sidebar-collapsed .nav-btn {
    width: 56px;
    min-height: 40px;
    justify-content: center;
    padding: 9px 0;
    gap: 0;
  }

  .screen-app.sidebar-collapsed .sidebar-account {
    width: 56px;
    padding-left: 0;
    padding-right: 0;
  }

  .screen-app.sidebar-collapsed .account-summary {
    justify-content: center;
    padding-bottom: 12px;
  }

  .screen-app.sidebar-collapsed .sidebar-logout {
    width: 56px;
    font-size: 0;
  }

  .screen-app.sidebar-collapsed .sidebar-logout span {
    font-size: 20px;
    margin: 0;
  }

  .screen-app.sidebar-collapsed .toggle-expanded {
    display: none;
  }

  .screen-app.sidebar-collapsed .toggle-collapsed {
    display: inline;
    font-size: 18px;
  }

  .screen-app.sidebar-collapsed .top-bar {
    padding-left: 24px;
  }
}

/* ═══════════════════════════════════════════════
   PATIENTS VIEW & SEARCH
═══════════════════════════════════════════════ */
.search-bar-wrap {
  padding: var(--space-md) var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(13, 62, 110, 0.05);
  padding: 0 16px;
  height: 52px;
  border: 1px solid rgba(14, 42, 80, 0.06);
}

.search-input-box:focus-within {
  border-color: var(--cmd-blue-light);
  box-shadow: 0 0 0 3px rgba(33, 150, 211, 0.15);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 12px;
  font-family: var(--font);
  font-size: var(--font-size-md);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  background: transparent;
  border: none;
  padding: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -8px;
  border-radius: var(--radius-full);
}

.search-clear:hover {
  background: var(--bg);
  color: var(--text);
}

.search-clear[hidden] {
  display: none;
}

.search-clear svg {
  width: 18px;
  height: 18px;
}

/* Patient List */
.patient-list {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.patient-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 4px 12px rgba(13, 62, 110, 0.04);
  border: 1px solid rgba(14, 42, 80, 0.04);
  cursor: pointer;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.patient-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(13, 62, 110, 0.08);
}

.patient-card:active {
  transform: scale(0.98);
}

.patient-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.patient-name {
  font-weight: 700;
  font-size: var(--font-size-md);
  color: var(--text);
}

.patient-phone {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.patient-meta-row {
  display: flex;
  gap: 12px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════
   PATIENT PROFILE & TREATMENTS
═══════════════════════════════════════════════ */
.patient-profile-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.profile-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.meta-tag {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid rgba(14, 42, 80, 0.08);
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.treatment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-left: 2px solid var(--cmd-blue-light);
  padding-left: 16px;
  margin-left: 8px;
}

.treatment-item {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(14, 42, 80, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px;
}

/* Timeline dot */
.treatment-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cmd-blue);
  box-shadow: 0 0 0 4px var(--card);
}

.treatment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.treatment-date {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--cmd-blue);
  text-transform: uppercase;
}

.treatment-doctor {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.treatment-details {
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.treatment-tooth {
  margin-top: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  background: var(--bg);
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.treatment-notes {
  margin-top: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* Figma source alignment overrides */
body,
.screen-app,
.screen-app button,
.screen-app input {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.mobile-cmd-label {
  display: none;
}

.patient-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

@media (min-width: 900px) {
  .bottom-nav {
    width: 220px;
    min-width: 220px;
    padding: 0;
    border-right: 1px solid #f0f0f2;
  }

  .sidebar-brand {
    padding: 20px 16px 12px;
    margin: 0;
    border: 0;
  }

  .sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .bottom-nav .nav-btn {
    width: calc(100% - 16px);
    min-height: 40px;
    margin: 0 8px;
    padding: 10px 12px;
    border-radius: 8px;
    gap: 10px;
  }

  .bottom-nav .nav-btn+.nav-btn {
    margin-top: 2px;
  }

  .bottom-nav .nav-label {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.1px;
  }

  .bottom-nav .nav-btn.active .nav-label {
    font-weight: 600;
  }

  .bottom-nav .nav-icon {
    width: 20px;
    height: 20px;
  }

  .sidebar-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-right: 16px;
    border: 1px solid #e7eaf0;
    border-radius: 9px;
    background: #fff;
    color: #6e747d;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
  }

  .screen-app.sidebar-collapsed .bottom-nav {
    width: 72px;
    min-width: 72px;
    padding-left: 0;
    padding-right: 0;
    align-items: center;
  }

  .screen-app.sidebar-collapsed .sidebar-brand {
    width: 56px;
    padding: 20px 8px 12px;
    justify-content: center;
  }

  .screen-app.sidebar-collapsed .sidebar-brand div,
  .screen-app.sidebar-collapsed .nav-label,
  .screen-app.sidebar-collapsed .sidebar-account strong,
  .screen-app.sidebar-collapsed .sidebar-account small {
    display: none;
  }

  .screen-app.sidebar-collapsed .bottom-nav .nav-btn {
    width: 56px;
    min-height: 40px;
    margin-left: 8px;
    margin-right: 8px;
    justify-content: center;
    padding: 10px;
    gap: 0;
  }

  .screen-app.sidebar-collapsed .sidebar-account {
    width: 56px;
    padding-left: 0;
    padding-right: 0;
  }

  .screen-app.sidebar-collapsed .account-summary {
    justify-content: center;
    padding-bottom: 12px;
  }

  .screen-app.sidebar-collapsed .sidebar-logout {
    width: 56px;
    font-size: 0;
  }

  .screen-app.sidebar-collapsed .sidebar-logout span {
    font-size: 20px;
    margin: 0;
  }

  .screen-app.sidebar-collapsed .toggle-expanded {
    display: none;
  }

  .screen-app.sidebar-collapsed .toggle-collapsed {
    display: inline;
    font-size: 18px;
  }

  .appt-card-main {
    grid-template-columns: 100px minmax(0, 1fr) auto auto;
    gap: 16px;
  }

  .appt-time-col {
    width: 100px;
  }
}

@media (max-width: 899px) {
  .top-bar {
    height: 60px;
    padding: 0 16px;
    justify-content: flex-start;
  }

  .top-bar-left {
    position: static;
    justify-content: flex-start;
    gap: 8px;
  }

  .top-bar-logo {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: none;
  }

  .mobile-cmd-label {
    display: inline;
    font-size: 15px;
    font-weight: 800;
    color: #1c1c1e;
    letter-spacing: -0.3px;
  }

  .top-bar-info {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
  }

  .top-bar-title {
    font-size: 16px;
  }

  .top-bar-date {
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
  }

  .top-bar-actions {
    display: block;
    position: absolute;
    right: 16px;
  }

  .profile-btn {
    display: flex;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #e0eeff;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    justify-content: center;
  }

  .profile-btn .account-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    background: transparent;
    font-size: 12px;
  }

  .profile-btn>span:not(.account-avatar) {
    display: none;
  }

  .notification-btn,
  .sidebar-toggle,
  .mobile-menu {
    display: none;
  }

  .patient-group {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
  }

  .patient-group .appt-info {
    min-width: 0;
  }

  .patient-group .appt-name {
    line-height: 26px;
  }


  .appt-card-main {
    display: flex;
    gap: 12px;
    min-height: 0;
    padding: 14px 16px;
  }

  .appt-time-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    flex-shrink: 0;
    padding-right: 12px;
    border-right: 1px solid #e5e7eb;
  }

  .appt-time {
    font-size: 15px;
    color: #1a73e8;
    text-align: center;
  }

  .appt-time-ampm {
    display: block;
    margin: 1px 0 0;
    text-align: center;
    font-size: 9px;
  }

  .patient-avatar {
    display: none;
  }

  .appt-name {
    font-size: 14px;
  }

  .appt-treatment {
    font-size: 11px;
  }

  .status-badge {
    padding: 3px 9px;
    font-size: 11px;
  }

  .appt-actions {
    display: none;
  }

  .appt-card-main::after {
    content: '›';
    color: #d1d5db;
    font-size: 20px;
    align-self: center;
  }
}

.doctor-profile-sheet {
  width: 100%;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px 40px;
  box-sizing: border-box;
  animation: sheet-up 300ms cubic-bezier(.32, .72, 0, 1);
}

.doctor-profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.doctor-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.doctor-profile-summary>.doctor-profile-avatar {
  display: grid !important;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.doctor-profile-summary strong,
.doctor-profile-summary span,
.doctor-profile-summary em {
  display: block;
  font-style: normal;
}

.doctor-profile-summary strong {
  font-size: 18px;
  letter-spacing: -.3px;
}

.doctor-profile-summary span {
  margin-top: 3px;
  color: #6e6e73;
  font-size: 13px;
}

.doctor-profile-summary em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eefbf2;
  color: #1e8a4a;
  font-size: 11px;
  font-weight: 700;
}

.doctor-profile-summary em i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34a853;
}

.doctor-profile-logout {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  border: 1.5px solid #fecaca;
  background: transparent;
  color: #ea4335;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 899px) {
  .doctor-profile-modal {
    background: rgba(0, 0, 0, 0.45) !important;
    animation: none !important;
  }
}

@media (min-width: 900px) {
  .doctor-profile-modal {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════
   Settings — Figma desktop and mobile workspace
═══════════════════════════════════════════════ */
#screen-app.settings-active .top-bar-title::after {
  content: none;
}

#screen-app.settings-active .top-bar-title {
  font-size: 17px;
}

.settings-root {
  height: 100%;
  min-height: 0;
  color: #1c1c1e;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.settings-layout {
  display: flex;
  gap: 24px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.settings-sidebar,
.settings-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.settings-sidebar {
  width: 260px;
  flex: 0 0 260px;
  overflow-y: auto;
  padding: 8px 0;
}

.settings-sidebar hr {
  margin: 6px 16px;
  border: 0;
  border-top: 1px solid #f3f4f6;
}

.settings-group-label {
  margin: 14px 20px 4px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.settings-nav-item {
  width: calc(100% - 16px);
  height: 44px;
  margin: 1px 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  font: 500 14px 'Plus Jakarta Sans', sans-serif;
  text-align: left;
}

.settings-nav-item:hover {
  background: #f3f4f6;
}

.settings-nav-item.is-active {
  background: #ebf2ff;
  color: #1a73e8;
  font-weight: 700;
}

.settings-nav-item>span:nth-child(2) {
  flex: 1;
}

.settings-nav-item .settings-nav-icon {
  display: flex;
  color: #9ca3af;
}

.settings-nav-item.is-active .settings-nav-icon {
  color: #1a73e8;
}

.settings-nav-item>svg {
  margin-left: auto;
  color: #c7c7cc;
}

.settings-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px;
}

.settings-section {
  max-width: 860px;
  margin: 0 auto;
}

.settings-section-header {
  margin-bottom: 28px;
}

.settings-section-header h2,
.settings-section-title-row h2 {
  margin: 0 0 4px;
  color: #1c1c1e;
  font-size: 18px;
  font-weight: 600;
}

.settings-section-header p,
.settings-section-title-row p {
  margin: 0;
  color: #6e6e73;
  font-size: 13px;
}

.settings-section-header hr,
.settings-title-rule {
  margin: 16px 0 0;
  border: 0;
  border-top: 1px solid #f3f4f6;
}

.settings-profile-photo {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.settings-large-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #673ab7;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.settings-large-avatar>div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .2s ease;
}

.settings-large-avatar:hover>div {
  opacity: 1;
}

.settings-large-avatar small {
  font-size: 10px;
  font-weight: 700;
}

.settings-profile-photo strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.settings-profile-photo p {
  margin: 0 0 10px;
  color: #6e6e73;
  font-size: 13px;
}

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

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-field>span,
.settings-logo-upload>label,
.settings-color-pick>label {
  color: #1c1c1e;
  font-size: 13px;
  font-weight: 600;
}

.settings-input-wrap {
  position: relative;
}

.settings-input-wrap input,
.settings-field input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: #1c1c1e;
  font: 14px 'Plus Jakarta Sans', sans-serif;
}

.settings-input-wrap input:focus,
.settings-field input:focus {
  border-color: #1a73e8;
}

.settings-input-wrap input::placeholder {
  color: #9ca3af;
}

.settings-eye {
  position: absolute;
  top: 0;
  right: 12px;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #9ca3af;
  cursor: pointer;
}

.settings-input-wrap:has(.settings-eye) input {
  padding-right: 44px;
}

.settings-outline-btn {
  height: 34px;
  padding: 0 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #1c1c1e;
  cursor: pointer;
  font: 600 13px 'Plus Jakarta Sans', sans-serif;
}

.settings-outline-btn:hover {
  background: #f7f8fa;
}

.settings-outline-btn.is-danger {
  border-color: #fca5a5;
  color: #ea4335;
}

.settings-primary-btn {
  height: 40px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
  font: 700 14px 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
}

.settings-primary-btn:hover {
  background: #1769d1;
}

.settings-inline-end {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.settings-savebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f3f4f6;
}

.settings-discard {
  padding: 0 4px;
  border: 0;
  background: none;
  color: #6e6e73;
  cursor: pointer;
  font: 600 14px 'Plus Jakarta Sans', sans-serif;
}

.settings-divider {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid #f3f4f6;
}

.settings-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #d1d5db;
  cursor: pointer;
  transition: background .2s ease;
}

.settings-toggle.is-on {
  background: #1a73e8;
}

.settings-toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: left .2s ease;
}

.settings-toggle.is-on span {
  left: 22px;
}

.settings-security-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.settings-security-card strong,
.settings-notification-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.settings-security-card p,
.settings-notification-row p,
.settings-export-card p,
.settings-danger-card p {
  margin: 0;
  color: #6e6e73;
  font-size: 13px;
}

.settings-status-group,
.settings-integration-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-status {
  height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-status.is-good {
  background: #eefbf2;
  color: #1e8a4a;
}

.settings-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
}

.settings-status.is-good i {
  background: #34a853;
}

.settings-eyebrow {
  margin: 0 0 12px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.settings-eyebrow.danger {
  color: #ea4335;
}

.settings-notification-group {
  margin-bottom: 32px;
}

.settings-notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}

.settings-notification-row.last {
  border-bottom: 0;
}

.settings-clinic-form .settings-form-grid {
  margin-top: 0;
}

.settings-logo-upload {
  margin-bottom: 32px;
}

.settings-logo-upload>label {
  display: block;
  margin-bottom: 10px;
}

.settings-dropzone {
  width: 200px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
}

.settings-dropzone strong {
  color: #6e6e73;
  font-size: 13px;
}

.settings-dropzone span {
  color: #9ca3af;
  font-size: 11px;
}

.settings-table-scroll {
  overflow-x: auto;
}

.settings-hours-table,
.settings-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.settings-hours-table th,
.settings-data-table th {
  padding: 0 8px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.settings-hours-table th:first-child,
.settings-data-table th:first-child {
  padding-left: 0;
  text-align: left;
}

.settings-hours-table td,
.settings-data-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f3f4f6;
  color: #6e6e73;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.settings-hours-table td:first-child,
.settings-data-table td:first-child {
  padding-left: 0;
  color: #1c1c1e;
  font-weight: 600;
  text-align: left;
}

.settings-hours-table tr.is-closed {
  opacity: .45;
}

.settings-hours-table input[type=time] {
  width: 112px;
  height: 36px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #1c1c1e;
  font: 13px 'Plus Jakarta Sans', sans-serif;
}

.settings-hours-table input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: #1a73e8;
}

.settings-hours-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.settings-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.settings-title-rule {
  margin: 0 0 24px;
}

.settings-data-table {
  min-width: 0;
}

.settings-data-table th {
  padding: 0 12px 12px;
}

.settings-data-table th:first-child,
.settings-data-table td:first-child {
  text-align: left;
}

.settings-data-table td {
  padding: 14px 12px;
}

.settings-data-table td:first-child {
  padding-left: 0;
}

.settings-data-table td:last-child {
  padding-right: 0;
}

.settings-data-table strong {
  color: #1c1c1e;
}

.service-color {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 10px;
  border-radius: 50%;
  vertical-align: 1px;
}

.settings-data-table tr.is-inactive {
  opacity: .5;
}

.settings-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.settings-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #6e6e73;
  cursor: pointer;
}

.settings-icon-btn.is-danger {
  border-color: #fee2e2;
  background: #fef2f2;
  color: #ea4335;
}

.settings-staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.settings-staff-card {
  padding: 20px;
  border: 1.5px solid #f3f4f6;
  border-radius: 12px;
  background: #fafafa;
}

.settings-staff-card.is-inactive {
  opacity: .5;
}

.settings-staff-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.settings-staff-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.settings-staff-card>strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.settings-staff-card>p {
  margin: 0;
  color: #6e6e73;
  font-size: 12px;
}

.settings-staff-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.settings-staff-actions .settings-outline-btn {
  flex: 1;
  padding: 0 8px;
}

.settings-integration-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-integration-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1.5px solid #f3f4f6;
  border-radius: 12px;
  background: #fafafa;
}

.settings-integration-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}

.settings-integration-logo.google {
  background: #fff;
  color: #4285f4;
  border: 1px solid #e5e7eb;
}

.settings-integration-logo.whatsapp {
  background: #25d366;
}

.settings-integration-logo.twilio {
  background: #f22f46;
}

.settings-integration-copy {
  flex: 1;
  min-width: 0;
}

.settings-integration-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.settings-integration-copy p {
  margin: 0;
  color: #6e6e73;
  font-size: 13px;
}

.settings-integration-actions {
  flex-shrink: 0;
}

.settings-plan-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
}

.settings-plan-card::before,
.settings-plan-card::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  content: '';
}

.settings-plan-card::before {
  width: 130px;
  height: 130px;
  top: -24px;
  right: -24px;
}

.settings-plan-card::after {
  width: 90px;
  height: 90px;
  right: 48px;
  bottom: -36px;
  background: rgba(255, 255, 255, .04);
}

.settings-plan-card>span {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.settings-plan-card>div {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.settings-plan-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.settings-plan-card strong small {
  font-size: 15px;
  font-weight: 500;
  opacity: .8;
}

.settings-plan-card p {
  margin: 6px 0 0;
  opacity: .75;
  font-size: 13px;
}

.settings-plan-card button {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #1a73e8;
  cursor: pointer;
  font: 700 14px 'Plus Jakarta Sans', sans-serif;
}

.settings-billing-block {
  margin-bottom: 32px;
}

.settings-billing-block h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.settings-payment-card,
.settings-export-card,
.settings-danger-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.settings-payment-card>div:nth-child(2) strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.settings-payment-card p {
  margin: 0;
  color: #9ca3af;
  font-size: 12px;
}

.settings-payment-card>button {
  border: 0;
  background: none;
  color: #1a73e8;
  cursor: pointer;
  font: 700 14px 'Plus Jakarta Sans', sans-serif;
}

.settings-mastercard {
  width: 52px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.settings-mastercard b {
  width: 14px;
  height: 14px;
  display: block;
  margin: -2px;
  border-radius: 50%;
}

.settings-mastercard b:first-child {
  background: #ea4335;
}

.settings-mastercard b:last-child {
  background: #fbbc04;
}

.settings-privacy-rows {
  margin-bottom: 32px;
}

.settings-privacy-rows>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}

.settings-privacy-rows strong,
.settings-export-card strong,
.settings-danger-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.settings-export-card {
  margin-bottom: 32px;
}

.settings-export-card button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-danger-card {
  border-color: #fca5a5;
  background: #fef2f2;
}

.settings-danger-card strong {
  color: #b91c1c;
}

.settings-danger-card p {
  color: #ef4444;
}

.settings-danger-btn {
  height: 36px;
  flex-shrink: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #ea4335;
  color: #fff;
  cursor: pointer;
  font: 700 13px 'Plus Jakarta Sans', sans-serif;
}

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .3);
  backdrop-filter: blur(4px);
}

.settings-dialog {
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}

.settings-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
}

.settings-dialog-header h3 {
  margin: 0;
  font-size: 16px;
}

.settings-dialog-header button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6e6e73;
  cursor: pointer;
}

.settings-dialog-body {
  padding: 24px;
}

.settings-dialog-body>p {
  margin: 0 0 24px;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.6;
}

.settings-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.settings-color-pick>label {
  display: block;
  margin-bottom: 10px;
}

.settings-color-pick>div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-color-pick button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid transparent;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

.settings-color-pick button.selected {
  border-color: #1c1c1e;
}

.settings-mobile-main,
.settings-mobile-pushed {
  display: none;
}

.settings-toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 30px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #1c1c1e;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
}

.settings-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 899px) {

  /* The live title already contains "Settings"; don't append it a second time. */
  #screen-app.settings-active .top-bar-title::after {
    content: none;
  }

  #screen-app.settings-active .top-bar-date-mobile {
    font-size: 0;
  }

  #screen-app.settings-active .top-bar-date-mobile::after {
    content: 'Clinic configuration';
    font-size: 10px;
  }

  #view-settings.active-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    margin: 0 -16px;
    overflow: hidden;
  }

  .settings-layout {
    display: none;
  }

  .settings-root {
    height: 100%;
  }

  .settings-mobile-main {
    display: block;
    height: 100%;
    overflow-y: auto;
    padding: 0 0 88px;
    background: #f7f8fa;
  }

  .settings-mobile-heading {
    padding: 20px 16px 8px;
  }

  .settings-mobile-heading h1 {
    margin: 0;
    color: #1c1c1e;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.4px;
  }

  .settings-mobile-group {
    margin-bottom: 24px;
  }

  .settings-mobile-group>p {
    margin: 0 0 6px 16px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .settings-mobile-group>div {
    margin: 0 16px;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  }

  .settings-mobile-row {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    color: #1c1c1e;
    cursor: pointer;
    font: 500 15px 'Plus Jakarta Sans', sans-serif;
    text-align: left;
  }

  .settings-mobile-row:last-child {
    border-bottom: 0;
  }

  .settings-mobile-row>span:nth-child(2) {
    flex: 1;
  }

  .settings-mobile-row>svg {
    color: #c7c7cc;
  }

  .settings-mobile-row .settings-nav-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #ebf2ff;
    color: #1a73e8;
  }

  .settings-mobile-profile>span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .settings-mobile-profile strong {
    font-size: 15px;
  }

  .settings-mobile-profile small {
    color: #9ca3af;
    font-size: 12px;
  }

  .settings-mobile-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    border-radius: 50%;
    background: #673ab7;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
  }

  .settings-mobile-logout {
    width: calc(100% - 32px);
    height: 52px;
    margin: 4px 16px 0;
    border: 0;
    border-radius: 12px;
    background: #ea4335;
    color: #fff;
    cursor: pointer;
    font: 700 16px 'Plus Jakarta Sans', sans-serif;
  }

  .settings-version {
    margin: 14px 0 0;
    color: #c7c7cc;
    font-size: 12px;
    text-align: center;
  }

  .settings-mobile-pushed {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 60px;
    left: 0;
    z-index: 80;
    display: block;
    overflow-y: auto;
    background: #f7f8fa;
    transform: translateX(100%);
  }

  .settings-mobile-pushed.is-visible {
    transform: translateX(0);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  }

  .settings-mobile-pushed>header {
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
  }

  .settings-mobile-pushed>header strong {
    font-size: 17px;
  }

  .settings-mobile-back {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #6e6e73;
    cursor: pointer;
  }

  .settings-mobile-content {
    padding: 16px 16px 40px;
  }

  .settings-mobile-content .settings-section {
    max-width: none;
  }

  .settings-mobile-content .settings-section-header {
    margin-bottom: 20px;
  }

  .settings-mobile-content .settings-section-header h2 {
    font-size: 18px;
  }

  .settings-mobile-content .settings-section-header hr {
    margin-top: 14px;
  }

  .settings-mobile-content .settings-profile-photo {
    gap: 14px;
    margin-bottom: 24px;
  }

  .settings-mobile-content .settings-large-avatar {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    font-size: 22px;
  }

  .settings-mobile-content .settings-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .settings-mobile-content .settings-security-card,
  .settings-mobile-content .settings-export-card,
  .settings-mobile-content .settings-danger-card {
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }

  .settings-mobile-content .settings-security-card>div:first-child,
  .settings-mobile-content .settings-export-card>div,
  .settings-mobile-content .settings-danger-card>div {
    flex: 1;
  }

  .settings-mobile-content .settings-status-group {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .settings-mobile-content .settings-notification-row {
    gap: 12px;
  }

  .settings-mobile-content .settings-notification-row>div {
    min-width: 0;
  }

  .settings-mobile-content .settings-notification-row p {
    line-height: 1.4;
  }

  .settings-mobile-content .settings-hours-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .settings-mobile-content .settings-staff-grid {
    grid-template-columns: 1fr;
  }

  .settings-mobile-content .settings-integration-card {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px;
  }

  .settings-mobile-content .settings-integration-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 56px;
  }

  .settings-mobile-content .settings-plan-card>div {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-mobile-content .settings-plan-card button {
    width: 100%;
  }

  .settings-mobile-content .settings-payment-card {
    flex-wrap: wrap;
    gap: 14px;
  }

  .settings-mobile-content .settings-payment-card>button {
    margin-left: 66px;
  }

  .settings-mobile-content .settings-danger-card {
    flex-direction: column;
  }

  .settings-mobile-content .settings-danger-btn {
    width: 100%;
  }

  .settings-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .settings-dialog {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .settings-dialog-header {
    padding: 18px 20px;
  }

  .settings-dialog-body {
    padding: 20px;
  }
}

/* Appointment row actions: keep the patient content flexible while reserving
   enough room for readable View and more-actions controls. */
@media (min-width: 900px) {
  .appt-card-main {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 110px 100px 104px;
    align-items: center;
    gap: 16px;
  }

  .patient-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .patient-group .appt-info {
    min-width: 0;
  }

  .appt-name,
  .appt-treatment {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .appt-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  .appt-view {
    width: 64px;
    min-width: 64px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
  }

  .appt-view svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
  }

  .appt-more {
    width: 32px;
    min-width: 32px;
    padding: 0;
    display: inline-grid;
    place-items: center;
  }
}

/* Final patient-card corrections: keep the list item horizontal even when legacy
   patient styles are loaded earlier in this stylesheet. */
#view-patients .patient-card {
  width: 100%;
  min-height: 68px;
  height: 68px;
  flex: 0 0 68px;
  padding: 10px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  box-sizing: border-box;
  text-align: left;
}

#view-patients .patient-card-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

#view-patients .patient-card-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#view-patients .patient-card-copy strong,
#view-patients .patient-card-copy small {
  text-align: left;
}

#view-patients .patient-status-dot {
  flex: 0 0 9px;
}

#view-patients .patient-card-chevron {
  flex: 0 0 auto;
  margin-left: 0;
}

#view-patients .patient-list {
  width: 100%;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

#view-patients .patient-card:hover,
#view-patients .patient-card:active {
  transform: none;
}

#view-patients .patient-detail-content {
  position: relative;
  min-height: 100%;
}

.patients-action-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

.patient-empty-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: #c8ced7;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.patient-detail-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.patient-detail-actions button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.patient-stat-cards .balance-due {
  color: #c2410c;
}

.visit-status--muted {
  background: #f1f3f6;
  color: #7b8490;
}

.file-card-icon {
  width: 25px;
  height: 25px;
  padding: 12px;
  box-sizing: content-box;
  border-radius: 8px;
  background: #eaf1ff;
  fill: none;
  stroke: #1a73e8;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-card-icon--doc {
  background: #fff3c4;
  stroke: #e88700;
}

.file-grid>div {
  align-items: flex-start;
}

.patient-detail-close {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 20px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: #fff0f0;
  color: #e5484d;
  font-family: inherit;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.patient-detail-close:hover {
  background: #ffe0e0;
}

@media (max-width:899px) {
  #view-patients .patient-card {
    height: 72px;
    min-height: 72px;
    flex: 0 0 72px;
    padding: 10px 14px;
  }

  .patient-detail-close {
    display: none;
  }
}

/* Patients owns the scroll area. The app shell and page body stay fixed while
   the list and detail panel scroll independently. */
#view-patients.app-view.active-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#app-main.patients-view-active {
  overflow: hidden;
}

#app-main.patients-view-active #view-patients {
  height: 100%;
  min-height: 0;
}

#view-patients .patients-page-head {
  flex: 0 0 86px;
  min-height: 86px;
  position: sticky;
  top: 0;
  z-index: 10;
}

#view-patients .patients-workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#view-patients .patients-list-panel,
#view-patients .patient-detail-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (max-width:899px) {
  #view-patients .patients-page-head {
    flex: 0 0 56px;
    min-height: 56px;
  }

  #view-patients .patients-workspace {
    overflow: hidden;
  }

  #view-patients .patients-list-panel {
    height: 100%;
    overflow-y: auto;
  }
}

/* Add Patient uses the same centered desktop modal treatment as New Appointment. */
.modal-overlay:has(.add-patient-sheet) {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.add-patient-sheet {
  width: 626px;
  max-height: 90vh;
  overflow: auto;
  padding: 0;
  border-radius: 16px;
  animation: sheet-scale-in 180ms ease;
}

.add-patient-sheet .sheet-handle {
  display: none;
}

.add-patient-heading {
  padding: 27px 30px 25px;
  border-bottom: 1px solid #f0f0f2;
}

.add-patient-heading h2 {
  margin: 0 0 4px;
  color: #1c1c1e;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.3px;
}

.add-patient-heading p {
  margin: 0;
  color: #6e6e73;
  font-size: 14px;
}

.add-patient-heading button {
  width: 40px;
  height: 40px;
}

.add-patient-sheet form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  padding: 30px;
}

.add-patient-sheet form>label:first-child {
  grid-column: 1 / -1;
}

.add-patient-sheet form>label {
  gap: 7px;
  color: #1c1c1e;
  font-size: 12px;
  font-weight: 700;
}

.add-patient-sheet input {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #1c1c1e;
  font-size: 16px;
}

.add-patient-sheet input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}

.add-patient-sheet fieldset,
.add-patient-sheet .save-patient-btn {
  grid-column: 1 / -1;
}

.add-patient-sheet fieldset {
  gap: 7px;
}

.add-patient-sheet legend {
  color: #1c1c1e;
  font-size: 12px;
  font-weight: 700;
}

.gender-options button {
  height: 48px;
  border-radius: 8px;
  font-size: 14px;
}

.save-patient-btn {
  height: 52px;
  border-radius: 12px;
  background: #1a73e8;
  font-size: 16px;
}

@media (max-width:899px) {
  .modal-overlay:has(.add-patient-sheet) {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .add-patient-sheet {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 0 20px 32px;
  }

  .add-patient-sheet .sheet-handle {
    display: block;
    margin: 10px auto 20px;
  }

  .add-patient-heading {
    padding: 0 0 18px;
    border: 0;
  }

  .add-patient-heading h2 {
    font-size: 21px;
  }

  .add-patient-heading p {
    display: none;
  }

  .add-patient-heading button {
    width: 36px;
    height: 36px;
  }

  .add-patient-sheet form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
  }

  .add-patient-sheet input {
    height: 56px;
    border-color: #c9e8ff;
    border-radius: 14px;
    font-size: 17px;
  }

  .add-patient-sheet label,
  .add-patient-sheet legend {
    color: #35587c;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .gender-options button {
    height: 48px;
    border-radius: 14px;
    font-size: 16px;
  }

  .save-patient-btn {
    height: 58px;
    border-radius: 20px;
    background: #1e8fd5;
    font-size: 18px;
  }
}

/* Final shell sizing: the Figma sidebar items are content-sized rows, not flex fillers. */
.screen-app {
  height: 100dvh;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.content-col {
  min-height: 0;
}

@media (min-width: 900px) {
  .bottom-nav .nav-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 899px) {
  .screen-app {
    flex-direction: column;
  }

  .app-main {
    min-height: 0;
  }

  .top-bar {
    position: relative;
    flex: 0 0 60px;
  }
}

/* Final visual/interaction corrections from the reference screenshots. */
.stat-pill::after {
  display: none;
}

.stat-pill {
  align-items: stretch;
}

.stat-icon {
  position: absolute;
  right: 22px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.stat-icon--blue {
  background: #ebf2ff;
  color: #1a73e8;
}

.stat-icon--green {
  background: #eefbf2;
  color: #1e8a4a;
}

.stat-icon--amber {
  background: #fffbe6;
  color: #a16207;
}

.stat-icon--red {
  background: #fef2f2;
  color: #b91c1c;
}

.sidebar-brand strong {
  font-size: 15px;
  font-weight: 800;
  color: #1c1c1e;
}

.sidebar-brand span {
  font-size: 10px;
  font-weight: 500;
  color: #6e6e73;
}

.bottom-nav {
  overflow: hidden;
}

.sidebar-account {
  padding-bottom: 12px;
}

.sidebar-logout {
  min-height: 42px;
}

.doctor-profile-modal {
  background: transparent;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 72px 24px 0;
}

.doctor-profile-modal .doctor-profile-sheet {
  width: 260px;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
}

.doctor-profile-modal .sheet-handle {
  display: none;
}

.doctor-profile-modal .doctor-profile-summary {
  margin-bottom: 18px;
}

.doctor-profile-modal .doctor-profile-avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.doctor-profile-modal .doctor-profile-summary strong {
  font-size: 15px;
}

.doctor-profile-modal .doctor-profile-summary span {
  font-size: 11px;
}

.doctor-profile-modal .doctor-profile-logout {
  height: 40px;
  font-size: 13px;
}

@media (min-width: 900px) {
  .doctor-profile-modal {
    display: flex !important;
  }
}

@media (max-width: 899px) {
  .stat-icon {
    right: 14px;
    top: 14px;
    width: 30px;
    height: 30px;
  }

  .stat-icon svg {
    width: 15px;
    height: 15px;
  }

  .doctor-profile-modal {
    padding: 0;
    align-items: flex-end;
  }

  .doctor-profile-modal .doctor-profile-sheet {
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 12px 24px 40px;
  }

  .doctor-profile-modal .sheet-handle {
    display: block;
  }
}

/* Header and content geometry matching the supplied dashboard frames. */
@media (min-width: 900px) {
  .top-bar {
    justify-content: flex-start;
    gap: 16px;
  }

  .top-bar-left {
    flex: 1 1 auto;
    min-width: 0;
  }

  .top-bar-info {
    align-items: flex-start;
  }

  .top-bar-actions {
    margin-left: auto;
  }

  .app-main {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 24px;
  }

  .app-view.active-view {
    width: 100%;
  }

  .notification-btn svg {
    display: block;
    margin: auto;
  }
}

@media (max-width: 899px) {
  .top-bar {
    justify-content: flex-start;
  }

  .top-bar-left {
    position: static;
    width: auto;
    flex: 0 0 auto;
  }

  .top-bar-info {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: max-content;
    align-items: center;
  }

  .top-bar-title {
    white-space: nowrap;
    line-height: 18px;
  }

  .top-bar-date {
    position: static;
    line-height: 14px;
  }

  .top-bar-actions {
    display: block;
    margin-left: auto;
    position: static;
  }

  .profile-btn {
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
  }

  .profile-btn .account-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    line-height: 1;
    padding: 0;
    margin: 0;
    color: #fff !important;
  }

  .doctor-profile-summary>.doctor-profile-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
  }
}

/* New Appointment modal — measured from the supplied desktop and mobile frames. */
.add-appt-sheet {
  width: 626px;
  max-height: none;
  overflow: visible;
  border-radius: 16px;
  padding: 0;
  animation: sheet-scale-in 180ms ease;
}

.modal-overlay:has(.add-appt-sheet) {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.add-appt-sheet .sheet-handle {
  display: none;
}

.add-appt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 27px 30px 25px;
  border-bottom: 1px solid #f0f0f2;
}

.add-appt-header .sheet-title {
  margin: 0 0 4px;
  font-size: 21px;
  line-height: 1.2;
  color: #1c1c1e;
  letter-spacing: -.3px;
}

.add-appt-header p {
  color: #6e6e73;
  font-size: 14px;
  margin: 0;
}

.sheet-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6e6e73;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.add-appt-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 20px;
  padding: 30px;
}

.add-appt-form>.form-group:first-child,
.add-appt-form>.form-group:nth-child(2),
.add-appt-form>.form-group:nth-child(4),
.add-appt-form>.form-group:nth-child(5),
.add-appt-form>.add-appt-actions {
  grid-column: 1 / -1;
}

.add-appt-form>.form-row {
  display: contents;
}

.add-appt-form .form-group {
  gap: 7px;
}

.add-appt-form .form-label {
  color: #1c1c1e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
}

.add-appt-form .form-input {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #1c1c1e;
  font-size: 16px;
}

.add-appt-form .form-input::placeholder {
  color: #9ca3af;
}

.add-appt-form .form-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}

.add-appt-form .doctor-toggle {
  gap: 8px;
}

.add-appt-form .doctor-btn {
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6e6e73;
  font-size: 14px;
}

.add-appt-form .doctor-btn.active {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.add-appt-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  margin-top: 2px;
}

.add-appt-actions .btn-secondary {
  height: 52px;
  padding: 0 4px;
  background: transparent;
  color: #6e6e73;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.add-appt-actions .btn-primary {
  width: 214px;
  height: 52px;
  margin: 0;
  border-radius: 12px;
  background: #d1d5db;
  font-size: 16px;
}

.add-appt-actions .btn-primary.is-ready {
  background: #1a73e8;
  color: #fff;
}

@keyframes sheet-scale-in {
  from {
    transform: scale(.97);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 899px) {
  .add-appt-sheet {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 0 24px 24px;
  }

  .add-appt-sheet .sheet-handle {
    display: block;
    margin: 10px auto 20px;
  }

  .add-appt-header {
    padding: 0 0 4px;
    border: 0;
  }

  .add-appt-header .sheet-title {
    font-size: 21px;
  }

  .add-appt-header p,
  .sheet-close {
    display: none;
  }

  .add-appt-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0;
  }

  .add-appt-form>.form-group:first-child {
    order: 0;
  }

  .add-appt-form .form-label {
    font-size: 16px;
    color: #35587c;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .add-appt-form .form-input {
    height: 56px;
    border-color: #c9e8ff;
    border-radius: 14px;
    font-size: 17px;
  }

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

  .add-appt-form .form-row .duration-group {
    grid-column: 1 / -1;
  }

  .add-appt-form .doctor-btn {
    height: 48px;
    border-radius: 14px;
    font-size: 16px;
  }

  .add-appt-actions {
    display: block;
    margin-top: 8px;
  }

  .add-appt-actions .btn-secondary {
    display: none;
  }

  .add-appt-actions .btn-primary {
    width: 100%;
    height: 58px;
    border-radius: 20px;
    background: #1e8fd5;
    font-size: 18px;
  }
}

.top-bar-date-mobile {
  display: none;
}

.logout-modal {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.logout-card {
  width: min(390px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(14, 42, 80, .2);
  text-align: center;
  animation: sheet-scale-in 180ms ease;
}

.logout-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fef2f2;
  color: #ea4335;
  font-size: 25px;
  font-weight: 700;
}

.logout-card h2 {
  margin: 0 0 8px;
  color: #1c1c1e;
  font-size: 19px;
}

.logout-card p {
  margin: 0;
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.5;
}

.logout-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.logout-actions button {
  flex: 1;
  height: 44px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.logout-actions button:first-child {
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #6e6e73;
}

.logout-actions button:last-child {
  border: 0;
  background: #ea4335;
  color: #fff;
}

@media (min-width: 900px) {
  .top-bar-date-mobile {
    display: none;
  }
}

@media (max-width: 899px) {
  .top-bar-left::after {
    display: none !important;
  }

  .top-bar-title {
    font-size: 0;
  }

  .top-bar-title::after {
    content: 'Today';
    font-size: 16px;
  }

  .top-bar-date {
    display: none;
  }

  .top-bar-date-mobile {
    display: block;
    color: #6e6e73;
    font-size: 10px;
    font-weight: 500;
    line-height: 14px;
  }

  .modal-overlay:has(.add-appt-sheet) {
    align-items: flex-end;
    padding: 0;
  }
}

@media (min-width: 900px) {
  .doctor-profile-modal {
    display: none !important;
  }
}

/* Final mobile settings overrides must come after the Figma settings rules. */
@media (max-width: 899px) {

  .settings-mobile-pushed,
  .settings-mobile-content {
    overflow-x: hidden;
  }

  .settings-mobile-content .settings-status-group {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .settings-mobile-content .settings-clinic-form+.settings-logo-upload {
    margin-top: 16px;
  }

  .settings-mobile-content .settings-hours-actions {
    align-items: flex-start;
  }

  .settings-mobile-content .settings-hours-actions>button {
    width: auto;
    align-self: flex-start;
  }

  .settings-mobile-content .settings-section-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .settings-mobile-content .settings-section-title-row .settings-primary-btn {
    width: auto;
    max-width: 100%;
    align-self: flex-start;
  }

  .settings-mobile-content .settings-integration-actions {
    width: calc(100% - 56px);
    max-width: calc(100% - 56px);
    margin-left: 56px;
    box-sizing: border-box;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .settings-mobile-content .settings-integration-actions>button {
    max-width: 100%;
    flex-shrink: 1;
  }
}

/* Appointment details modal opened by the desktop View action. */
.appointment-view-modal {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.appointment-view-card {
  width: min(520px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(8, 24, 50, .2);
  animation: sheet-scale-in 180ms ease;
}

.appointment-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid #f0f0f2;
}

.appointment-view-header p {
  margin: 0 0 5px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.appointment-view-header h2 {
  margin: 0;
  color: #1c1c1e;
  font-size: 21px;
}

.appointment-view-header button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6e6e73;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.appointment-view-source {
  margin: 20px 26px 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #edf4ff;
  color: #1669d8;
  font-size: 12px;
  font-weight: 700;
}

.appointment-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 22px 26px 0;
}

.appointment-view-grid>div {
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.appointment-view-grid>div span {
  display: block;
  margin-bottom: 5px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.appointment-view-grid>div strong {
  display: block;
  overflow-wrap: anywhere;
  color: #1c1c1e;
  font-size: 14px;
  font-weight: 600;
}

.appointment-view-wide {
  grid-column: 1 / -1;
}

.appointment-view-notes {
  margin: 18px 26px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f7f8fa;
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.5;
}

.appointment-view-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px 26px 26px;
}

.appointment-view-actions button {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font: 700 13px 'Plus Jakarta Sans', sans-serif;
}

.view-secondary-btn {
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #6e6e73;
}

.view-primary-btn {
  border: 0;
  background: #1a73e8;
  color: #fff;
}

@media (max-width: 899px) {
  .appointment-view-modal {
    align-items: flex-end;
    padding: 0;
  }

  .appointment-view-card {
    width: 100%;
    max-height: 86dvh;
    border-radius: 24px 24px 0 0;
    animation: sheet-up 300ms cubic-bezier(.32, .72, 0, 1);
  }

  .appointment-view-header {
    padding: 20px 20px 16px;
  }

  .appointment-view-source {
    margin: 16px 20px 0;
  }

  .appointment-view-grid {
    padding: 18px 20px 0;
    gap: 14px;
  }

  .appointment-view-actions {
    padding: 18px 20px calc(20px + var(--safe-bottom));
  }
}


/* ═══════════════════════════════════════════════
   "THIS WEEK" SHORTCUT BUTTON (Today view heading)
═══════════════════════════════════════════════ */

.appt-heading-right {
  display: none;
  /* replaced by heading-top / heading-bottom */
}

/* Top row: title + This Week button */
.appointments-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.appointments-heading-top h2 {
  margin: 0;
}

/* Bottom row: doctor filters + status filters */
.appointments-heading-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.view-week-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--cmd-blue-light);
  color: var(--cmd-blue-dark);
  border: 1.5px solid var(--cmd-blue-mid);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--trans-fast), transform var(--trans-fast), box-shadow var(--trans-fast);
  white-space: nowrap;
}

.view-week-btn:hover {
  background: var(--cmd-blue-mid);
  box-shadow: 0 2px 8px rgba(30, 143, 213, 0.18);
  transform: translateY(-1px);
}

.view-week-btn:active {
  transform: translateY(0);
}

.view-week-btn svg {
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════
   SCHEDULE VIEW
═══════════════════════════════════════════════ */

#view-schedule {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────── */
.schedule-header {
  background: var(--card);
  border-bottom: 1px solid var(--bg-secondary);
  padding: 24px 24px 0;
  flex-shrink: 0;
}

.schedule-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.schedule-title-row h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.schedule-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.back-to-today-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--trans-fast), color var(--trans-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.back-to-today-btn:hover {
  background: var(--cmd-blue-light);
  color: var(--cmd-blue-dark);
  border-color: var(--cmd-blue-mid);
}

/* ── 7-day strip ─────────────────────────────── */
.schedule-day-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.schedule-day-strip::-webkit-scrollbar {
  display: none;
}

.strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px 10px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: background var(--trans-fast), border-color var(--trans-fast);
  min-width: 56px;
  flex-shrink: 0;
}

.strip-day:hover {
  background: var(--cmd-blue-light);
}

.strip-day--active {
  border-bottom-color: var(--cmd-blue);
  background: var(--cmd-blue-light);
}

.strip-day-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.strip-day--active .strip-day-label {
  color: var(--cmd-blue);
}

.strip-day-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.strip-day--active .strip-day-num {
  color: var(--cmd-blue);
}

.strip-day-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--cmd-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.strip-day-dot--empty {
  background: transparent;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-secondary);
  margin: 6px auto 0;
}

/* ── Body (scrollable) ───────────────────────── */
.schedule-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 80px;
  scroll-behavior: smooth;
}

/* ── Day section ─────────────────────────────── */
.schedule-day-section {
  margin-bottom: 24px;
}

.schedule-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  border-bottom: 1.5px solid var(--bg-secondary);
  margin-bottom: 10px;
}

.schedule-day-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--cmd-blue);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.schedule-day-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.schedule-day-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 4px;
  font-style: italic;
}

/* ── Appointment row ─────────────────────────── */
.schedule-appt-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--trans-fast), transform var(--trans-fast);
}

.schedule-appt-row:hover {
  box-shadow: var(--card-shadow-lg);
  transform: translateY(-1px);
}

.schedule-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--cmd-blue-dark);
  white-space: nowrap;
}

/* ── Empty state ─────────────────────────────── */
.schedule-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

/* ── Responsive tweaks ───────────────────────── */
@media (max-width: 600px) {
  .schedule-header {
    padding: 16px 16px 0;
  }

  .schedule-body {
    padding: 12px 12px 80px;
  }

  .strip-day {
    min-width: 48px;
    padding: 8px 8px 10px;
  }

  .strip-day-num {
    font-size: 16px;
  }

  .schedule-appt-row {
    grid-template-columns: 62px 1fr auto;
    padding: 10px 12px;
  }

  .schedule-title-row h1 {
    font-size: 18px;
  }

  .view-week-btn {
    font-size: 11px;
    padding: 4px 10px;
  }
}

.status-dropdown-menu {
  position: absolute;
  z-index: 9999;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  padding: 6px;
  min-width: 140px;
}

.status-dropdown-menu .status-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-dropdown-menu .status-opt {
  justify-content: flex-start;
  text-align: left;
}

.btn-chip {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
}

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

.btn-chip.active {
  background: var(--cmd-blue);
  color: white;
  border-color: var(--cmd-blue);
}

/* ═══════════════════════════════════════════════
   INBOX VIEW
═══════════════════════════════════════════════ */

#view-inbox {
  padding: 0;
  height: calc(100vh - var(--top-bar-h, 56px));
  overflow: hidden;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100%;
  overflow: hidden;
}

/* ── Left Pane: Conversation List ──────────────── */
.inbox-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}

.inbox-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.inbox-sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.inbox-count {
  background: #e5484d;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.inbox-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.inbox-search-box svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.inbox-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.inbox-conversation-list {
  flex: 1;
  overflow-y: auto;
}

.inbox-convo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--trans-fast);
}

.inbox-convo-item:hover {
  background: var(--bg);
}

.inbox-convo-item.active {
  background: rgba(33, 150, 211, 0.06);
  border-left: 3px solid var(--cmd-blue);
}

.inbox-convo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cmd-blue);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inbox-convo-body {
  flex: 1;
  min-width: 0;
}

.inbox-convo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.inbox-convo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-convo-time {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 8px;
}

.inbox-convo-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.inbox-convo-preview.outbound {
  color: var(--cmd-blue);
}

.inbox-empty-list {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Right Pane: Chat Window ───────────────────── */
.inbox-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.inbox-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  padding: 40px;
  text-align: center;
}

.inbox-chat-empty strong {
  font-size: 16px;
  color: var(--text-primary);
  display: block;
}

.inbox-chat-empty span {
  font-size: 13px;
}

.inbox-chat-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.inbox-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.inbox-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cmd-blue);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inbox-chat-header strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.inbox-chat-header span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Messages Area ─────────────────────────────── */
.inbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-bubble-row {
  display: flex;
}

.inbox-bubble-row.inbound {
  justify-content: flex-start;
}

.inbox-bubble-row.outbound {
  justify-content: flex-end;
}

.inbox-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
}

.inbox-bubble.inbound {
  background: var(--card);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.inbox-bubble.outbound {
  background: var(--cmd-blue);
  color: white;
  border-bottom-right-radius: 4px;
}

.bubble-text {
  display: block;
  word-break: break-word;
}

/* "Voice note, transcribed": the text below came from a machine transcription and can contain mistakes */
.voice-tag {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
  opacity: 0.7;
}

.bubble-time {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.65;
  text-align: right;
}

.inbox-no-messages,
.inbox-loading,
.inbox-error {
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  align-self: center;
  width: 100%;
}

/* ── Composer ──────────────────────────────────── */
.inbox-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

#inbox-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color var(--trans-fast);
  line-height: 1.4;
}

#inbox-input:focus {
  border-color: var(--cmd-blue);
  box-shadow: 0 0 0 3px rgba(33, 150, 211, 0.1);
}

#inbox-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cmd-blue);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--trans-fast), transform var(--trans-fast);
}

#inbox-send-btn:hover {
  background: #1976d2;
  transform: scale(1.05);
}

#inbox-send-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Chat header layout ─────────────────────────── */
.inbox-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inbox-chat-header-info {
  flex: 1;
  min-width: 0;
}

.inbox-chat-header-info strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-chat-header-info span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Back button (mobile ‹ arrow) ───────────────── */
.inbox-back-btn {
  display: none; /* hidden on desktop */
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--cmd-blue);
  flex-shrink: 0;
  border-radius: 50%;
  transition: background var(--trans-fast);
}

.inbox-back-btn:hover {
  background: var(--bg);
}

.inbox-back-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Refresh button ─────────────────────────────── */
.inbox-refresh-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font);
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.inbox-refresh-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
  border-color: var(--cmd-blue);
}

.inbox-refresh-btn svg {
  width: 14px;
  height: 14px;
}

/* Spinning animation for refresh */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.inbox-refresh-btn.spinning svg {
  animation: spin 0.6s linear;
}

/* ── Bubble sending state ───────────────────────── */
.bubble-sending {
  opacity: 0.6;
  font-style: italic;
}

/* ── Responsive: collapse sidebar on mobile ────── */
@media (max-width: 699px) {
  .inbox-layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  /* Default: show sidebar, hide chat */
  .inbox-sidebar {
    display: flex;
  }

  .inbox-chat {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 10;
    background: var(--bg);
  }

  /* chat-open: hide sidebar, show chat */
  .inbox-layout.chat-open .inbox-sidebar {
    display: none;
  }

  .inbox-layout.chat-open .inbox-chat {
    display: flex;
    flex-direction: column;
  }

  /* Show back button on mobile */
  .inbox-back-btn {
    display: flex;
  }

  /* Hide "Refresh" text label on mobile, keep icon */
  .inbox-refresh-btn .refresh-label {
    display: none;
  }

  .inbox-refresh-btn {
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    justify-content: center;
  }
}

/* Cancellation confirm modal — centered like appointment details / logout. */
.cancel-confirm-modal {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cancel-confirm-card {
  width: min(520px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(8, 24, 50, .2);
  animation: sheet-scale-in 180ms ease;
}

.cancel-confirm-header {
  padding: 24px 26px 16px;
  border-bottom: 1px solid #f0f0f2;
}

.cancel-confirm-header p {
  margin: 0 0 5px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cancel-confirm-header h2 {
  margin: 0;
  color: #1c1c1e;
  font-size: 21px;
}

.cancel-confirm-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 26px 24px;
}

.cancel-confirm-form .quick-reasons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -8px;
}

.suggest-slot-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

#suggested-slot-display {
  font-size: 14px;
  color: var(--text-secondary);
}

.cancel-slot-clear {
  border: 0;
  background: none;
  color: #1a73e8;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.cancel-slot-list {
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  color: #6e6e73;
  font-size: 13px;
}

.cancel-slot-day {
  margin: 10px 0 8px;
  color: #35587c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.cancel-slot-day:first-child {
  margin-top: 0;
}

.cancel-slot-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cancel-slot-btn {
  border: 1px solid #dbe4ee;
  background: #fff;
  color: #1c1c1e;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cancel-slot-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
}

.cancel-slot-btn.is-selected {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.cancel-confirm-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.cancel-confirm-actions .btn-secondary {
  height: 48px;
  background: transparent;
  color: #6e6e73;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.cancel-confirm-actions .btn-primary.is-danger {
  min-width: 200px;
  height: 48px;
  margin: 0;
  border-radius: 12px;
  background: #e53935;
  color: #fff;
  font-size: 15px;
}

@media (max-width: 899px) {
  .cancel-confirm-modal {
    align-items: flex-end;
    padding: 0;
  }

  .cancel-confirm-card {
    width: 100%;
    max-height: 90dvh;
    border-radius: 24px 24px 0 0;
    animation: sheet-up 300ms cubic-bezier(.32, .72, 0, 1);
  }
}

/* ═══════════════════════════════════════════════
   Patient autocomplete, detail menu, merged history
═══════════════════════════════════════════════ */
.patient-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(25, 35, 50, .16);
}

.patient-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.patient-suggest-item strong {
  color: #202124;
  font-size: 14px;
}

.patient-suggest-item span {
  color: #6e7480;
  font-size: 12px;
}

.patient-suggest-item:hover,
.patient-suggest-item.active {
  background: #eef4ff;
}

.patient-suggest-hint {
  padding: 8px 14px;
  border-top: 1px solid #eef0f3;
  color: #8c939d;
  font-size: 11px;
}

.detail-more-wrap {
  position: relative;
}

.detail-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 70;
  min-width: 190px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(25, 35, 50, .16);
}

.detail-more-menu[hidden] {
  display: none;
}

.patient-detail-actions .detail-more-menu button {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #30343b;
  text-align: left;
  font: 500 13px inherit;
  cursor: pointer;
}

.patient-detail-actions .detail-more-menu button:hover {
  background: #f1f3f6;
}

.patient-detail-actions .detail-more-menu button.danger {
  color: #d93025;
}

.patient-detail-tabs-title {
  height: 46px;
  display: flex;
  align-items: center;
  color: #1a73e8;
  font-weight: 700;
  font-size: 13px;
}

.detail-visit-row .visit-notes {
  display: block;
  margin-top: 3px;
  color: #8c939d;
  font-size: 12px;
  font-weight: 400;
}

/* Mobile: the search icon expands into a full-width field */
@media (max-width:899px) {
  .patients-search-box {
    cursor: pointer;
  }

  .patients-page-head.search-open > div:first-child {
    display: none;
  }

  .patients-page-head.search-open .patients-head-actions {
    width: 100%;
  }

  .patients-page-head.search-open .patients-search-box {
    width: 100%;
    padding: 0 12px;
    justify-content: flex-start;
    gap: 8px;
    cursor: text;
  }

  .patients-page-head.search-open .patients-search-box input {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 16px;
  }

  .patients-page-head.search-open .patients-search-box button {
    display: block;
  }
}


/* Sana pause control in the Inbox chat header */
.inbox-handoff-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  margin-left: auto;
  margin-right: 8px;
  border: 1px solid #cfe8d8;
  border-radius: 999px;
  background: #eef8f1;
  color: #1e7a45;
  font: 600 12px inherit;
  white-space: nowrap;
  cursor: pointer;
}

.inbox-handoff-btn .handoff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22a559;
}

.inbox-handoff-btn.paused {
  border-color: #f3d9a4;
  background: #fff6e0;
  color: #9a6400;
}

.inbox-handoff-btn.paused .handoff-dot {
  background: #f5a623;
}

.inbox-handoff-btn:disabled {
  opacity: .6;
  cursor: default;
}

@media (max-width:899px) {
  .inbox-handoff-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }
}


/* Time slot select should look like the other inputs */
.add-appt-form select.form-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236e7480' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer;
}


/* Day dividers inside an Inbox chat (Today / Yesterday / Monday, 12 October) */
.inbox-day-divider {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}

.inbox-day-divider span {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 58, 115, .08);
  color: #4a5f78;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}


/* Visible notice when the Inbox's live connection is down */
.inbox-live-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff4e0;
  color: #8a5a00;
  border: 1px solid #f3d9a4;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.inbox-live-banner[hidden] {
  display: none;
}

.inbox-live-banner .live-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #f5a623;
}

/* ── Unread badges and older-messages loading ── */
.nav-badge {
  position: absolute;
  top: 5px;
  left: calc(50% + 7px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: #e5484d;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}

.nav-badge[hidden] {
  display: none;
}

/* In the sidebar layout (wide screens) the badge sits at the right end of the row */
@media (min-width: 900px) {
  .nav-badge {
    position: static;
    margin-left: auto;
    box-shadow: none;
  }
}

.inbox-convo-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inbox-convo-bottom .inbox-convo-preview {
  flex: 1;
  min-width: 0;
}

.inbox-unread-pill {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.inbox-convo-item.unread .inbox-convo-name {
  font-weight: 800;
}

.inbox-convo-item.unread .inbox-convo-preview {
  color: var(--text-primary);
  font-weight: 600;
}

.inbox-convo-item.unread .inbox-convo-time {
  color: #e5484d;
  font-weight: 700;
}

.inbox-older-status {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ═══════════════ Toasts and notifications (bell) ═══════════════ */
.toast-stack {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: var(--card);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  border: 1px solid rgba(14, 42, 80, 0.08);
  border-left: 4px solid var(--cmd-blue);
  box-shadow: var(--card-shadow-lg);
  transform: translateX(115%);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 260ms ease;
}

.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast.is-leaving { transform: translateX(115%); opacity: 0; }
.toast-clickable { cursor: pointer; }
.toast-success { border-left-color: var(--status-show); }
.toast-error { border-left-color: var(--status-noshow); }
.toast-critical { border-left-color: #e5484d; background: #fff6f6; }
.toast-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--cmd-blue); }
.toast-success .toast-icon { color: var(--status-show); }
.toast-error .toast-icon, .toast-critical .toast-icon { color: #e5484d; }
.toast-icon svg { width: 20px; height: 20px; display: block; }
.toast-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.35; }
.toast-text strong { font-size: 13.5px; font-weight: 700; }
.toast-text span { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast-action { flex: none; align-self: center; font-size: 12px; font-weight: 700; color: #e5484d; }
.toast-close { flex: none; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0 2px; }
.toast-close:hover { color: var(--text-primary); }

@media (max-width: 600px) {
  .toast-stack { top: 64px; right: 16px; left: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 120ms ease; transform: none; }
  .toast.is-leaving { transform: none; }
}

/* Bell badge */
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #e5484d;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.notif-badge[hidden] { display: none; }
.top-bar-actions { position: relative; }

/* Popover under the bell */
.notif-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 250;
  width: 390px;
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid rgba(14, 42, 80, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow-lg);
  overflow: hidden;
}
.notif-popover[hidden] { display: none; }
.notif-pop-head, .notif-pop-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.notif-pop-head { border-bottom: 1px solid var(--bg-secondary); font-size: 14px; }
.notif-pop-foot { border-top: 1px solid var(--bg-secondary); justify-content: center; }
.notif-pop-list { overflow-y: auto; flex: 1; }

.notif-link { border: 0; background: none; color: var(--cmd-blue-dark); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.notif-link:hover:not(:disabled) { background: var(--cmd-blue-light); }
.notif-link:disabled { color: var(--text-muted); cursor: default; }

.notif-group { padding: 10px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); background: var(--card); }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--bg);
  background: var(--card);
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
}
.notif-item:hover { background: var(--cmd-grey-light); }
.notif-item:focus-visible { outline: 2px solid var(--cmd-blue); outline-offset: -2px; }
.notif-item.unread { background: #f3f9ff; }
.notif-item.critical.unread { background: #fff6f6; }
.notif-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--cmd-blue-light); color: var(--cmd-blue-dark); }
.tone-good .notif-icon, .notif-icon.tone-good { background: var(--status-show-bg); color: var(--status-show-text); }
.tone-bad .notif-icon, .notif-icon.tone-bad { background: var(--status-noshow-bg); color: var(--status-noshow-text); }
.tone-critical .notif-icon, .notif-icon.tone-critical { background: #ffe5e5; color: #b4232a; }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-text strong { font-size: 13.5px; font-weight: 600; }
.notif-item.unread .notif-text strong { font-weight: 800; }
.notif-body { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cmd-blue); display: block; }
.notif-item.critical .notif-dot { background: #e5484d; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 20px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.notif-empty strong { font-size: 14px; color: var(--text-primary); }
.notif-more { padding: 14px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* Modals: "View all" and the detail view */
.notif-overlay { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 24, 50, 0.5); animation: overlay-in 180ms ease; }
.notif-overlay[hidden] { display: none; }
.notif-overlay-top { z-index: 410; }
.notif-modal { width: min(640px, 100%); max-height: min(82vh, 740px); display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius-xl); box-shadow: var(--card-shadow-lg); overflow: hidden; outline: none; }
.notif-modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.notif-modal-head h2 { margin: 0; font-size: 18px; color: var(--text-primary); }
.notif-modal-actions { display: flex; align-items: center; gap: 6px; }
.notif-close { border: 0; background: var(--cmd-grey-light); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--text-secondary); cursor: pointer; }
.notif-close:hover { background: var(--bg-secondary); }
.notif-filters { flex: none; display: flex; gap: 8px; padding: 0 20px 12px; overflow-x: auto; border-bottom: 1px solid var(--bg-secondary); }
.notif-chip { flex: none; padding: 6px 14px; border: 1px solid var(--bg-secondary); border-radius: 99px; background: var(--card); font: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.notif-chip.active { background: var(--cmd-blue); border-color: var(--cmd-blue); color: #fff; }
.notif-modal-list { overflow-y: auto; flex: 1; min-height: 240px; }

.notif-detail { width: min(460px, 100%); }
.notif-detail-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.notif-detail-title h2 { font-size: 16px; line-height: 1.3; }
.notif-kind { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.notif-detail-body { padding: 4px 20px 8px; overflow-y: auto; }
.notif-detail-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--text-primary); }
.notif-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--cmd-grey-light); font-size: 13px; }
.notif-facts dt { color: var(--text-muted); font-weight: 600; }
.notif-facts dd { margin: 0; color: var(--text-primary); font-weight: 600; }
.notif-detail-body .notif-stamp { font-size: 12px; color: var(--text-muted); }
.notif-detail-foot { flex: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; }
.notif-btn { padding: 9px 16px; border: 0; border-radius: var(--radius-md); background: var(--cmd-blue); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.notif-btn:hover { background: var(--cmd-blue-dark); }
.notif-btn-ghost { background: var(--cmd-grey-light); color: var(--text-secondary); }
.notif-btn-ghost:hover { background: var(--bg-secondary); }

@media (max-width: 600px) {
  .notif-popover { position: fixed; top: 64px; left: 8px; right: 8px; width: auto; }
  .notif-overlay { padding: 0; align-items: flex-end; }
  .notif-modal { width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
}

/* On phones the existing layout hides the bell and shows only the profile avatar. Notifications matter most
   on a phone, so the actions area becomes a small row: bell, then avatar. */
@media (max-width: 899px) {
  .top-bar .top-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    right: 16px;
    top: 12px;               /* the bar is 60px tall; this centres 36px controls on it */
    height: 36px;
    width: auto;
    transform: none;
  }

  .top-bar .top-bar-actions .notification-btn {
    position: relative;      /* the red count is positioned against the bell */
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    border-radius: 50%;
    color: var(--text-secondary);
  }

  .top-bar .top-bar-actions .notification-btn svg { width: 22px; height: 22px; }
  .notif-badge { top: -2px; right: -2px; }
}

/* ── Web Push card (Settings > Notifications) ── */
.push-alerts-card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.push-alerts-card-body strong { display: block; color: var(--text-primary, #1a2b3c); font-size: 14px; }
.push-alerts-card-body p { margin: 4px 0 0; color: var(--text-secondary, #5b6b7b); font-size: 13px; max-width: 460px; }
.push-alerts-card-body .push-alerts-note { color: var(--primary, #2196D3); }
.push-alerts-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-alerts-actions button:disabled { opacity: .6; }
.settings-secondary-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border, #d5e2ee); background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }

/* Delete in the notification detail box (removes it from this doctor's bell only) */
.notif-btn-danger { background: #fdecea; color: #c62828; }
.notif-btn-danger:hover { background: #fbd9d5; }
