/* =============================================================
   TrainerHub Pro — Corporate Design System
   Poppins (headings) + Inter (body)
   LinkedIn + Zoho CRM + HubSpot + Tabler aesthetic
   ============================================================= */

/* ----------------------------------------------------------
   CSS Custom Properties — Design Tokens
   ---------------------------------------------------------- */
:root {
  /* Brand Colors */
  --primary:        #1E3A5F;  /* Deep Navy — Trust & Authority */
  --primary-light:  #2D5282;  /* Slightly lighter navy */
  --accent:         #2563EB;  /* Royal Blue — CTAs & Links */
  --accent-hover:   #1D4ED8;  /* Darker on hover */
  --accent-light:   #EFF6FF;  /* Light blue tint for backgrounds */

  /* Semantic Colors */
  --success:        #10B981;
  --success-light:  #D1FAE5;
  --warning:        #F59E0B;
  --warning-light:  #FEF3C7;
  --danger:         #EF4444;
  --danger-light:   #FEE2E2;
  --info:           #3B82F6;
  --info-light:     #DBEAFE;

  /* Neutrals */
  --gray-50:   #F8FAFC;
  --gray-100:  #F1F5F9;
  --gray-200:  #E2E8F0;
  --gray-300:  #CBD5E1;
  --gray-400:  #94A3B8;
  --gray-500:  #64748B;
  --gray-600:  #475569;
  --gray-700:  #334155;
  --gray-800:  #1E293B;
  --gray-900:  #0F172A;

  /* Surface */
  --bg:        #F8FAFC;
  --surface:   #FFFFFF;
  --surface-2: #F1F5F9;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #6B7280; /* WCAG AA compliant (4.6:1 on white) */
  --text-inverse:   #FFFFFF;

  /* Borders */
  --border:         #E2E8F0;
  --border-focus:   #2563EB;

  /* Layout */
  --sidebar-w:      240px;
  --topbar-h:       60px;
  --radius-sm:      4px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:     0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.05);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);

  /* Transitions */
  --transition: 0.18s ease;
}

/* ----------------------------------------------------------
   Base Reset & Typography
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden; /* Prevent horizontal scroll at root */
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 70px; /* Mobile bottom nav clearance */
  overflow-x: hidden; /* Belt-and-suspenders: no horiz scroll */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.9rem; }

p { color: var(--text-secondary); line-height: 1.65; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

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

/* ----------------------------------------------------------
   Layout — App Shell
   ---------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  white-space: nowrap;
  min-width: var(--sidebar-w);
  padding-left: 4px;
}

.topbar-brand span { font-size: 1.4rem; }

.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--gray-100);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  transition: all var(--transition);
}

.topbar-search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.topbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.topbar-btn:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.notif-btn:hover { background: var(--gray-100); color: var(--text-primary); }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition);
}
.avatar-btn:hover { opacity: 0.85; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--primary);
  z-index: 150;
  overflow-y: auto;
  display: none; /* hidden on mobile */
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 20px 4px;
}

.sidebar-item {
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border-left-color: rgba(255,255,255,0.4);
}

.sidebar-link.active {
  background: rgba(37,99,235,0.35);
  color: #ffffff;
  border-left-color: #60A5FA;
  font-weight: 600;
}

.sidebar-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition);
  min-width: 0;
}
.sidebar-logout:hover { color: #ffffff; }

.sidebar-logout-link {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all var(--transition);
  display: block;
  text-align: center;
}
.sidebar-logout-link:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

/* Main content area */
.main-wrap {
  padding-top: var(--topbar-h);
  width: 100%;
  min-width: 0;        /* Prevent flex children from overflowing */
  min-height: 100vh;
  overflow-x: hidden;  /* Clip any child that overshoots */
}

.main-content {
  padding: 24px 20px;
  max-width: 1200px;
  width: 100%;         /* Never exceed parent */
  margin: 0 auto;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   Page Header (breadcrumb style title areas)
   ---------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.page-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   Cards
   ---------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ----------------------------------------------------------
   KPI / Stat Cards
   ---------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  align-items: center;
  transition: box-shadow var(--transition);
  min-width: 0;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.stat-icon-blue  { background: var(--info-light);    }
.stat-icon-green { background: var(--success-light); }
.stat-icon-amber { background: var(--warning-light); }
.stat-icon-red   { background: var(--danger-light);  }

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ----------------------------------------------------------
   Trainer Cards (LinkedIn style)
   ---------------------------------------------------------- */
.trainer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.trainer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow: hidden;
}
.trainer-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.trainer-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
  min-width: 0;
  min-height: 0;
}

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

.trainer-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.trainer-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.trainer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.trainer-meta span { display: flex; align-items: center; gap: 3px; }

.trainer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.trainer-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ----------------------------------------------------------
   Badges / Tags
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-primary  { background: var(--accent-light);     color: var(--accent); }
.badge-success  { background: var(--success-light);    color: #065F46; }
.badge-warning  { background: var(--warning-light);    color: #92400E; }
.badge-danger   { background: var(--danger-light);     color: #991B1B; }
.badge-info     { background: var(--info-light);       color: #1E40AF; }
.badge-neutral  { background: var(--gray-100);         color: var(--gray-600); }
.badge-primary-solid { background: var(--accent); color: white; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover {
  background: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
  border-color: var(--gray-300);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover { background: #DC2626; }

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
}
.btn-block { width: 100%; }

.btn-icon-only {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 4px;
}

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

/* ----------------------------------------------------------
   Step Wizard
   ---------------------------------------------------------- */
.wizard-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 32px;
  overflow-x: auto;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.wizard-step::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.wizard-step:last-child::after { display: none; }
.wizard-step.completed::after { background: var(--accent); }

.wizard-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  z-index: 1;
  position: relative;
  transition: all var(--transition);
}
.wizard-step.active .wizard-dot {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}
.wizard-step.completed .wizard-dot {
  background: var(--success);
  color: white;
}

.wizard-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}
.wizard-step.active .wizard-label { color: var(--accent); }
.wizard-step.completed .wizard-label { color: var(--success); }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gray-50); }
.table-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.table td { overflow: hidden; }

/* ----------------------------------------------------------
   Alerts
   ---------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: opacity 0.4s ease;
}
.alert-success {
  background: var(--success-light);
  border-color: #6EE7B7;
  color: #065F46;
}
.alert-danger {
  background: var(--danger-light);
  border-color: #FECACA;
  color: #991B1B;
}
.alert-warning {
  background: var(--warning-light);
  border-color: #FDE68A;
  color: #92400E;
}
.alert-info {
  background: var(--info-light);
  border-color: #BFDBFE;
  color: #1E40AF;
}

/* ----------------------------------------------------------
   Tabs
   ---------------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 24px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-link {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}
.tab-link:hover { color: var(--text-primary); }
.tab-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----------------------------------------------------------
   Hero Section (Public pages)
   ---------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2D5282 50%, #1E3A5F 100%);
  color: white;
  padding: 60px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='28'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 20px;
}

.hero h1 {
  color: white;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 28px;
}

.hero-search {
  background: white;
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  gap: 8px;
  max-width: 540px;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  border-radius: var(--radius);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  margin-top: 8px;
}

.hero-stat-value {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #93C5FD;
}
.hero-stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

/* ----------------------------------------------------------
   Profile Hero
   ---------------------------------------------------------- */
.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2D5282 100%);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  color: white;
  margin-bottom: 24px;
}

.profile-hero-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  object-fit: cover;
  flex-shrink: 0;
}

.profile-hero-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.profile-hero-title { color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-bottom: 10px; }
.profile-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 14px;
}
.profile-hero-meta span { display: flex; align-items: center; gap: 4px; }

/* ----------------------------------------------------------
   Empty State
   ---------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state h4 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.875rem; max-width: 320px; margin: 0 auto 16px; }

/* ----------------------------------------------------------
    Mobile Responsive — Hero Only
    ---------------------------------------------------------- */
@media (max-width: 767px) {
  .hero { padding: 48px 16px !important; }
  .hero h1 { font-size: 1.6rem !important; margin-bottom: 16px !important; }
  .hero p { font-size: 0.95rem !important; max-width: 100% !important; margin: 0 auto 24px !important; }

  .hero-search { max-width: 100% !important; box-shadow: 0 6px 18px rgba(0,0,0,0.12) !important; }
  .hero-search form { flex-direction: column; gap: 10px; }
  .hero-search input { padding: 12px 14px !important; font-size: 1rem; }
  .hero-search .btn { width: 100%; padding: 12px !important; text-align: center; }

  .hero-tags { gap: 10px !important; font-size: 0.8rem !important; margin-bottom: 24px !important; }

  .hero-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; max-width: 100% !important; display: grid !important; }
  .hero-stats > div { padding: 12px 8px !important; }
  .hero-stat-value { font-size: 1.3rem !important; }
  .hero-stat-label { font-size: 0.7rem !important; }
}

/* ----------------------------------------------------------
    Bottom Mobile Navigation
    ---------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 200;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  transition: color var(--transition);
  padding: 6px 0;
}
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:hover { color: var(--text-primary); }
.bottom-nav-icon { font-size: 1.3rem; line-height: 1; }

/* Hamburger Menu Toggle — visible on mobile, hidden on desktop */
.hamburger-btn {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: all var(--transition);
  order: 99;
}
.hamburger-btn:hover { background: var(--gray-100); color: var(--text-primary); }

/* FAB (Floating Action Button) */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px; height: 52px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(37,99,235,0.4);
  z-index: 199;
  text-decoration: none;
  transition: all var(--transition);
}
.fab:hover {
  background: var(--accent-hover);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37,99,235,0.5);
}

/* ----------------------------------------------------------
   Divider
   ---------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ----------------------------------------------------------
   Utility Classes
   ---------------------------------------------------------- */
.text-muted    { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary  { color: var(--text-primary) !important; }
.text-accent   { color: var(--accent) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--warning) !important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-poppins { font-family: 'Poppins', sans-serif; }
.text-sm  { font-size: 0.85rem; }
.text-xs  { font-size: 0.75rem; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.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; }

.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ----------------------------------------------------------
   Responsive — Desktop (Sidebar visible)
   ---------------------------------------------------------- */
@media (min-width: 768px) {
  body { padding-bottom: 0; }

  .sidebar { display: flex; }

  .main-wrap {
    margin-left: var(--sidebar-w);
    /* Recalculate width so sidebar + main-wrap = 100vw, no overflow */
    width: calc(100% - var(--sidebar-w));
    max-width: calc(100vw - var(--sidebar-w));
  }

  .bottom-nav { display: none; }
  .hamburger-btn { display: none; }
  .fab { bottom: 24px; }

  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .trainer-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }

  .hero h1 { font-size: 2.8rem; }

  /* Keep topbar brand compact on desktop */
  .topbar-brand { min-width: auto; }

  .profile-hero { padding: 40px 32px; }
  .profile-hero-avatar { width: 110px; height: 110px; }
  .profile-hero-name { font-size: 1.7rem; }
}

@media (min-width: 1024px) {
  .main-content { padding: 28px 32px; }
  .trainer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Master data grid: 2 cols on tablet+, 1 col on mobile */
@media (max-width: 640px) {
  .master-grid { grid-template-columns: 1fr !important; }
  .form-row    { grid-template-columns: 1fr !important; }
}

/* ----------------------------------------------------------
   Mobile Responsive — Homepage Hero + Content
   ---------------------------------------------------------- */
@media (max-width: 767px) {
  .hero { padding: 48px 16px !important; }
  .hero h1 { font-size: 1.6rem !important; margin-bottom: 16px !important; }
  .hero p { font-size: 0.95rem !important; max-width: 100% !important; margin: 0 auto 24px !important; }

  .hero-search { max-width: 100% !important; box-shadow: 0 6px 18px rgba(0,0,0,0.12) !important; }
  .hero-search form { flex-direction: column; gap: 10px; }
  .hero-search input { padding: 12px 14px !important; font-size: 1rem; }
  .hero-search .btn { width: 100%; padding: 12px !important; text-align: center; }

  .hero-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; max-width: 100% !important; display: grid !important; }
  .hero-stats > div { padding: 12px 8px !important; }
  .hero-stat-value { font-size: 1.3rem !important; }
  .hero-stat-label { font-size: 0.7rem !important; }

  /* Mobile enquiry cards */
  .enq-details-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    font-size: 0.8rem !important;
  }
  .enq-form-grid {
    grid-template-columns: 1fr !important;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  .card-header > div:first-child {
    width: 100%;
  }
  .card-header > div:last-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  
  /* Mobile page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .page-header > div {
    width: 100%;
  }
  .page-title {
    font-size: 1.3rem !important;
  }
  
  /* Mobile form buttons */
  .btn-sm {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
  }
  
  /* Mobile notification and avatar */
  .notif-btn, .avatar-btn {
    width: 32px;
    height: 32px;
  }

  /* Mobile stat cards */
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 14px 12px;
    gap: 10px;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .stat-value {
    font-size: 1.2rem;
  }
  .stat-label {
    font-size: 0.7rem;
  }
}

  /* Org table: hide less-critical columns on mobile */
  #orgTable th:nth-child(1),
  #orgTable td:nth-child(1),
  #orgTable th:nth-child(6),
  #orgTable td:nth-child(6),
  #orgTable th:nth-child(8),
  #orgTable td:nth-child(8) {
    display: none;
  }
  .table { font-size: 0.8rem; }
  .table th { padding: 8px 10px; font-size: 0.7rem; }
  .table td { padding: 10px; }
}

@media (max-width: 480px) {
  .hero { padding: 36px 12px !important; }
  .hero h1 { font-size: 1.35rem !important; }
}

/* Mobile sidebar overlay + hamburger visibility */
@media (max-width: 767px) {
  .logout-btn-desktop { display: none !important; }

  .sidebar {
    display: flex !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 160;
    bottom: 64px;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  .sidebar.sidebar-open + .sidebar-overlay,
  .sidebar-overlay.sidebar-open { display: none; }
  body.sidebar-visible .sidebar-overlay { display: block; }

  /* Mobile topbar fixes */
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .topbar-brand {
    min-width: auto;
    font-size: 0.95rem;
    padding-left: 0;
  }
  .topbar-brand span { font-size: 1.2rem; }
  .topbar-search {
    display: none;
  }
  .topbar-right {
    gap: 4px;
  }
  .notif-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .avatar-btn {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  /* Mobile modal fixes */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .modal-content {
    background: #fff;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-content .card-body {
    padding: 16px;
  }
  .modal-content .form-row {
    grid-template-columns: 1fr !important;
  }
  .modal-content .form-group {
    margin-bottom: 12px;
  }
  .modal-content .form-label {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }
  .modal-content .form-control {
    padding: 10px 12px;
    font-size: 16px;
  }
  .modal-content .btn {
    padding: 10px 16px;
  }
  .modal-header {
    padding: 12px 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
  }

  /* Fix bottom nav overlap */
  body {
    padding-bottom: 70px;
  }
}

/* Modal base styles (all screens) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 550px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-content .card-body { padding: 20px; }
.modal-content .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-content .form-group { margin-bottom: 14px; }
.modal-content .form-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.modal-content .form-control { padding: 10px 12px; }
.modal-header { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

@media (min-width: 768px) {
  #forWhom { grid-template-columns: 1fr 1fr !important; }
}

/* ----------------------------------------------------------
   View Toggle (List / Card)
   ---------------------------------------------------------- */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}
.view-toggle-btn {
  padding: 5px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--border);
}
.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}
.view-toggle-btn:hover:not(.active) {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* ----------------------------------------------------------
   List View (compact rows for card-first pages)
   ---------------------------------------------------------- */
.list-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow var(--transition);
  font-size: 0.875rem;
}
.list-row:hover {
  box-shadow: var(--shadow-sm);
}
.list-row + .list-row {
  margin-top: 6px;
}
.list-row-primary {
  font-weight: 600;
  color: var(--text-primary);
}
.list-row-secondary {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.list-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ----------------------------------------------------------
   Card Grid View (for table-first pages)
   ---------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card-grid .card {
  transition: box-shadow var(--transition);
}
.card-grid .card:hover {
  box-shadow: var(--shadow-md);
}
@media (max-width: 767px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .list-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 12px;
  }
  .list-row-actions {
    justify-content: flex-start;
  }
  .trainer-grid {
    grid-template-columns: 1fr !important;
  }
  .trainer-table { display: none !important; }
  .mobile-trainer-list { display: block !important; }
}

/* ----------------------------------------------------------
   Mobile Trainer List (hidden on desktop)
   ---------------------------------------------------------- */
.mobile-trainer-list { display: none; }

.mobile-trainer-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
}
.mobile-trainer-row-top { margin-bottom: 8px; }

.mobile-trainer-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-trainer-row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.mobile-trainer-row-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

.mobile-trainer-row-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-trainer-row-name:hover { color: var(--accent); }

.mobile-trainer-row-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.mobile-trainer-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 50px;
}

.mobile-trainer-row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  padding-left: 50px;
}
.mobile-trainer-row-actions .btn-sm {
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
}
.mobile-trainer-row-badge {
  margin-left: auto;
}

/* ----------------------------------------------------------
   Organization Modal (Sectioned Design)
   ---------------------------------------------------------- */
.org-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.org-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 660px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.org-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.org-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.org-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.org-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.org-modal-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}
.org-modal-body {
  padding: 0 24px 24px;
}
.org-modal-section {
  padding: 16px 0 0;
}
.org-modal-section + .org-modal-section {
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
  padding-top: 16px;
}
.org-modal-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.org-modal-row {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
}
.org-modal-field {
  flex: 1;
  min-width: 0;
  margin-bottom: 12px;
}
.org-modal-field:last-child {
  margin-bottom: 0;
}
.org-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.org-view-value {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-50);
  font-size: 0.875rem;
  color: var(--text-primary);
  min-height: 20px;
  word-break: break-word;
}
@media (max-width: 640px) {
  .org-modal-overlay { padding: 20px 8px; }
  .org-modal-header { padding: 16px 16px 12px; }
  .org-modal-body { padding: 0 16px 16px; }
  .org-modal-row { flex-direction: column; gap: 0; }
}
