/* ============================================================
   FrontDesk Design System — style.css
   Shared across all pages: admin board, pro dashboard, 
   website templates, login, setup wizard, booking page
   ============================================================ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,400;0,600;1,300&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ── CSS VARIABLES (Design Tokens) ── */
:root {
  /* Core palette */
  --color-sidebar:        #152030;
  --color-page-bg:        #F2EEE8;
  --color-card-bg:        #FFFFFF;
  --color-text-primary:   #152030;
  --color-text-secondary: #7A8694;
  --color-text-light:     #B0BAC4;
  --color-border:         rgba(21, 32, 48, 0.10);
  --color-border-light:   rgba(21, 32, 48, 0.05);

  /* Brand accent colours */
  --color-teal:           #1AABAA;
  --color-teal-light:     rgba(26, 171, 170, 0.10);
  --color-teal-mid:       rgba(26, 171, 170, 0.20);
  --color-amber:          #E9933A;
  --color-amber-light:    rgba(233, 147, 58, 0.10);
  --color-plum:           #8B5CF6;
  --color-plum-light:     rgba(139, 92, 246, 0.10);
  --color-coral:          #F06A6A;
  --color-coral-light:    rgba(240, 106, 106, 0.10);
  --color-green:          #2DB88A;
  --color-green-light:    rgba(45, 184, 138, 0.10);
  --color-blue:           #3B82F6;
  --color-blue-light:     rgba(59, 130, 246, 0.10);
  --color-gold:           #C9945C;
  --color-gold-light:     rgba(201, 148, 92, 0.10);
  --color-rose:           #F43F5E;
  --color-rose-light:     rgba(244, 63, 94, 0.10);
  --color-navy:           #152030;
  --color-navy-light:     rgba(21, 32, 48, 0.06);

  /* Sidebar specific */
  --sidebar-width:        260px;
  --sidebar-width-collapsed: 72px;

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

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-card: 28px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-soft:    0 4px 24px rgba(21, 32, 48, 0.07);
  --shadow-medium:  0 8px 32px rgba(21, 32, 48, 0.10);
  --shadow-hover:   0 12px 40px rgba(21, 32, 48, 0.13);
  --shadow-strong:  0 20px 60px rgba(21, 32, 48, 0.18);
  --shadow-inset:   inset 0 1px 3px rgba(21, 32, 48, 0.08);

  /* Transitions */
  --transition:       all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:  all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:  all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography scale */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  26px;
  --text-3xl:  32px;
  --text-4xl:  38px;

  /* Font families */
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui:      'Manrope', system-ui, -apple-system, sans-serif;

  /* Z-index layers */
  --z-base:    1;
  --z-dropdown: 100;
  --z-sticky:  200;
  --z-modal:   400;
  --z-toast:   500;
}

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

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

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font-ui); }
ul, ol { list-style: none; }

/* ── LAYOUT: APP SHELL (sidebar + main) ── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) 0;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Decorative glow effects */
.sidebar::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(26, 171, 170, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: 40px; left: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(201, 148, 92, 0.10) 0%, transparent 70%);
  pointer-events: none;
}

/* Brand / Logo area */
.sidebar-brand {
  padding: 0 var(--space-lg) var(--space-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--color-teal);
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-sub {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.30);
  margin-top: var(--space-xs);
  letter-spacing: 0.9px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.22);
  padding: var(--space-md) var(--space-sm) var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px var(--space-md);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  color: rgba(255, 255, 255, 0.52);
  font-size: var(--text-base);
  font-weight: 500;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
}

.nav-item.active {
  background: rgba(26, 171, 170, 0.15);
  color: #FFFFFF;
}

.nav-item.active .nav-icon {
  color: var(--color-teal);
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label { flex: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--color-coral);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
  line-height: 1.5;
}

/* Sidebar footer / profile */
.sidebar-footer {
  padding: var(--space-md) var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.signout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 9px var(--space-sm);
  border-radius: var(--radius-lg);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}
.signout-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px var(--space-sm);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: var(--transition);
}

.profile-pill:hover {
  background: rgba(255, 255, 255, 0.09);
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-teal), var(--color-plum));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

.profile-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.profile-role {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  line-height: 1.3;
}

.plan-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(26, 171, 170, 0.25);
  color: var(--color-teal);
  border: 1px solid rgba(26, 171, 170, 0.35);
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  background: var(--color-page-bg);
  flex-shrink: 0;
  gap: var(--space-md);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.topbar-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--color-teal);
}

.topbar-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* AI status pill */
.ai-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(45, 184, 138, 0.10);
  border: 1px solid rgba(45, 184, 138, 0.22);
  border-radius: var(--radius-pill);
  padding: 8px var(--space-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-green);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.ai-pill:hover {
  background: rgba(45, 184, 138, 0.18);
}

.ai-pill.paused {
  background: rgba(240, 106, 106, 0.10);
  border-color: rgba(240, 106, 106, 0.22);
  color: var(--color-coral);
}

.ai-pulse {
  width: 8px;
  height: 8px;
  background: var(--color-green);
  border-radius: 50%;
  animation: fdPulse 2s infinite;
  flex-shrink: 0;
}

.ai-pulse.paused {
  background: var(--color-coral);
  animation: none;
}

/* Icon buttons */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-card-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.topbar-signout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.topbar-signout-btn:hover {
  background: var(--color-navy-light);
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}

.notif-dot {
  position: absolute;
  top: 9px; right: 9px;
  width: 8px; height: 8px;
  background: var(--color-coral);
  border-radius: 50%;
  border: 2px solid var(--color-page-bg);
}

/* ── CONTENT AREA ── */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-2xl) var(--space-2xl);
}

.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb {
  background: rgba(21, 32, 48, 0.13);
  border-radius: 3px;
}

/* ── SECTION HEADERS ── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-teal);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.section-link:hover { opacity: 0.75; }

/* ── PILL CARDS (3×3 dashboard grid) ── */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: var(--space-lg);
}

.pill-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-card);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: fdCardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Top accent strip */
.pill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

/* Card accent variants */
.card-teal::before   { background: linear-gradient(90deg, #1AABAA, #44D9D8); }
.card-amber::before  { background: linear-gradient(90deg, #E9933A, #F5C06A); }
.card-plum::before   { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.card-coral::before  { background: linear-gradient(90deg, #F06A6A, #FB923C); }
.card-green::before  { background: linear-gradient(90deg, #2DB88A, #34D399); }
.card-blue::before   { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.card-gold::before   { background: linear-gradient(90deg, #C9945C, #F5C07A); }
.card-navy::before   { background: linear-gradient(90deg, #152030, #2D4A6A); }
.card-rose::before   { background: linear-gradient(90deg, #F43F5E, #FB7185); }

/* Stagger animation delays */
.pill-card:nth-child(1) { animation-delay: 0.05s; }
.pill-card:nth-child(2) { animation-delay: 0.10s; }
.pill-card:nth-child(3) { animation-delay: 0.15s; }
.pill-card:nth-child(4) { animation-delay: 0.20s; }
.pill-card:nth-child(5) { animation-delay: 0.25s; }
.pill-card:nth-child(6) { animation-delay: 0.30s; }
.pill-card:nth-child(7) { animation-delay: 0.35s; }
.pill-card:nth-child(8) { animation-delay: 0.40s; }
.pill-card:nth-child(9) { animation-delay: 0.45s; }

/* Card internals */
.card-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Card icon background variants */
.icon-teal  { background: var(--color-teal-light); }
.icon-amber { background: var(--color-amber-light); }
.icon-plum  { background: var(--color-plum-light); }
.icon-coral { background: var(--color-coral-light); }
.icon-green { background: var(--color-green-light); }
.icon-blue  { background: var(--color-blue-light); }
.icon-gold  { background: var(--color-gold-light); }
.icon-rose  { background: var(--color-rose-light); }
.icon-navy  { background: var(--color-navy-light); }

.card-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-primary);
  letter-spacing: -1.5px;
  margin-bottom: 6px;
}

.card-value.value-sm {
  font-size: var(--text-3xl);
  letter-spacing: -0.5px;
}

.card-value.value-xs {
  font-size: var(--text-xl);
  letter-spacing: 0;
  font-family: var(--font-ui);
  font-weight: 700;
}

.card-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.card-sub {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  font-weight: 500;
}

/* ── TREND BADGES ── */
.trend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.trend-up      { background: rgba(45, 184, 138, 0.10); color: var(--color-green); }
.trend-down    { background: rgba(240, 106, 106, 0.10); color: var(--color-coral); }
.trend-neutral { background: rgba(122, 134, 148, 0.10); color: var(--color-text-secondary); }
.trend-live    { background: rgba(26, 171, 170, 0.10); color: var(--color-teal); }

/* ── PROGRESS / MINI BAR ── */
.mini-bar {
  height: 4px;
  background: rgba(21, 32, 48, 0.07);
  border-radius: 2px;
  margin-top: var(--space-md);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── GENERAL CARDS / PANELS ── */
.card {
  background: var(--color-card-bg);
  border-radius: var(--radius-card);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-soft);
}

.card-sm {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-soft);
}

.panel {
  background: var(--color-card-bg);
  border-radius: var(--radius-card);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  animation: fdCardIn 0.5s 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.panel-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── BOTTOM GRID (two panels side by side) ── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px var(--space-lg);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Primary */
.btn-primary {
  background: var(--color-teal);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(26, 171, 170, 0.30);
}
.btn-primary:hover {
  background: #18A09F;
  box-shadow: 0 6px 20px rgba(26, 171, 170, 0.40);
}

/* Secondary */
.btn-secondary {
  background: var(--color-card-bg);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { box-shadow: var(--shadow-medium); }

/* Ghost variants */
.btn-ghost-teal  { background: var(--color-teal-light);  color: var(--color-teal); }
.btn-ghost-amber { background: var(--color-amber-light); color: var(--color-amber); }
.btn-ghost-plum  { background: var(--color-plum-light);  color: var(--color-plum); }
.btn-ghost-coral { background: var(--color-coral-light); color: var(--color-coral); }
.btn-ghost-green { background: var(--color-green-light); color: var(--color-green); }
.btn-ghost-navy  { background: var(--color-navy-light);  color: var(--color-text-primary); }

.btn-ghost-teal:hover  { background: var(--color-teal-mid); }
.btn-ghost-amber:hover { background: rgba(233, 147, 58, 0.18); }
.btn-ghost-plum:hover  { background: rgba(139, 92, 246, 0.18); }
.btn-ghost-coral:hover { background: rgba(240, 106, 106, 0.18); }
.btn-ghost-green:hover { background: rgba(45, 184, 138, 0.18); }
.btn-ghost-navy:hover  { background: rgba(21, 32, 48, 0.10); }

/* Danger */
.btn-danger {
  background: rgba(240, 106, 106, 0.10);
  color: var(--color-coral);
}
.btn-danger:hover { background: rgba(240, 106, 106, 0.20); }

/* Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--text-md);
}

.btn-full { width: 100%; }

/* Card action button (small, sits inside pill cards) */
.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.2px;
  font-family: var(--font-ui);
}

/* ── FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: 0.1px;
}

.form-label-sub {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 12px var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 500;
  transition: var(--transition-fast);
  outline: none;
  box-shadow: var(--shadow-inset);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(26, 171, 170, 0.12);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-light);
  font-weight: 400;
}

.input.error,
.select.error,
.textarea.error {
  border-color: var(--color-coral);
  box-shadow: 0 0 0 3px rgba(240, 106, 106, 0.10);
}

.textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: 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' stroke='%237A8694' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-coral);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* Toggle / Switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { display: none; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle input:checked ~ .toggle-track { background: var(--color-teal); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

.toggle-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ── TABLES ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  padding: 12px var(--space-md);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-secondary);
  background: rgba(21, 32, 48, 0.03);
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
}

.table td {
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td {
  background: rgba(26, 171, 170, 0.03);
}

/* ── STATUS PILLS / BADGES ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-confirmed { background: rgba(45, 184, 138, 0.10); color: var(--color-green); }
.status-pending   { background: rgba(233, 147, 58, 0.10); color: var(--color-amber); }
.status-cancelled { background: rgba(240, 106, 106, 0.10); color: var(--color-coral); }
.status-completed { background: rgba(59, 130, 246, 0.10); color: var(--color-blue); }
.status-no-show   { background: rgba(139, 92, 246, 0.10); color: var(--color-plum); }
.status-active    { background: rgba(45, 184, 138, 0.10); color: var(--color-green); }
.status-suspended { background: rgba(240, 106, 106, 0.10); color: var(--color-coral); }
.status-trial     { background: rgba(233, 147, 58, 0.10); color: var(--color-amber); }
.status-live      { background: rgba(26, 171, 170, 0.10); color: var(--color-teal); }

/* Plan badges */
.plan-starter { background: rgba(59, 130, 246, 0.10); color: var(--color-blue); }
.plan-growth  { background: rgba(139, 92, 246, 0.10); color: var(--color-plum); }
.plan-pro     { background: rgba(26, 171, 170, 0.10); color: var(--color-teal); }
.plan-clinic  { background: rgba(201, 148, 92, 0.10); color: var(--color-gold); }
.plan-trial   { background: rgba(122, 134, 148, 0.10); color: var(--color-text-secondary); }

/* ── UPGRADE PLAN CARDS ── */
.upgrade-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upgrade-card:hover { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.upgrade-card-popular { border-color: var(--color-primary); }
.upgrade-card-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.upgrade-card-name { font-weight: 700; font-size: 16px; }
.upgrade-card-price { font-size: 28px; font-weight: 800; color: var(--color-text); }
.upgrade-card-price span { font-size: 14px; font-weight: 400; color: var(--color-text-secondary); }
.upgrade-card-features { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--color-text-secondary); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.upgrade-card-features li::before { content: "✓ "; color: var(--color-success, #22c55e); font-weight: 700; }
.upgrade-card-btn { margin-top: 8px; width: 100%; }

/* ── TRIAL BANNER ── */
.trial-banner {
  background: linear-gradient(90deg, rgba(99,102,241,0.12), rgba(168,85,247,0.10));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: var(--space-lg);
}
.trial-banner-text { color: var(--color-text); }
.trial-banner-text strong { color: var(--color-primary); }
.trial-banner.trial-expired { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); }
.trial-banner.trial-expired .trial-banner-text strong { color: #ef4444; }

/* ── MODALS ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 48, 0.50);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  animation: fdFadeIn 0.2s ease forwards;
}

.modal {
  background: var(--color-card-bg);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-strong);
  transform: translateY(16px);
  animation: fdSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg { max-width: 720px; }
.modal-sm { max-width: 380px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-navy-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--color-border);
  color: var(--color-text-primary);
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--color-sidebar);
  color: #FFFFFF;
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-strong);
  max-width: 340px;
  pointer-events: all;
  animation: fdSlideLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-success { border-left: 3px solid var(--color-green); }
.toast-error   { border-left: 3px solid var(--color-coral); }
.toast-info    { border-left: 3px solid var(--color-teal); }
.toast-warning { border-left: 3px solid var(--color-amber); }

/* ── AVATAR ── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-teal), var(--color-plum));
}

.avatar-sm  { width: 30px; height: 30px; font-size: var(--text-xs); }
.avatar-md  { width: 38px; height: 38px; font-size: var(--text-base); }
.avatar-lg  { width: 48px; height: 48px; font-size: var(--text-md); }
.avatar-xl  { width: 64px; height: 64px; font-size: var(--text-xl); }

/* ── LOADING SKELETONS ── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(21, 32, 48, 0.06) 25%,
    rgba(21, 32, 48, 0.10) 50%,
    rgba(21, 32, 48, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: fdSkeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text  { height: 14px; border-radius: 4px; }
.skeleton-title { height: 22px; border-radius: 4px; }
.skeleton-card  { height: 160px; border-radius: var(--radius-card); }

/* ── DIVIDERS ── */
.divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-md) 0;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: var(--space-md) 0;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}

/* ── EMPTY STATES ── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--color-text-secondary);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.empty-state-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

/* ── STEP WIZARD ── */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-xl);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.wizard-step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.step-pending  { background: rgba(21,32,48,0.07); color: var(--color-text-secondary); }
.step-active   { background: var(--color-teal);   color: #FFFFFF;
                 box-shadow: 0 0 0 4px rgba(26,171,170,0.20); }
.step-complete { background: var(--color-green);  color: #FFFFFF; }

.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--color-border-light);
  transition: var(--transition);
}

.wizard-connector.complete { background: var(--color-green); }

/* ── UTILITY CLASSES ── */
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-md      { font-size: var(--text-md); }
.text-lg      { font-size: var(--text-lg); }
.text-display { font-family: var(--font-display); }

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-light     { color: var(--color-text-light); }
.text-teal      { color: var(--color-teal); }
.text-green     { color: var(--color-green); }
.text-coral     { color: var(--color-coral); }
.text-amber     { color: var(--color-amber); }

.font-400 { font-weight: 400; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs      { gap: var(--space-xs); }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0     { min-width: 0; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden  { display: none !important; }
.visible { display: flex !important; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ── ANIMATIONS / KEYFRAMES ── */
@keyframes fdCardIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fdFadeIn {
  to { opacity: 1; }
}

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

@keyframes fdSlideLeft {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fdSkeleton {
  to { background-position: -200% 0; }
}

@keyframes fdPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.85); }
}

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

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: fdSpin 0.7s linear infinite;
}

/* ── HAMBURGER BUTTON (shown on tablet/mobile only) ── */
.hamburger-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-card-bg);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.hamburger-btn:hover { box-shadow: var(--shadow-medium); }

/* ── SIDEBAR BACKDROP OVERLAY ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 350;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.open { display: block; }

/* Prevent body scroll when sidebar drawer is open */
body.sidebar-open { overflow: hidden; }

/* ── INBOX BACK BUTTON (shown on tablet/mobile only) ── */
.back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}
.back-btn:hover { background: var(--color-navy-light); }

/* ── RESPONSIVE BREAKPOINTS ── */

/* Large tablets / small laptops */
@media (max-width: 1100px) {
  :root { --sidebar-width: 220px; }

  .topbar {
    padding: var(--space-md) var(--space-xl);
  }

  .content-area {
    padding: var(--space-sm) var(--space-xl) var(--space-xl);
  }

  .pill-grid { gap: 14px; }

  .pill-card {
    padding: 22px 20px 18px;
  }

  .card-value { font-size: var(--text-3xl); }
}

/* iPad portrait / small tablets */
@media (max-width: 860px) {
  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 40px rgba(0, 0, 0, 0.3);
  }

  .hamburger-btn { display: flex; }

  .pill-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .topbar {
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .content-area {
    padding: var(--space-sm) var(--space-md) var(--space-xl);
  }

  .topbar-title { font-size: var(--text-xl); }

  /* Inbox: stack list above chat panel */
  .inbox-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 76px);
  }
  .inbox-left {
    max-height: 42%;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }
  /* When a conversation is active on mobile, hide the list */
  .inbox-layout.conv-active .inbox-left { display: none; }
  .inbox-layout.conv-active .inbox-right { height: 100%; }
  .back-btn { display: flex !important; }

  /* Tables: allow horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Section header: stack on narrow screens */
  .section-header { flex-wrap: wrap; gap: var(--space-sm); }

  /* KB grid: 2 cols on tablet */
  .kb-item { grid-template-columns: 1fr 1fr auto; }
}

/* Mobile */
@media (max-width: 520px) {
  .pill-grid {
    grid-template-columns: 1fr;
  }

  .ai-pill span { display: none; }

  .modal {
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
  }
}
