/* ════════════════════════════════════════════════════════════
   BookPro — app.css
   Design System: SaaS High-End, RTL Hebrew
   v3.2 · NexaLabs · 2026
════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────────── */
:root {
  /* Brand Colors */
  --primary:      #4F46E5;
  --primary-h:    #4338CA;
  --primary-lt:   #EEF2FF;
  --navy:         #1E2D5A;

  /* Status Colors */
  --green:        #22C55E;
  --green-lt:     #DCFCE7;
  --amber:        #F59E0B;
  --amber-lt:     #FEF3C7;
  --red:          #EF4444;
  --red-lt:       #FEE2E2;

  /* Backgrounds */
  --bg:           #F9FAFB;
  --white:        #FFFFFF;
  --glass:        rgba(255,255,255,0.85);
  --glass2:       rgba(255,255,255,0.96);

  /* Typography */
  --text:         #111827;
  --text2:        #6B7280;
  --text3:        #D1D5DB;
  --text-inv:     #FFFFFF;

  /* Borders */
  --border:       #E5E7EB;
  --border2:      #D1D5DB;

  /* Shape */
  --r:            16px;
  --r-sm:         10px;
  --r-lg:         24px;
  --r-full:       9999px;

  /* Shadows */
  --sh:           0 2px 8px -1px rgba(0,0,0,0.08), 0 1px 4px -1px rgba(0,0,0,0.06);
  --sh-md:        0 4px 16px -2px rgba(0,0,0,0.10), 0 2px 6px -1px rgba(0,0,0,0.06);
  --sh-lg:        0 10px 30px -4px rgba(0,0,0,0.12), 0 4px 10px -2px rgba(0,0,0,0.06);

  /* Transitions */
  --tr:           all 0.2s ease;
  --tr-slow:      all 0.35s ease;

  /* Layout */
  --nav-h:        64px;    /* bottom nav height */
  --top-bar-h:    56px;
  --sidebar-w:    220px;
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Heebo', 'Arial Hebrew', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  direction: rtl;
  text-align: right;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;               /* app takes full viewport */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  direction: rtl;
}

input, textarea, select {
  font-family: inherit;
  font-size: 16px;   /* prevents iOS zoom */
  outline: none;
}

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

/* ─── APP SHELL ─────────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ─── SCREENS ───────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.screen.active { display: flex; }

/* ─── SPLASH ────────────────────────────────────────────── */
.splash-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  background: linear-gradient(160deg, var(--navy) 0%, #2D3FA6 100%);
}
.splash-icon  { font-size: 72px; }
.splash-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -1px;
}
.splash-sub   { font-size: 16px; color: rgba(255,255,255,0.7); }

/* Spinner */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-top: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── AUTH SCREEN ───────────────────────────────────────── */
#screen-login {
  background: linear-gradient(160deg, var(--navy) 0%, #2D3FA6 60%, var(--bg) 100%);
  overflow-y: auto;
}

.auth-scroll {
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 40px;
}

.auth-panel {
  width: 100%;
  max-width: 420px;
  background: var(--glass2);
  border-radius: var(--r-lg);
  padding: 32px 24px;
  box-shadow: var(--sh-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-panel.hidden { display: none; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}
.auth-logo  { font-size: 48px; margin-bottom: 8px; }
.auth-header h1 { font-size: 28px; font-weight: 900; color: var(--navy); }
.auth-header p  { font-size: 14px; color: var(--text2); margin-top: 4px; }

.back-btn {
  position: absolute;
  right: 0; top: 4px;
  font-size: 14px;
  color: var(--text2);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: var(--tr);
}
.back-btn:hover { background: var(--border); }

/* Auth Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  border-radius: 8px;
  transition: var(--tr);
}
.auth-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--sh);
}

/* Auth Forms */
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: var(--tr);
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.input.ltr { direction: ltr; text-align: left; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.link { color: var(--primary); font-weight: 700; }
.link-sm { font-size: 13px; color: var(--text2); text-align: center; margin-top: 8px; }

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.auth-cta-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-top: 12px;
  transition: var(--tr);
}
.auth-cta-link:hover { color: var(--primary); }

/* OTP */
.otp-header {
  text-align: center;
  margin-bottom: 16px;
}
.otp-icon    { font-size: 40px; margin-bottom: 8px; }
.otp-header p    { font-size: 14px; color: var(--text2); }
.otp-header strong { display: block; font-size: 15px; color: var(--text); direction: ltr; }
.otp-header small  { display: block; font-size: 12px; color: var(--text3); margin-top: 4px; }

.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  direction: ltr;
}
.otp-digit {
  width: 46px; height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  transition: var(--tr);
}
.otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary);
  color: var(--text-inv);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  transition: var(--tr);
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.btn-primary:hover  { background: var(--primary-h); box-shadow: 0 4px 12px rgba(79,70,229,0.4); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; pointer-events: none; }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  transition: var(--tr);
}
.btn-outline:hover { background: var(--primary-lt); }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  color: var(--text2);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--tr);
}
.btn-ghost:hover { background: var(--bg); }

.btn-danger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  background: var(--red); color: var(--white);
  border-radius: var(--r-sm); font-size: 14px; font-weight: 700;
  transition: var(--tr);
}
.btn-danger:hover { background: #DC2626; }

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.w-full { width: 100%; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: var(--tr);
}
.icon-btn:hover { background: rgba(0,0,0,0.06); }

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 20px;
  transition: var(--tr);
}
.card:hover { box-shadow: var(--sh-md); }
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

/* Stat Card */
.stat-card {
  background: var(--white);
  border-radius: var(--r);
  padding: 16px 20px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num   { font-size: 32px; font-weight: 900; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text2); }
.stat-icon  { font-size: 24px; margin-bottom: 4px; }

/* ─── BUSINESS APP LAYOUT ───────────────────────────────── */
#screen-business {
  padding-top: var(--top-bar-h);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.top-bar {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: var(--top-bar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--sh);
}
.top-bar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.top-bar-actions { display: flex; gap: 4px; }

.biz-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  height: 100%;
}

.biz-screen { display: none; }
.biz-screen.active { display: block; }

/* ─── BOTTOM NAV ────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 8px 4px;
  color: var(--text3);
  font-size: 11px;
  font-weight: 500;
  transition: var(--tr);
  border-radius: var(--r-sm);
}
.nav-item.active { color: var(--primary); }
.nav-item:hover  { color: var(--primary); }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 11px; }

/* FAB center button */
.nav-fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(79,70,229,0.4);
  transition: var(--tr);
  flex-shrink: 0;
  margin-bottom: 8px;
}
.nav-fab:hover  { background: var(--primary-h); transform: scale(1.05); }
.nav-fab:active { transform: scale(0.95); }

/* ─── ADMIN LAYOUT ──────────────────────────────────────── */
#screen-admin { overflow: hidden; }
.admin-layout {
  display: flex;
  height: 100%;
}

.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 0 16px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 20px;
  font-size: 15px;
  font-weight: 900;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px;
  gap: 2px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: var(--tr);
  text-align: right;
}
.sidebar-item:hover  { background: rgba(255,255,255,0.1); color: var(--white); }
.sidebar-item.active { background: var(--primary); color: var(--white); }

.sidebar-logout {
  margin: 16px;
  padding: 10px 16px;
  background: rgba(239,68,68,0.15);
  color: #FCA5A5;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  transition: var(--tr);
}
.sidebar-logout:hover { background: rgba(239,68,68,0.25); }

.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}
.admin-screen { display: none; }
.admin-screen.active { display: block; }

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 0;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: sheetUp 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--sh-lg);
}

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Desktop: center modal */
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal-box     { border-radius: var(--r-lg); max-height: 80vh; }
}

.modal-close {
  position: absolute;
  top: 16px; left: 16px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text2);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--tr);
}
.modal-close:hover { background: var(--border); }

/* ─── TOAST ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  animation: toastIn 0.25s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
.toast.success { background: #15803D; }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--amber); color: var(--text); }
.toast.fadeout { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn  {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.9); }
}

/* ─── BADGE ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
}
.badge-green  { background: var(--green-lt); color: #15803D; }
.badge-red    { background: var(--red-lt);   color: #B91C1C; }
.badge-amber  { background: var(--amber-lt); color: #92400E; }
.badge-blue   { background: var(--primary-lt); color: var(--primary); }
.badge-gray   { background: #F3F4F6; color: var(--text2); }

/* ─── TIMELINE (Appointments) ───────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px; }

.appt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  border-right: 4px solid var(--green);
  box-shadow: var(--sh);
  transition: var(--tr);
}
.appt-card.free     { border-right-color: var(--text3); }
.appt-card.closed   { border-right-color: var(--amber); opacity: 0.7; }
.appt-card:hover    { box-shadow: var(--sh-md); }

.appt-time  { font-size: 15px; font-weight: 700; color: var(--navy); min-width: 48px; }
.appt-name  { font-size: 15px; font-weight: 600; flex: 1; }
.appt-service {
  font-size: 12px;
  background: var(--primary-lt);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-weight: 600;
}

/* ─── HORIZONTAL DATE PICKER ────────────────────────────── */
.date-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  scrollbar-width: none;
}
.date-slider::-webkit-scrollbar { display: none; }

.date-item {
  flex: 0 0 56px;
  scroll-snap-align: center;
  border-radius: var(--r-sm);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: var(--tr);
  background: var(--white);
  border: 1.5px solid var(--border);
  position: relative;
}
.date-item:hover { border-color: var(--primary); }
.date-item.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: var(--sh-md);
}
.date-item.disabled { opacity: 0.4; pointer-events: none; }
.date-item.vacation { opacity: 0.45; }

.date-day   { font-size: 11px; font-weight: 600; }
.date-num   { font-size: 20px; font-weight: 900; line-height: 1.2; }
.date-dot   {
  position: absolute;
  bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.date-item.selected .date-dot { background: var(--white); }

/* ─── STATS GRID ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── SERVICES GRID ─────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 16px;
}

.service-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--tr);
}
.service-card:hover  { border-color: var(--primary); }
.service-card.active {
  border-color: var(--primary);
  background: var(--primary-lt);
  box-shadow: var(--sh);
}
.service-name  { font-size: 15px; font-weight: 700; }
.service-price { font-size: 16px; color: var(--primary); font-weight: 700; margin-top: 4px; }

/* ─── GLASS MORPHISM (Modals, Floating) ─────────────────── */
.glass-panel {
  background: var(--glass2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
}

/* ─── SKELETON LOADING ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── PLACEHOLDER SCREENS ───────────────────────────────── */
.placeholder-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  gap: 12px;
  color: var(--text2);
  padding: 40px;
  text-align: center;
}
.ph-icon { font-size: 56px; opacity: 0.4; }
.placeholder-screen h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.placeholder-screen p  { font-size: 14px; }

/* ─── SECTION HEADERS ───────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

/* ─── FORM CONTROLS ─────────────────────────────────────── */
.select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  appearance: none;
  cursor: pointer;
  transition: var(--tr);
}
.select:focus { border-color: var(--primary); }

.textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  min-height: 100px;
  transition: var(--tr);
}
.textarea:focus { border-color: var(--primary); }

/* Toggle Switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toggle-label { font-size: 14px; font-weight: 600; }
.toggle {
  position: relative;
  width: 48px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 26px;
  cursor: pointer;
  transition: var(--tr);
}
.toggle input:checked + .toggle-track { background: var(--primary); }
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--tr);
  box-shadow: var(--sh);
}
.toggle input:checked + .toggle-track::after { right: auto; left: 3px; }

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

/* ─── PAGE PADDING ──────────────────────────────────────── */
.page-pad { padding: 16px; }

/* ─── UTILITIES ─────────────────────────────────────────── */
.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.mb-8    { margin-bottom: 8px; }
.mb-16   { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text2); }
.text-danger  { color: var(--red); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── LOADING OVERLAY ───────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;
}
#loading-overlay.hidden { display: none; }
.loading-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.loading-inner .spinner {
  border-color: rgba(79,70,229,0.2);
  border-top-color: var(--primary);
}
.loading-inner p { font-size: 14px; color: var(--text2); }

/* ─── AVATAR ────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-lt);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--primary);
  flex-shrink: 0;
}
.avatar-sm  { width: 36px; height: 36px; font-size: 14px; }
.avatar-md  { width: 52px; height: 52px; font-size: 20px; }
.avatar-lg  { width: 72px; height: 72px; font-size: 28px; }
.avatar-xl  { width: 88px; height: 88px; font-size: 36px; }

/* ─── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text2);
  gap: 12px;
}
.empty-icon { font-size: 48px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text); }
.empty-text  { font-size: 14px; max-width: 280px; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (min-width: 768px) {
  .auth-scroll { padding: 60px 16px; align-items: center; }
  .auth-panel  { padding: 40px 36px; }
}

/* Desktop: wider admin sidebar */
@media (min-width: 1024px) {
  :root { --sidebar-w: 240px; }
}

/* Small phone fixes */
@media (max-width: 360px) {
  .auth-panel { padding: 24px 16px; }
  .otp-digit  { width: 40px; height: 48px; font-size: 18px; }
}
