/* ==========================================================================
   Sakina Autism Center System - Unified Design System (app.css)
   Clean, modern healthcare UI with Glassmorphism, Arabic Typography,
   Vibrant Harmonic Accents, and Smooth Micro-Interactions.
   ========================================================================== */

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

:root {
  /* Brand Primary Colors */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-dark: #3730a3;
  --primary-light: #6366f1;
  --primary-soft: #eef2ff;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
  --brand-gradient: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);

  /* Accent Colors */
  --secondary: #64748b;
  --secondary-soft: #f1f5f9;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --emerald: #10b981;
  --emerald-soft: #d1fae5;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --rose: #f43f5e;
  --rose-soft: #ffe4e6;
  --sky: #0ea5e9;
  --sky-soft: #e0f2fe;

  /* Neutral Surface Palette */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;

  /* Text & Border Palette */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: #818cf8;
  --border-glass: rgba(255, 255, 255, 0.4);

  /* Radius & Shadows */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 32px -8px rgba(15, 23, 42, 0.08), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: none;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Standalone Native PWA Polish */
@media all and (display-mode: standalone) {
  body {
    user-select: none;
    -webkit-user-select: none;
  }

  input,
  textarea,
  select {
    user-select: text;
    -webkit-user-select: text;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   Header & Glass Navbar
   ========================================================================== */
.main-navbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.65rem 1.25rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary-dark) !important;
  letter-spacing: -0.02em;
}

.navbar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.main-navbar .nav-link {
  color: var(--text-muted) !important;
  font-weight: 600;
  padding: 0.55rem 0.9rem !important;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.main-navbar .nav-link:hover {
  color: var(--primary) !important;
  background-color: var(--primary-soft);
  transform: translateY(-1px);
}

.main-navbar .nav-link.active {
  color: var(--primary) !important;
  background-color: var(--primary-soft);
  font-weight: 700;
}

.navbar-user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ==========================================================================
   Cards & Glass Containers
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 1.1rem 1.4rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.4rem;
}

.card-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.4rem;
}

/* Glassmorphism Card Style */
.card-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Stat Widgets / KPI Cards
   ========================================================================== */
.stat-card {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: all var(--transition-bounce);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.stat-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-wrap.stat-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon-wrap.stat-emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.stat-icon-wrap.stat-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.stat-icon-wrap.stat-rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.stat-icon-wrap.stat-sky {
  background: var(--sky-soft);
  color: var(--sky);
}

.stat-content {
  flex-grow: 1;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  font-feature-settings: "tnum";
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   Hero Banners
   ========================================================================== */
.hero-banner {
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 2.2rem 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.hero-banner h2 {
  font-weight: 800;
  font-size: 1.85rem;
  margin-bottom: 0.4rem;
}

.hero-banner p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

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

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.btn-success {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.btn-danger:hover {
  background: #e11d48;
  border-color: #e11d48;
}

.btn-light,
.btn-secondary-soft {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-light);
}

.btn-light:hover,
.btn-secondary-soft:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Icon Buttons */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.95rem;
  font-size: 0.92rem;
  color: var(--text-main);
  background-color: var(--bg-surface);
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

.input-group-text {
  background-color: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
}

/* Checkbox & Radio */
.form-check-input {
  width: 1.15em;
  height: 1.15em;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   Modern Data Tables
   ========================================================================== */
.table-responsive {
  border-radius: var(--radius-md);
}

.table {
  color: var(--text-main);
  margin-bottom: 0;
  vertical-align: middle;
}

.table thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--border-light);
  padding: 0.85rem 1.1rem;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.table-hover tbody tr {
  transition: background-color var(--transition-fast);
}

.table-hover tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.03);
}

/* Table Avatar Cell */
.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ==========================================================================
   Badges, Status Tags & Pills
   ========================================================================== */
.badge {
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: -0.01em;
}

.badge-scheduled,
.badge-upcoming {
  background: var(--sky-soft);
  color: #0369a1;
}

.badge-in_progress,
.badge-running {
  background: var(--amber-soft);
  color: #b45309;
  animation: pulse-badge 2s infinite;
}

.badge-completed,
.badge-done {
  background: var(--emerald-soft);
  color: #047857;
}

.badge-cancelled {
  background: var(--secondary-soft);
  color: var(--text-muted);
}

.badge-absent,
.badge-no-show {
  background: var(--rose-soft);
  color: #be123c;
}

@keyframes pulse-badge {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  background: var(--bg-subtle);
}

.modal-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
}

/* ==========================================================================
   Interactive Quick Action Grid (Dashboard)
   ========================================================================== */
.quick-action-card {
  text-decoration: none;
  display: block;
  height: 100%;
}

.quick-action-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.4rem;
  text-align: center;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.quick-action-card:hover .quick-action-inner {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.quick-action-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  margin-bottom: 1rem;
  transition: transform var(--transition-bounce);
}

.quick-action-card:hover .quick-action-icon {
  transform: scale(1.1);
}

.quick-action-title {
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.quick-action-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Login Screens
   ========================================================================== */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: radial-gradient(circle at 15% 15%, #4338ca 0%, #312e81 40%, #1e1b4b 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

.login-body::before {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0) 70%);
  top: -150px;
  right: -150px;
  pointer-events: none;
  z-index: 1;
}

.login-body::after {
  content: '';
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0) 70%);
  bottom: -120px;
  left: -120px;
  pointer-events: none;
  z-index: 1;
}

.login-wrapper {
  width: 100%;
  max-width: 450px;
  margin: auto;
  position: relative;
  z-index: 10;
  padding: 0.5rem 0;
}

.login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  position: relative;
  z-index: 10;
}

.login-brand-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

/* ==========================================================================
   Timeline & Observation Notes
   ========================================================================== */
.note-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.note-item-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: #cbd5e1;
}

/* ==========================================================================
   Admin Sidebar & Dashboard Layout
   ========================================================================== */
body.has-admin-sidebar {
  overflow-x: hidden;
  background-color: var(--bg-main);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* --- Admin Sidebar (RTL: right side fixed) --- */
.admin-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 1045;
  transition: width var(--transition-normal), right var(--transition-normal), transform var(--transition-normal);
  box-shadow: -2px 0 16px rgba(15, 23, 42, 0.03);
}

.admin-sidebar-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-brand-text {
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand-text .brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary-dark);
  line-height: 1.2;
}

.sidebar-brand-text .brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.75rem 0.35rem;
  white-space: nowrap;
  overflow: hidden;
}

.admin-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}

.admin-nav-link i {
  font-size: 1.15rem;
  color: var(--text-subtle);
  transition: all var(--transition-fast);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.admin-nav-link:hover {
  color: var(--primary);
  background-color: var(--primary-soft);
  transform: translateX(-3px);
}

.admin-nav-link:hover i {
  color: var(--primary);
}

.admin-nav-link.active {
  color: #ffffff !important;
  background: var(--primary-gradient) !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.admin-nav-link.active i {
  color: #ffffff !important;
}

.admin-sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.sidebar-user-card .user-info {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-user-card .user-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.2;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-user-card .user-role {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
}

/* --- Admin Main Content Wrapper --- */
.admin-main-wrapper {
  flex: 1;
  margin-right: 260px;
  width: calc(100% - 260px);
  max-width: calc(100vw - 260px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-right var(--transition-normal), width var(--transition-normal), max-width var(--transition-normal);
}

.admin-topbar {
  height: 70px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--shadow-xs);
}

.admin-topbar .topbar-start,
.admin-topbar .topbar-end {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-main-body {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background-color: var(--bg-main);
}

.admin-main-body>.container-fluid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* --- Collapsed State on Desktop --- */
.admin-layout.sidebar-collapsed .admin-sidebar {
  width: 76px;
}

.admin-layout.sidebar-collapsed .admin-main-wrapper {
  margin-right: 76px;
  width: calc(100% - 76px);
  max-width: calc(100vw - 76px);
}

.admin-layout.sidebar-collapsed .sidebar-brand-text,
.admin-layout.sidebar-collapsed .sidebar-group-title,
.admin-layout.sidebar-collapsed .admin-nav-link span,
.admin-layout.sidebar-collapsed .sidebar-user-card .user-info {
  display: none !important;
}

.admin-layout.sidebar-collapsed .admin-nav-link {
  justify-content: center;
  padding: 0.75rem 0;
}

.admin-layout.sidebar-collapsed .admin-nav-link i {
  margin: 0;
  font-size: 1.25rem;
}

.admin-layout.sidebar-collapsed .sidebar-user-card {
  justify-content: center;
}

/* --- Responsive Drawer on Mobile & Tablets (<992px) --- */
@media (max-width: 991.98px) {
  .admin-sidebar {
    right: -280px;
    width: 270px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  }


    .admin-main-wrapper,
    .admin-layout.sidebar-collapsed .admin-main-wrapper {
      margin-right: 0 !important;
      width: 100% !important;
      max-width: 100vw !important;
      min-width: 0 !important;
    }

    .admin-layout.mobile-sidebar-open .admin-sidebar {
      right: 0;
    }

    .admin-sidebar-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 1040;
      opacity: 0;
      visibility: hidden;
      transition: opacity var(--transition-fast), visibility var(--transition-fast);
    }

    .admin-layout.mobile-sidebar-open .admin-sidebar-backdrop {
      opacity: 1;
      visibility: visible;
    }
  }

  /* ==========================================================================
   Print Optimization
   ========================================================================== */
  @media print {

    .main-navbar,
    .admin-sidebar,
    .admin-topbar,
    .btn,
    .no-print {
      display: none !important;
    }


      .admin-main-wrapper,
      .admin-layout.sidebar-collapsed .admin-main-wrapper {
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
      }

      body {
        background: #fff !important;
        font-size: 12pt;
      }

      .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
      }
    }

    /* ==========================================================================
   Schedule Matrix View Styles (Professional Clinical Grid)
   ========================================================================== */
    .schedule-matrix-card {
      display: block !important;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
    }

    .schedule-card-header {
      display: block !important;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      box-sizing: border-box !important;
    }

    .schedule-days-scroll-wrap {
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      overflow: hidden !important;
    }

    .schedule-matrix-container {
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      overflow-x: auto !important;
      -webkit-overflow-scrolling: touch;
      position: relative;
      border-radius: 8px;
    }

    .matrix-grid-table {
      border-collapse: separate;
      border-spacing: 0;
      width: 100%;
      min-width: 1100px;
      background: #ffffff;
    }

    .matrix-grid-table th {
      background: #f8fafc;
      color: #334155;
      font-weight: 700;
      font-size: 0.82rem;
      padding: 0.7rem 0.5rem;
      text-align: center;
      border-bottom: 2px solid #cbd5e1;
      border-left: 1px solid #e2e8f0;
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .matrix-therapist-header {
      width: 220px;
      min-width: 220px;
      position: sticky;
      right: 0;
      z-index: 20 !important;
      background: #f1f5f9 !important;
      border-left: 2px solid #94a3b8 !important;
      text-align: right !important;
      padding-right: 1rem !important;
    }

    .matrix-therapist-cell {
      position: sticky;
      right: 0;
      z-index: 15;
      background: #f8fafc;
      border-left: 2px solid #94a3b8 !important;
      border-bottom: 1px solid #e2e8f0;
      padding: 0.6rem 0.8rem;
      vertical-align: middle;
    }

    .matrix-time-cell {
      border-bottom: 1px solid #e2e8f0;
      border-left: 1px solid #e2e8f0;
      padding: 0.35rem;
      vertical-align: top;
      min-width: 125px;
      height: 86px;
      background: #ffffff;
      transition: background 0.15s ease;
    }

    .matrix-time-cell:hover {
      background: #f8fafc;
    }

    .matrix-session-card {
      border-radius: 7px;
      padding: 0.4rem 0.5rem;
      font-size: 0.78rem;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
      position: relative;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
      margin-bottom: 0.25rem;
    }

    .matrix-session-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
      z-index: 5;
    }

    .matrix-session-card.spec-aba {
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      color: #1e40af;
    }

    .matrix-session-card.spec-slp {
      background: #ecfdf5;
      border: 1px solid #a7f3d0;
      color: #065f46;
    }

    .matrix-session-card.spec-ot {
      background: #faf5ff;
      border: 1px solid #e9d5ff;
      color: #6b21a8;
    }

    .matrix-session-card.is-fusion {
      border-right: 4px solid #f59e0b !important;
    }

    .matrix-session-card.is-supervision {
      background: #f5f3ff;
      border: 1px solid #ddd6fe;
      border-right: 4px solid #7c3aed !important;
      color: #5b21b6;
    }

    .matrix-session-card.is-parent-comm {
      background: #fffbeb;
      border: 1px solid #fde68a;
      border-right: 4px solid #d97706 !important;
      color: #92400e;
    }

    .matrix-session-card.is-break {
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      border-right: 4px solid #16a34a !important;
      color: #166534;
    }

    .matrix-session-card.is-office-work {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-right: 4px solid #64748b !important;
      color: #475569;
    }

    .matrix-session-card.is-training {
      background: #f0fdfa;
      border: 1px solid #99f6e4;
      border-right: 4px solid #0d9488 !important;
      color: #115e59;
    }

    .matrix-session-card.is-training .child-name {
      color: #0f766e;
    }

    .matrix-session-card.is-school {
      background: #eef2ff;
      border: 1px solid #c7d2fe;
      border-right: 4px solid #4f46e5 !important;
      color: #3730a3;
    }

    .matrix-session-card.is-school .child-name {
      color: #312e81;
      font-weight: 700;
    }

    .tp-status--training {
      background: #ccfbf1 !important;
      color: #0f766e !important;
      border: 1px solid #99f6e4 !important;
    }

    .matrix-session-card .child-name {
      font-weight: 700;
      color: #0f172a;
      line-height: 1.25;
      margin-bottom: 2px;
    }

    .matrix-session-card .time-range {
      font-size: 0.7rem;
      opacity: 0.85;
    }

    .matrix-empty-slot {
      height: 100%;
      min-height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.15s ease;
    }

    .matrix-time-cell:hover .matrix-empty-slot {
      opacity: 1;
    }

    /* ==========================================================================
   Executive 7-Day Week Calendar Strip (Full Responsive Across All Devices)
   ========================================================================== */
    #dayTabsContainer,
    .schedule-days-grid {
      display: grid !important;
      grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
      gap: 10px !important;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      margin: 0 !important;
      padding: 2px 0 !important;
      box-sizing: border-box !important;
    }

    .day-tab-pill {
      width: 100% !important;
      min-width: 0 !important;
      min-height: 68px !important;
      border-radius: 12px !important;
      padding: 8px 12px !important;
      border: 1px solid #e2e8f0 !important;
      background: #ffffff !important;
      color: #334155 !important;
      cursor: pointer !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: space-between !important;
      text-align: right !important;
      position: relative !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
      transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
      white-space: normal !important;
      box-sizing: border-box !important;
    }

    .day-tab-pill:hover {
      background: #f8fafc !important;
      border-color: #cbd5e1 !important;
      transform: translateY(-2px) !important;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06) !important;
    }

    .day-tab-pill.is-today {
      border-color: #fca5a5 !important;
      background: #fffafa !important;
    }

    .day-tab-pill.is-today::before {
      content: '';
      position: absolute;
      top: 6px;
      left: 6px;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #ef4444;
    }

    .day-tab-pill.active {
      background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
      color: #ffffff !important;
      border-color: #3730a3 !important;
      box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35) !important;
      transform: translateY(-1px) !important;
    }

    .day-tab-pill.active.is-today::before {
      background: #fef08a !important;
    }

    .day-tab-top {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 4px !important;
      width: 100% !important;
      min-width: 0 !important;
      margin-bottom: 4px !important;
    }

    .day-tab-name-wrap {
      display: flex !important;
      align-items: center !important;
      gap: 5px !important;
      min-width: 0 !important;
      flex-wrap: wrap !important;
    }

    .day-tab-name {
      font-weight: 700 !important;
      font-size: 0.92rem !important;
      color: inherit !important;
      line-height: 1.2 !important;
      white-space: nowrap !important;
    }

    .day-tab-date {
      font-size: 0.74rem !important;
      color: #64748b !important;
      font-weight: 500 !important;
      white-space: nowrap !important;
      flex-shrink: 0 !important;
    }

    .day-tab-pill.active .day-tab-date {
      color: rgba(255, 255, 255, 0.85) !important;
    }

    .day-tab-today-pill {
      font-size: 0.62rem !important;
      padding: 1px 5px !important;
      border-radius: 6px !important;
      background: #fee2e2 !important;
      color: #b91c1c !important;
      font-weight: 700 !important;
      line-height: 1.3 !important;
      white-space: nowrap !important;
    }

    .day-tab-pill.active .day-tab-today-pill {
      background: rgba(255, 255, 255, 0.25) !important;
      color: #ffffff !important;
    }

    .day-tab-bottom {
      display: flex !important;
      align-items: center !important;
      justify-content: flex-start !important;
      width: 100% !important;
      min-width: 0 !important;
    }

    .day-tab-badge {
      font-size: 0.72rem !important;
      font-weight: 600 !important;
      padding: 2px 8px !important;
      border-radius: 6px !important;
      display: inline-flex !important;
      align-items: center !important;
      white-space: nowrap !important;
      line-height: 1.3 !important;
      max-width: 100% !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }

    .day-tab-badge.badge-has-sessions {
      background: #eef2ff !important;
      color: #4338ca !important;
      border: 1px solid #c7d2fe !important;
    }

    .day-tab-badge.badge-empty {
      background: #f8fafc !important;
      color: #94a3b8 !important;
      border: 1px dashed #cbd5e1 !important;
    }

    .day-tab-badge.badge-fri {
      background: #f1f5f9 !important;
      color: #64748b !important;
      border: 1px solid #e2e8f0 !important;
    }

    .day-tab-pill.active .day-tab-badge {
      background: rgba(255, 255, 255, 0.22) !important;
      color: #ffffff !important;
      border: 1px solid rgba(255, 255, 255, 0.35) !important;
    }

    /* Medium Laptops & Small Desktops (992px - 1279.98px) */
    @media (min-width: 992px) and (max-width: 1279.98px) {

      #dayTabsContainer,
      .schedule-days-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 6px !important;
      }

      .day-tab-pill {
        padding: 6px 8px !important;
        min-height: 62px !important;
        border-radius: 10px !important;
      }

      .day-tab-name {
        font-size: 0.82rem !important;
      }

      .day-tab-date {
        font-size: 0.68rem !important;
      }

      .day-tab-today-pill {
        font-size: 0.56rem !important;
        padding: 1px 4px !important;
      }

      .day-tab-badge {
        font-size: 0.66rem !important;
        padding: 2px 6px !important;
      }
    }

    /* Tablets & Mobile (< 991.98px) */
    @media (max-width: 991.98px) {
      #dayTabsContainer,
      .schedule-days-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 4px 2px 10px 2px !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x proximity !important;
        scrollbar-width: thin;
      }

      #dayTabsContainer::-webkit-scrollbar,
      .schedule-days-grid::-webkit-scrollbar {
        height: 4px !important;
      }

      #dayTabsContainer::-webkit-scrollbar-thumb,
      .schedule-days-grid::-webkit-scrollbar-thumb {
        background: #cbd5e1 !important;
        border-radius: 4px !important;
      }

      .day-tab-pill {
        flex: 0 0 120px !important;
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        min-height: 66px !important;
        padding: 8px 10px !important;
        border-radius: 12px !important;
        scroll-snap-align: start !important;
        align-items: stretch !important;
        justify-content: space-between !important;
        text-align: right !important;
      }

      .day-tab-top {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 4px !important;
      }

      .day-tab-name {
        font-size: 0.85rem !important;
      }

      .day-tab-date {
        font-size: 0.7rem !important;
      }

      .day-tab-badge {
        font-size: 0.68rem !important;
        padding: 2px 7px !important;
      }
    }

    /* Phones (< 575.98px) */
    @media (max-width: 575.98px) {
      .day-tab-pill {
        flex: 0 0 108px !important;
        width: 108px !important;
        min-width: 108px !important;
        max-width: 108px !important;
        min-height: 62px !important;
        padding: 7px 8px !important;
        border-radius: 10px !important;
      }

      .day-tab-name {
        font-size: 0.8rem !important;
      }

      .day-tab-date {
        font-size: 0.66rem !important;
      }

      .day-tab-today-pill {
        font-size: 0.56rem !important;
        padding: 1px 4px !important;
      }

      .day-tab-badge {
        font-size: 0.65rem !important;
        padding: 2px 6px !important;
      }
    }

    .timeline-session-card-wrap {
      width: 220px;
    }

    @media (max-width: 575.98px) {
      .timeline-session-card-wrap {
        width: 100%;
      }
    }

    .hour-block-row {
      border-bottom: 1px solid #f1f5f9;
      padding: 0.5rem 0;
    }

    .hour-block-label {
      width: 90px;
      min-width: 90px;
      font-weight: 700;
      font-size: 0.8rem;
      color: #475569;
      background: #f8fafc;
      padding: 0.4rem 0.6rem;
      border-radius: 6px;
      text-align: center;
    }

    .matrix-session-card.highlighted {
      box-shadow: 0 0 0 3px #4f46e5 !important;
      border-color: #4f46e5 !important;
      transform: scale(1.02);
      z-index: 10;
      animation: pulse-ring 1.5s infinite;
    }

    .matrix-session-card.dimmed {
      opacity: 0.22 !important;
      filter: grayscale(80%);
    }

    .matrix-card-actions {
      display: flex;
      gap: 2px;
      margin-top: 4px;
      opacity: 0;
      transition: opacity 0.15s ease;
    }

    .matrix-session-card:hover .matrix-card-actions {
      opacity: 1;
    }

    .matrix-add-btn {
      font-size: 0.72rem;
      font-weight: 600;
      padding: 3px 8px;
      border-radius: 4px;
      border: 1px dashed #cbd5e1;
      background: #ffffff;
      color: #64748b;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    /* Live Operational Handover & Transition Hub */
    .live-hub-card {
      border-radius: var(--radius-md);
      border: 1px solid rgba(226, 232, 240, 0.9);
      background: #ffffff;
      box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      overflow: hidden;
    }

    .live-hub-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.1);
    }

    .live-hub-card.is-current {
      border-right: 5px solid #2563eb !important;
      background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    }

    .live-hub-card.is-next {
      border-right: 5px solid #7c3aed !important;
      background: linear-gradient(135deg, #fbf7ff 0%, #ffffff 100%);
    }

    .live-pulse-dot {
      width: 9px;
      height: 9px;
      background-color: #10b981;
      border-radius: 50%;
      display: inline-block;
      animation: livePulseAnim 1.8s infinite;
    }

    @keyframes livePulseAnim {
      0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
      }

      70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
      }

      100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
      }
    }

    .handover-badge {
      font-size: 0.8rem;
      border-radius: 6px;
      padding: 5px 10px;
      display: flex;
      align-items: center;
      gap: 6px;
      line-height: 1.35;
    }

    .handover-pickup {
      background-color: #ecfdf5;
      color: #065f46;
      border: 1px solid #a7f3d0;
    }

    .handover-dropoff {
      background-color: #eff6ff;
      color: #1e40af;
      border: 1px solid #bfdbfe;
    }

    .transition-cell-tag {
      font-size: 0.65rem;
      padding: 2px 4px;
      border-radius: 4px;
      margin-top: 2px;
      display: block;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .transition-cell-tag.pickup-tag {
      background-color: #f0fdf4;
      color: #166534;
      border: 1px solid #bbf7d0;
    }

    .transition-cell-tag.handover-tag {
      background-color: #eff6ff;
      color: #1d4ed8;
      border: 1px solid #bfdbfe;
    }

    .matrix-add-btn:hover {
      border-color: #4f46e5;
      background: #eef2ff;
      color: #4f46e5;
      box-shadow: 0 1px 4px rgba(79, 70, 229, 0.15);
    }

    .btn-xs {
      padding: 0.15rem 0.35rem;
      font-size: 0.7rem;
      line-height: 1.2;
      border-radius: 3px;
    }

    .fs-7 {
      font-size: 0.82rem;
    }

    @keyframes pulse-ring {
      0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5);
      }

      70% {
        box-shadow: 0 0 0 6px rgba(79, 70, 229, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
      }
    }

    @media print {
      body {
        background: #ffffff !important;
      }

      .card-header,
      .btn,
      .input-group,
      #dayTabsContainer,
      #specFilterPills,
      .navbar,
      .sidebar,
      .admin-mobile-bottom-nav {
        display: none !important;
      }

      .matrix-grid-table {
        min-width: 100% !important;
        font-size: 10pt;
      }

      .matrix-therapist-header,
      .matrix-therapist-cell {
        position: static !important;
      }

      .matrix-card-actions,
      .matrix-add-btn {
        display: none !important;
      }
    }

    /* ==========================================================================
   Mobile-First Native Responsive Design System (<992px, <768px, <576px)
   100% Coherent, Touch-Optimized, and Seamless on Smartphones & Tablets
   ========================================================================== */

    /* --- Mobile Bottom App Bar --- */
    .admin-mobile-bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      min-height: calc(62px + env(safe-area-inset-bottom, 0px));
      height: auto;
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-top: 1px solid var(--border-light);
      z-index: 1035;
      display: none;
      justify-content: space-around;
      align-items: center;
      padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px;
      box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
    }

    /* --- iOS / Apple Standalone PWA Safe Area Support (Notch & Dynamic Island) --- */
    @supports (padding-top: env(safe-area-inset-top)) {
      @media all and (display-mode: standalone) {
        .admin-topbar,
        .tp-topbar {
          padding-top: calc(0.5rem + env(safe-area-inset-top, 0px)) !important;
          height: calc(60px + env(safe-area-inset-top, 0px)) !important;
        }

        .admin-sidebar-header {
          padding-top: calc(1rem + env(safe-area-inset-top, 0px)) !important;
          height: auto !important;
          min-height: calc(70px + env(safe-area-inset-top, 0px)) !important;
        }
      }
    }

    .mobile-nav-link {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      color: var(--text-muted);
      text-decoration: none;
      font-size: 0.7rem;
      font-weight: 600;
      padding: 6px 4px;
      flex: 1;
      text-align: center;
      border-radius: 12px;
      background: none;
      border: none;
      cursor: pointer;
      transition: all var(--transition-fast);
      -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-link i {
      font-size: 1.25rem;
      line-height: 1;
      transition: transform var(--transition-fast), color var(--transition-fast);
    }

    .mobile-nav-link:hover,
    .mobile-nav-link:focus {
      color: var(--primary);
    }

    .mobile-nav-link:active {
      transform: scale(0.92);
    }

    .mobile-nav-link.active {
      color: var(--primary);
      font-weight: 800;
    }

    .mobile-nav-link.active i {
      color: var(--primary);
      transform: translateY(-2px);
    }

    .mobile-nav-badge {
      position: absolute;
      top: -4px;
      right: -8px;
      font-size: 0.62rem;
      padding: 0.25em 0.45em;
      border-radius: 9999px;
      box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
    }

    /* --- Touch optimization across all devices --- */
    @media (pointer: coarse) {

      /* On touch devices, reveal matrix card actions without needing hover */
      .matrix-card-actions {
        opacity: 1 !important;
      }

      .matrix-empty-slot {
        opacity: 0.7 !important;
      }
    }

    /* --- Tablets & Mobile (<992px) --- */
    @media (max-width: 991.98px) {

      body.has-admin-sidebar,
      body.tp-body,
      body.therapist-body {
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
      }

      .admin-mobile-bottom-nav {
        display: flex;
      }

      .admin-main-wrapper {
        margin-right: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
      }

      .admin-topbar {
        height: 60px;
        padding: 0.5rem 1rem;
      }

      /* Safe margins for mobile drawer */
      .admin-sidebar {
        top: 0;
        right: -300px;
        bottom: 0;
        width: 280px;
        z-index: 1050;
        box-shadow: -8px 0 32px rgba(15, 23, 42, 0.2);
      }

      .admin-layout.mobile-sidebar-open .admin-sidebar {
        right: 0;
      }

      /* Compact Hero Banner */
      .hero-banner {
        padding: 1.25rem 1rem !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 1.25rem !important;
      }

      .hero-banner h2 {
        font-size: 1.35rem !important;
      }

      .hero-banner p {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
      }

      /* Responsive Horizontal Scroll containers */

      #specFilterPills {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none;
      }

      #specFilterPills::-webkit-scrollbar {
        display: none;
      }

      /* Sticky Therapist Column in RTL Schedule Matrix */
      /* Non-Sticky Therapist Column in RTL Schedule Matrix on Mobile so it doesn't block schedule data */
      .matrix-therapist-header,
      .matrix-therapist-cell {
        position: sticky !important;
        right: 0 !important;
        z-index: 8 !important;
        background: #ffffff !important;
        box-shadow: -3px 0 8px rgba(15, 23, 42, 0.05) !important;
        position: static !important;
        right: auto !important;
        z-index: auto !important;
        width: 155px !important;
        min-width: 155px !important;
        max-width: 165px !important;
        box-shadow: none !important;
      }

      .matrix-therapist-header {
        background: #f1f5f9 !important;
        padding-right: 0.6rem !important;
      }

      .matrix-therapist-cell {
        background: #f8fafc !important;
        padding: 0.5rem 0.6rem !important;
      }

      /* Touch-friendly table actions */
      .table-responsive {
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        scrollbar-width: thin;
      }

      .table th,
      .table td {
        padding: 0.65rem 0.6rem;
        font-size: 0.86rem;
        white-space: nowrap;
      }

      /* Responsive Horizontal Scroll for Reports & Filter Tabs */
      #reportTabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding: 4px 2px 8px 2px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none;
      }

      #reportTabs::-webkit-scrollbar {
        display: none;
      }

      #reportTabs .nav-item {
        flex-shrink: 0 !important;
      }

      #reportTabs .nav-link {
        white-space: nowrap !important;
        font-size: 0.84rem !important;
      }
    }

    /* --- Smartphones (<576px) --- */
    @media (max-width: 575.98px) {
      body {
        font-size: 0.9rem;
      }

      .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.75rem !important;
        padding-bottom: 1.25rem !important;
      }

      .admin-topbar {
        height: 56px;
        padding: 0.4rem 0.75rem;
      }

      .admin-topbar .topbar-start {
        gap: 0.5rem;
      }

      .admin-topbar .topbar-end {
        gap: 0.4rem;
      }

      /* 2x2 Grid for Dashboard Stats on mobile phones */
      .stat-card {
        padding: 0.75rem 0.65rem !important;
        gap: 0.6rem !important;
        min-height: 72px !important;
        border-radius: 12px !important;
      }

      .stat-icon-wrap {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        font-size: 1.15rem !important;
        border-radius: 10px !important;
      }

      .stat-value {
        font-size: 1.35rem !important;
        font-weight: 800 !important;
        line-height: 1.15 !important;
      }

      .stat-label {
        font-size: 0.72rem !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
      }

      /* Full screen-bounded notification menu */
      #notifMenu,
      #tpNotifMenu {
        position: fixed !important;
        top: 58px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        max-height: 78vh !important;
        border-radius: 18px !important;
        transform: none !important;
        box-shadow: 0 12px 36px rgba(15, 23, 42, 0.22) !important;
        z-index: 1070 !important;
      }

      /* Modals on Phones: comfortable thumb-first sheet style */
      .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: calc(100% - 1rem) !important;
      }

      .modal-content {
        border-radius: 18px !important;
        border: none !important;
      }

      .modal-header {
        padding: 0.9rem 1.15rem !important;
      }

      .modal-body {
        padding: 1.15rem 1rem !important;
      }

      .modal-footer {
        padding: 0.75rem 1rem !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
      }

      .modal-footer .btn {
        flex: 1 !important;
        padding: 8px 12px !important;
        font-size: 0.88rem !important;
      }

      /* Input fields: 16px to prevent iOS Safari auto-zoom */
      input.form-control,
      select.form-select,
      textarea.form-control {
        font-size: 16px !important;
        min-height: 42px !important;
        border-radius: 10px !important;
      }

      /* Form labels */
      .form-label {
        font-size: 0.82rem !important;
        margin-bottom: 0.35rem !important;
      }

      /* Schedule Toolbar Stacking */
      .schedule-toolbar-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
      }

      .schedule-week-nav {
        width: 100% !important;
        justify-content: center !important;
      }

      .schedule-actions-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        padding-bottom: 6px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none;
      }

      .schedule-actions-row::-webkit-scrollbar {
        display: none;
      }

      .schedule-actions-row .btn {
        flex-shrink: 0 !important;
        font-size: 0.78rem !important;
        padding: 6px 12px !important;
      }

      /* Operational Handover cards */
      .live-hub-card {
        padding: 12px !important;
        border-radius: 12px !important;
      }

      .live-hub-card .handover-badge {
        font-size: 0.76rem !important;
        padding: 4px 8px !important;
      }

      /* Quick action buttons & links on dashboard */
      .quick-action-card {
        padding: 1rem 0.75rem !important;
      }

      /* Compact button styling on phones */
      .btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.86rem;
        border-radius: 10px;
      }

      .btn-sm {
        padding: 0.32rem 0.65rem;
        font-size: 0.78rem;
        border-radius: 8px;
      }
    }

    /* ==========================================================================
   Command Palette (Ctrl + K / Quick Action Search Hub)
   ========================================================================== */
    .command-palette-backdrop {
      position: fixed;
      inset: 0;
      z-index: 1060;
      background: rgba(15, 23, 42, 0.65);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: none;
      align-items: flex-start;
      justify-content: center;
      padding: 4rem 1rem 1rem;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
    }

    .command-palette-backdrop.is-open {
      display: flex !important;
      opacity: 1 !important;
      visibility: visible !important;
    }

    .command-palette-modal {
      width: 100%;
      max-width: 640px;
      background: #ffffff;
      border-radius: 18px;
      box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
      overflow: hidden;
      transform: scale(0.96) translateY(-10px);
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      flex-direction: column;
      max-height: 80vh;
    }

    .command-palette-backdrop.is-open .command-palette-modal {
      transform: scale(1) translateY(0);
    }

    .command-search-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-light);
      background: #ffffff;
    }

    .command-search-icon {
      font-size: 1.25rem;
      color: var(--primary);
    }

    .command-search-input {
      flex: 1;
      border: none;
      outline: none;
      font-size: 1.05rem;
      font-family: inherit;
      color: var(--text-main);
      background: transparent;
    }

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

    .command-key-badge {
      font-size: 0.72rem;
      background: var(--bg-subtle);
      color: var(--text-muted);
      border: 1px solid var(--border-light);
      padding: 2px 7px;
      border-radius: 6px;
      font-family: monospace;
      font-weight: 600;
    }

    .command-results-body {
      overflow-y: auto;
      padding: 10px 12px;
      scrollbar-width: thin;
    }

    .command-group-title {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 8px 12px 4px;
    }

    .command-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border-radius: 10px;
      cursor: pointer;
      text-decoration: none;
      color: var(--text-main);
      transition: background 0.12s ease, color 0.12s ease;
    }

    .command-item:hover,
    .command-item.is-active {
      background: var(--primary-soft);
      color: var(--primary-dark);
    }

    .command-item-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #f1f5f9;
      color: var(--text-muted);
      font-size: 0.95rem;
      flex-shrink: 0;
      transition: background 0.12s ease, color 0.12s ease;
    }

    .command-item:hover .command-item-icon,
    .command-item.is-active .command-item-icon {
      background: #ffffff;
      color: var(--primary);
      box-shadow: 0 2px 6px rgba(79, 70, 229, 0.15);
    }

    .command-item-content {
      flex: 1;
      min-width: 0;
    }

    .command-item-title {
      font-weight: 600;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .command-item-desc {
      font-size: 0.75rem;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .command-palette-footer {
      padding: 8px 16px;
      background: #f8fafc;
      border-top: 1px solid var(--border-light);
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    /* ==========================================================================
   Skeleton Shimmer Loaders
   ========================================================================== */
    @keyframes shimmerWave {
      0% {
        background-position: -200% 0;
      }

      100% {
        background-position: 200% 0;
      }
    }

    .skeleton-box {
      display: inline-block;
      height: 1em;
      background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
      background-size: 200% 100%;
      animation: shimmerWave 1.6s infinite ease-in-out;
      border-radius: var(--radius-xs);
    }

    .skeleton-circle {
      border-radius: 50% !important;
    }

    /* ==========================================================================
   Evaluation Stepper UI
   ========================================================================== */
    .eval-stepper-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #ffffff;
      border-radius: 14px;
      padding: 14px 20px;
      border: 1px solid var(--border-light);
      box-shadow: var(--shadow-xs);
      margin-bottom: 20px;
    }

    .stepper-progress-wrap {
      flex: 1;
      max-width: 320px;
    }

    .stepper-progress-bar {
      height: 8px;
      border-radius: 4px;
      background: #e2e8f0;
      overflow: hidden;
    }

    .stepper-progress-fill {
      height: 100%;
      background: var(--primary-gradient);
      transition: width 0.35s ease;
    }

    .eval-big-action-btn {
      min-height: 48px;
      border-radius: 12px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .eval-big-action-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .eval-big-action-btn:active {
      transform: translateY(0);
    }

    /* Sticky Filter Bar on Schedule */
    .sticky-filter-strip {
      position: sticky;
      top: 68px;
      z-index: 100;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid var(--border-light);
      border-radius: 14px;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
      padding: 12px 18px;
      margin-bottom: 20px;
      transition: box-shadow 0.2s ease;
    }

    /* ==========================================================================
   School Schedule & Integration Component Styles
   ========================================================================== */
    .school-day-card {
      transition: all var(--transition-normal);
      background: var(--bg-surface);
      border: 1px solid var(--border-light) !important;
      border-radius: var(--radius-md) !important;
    }

    .school-day-card.school-day-active {
      border-color: #cbd5e1 !important;
      box-shadow: var(--shadow-sm);
      background: #ffffff;
    }

    .school-day-card.school-day-active:hover {
      border-color: var(--border-focus) !important;
      box-shadow: var(--shadow-md);
    }

    .sch-session-box {
      animation: fadeIn 0.25s ease-in-out;
    }

    .sch-fields-panel {
      animation: fadeIn 0.2s ease-in-out;
    }

    .cursor-pointer {
      cursor: pointer;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(-4px);
      }

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