/* ============================================
   DENTAL CLINIC MANAGEMENT - GLOBAL STYLES
   RTL Arabic interface with 3 theme options
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  direction: rtl;
}

/* ============================================
   THEME 1: Clean Medical (Default)
   Soft white + medical teal/cyan
   ============================================ */
[data-theme="clean"] {
  --bg: #f4f7fa;
  --bg-elevated: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f5f9;
  --bg-subtle: #eef3f8;

  --text-primary: #0f1f2e;
  --text-secondary: #4a5b6d;
  --text-tertiary: #8a98a8;
  --text-muted: #b5bfc9;

  --border: #e4ebf2;
  --border-strong: #d0dae4;

  --accent: #0891b2;           /* medical teal */
  --accent-hover: #0e7490;
  --accent-soft: #ecfeff;
  --accent-text: #155e75;

  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;

  --shadow-sm: 0 1px 2px rgba(15, 31, 46, 0.04);
  --shadow: 0 2px 8px rgba(15, 31, 46, 0.06), 0 1px 2px rgba(15, 31, 46, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 31, 46, 0.10), 0 2px 8px rgba(15, 31, 46, 0.06);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

/* ============================================
   THEME 2: Luxe Dark
   Deep navy + gold/violet accents
   ============================================ */
[data-theme="luxe"] {
  --bg: #0b1020;
  --bg-elevated: #131a2e;
  --bg-sidebar: #0f1525;
  --bg-card: #151c33;
  --bg-hover: #1c2541;
  --bg-subtle: #1a2139;

  --text-primary: #f1f5fb;
  --text-secondary: #a8b3c7;
  --text-tertiary: #6a7690;
  --text-muted: #4a5570;

  --border: #232c47;
  --border-strong: #303a58;

  --accent: #d4af6f;           /* warm gold */
  --accent-hover: #e6c18a;
  --accent-soft: #2a2419;
  --accent-text: #e6c18a;

  --success: #34d399;
  --success-soft: #0f2a22;
  --warning: #fbbf24;
  --warning-soft: #2a2212;
  --danger: #f87171;
  --danger-soft: #2a1515;
  --info: #818cf8;
  --info-soft: #1a1a33;
  --purple: #a78bfa;
  --purple-soft: #231a33;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

/* ============================================
   THEME 3: Warm Pastel
   Cream + soft pink/mint
   ============================================ */
[data-theme="warm"] {
  --bg: #fbf6f1;
  --bg-elevated: #ffffff;
  --bg-sidebar: #fff8f1;
  --bg-card: #ffffff;
  --bg-hover: #fbf1e8;
  --bg-subtle: #f7ede3;

  --text-primary: #2b1810;
  --text-secondary: #5c4a3e;
  --text-tertiary: #8a7a6e;
  --text-muted: #b8ab9f;

  --border: #ecdfd1;
  --border-strong: #d9c8b5;

  --accent: #c2675b;           /* terracotta */
  --accent-hover: #a7544a;
  --accent-soft: #fbeae6;
  --accent-text: #8e3e34;

  --success: #5b8a72;
  --success-soft: #e3efe8;
  --warning: #c9944a;
  --warning-soft: #faf0d9;
  --danger: #b14848;
  --danger-soft: #f5dede;
  --info: #5b7aa3;
  --info-soft: #e0e9f3;
  --purple: #9579a5;
  --purple-soft: #ece4f1;

  --shadow-sm: 0 1px 2px rgba(43, 24, 16, 0.05);
  --shadow: 0 3px 10px rgba(43, 24, 16, 0.07), 0 1px 2px rgba(43, 24, 16, 0.04);
  --shadow-lg: 0 16px 40px rgba(43, 24, 16, 0.10), 0 3px 8px rgba(43, 24, 16, 0.06);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 26px;
}

/* ============================================
   Layout
   ============================================ */
#root, .app-root {
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  overflow: hidden;
}

.main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ============================================
   Scrollbars
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Reusable bits
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
[data-theme="luxe"] .btn.primary { color: #0b1020; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn.ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn.outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn.outline:hover { background: var(--bg-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 85%, #000); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.icon { padding: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.warning { background: var(--warning-soft); color: var(--warning); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }

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

.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
}
.sidebar-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
[data-theme="luxe"] .sidebar-logo-mark { color: #0b1020; }
.sidebar-logo-title { font-weight: 800; font-size: 15px; color: var(--text-primary); line-height: 1.2; }
.sidebar-logo-sub { font-size: 11px; color: var(--text-tertiary); }

.sidebar-group-label {
  padding: 16px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  overflow-y: auto;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: right;
  width: 100%;
  transition: all 0.12s ease;
  font-family: inherit;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}
[data-theme="luxe"] .nav-item.active { background: var(--bg-hover); color: var(--accent); }
.nav-item .icon-box {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.nav-item .badge-count {
  margin-inline-start: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
[data-theme="luxe"] .nav-item .badge-count { color: #0b1020; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--info));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 14px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.avatar.lg { width: 54px; height: 54px; font-size: 18px; border-radius: 14px; }

/* ============================================
   Topbar
   ============================================ */
.topbar {
  height: 64px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar .search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.topbar .search input {
  width: 100%;
  padding: 9px 40px 9px 14px;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.topbar .search input:focus {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}
.topbar .search .search-icon {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.12s ease;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.icon-btn .pulse-dot {
  position: absolute;
  top: 8px;
  inset-inline-end: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-elevated);
}

/* ============================================
   Page header
   ============================================ */
.page-header {
  padding: 24px 32px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.page-content {
  padding: 16px 32px 32px;
}

/* ============================================
   Grid helpers
   ============================================ */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex.gap-8 { gap: 8px; }
.flex.gap-12 { gap: 12px; }
.flex.gap-16 { gap: 16px; }
.flex.ai-c { align-items: center; }
.flex.jc-sb { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fade-in { animation: fadeIn 0.25s ease-out; }
.scale-in { animation: scaleIn 0.2s ease-out; }

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}
[data-theme="luxe"] .modal-backdrop { background: rgba(0, 0, 0, 0.6); }
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.2s ease-out;
  border: 1px solid var(--border);
}
.modal.lg { max-width: 900px; }
.modal.xl { max-width: 1100px; }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

/* ============================================
   Tables
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ============================================
   Tweaks panel
   ============================================ */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  inset-inline-start: 20px;
  width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 1000;
  animation: scaleIn 0.2s ease-out;
}
.tweaks-panel h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tweak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}
.tweak-row .label-txt { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.theme-swatches { display: flex; gap: 6px; }
.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}
.theme-swatch.active { border-color: var(--accent); transform: scale(1.1); }
.theme-swatch[data-preview="clean"] { background: linear-gradient(135deg, #f4f7fa 50%, #0891b2 50%); }
.theme-swatch[data-preview="luxe"] { background: linear-gradient(135deg, #0b1020 50%, #d4af6f 50%); }
.theme-swatch[data-preview="warm"] { background: linear-gradient(135deg, #fbf6f1 50%, #c2675b 50%); }

/* ============================================
   Tooth chart
   ============================================ */
.tooth-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
}
.tooth {
  aspect-ratio: 0.75;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px 6px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 2px;
  cursor: pointer;
  position: relative;
  transition: all 0.12s ease;
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
}
.tooth.lower { border-radius: 10px 10px 6px 6px; flex-direction: column-reverse; }
.tooth:hover { border-color: var(--accent); transform: translateY(-2px); }
.tooth.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tooth.cavity { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.tooth.filled { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.tooth.crown { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.tooth.missing { background: var(--bg-subtle); border-style: dashed; opacity: 0.5; }
.tooth.treated { background: var(--success-soft); border-color: var(--success); color: var(--success); }

.mouth-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border-strong);
  margin: 4px 0;
}

/* ============================================
   Utility
   ============================================ */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 26px; }
.text-3xl { font-size: 32px; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.w-full { width: 100%; }

.progress {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Login screen specific */
.login-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  overflow: hidden;
}
.login-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--info) 100%);
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
[data-theme="luxe"] .login-hero {
  background: linear-gradient(135deg, #1a1f3a 0%, #2a2030 100%);
  color: var(--accent);
}
.login-form-side {
  display: grid;
  place-items: center;
  padding: 48px;
  overflow-y: auto;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
}
.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.calendar-day-header {
  background: var(--bg-subtle);
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.calendar-day {
  background: var(--bg-elevated);
  min-height: 90px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calendar-day:hover { background: var(--bg-hover); }
.calendar-day.other-month { opacity: 0.4; }
.calendar-day.today .day-num {
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
[data-theme="luxe"] .calendar-day.today .day-num { color: #0b1020; }
.day-num { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.event-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.event-pill.warning { background: var(--warning-soft); color: var(--warning); }
.event-pill.success { background: var(--success-soft); color: var(--success); }

/* Appointment timeline */
.timeline {
  position: relative;
  padding-inline-end: 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  inset-inline-end: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 28px 20px 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  inset-inline-end: 4px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-elevated);
}

/* KPI card */
.kpi {
  padding: 20px;
}
.kpi .label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; margin: 0 0 8px; }
.kpi .value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; letter-spacing: -0.02em; }
.kpi .trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}
.kpi .trend.up { color: var(--success); }
.kpi .trend.down { color: var(--danger); }
.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: scaleIn 0.2s ease-out;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  max-width: 360px;
}
.toast.success { border-color: var(--success); }
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  flex-shrink: 0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: all 0.12s ease;
  white-space: nowrap;
  font-family: inherit;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.app-shell {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
@keyframes spin { to { transform: rotate(360deg); } }
