/* ============================================================
   SaaS Blog Platform - Modern Custom Styles
   Built on Bootstrap 5.3 with custom design tokens
   Brand palette aligned with the marketing front page (sky blue + amber)
   ============================================================ */

/* ----- Design Tokens / Theme Colors ----- */
:root {
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;
  --brand-200: #bae6fd;
  --brand-300: #7dd3fc;
  --brand-400: #38bdf8;
  --brand-500: #0ea5e9;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
  --brand-800: #075985;
  --brand-900: #0c4a6e;

  --brand-gradient: linear-gradient(135deg, #0ea5e9, #0284c7);
  --brand-gradient-hover: linear-gradient(135deg, #0284c7, #0369a1);

  /* Single accent color for "premium / highlight" moments — used sparingly */
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fef3c7;

  /* Single success green used everywhere "active / money / good" is communicated */
  --success: #16a34a;
  --success-dark: #15803d;
  --success-light: #dcfce7;

  --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;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 10px 40px rgba(0,0,0,0.08);
  --shadow-dropdown: 0 10px 40px rgba(0,0,0,0.12);
  --transition-base: all 0.2s ease;
}

/* ----- Base / Typography ----- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Auth Pages (login.php, register.php) ----- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(14,165,233,0.12) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(2,132,199,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.auth-card .card {
  border: none;
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.3);
  overflow: hidden;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
}
.auth-card .card-body {
  padding: 2.5rem;
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo i {
  font-size: 2.5rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo h4 {
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--gray-900);
}
.auth-title {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-title h2 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.auth-title p {
  color: var(--gray-500);
  font-size: 0.9rem;
}
.auth-card .form-control {
  border-radius: var(--border-radius-sm);
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--gray-200);
  font-size: 0.95rem;
  transition: var(--transition-base);
}
.auth-card .form-control:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.auth-card .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}
.auth-card .btn-auth {
  background: var(--brand-gradient);
  border: none;
  border-radius: 50px;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  width: 100%;
  transition: var(--transition-base);
}
.auth-card .btn-auth:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(14,165,233,0.35);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--gray-400);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--gray-200);
}
.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--gray-500);
}
.auth-footer-link a {
  color: var(--brand-600);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

/* ----- Top Navbar ----- */
.saas-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  z-index: 1030;
  display: flex;
  align-items: center;
}
.saas-topbar .brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gray-900);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.saas-topbar .brand-text i {
  font-size: 1.4rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Campaign Selector Dropdown ───────────────────────────────── */
.campaign-selector {
  vertical-align: middle;
}
.campaign-selector .dropdown-toggle {
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}
.campaign-selector .dropdown-item small {
  font-size: 0.7rem;
  opacity: 0.7;
}
.campaign-selector .dropdown-item.active,
.campaign-selector .dropdown-item:active {
  background-color: var(--brand-50);
  color: var(--brand-700);
}
.campaign-selector .dropdown-item.active i,
.campaign-selector .dropdown-item:active i {
  color: var(--brand-600);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.avatar-xs {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.bg-brand {
  background: var(--brand-500);
}
.bg-brand-gradient {
  background: var(--brand-gradient);
}
.bg-purple {
  background: var(--accent) !important;
  color: #1e293b;
}

/* ----- Sidebar ----- */
.saas-sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--gray-900);
  border-right: 1px solid rgba(255,255,255,0.05);
  z-index: 1020;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
}

/* Scrollbar — wide, bright, and always visible on the dark sidebar */
.saas-sidebar {
  scrollbar-width: auto;
  scrollbar-color: var(--brand-400) rgba(255, 255, 255, 0.08);
}
.saas-sidebar::-webkit-scrollbar {
  width: 12px;
}
.saas-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}
.saas-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--brand-400); /* bright against dark sidebar */
  border-radius: 6px;
  border: 3px solid var(--gray-900); /* insets the thumb so it doesn't touch the edges */
}
.saas-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--brand-300); /* brighter on hover */
}

.saas-sidebar-inner {
  padding: 1rem 0;
}
.saas-sidebar .nav-section-title {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8; /* improved contrast for dark sidebar */
}
.saas-sidebar .nav-item {
  margin: 2px 0;
}
.saas-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: #cbd5e1; /* was var(--gray-400) — improved contrast */
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: var(--transition-base);
  text-decoration: none;
}
.saas-sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.saas-sidebar .nav-link.active {
  color: #fff;
  background: rgba(14,165,233,0.18);
  border-left-color: var(--brand-500);
}
.saas-sidebar .nav-link i {
  font-size: 1.15rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.saas-sidebar .nav-link .badge {
  margin-left: auto;
  font-size: 0.7rem;
}

/* Nav-tip help icon — visible white on dark sidebar */
.saas-sidebar .nav-tip-icon {
  color: rgba(255,255,255,0.5);
  opacity: 1 !important;
  margin-left: 2px;
}
.saas-sidebar .nav-link:hover .nav-tip-icon,
.saas-sidebar .nav-link.active .nav-tip-icon {
  color: rgba(255,255,255,0.75);
}

/* Hire a Pro — standout link. Uses the amber accent (premium upsell),
   not red (which reads as urgent/error) and no pulsing glow animation,
   so it stands out as "special" rather than "something's wrong". */
.saas-sidebar .nav-link.hire-pro {
  color: #1e293b !important;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  margin: 0.25rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--accent-dark);
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
}
.saas-sidebar .nav-link.hire-pro:hover {
  background: linear-gradient(135deg, #fbbf24, var(--accent));
  box-shadow: 0 0 16px rgba(245,158,11,0.4);
  color: #1e293b !important;
}
.saas-sidebar .nav-link.hire-pro.active {
  background: linear-gradient(135deg, var(--accent-dark), #b45309);
  border-left-color: #fde68a;
}
.saas-sidebar .nav-link.hire-pro i {
  color: #7c2d12;
}

/* Offcanvas sidebar on mobile */
@media (max-width: 991.98px) {
  .saas-sidebar {
    transform: translateX(-100%);
  }
  .saas-sidebar.show {
    transform: translateX(0);
  }
}

/* ----- Main Content Area ----- */
.saas-layout {
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}
.saas-main {
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--topbar-height));
  padding: 0;
  transition: margin-left 0.3s ease;
}
@media (max-width: 991.98px) {
  .saas-main {
    margin-left: 0;
  }
}

/* Page header area */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--gray-900);
}
.page-header .breadcrumb {
  margin: 0;
  font-size: 0.85rem;
}
.page-header .breadcrumb-item a {
  color: var(--gray-500);
  text-decoration: none;
}
.page-header .breadcrumb-item a:hover {
  color: var(--brand-600);
}
.page-header .breadcrumb-item.active {
  color: var(--gray-800);
}

/* ----- Modern Cards ----- */
.card-modern {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  transition: var(--transition-base);
}
.card-modern:hover {
  box-shadow: var(--shadow-card-hover);
}
.card-modern .card-header {
  background: transparent;
  border-bottom: 1px solid var(--gray-100);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}
.card-modern .card-body {
  padding: 1.5rem;
}
.card-modern .card-footer {
  background: transparent;
  border-top: 1px solid var(--gray-100);
  padding: 1rem 1.5rem;
}

/* ----- Dashboard Stats Cards -----
   Color assignment now follows a consistent rule:
   blue/indigo  = counts / volume
   green        = money, completion, success
   amber        = attention / premium
   teal/cyan    = engagement / secondary metrics
   rose         = needs-attention / tickets
   ----------------------------------------------------------- */
.stat-card {
  border: none;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-base);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}
.stat-card .stat-change {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.stat-card .stat-decoration {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.08;
}

/* Stat card color variants — remapped onto the sky-blue/amber palette */
.stat-card.stat-blue { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); color: #075985; }
.stat-card.stat-green { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #16a34a; }
.stat-card.stat-teal { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); color: #0d9488; }
.stat-card.stat-purple { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #b45309; }
.stat-card.stat-indigo { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); color: #0284c7; }
.stat-card.stat-amber { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #d97706; }
.stat-card.stat-rose { background: linear-gradient(135deg, #fff1f2, #ffe4e6); color: #e11d48; }
.stat-card.stat-cyan { background: linear-gradient(135deg, #ecfeff, #cffafe); color: #0891b2; }
.stat-card.stat-info { background: linear-gradient(135deg, #f0f9ff, #e0f2fe); color: #0369a1; }

/* Stat card colored badges/icons */
.stat-card.stat-blue .stat-icon { background: rgba(14,165,233,0.15); color: #0ea5e9; }
.stat-card.stat-green .stat-icon { background: rgba(22,163,74,0.15); color: #16a34a; }
.stat-card.stat-teal .stat-icon { background: rgba(13,148,136,0.15); color: #0d9488; }
.stat-card.stat-purple .stat-icon { background: rgba(217,119,6,0.15); color: #d97706; }
.stat-card.stat-indigo .stat-icon { background: rgba(2,132,199,0.15); color: #0284c7; }
.stat-card.stat-amber .stat-icon { background: rgba(217,119,6,0.15); color: #d97706; }
.stat-card.stat-rose .stat-icon { background: rgba(225,29,72,0.15); color: #e11d48; }
.stat-card.stat-cyan .stat-icon { background: rgba(8,145,178,0.15); color: #0891b2; }
.stat-card.stat-info .stat-icon { background: rgba(3,105,161,0.15); color: #0369a1; }

/* ----- Modern Tables ----- */
.table-modern {
  margin-bottom: 0;
}
.table-modern thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--gray-200);
}
.table-modern tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  color: var(--gray-700);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
}
.table-modern tbody tr:hover {
  background: var(--gray-50);
}
.table-modern tbody tr:last-child td {
  border-bottom: none;
}

/* ----- Modern Buttons ----- */
.btn-brand {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-base);
}
.btn-brand:hover {
  background: var(--brand-gradient-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(14,165,233,0.3);
}
.btn-brand-sm {
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
}
.btn-outline-impersonate { border: 2px solid #ea580c; color: #ea580c; }
.btn-outline-impersonate:hover { background: #ea580c; color: #fff; }

.btn-outline-brand {
  border: 2px solid var(--brand-500);
  color: var(--brand-600);
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  background: transparent;
  transition: var(--transition-base);
}
.btn-outline-brand:hover {
  background: var(--brand-500);
  color: #fff;
}

/* ----- Dashboard & Buy Button Variants ----- */
.btn-dashboard {
  background: var(--gray-900);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-base);
}
.btn-dashboard:hover {
  background: #1e293b;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(15,23,42,0.3);
}

.btn-buy {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-base);
}
.btn-buy:hover {
  background: var(--success-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(22,163,74,0.3);
}
.btn-buy-sm {
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
}

/* ----- Bold checkboxes for marketplace ----- */
.addon-checkbox {
  width: 1.3em !important;
  height: 1.3em !important;
  border: 2.5px solid #6b7280 !important;
  cursor: pointer;
}
.addon-checkbox:checked {
  background-color: var(--success) !important;
  border-color: var(--success) !important;
}
.addon-checkbox:focus {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 0.2rem rgba(22,163,74,0.25) !important;
}

/* ----- Modern Form Controls ----- */
.form-control-modern {
  border-radius: var(--border-radius-sm);
  border: 1.5px solid var(--gray-200);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: var(--transition-base);
}
.form-control-modern:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.form-select-modern {
  border-radius: var(--border-radius-sm);
  border: 1.5px solid var(--gray-200);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  font-size: 0.9rem;
  background-position: right 0.75rem center;
}

/* ----- Modern Input Groups ----- */
.input-group-modern .input-group-text {
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.9rem;
}
.input-group-modern .form-control,
.input-group-modern .form-select {
  border: 1.5px solid var(--gray-200);
  font-size: 0.9rem;
}
.input-group-modern .form-control:focus,
.input-group-modern .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

/* ----- Modern Alerts ----- */
.alert-modern {
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
}
.alert-modern.alert-success { background: #f0fdf4; color: #16a34a; border-left: 4px solid #22c55e; }
.alert-modern.alert-danger { background: #fef2f2; color: #dc2626; border-left: 4px solid #ef4444; }
.alert-modern.alert-warning { background: #fffbeb; color: #d97706; border-left: 4px solid #f59e0b; }
.alert-modern.alert-info { background: #f0f9ff; color: #0284c7; border-left: 4px solid #0ea5e9; }

/* ----- Quick Action Links ----- */
.quick-action-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-base);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  margin-bottom: 0.5rem;
}
.quick-action-link:hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
  transform: translateX(4px);
}
.quick-action-link .qal-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
}

/* ----- Page Loading Skeleton ----- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----- Badge / Pill Variants ----- */
.badge-brand {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}
.badge-success-pill {
  background: var(--success-light);
  color: var(--success);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}
.badge-danger-pill {
  background: #fee2e2;
  color: #dc2626;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}
.badge-warning-pill {
  background: #fef3c7;
  color: #d97706;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}
.badge-info-pill {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

/* ----- Empty State ----- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--gray-300);
}
.empty-state h5 {
  font-weight: 600;
  color: var(--gray-600);
}
.empty-state p {
  color: var(--gray-400);
  max-width: 400px;
  margin: 0.5rem auto;
}

/* ----- Tabs Modern ----- */
.tabs-modern,
.nav-tabs-modern {
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.tabs-modern .nav-link,
.nav-tabs-modern .nav-link {
  border: none;
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  position: relative;
  transition: var(--transition-base);
}
.tabs-modern .nav-link::after,
.nav-tabs-modern .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--brand-500);
  transition: var(--transition-base);
  border-radius: 2px;
}
.tabs-modern .nav-link:hover,
.nav-tabs-modern .nav-link:hover {
  color: var(--gray-800);
}
.tabs-modern .nav-link.active,
.nav-tabs-modern .nav-link.active {
  color: var(--brand-600);
  background: transparent;
}
.tabs-modern .nav-link.active::after,
.nav-tabs-modern .nav-link.active::after {
  width: 60%;
}

/* ----- Chat Bubbles ----- */
.chat-bubble {
  max-width: 80%;
  border-radius: 16px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.chat-bubble-mine {
  background: var(--brand-500);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-other {
  background: var(--gray-100);
  color: var(--gray-800);
  border-bottom-left-radius: 4px;
}

/* ----- Progress / Steps ----- */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--gray-200);
  color: var(--gray-500);
  transition: var(--transition-base);
}
.step-circle.active {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(14,165,233,0.2);
}
.step-circle.completed {
  background: var(--success);
  color: #fff;
}
.step-line {
  width: 40px;
  height: 2px;
  background: var(--gray-200);
  margin: 0 0.5rem;
}
.step-line.completed {
  background: var(--success);
}

/* ----- Dropdown Enhancements ----- */
.dropdown-menu-modern {
  border: none;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-dropdown);
  padding: 0.5rem;
}
.dropdown-menu-modern .dropdown-item {
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  transition: var(--transition-base);
}
.dropdown-menu-modern .dropdown-item:hover {
  background: var(--gray-50);
  color: var(--brand-600);
}
.dropdown-menu-modern .dropdown-item i {
  width: 18px;
  margin-right: 0.5rem;
}

/* ----- Responsive helpers ----- */
@media (max-width: 767.98px) {
  .auth-page {
    padding: 1rem;
  }
  .auth-card .card-body {
    padding: 1.5rem;
  }
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE OVERRIDES
   Targets < 768px (sm), < 576px (xs) and offcanvas sidebar
   ============================================================ */

/* --- Main content padding for all mobile sizes --- */
@media (max-width: 991.98px) {
  .saas-main .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

@media (max-width: 575.98px) {
  .saas-main .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* --- Topbar adjustments on mobile --- */
@media (max-width: 767.98px) {
  .saas-topbar .px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Ensure the hamburger button is large enough to tap */
  .saas-topbar button[data-bs-toggle="offcanvas"] {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Brand text: always visible on mobile (override d-none d-sm-inline) */
  .saas-topbar .brand-text span {
    display: inline !important;
  }
}

/* --- Stat cards: stack 2 per row on small screens --- */
@media (max-width: 575.98px) {
  .row > [class*="col-"] .stat-card {
    margin-bottom: 0.25rem;
  }
}

/* --- Table responsiveness improvements --- */
@media (max-width: 767.98px) {
  .table-modern thead th,
  .table-modern tbody td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Force horizontal scroll if table is too wide */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
}

/* --- Card improvements on mobile --- */
@media (max-width: 575.98px) {
  .card-modern .card-header {
    padding: 1rem 1rem;
  }
  .card-modern .card-body {
    padding: 1rem;
  }
  .card-modern .card-footer {
    padding: 0.75rem 1rem;
  }
}

/* --- Form controls on mobile --- */
@media (max-width: 575.98px) {
  .form-control-modern,
  .form-select-modern {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 0.5rem 0.75rem;
  }

  /* Ensure input groups don't overflow */
  .input-group {
    flex-wrap: wrap;
  }

  .input-group > .form-control,
  .input-group > .form-select {
    min-width: 0;
  }
}

/* --- Button groups on mobile --- */
@media (max-width: 575.98px) {
  .btn-group {
    flex-wrap: wrap;
  }
  .btn-group .btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }
}

/* --- Offcanvas sidebar refinements --- */
@media (max-width: 991.98px) {
  #sidebarOffcanvas {
    width: 280px !important;
  }

  #sidebarOffcanvas .offcanvas-body {
    padding: 0;
    overflow-y: auto;
  }

  /* Match the widened/brightened desktop sidebar scrollbar on mobile offcanvas */
  #sidebarOffcanvas .offcanvas-body {
    scrollbar-width: auto;
    scrollbar-color: var(--brand-400) rgba(255, 255, 255, 0.08);
  }
  #sidebarOffcanvas .offcanvas-body::-webkit-scrollbar {
    width: 12px;
  }
  #sidebarOffcanvas .offcanvas-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
  }
  #sidebarOffcanvas .offcanvas-body::-webkit-scrollbar-thumb {
    background-color: var(--brand-400);
    border-radius: 6px;
    border: 3px solid var(--gray-900);
  }
  #sidebarOffcanvas .offcanvas-body::-webkit-scrollbar-thumb:hover {
    background-color: var(--brand-300);
  }

  #sidebarOffcanvas .saas-sidebar-inner {
    padding: 1rem 0;
  }

  #sidebarOffcanvas .nav-tip-icon {
    color: rgba(255,255,255,0.5);
    opacity: 1 !important;
  }

  #sidebarOffcanvas .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    border-radius: 0;
    text-decoration: none;
  }
  #sidebarOffcanvas .nav-link i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
  }
  #sidebarOffcanvas .nav-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
  }
  #sidebarOffcanvas .nav-link:hover,
  #sidebarOffcanvas .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.06);
  }
  #sidebarOffcanvas .nav-link.active {
    background: rgba(14,165,233,0.18);
    border-left-color: var(--brand-500);
  }

  #sidebarOffcanvas .nav-section-title { color: #94a3b8; }
  #sidebarOffcanvas .nav-section-title {
    padding: 0.75rem 1.25rem 0.25rem;
  }

  #sidebarOffcanvas .nav-link.hire-pro {
    margin: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--accent-dark);
    padding: 0.55rem 1rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e293b !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  }
}

/* --- Modal dialogs on small screens --- */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.5rem;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-header {
    padding: 0.75rem 1rem;
  }
  .modal-footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
}

/* --- Alerts on mobile --- */
@media (max-width: 575.98px) {
  .alert-modern {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

/* --- Tabs on mobile --- */
@media (max-width: 575.98px) {
  .nav-tabs-modern .nav-link,
  .tabs-modern .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* --- Page header on very small screens --- */
@media (max-width: 575.98px) {
  .page-header h1 {
    font-size: 1.25rem;
  }
  .page-header .breadcrumb {
    font-size: 0.75rem;
  }
  .page-header {
    margin-bottom: 1rem;
  }
}

/* --- Dropdown menus on mobile: full width when small --- */
@media (max-width: 575.98px) {
  .dropdown-menu-modern {
    min-width: 180px !important;
  }
}

/* --- Nav pills on mobile (filter bars etc.) --- */
@media (max-width: 575.98px) {
  .nav-pills .nav-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }
}

/* --- Quick action links on mobile --- */
@media (max-width: 575.98px) {
  .quick-action-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
  .quick-action-link .qal-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}


/* ============================================================
   ACCESSIBILITY & COMPREHENSIVE MOBILE OVERHAUL
   WCAG 2.1 AA compliance + touch-friendly + semantic ARIA
   ============================================================ */

/* ----- A. Skip Navigation Link ----- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  background: var(--brand-600);
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0 0 var(--border-radius-sm) 0;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-nav:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: -6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ----- B. Focus Indicators (WCAG 2.4.7) ----- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.saas-sidebar .nav-link:focus-visible {
  outline: 2px solid var(--brand-500) !important;
  outline-offset: 2px !important;
}

/* Bootstrap btn-close override */
.btn-close:focus-visible {
  outline: 2px solid var(--brand-500) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* Nav links in offcanvas sidebar — white focus ring */
#sidebarOffcanvas .nav-link:focus-visible,
#sidebarOffcanvas a:focus-visible {
  outline: 2px solid var(--brand-400) !important;
  outline-offset: 1px !important;
}

/* ----- C. Touch Target Sizes (WCAG 2.5.5) — 44×44px min ----- */
@media (max-width: 767.98px) {
  .saas-sidebar .nav-link,
  #sidebarOffcanvas .nav-link,
  .btn,
  .nav-pills .nav-link,
  .nav-tabs-modern .nav-link,
  .tabs-modern .nav-link,
  .dropdown-item,
  .quick-action-link,
  .page-link,
  .form-check-label,
  a.btn,
  button[type="submit"],
  button[type="button"] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }

  .table-modern tbody td a.btn,
  .table-modern tbody td button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }

  .form-control,
  .form-select,
  .form-control-modern,
  .form-select-modern {
    min-height: 44px;
  }

  .modal-header .btn-close,
  .offcanvas-header .btn-close {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .btn-group {
    flex-direction: column;
  }
  .btn-group .btn {
    border-radius: var(--border-radius-sm) !important;
    margin-bottom: 0.25rem;
    min-height: 44px;
  }
  .btn-group .btn:last-child {
    margin-bottom: 0;
  }
}

/* ----- D. Form Accessibility — 16px font to prevent iOS zoom ----- */
@media (max-width: 767.98px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  textarea,
  select,
  .form-control,
  .form-control-modern,
  .form-select,
  .form-select-modern {
    font-size: 16px !important;
  }

  .form-label,
  label {
    display: block;
    margin-bottom: 0.35rem;
  }
}

/* ----- E. Responsive Table Improvements ----- */
.table-responsive {
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* Right shadow */
.table-responsive::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.06));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.table-responsive.scrollable-end::after {
  opacity: 1;
}

/* Left shadow */
.table-responsive::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to left, transparent, rgba(0,0,0,0.06));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.table-responsive.scrollable-start::before {
  opacity: 1;
}

/* Card-like stacked table on very small screens */
@media (max-width: 480px) {
  .table-modern.table-stack-sm thead {
    display: none;
  }

  .table-modern.table-stack-sm,
  .table-modern.table-stack-sm tbody,
  .table-modern.table-stack-sm tr,
  .table-modern.table-stack-sm td {
    display: block;
    width: 100%;
  }

  .table-modern.table-stack-sm tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: #fff;
    box-shadow: var(--shadow-card);
  }

  .table-modern.table-stack-sm td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .table-modern.table-stack-sm td:last-child {
    border-bottom: none;
  }

  .table-modern.table-stack-sm td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.03em;
    margin-right: 0.5rem;
    flex-shrink: 0;
  }
}

/* ----- F. Touch-Friendly Modals ----- */
@media (max-width: 767.98px) {
  .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }

  .modal-content {
    max-height: calc(100vh - 1rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    overflow-y: auto;
    flex: 1;
  }

  .modal-header .btn-close {
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
  }

  .modal {
    --bs-modal-margin: 0.5rem;
  }
}

/* ----- G. General Mobile UX ----- */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Ensure no content cut off at 320px */
@media (max-width: 359px) {
  .saas-main .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .page-header h1 {
    font-size: 1.1rem;
  }

  .table-modern td,
  .table-modern th,
  .card-modern .card-body {
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

/* Images and iframes never overflow */
img,
iframe,
video {
  max-width: 100%;
  height: auto;
}

/* ----- H. ARIA & Semantic Styles ----- */
.saas-sidebar .nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(14,165,233,0.18);
  border-left-color: var(--brand-500);
}

[aria-expanded="true"] > i.bi-chevron-down,
[aria-expanded="true"] > .bi-chevron-down {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}


/* --- Two-column form layouts on mobile: stack --- */
@media (max-width: 575.98px) {
  .row.form-row > [class*="col-"] {
    margin-bottom: 0.5rem;
  }
}

/* --- Badges on mobile --- */
@media (max-width: 575.98px) {
  .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  .badge-pill,
  .badge-success-pill,
  .badge-danger-pill,
  .badge-warning-pill,
  .badge-info-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

/* --- Pre/code blocks on mobile --- */
@media (max-width: 575.98px) {
  pre {
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
  }
}

/* Horizontal scroll prevention */
.saas-layout {
  overflow-x: hidden;
}

/* ----- Print ----- */
@media print {
  .saas-sidebar,
  .saas-topbar {
    display: none !important;
  }
  .saas-main {
    margin-left: 0 !important;
  }
}

/* ----- Utility Classes ----- */
.text-brand {
  color: var(--brand-600) !important;
}
.bg-brand-subtle {
  background: var(--brand-50) !important;
}
.border-brand {
  border-color: var(--brand-200) !important;
}
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

/* ----- Dashed Border Card Variant ----- */
.border-dashed {
  border-style: dashed !important;
  border-color: var(--gray-300) !important;
}

/* Badge glow for popular plan */
.badge-glow {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(14,165,233,0.35);
}

/* ============================================================
   VIDEO MODAL — Responsive embed + play icon animation
   ============================================================ */
.video-embed-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Video play link on addon cards */
.addon-video-link {
  transition: color 0.2s ease;
}
.addon-video-link:hover {
  color: var(--brand-700) !important;
}

.video-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}
.addon-video-link:hover .video-play-icon {
  transform: scale(1.15);
}

/* Modal tweaks for mobile */
@media (max-width: 575.98px) {
  #videoModal .modal-dialog {
    margin: 0.5rem;
    max-width: 100%;
  }
  #videoModal .modal-header {
    padding: 0.5rem 0.75rem;
  }
  #videoModal .modal-header h6 {
    font-size: 0.9rem;
  }
}

/* ============================================================
   MOBILE MODE ARCHITECTURE — Card System, Action Bar, FAB,
   Bottom Tab Bar, Accordion Help, Dashboard Overhaul
   ============================================================ */

/* ----- 1. MOBILE CARD SYSTEM — Convert Tables to Cards ----- */
@media (max-width: 767.98px) {
  .table-cards-mobile thead {
    display: none;
  }
  .table-cards-mobile .table-responsive {
    overflow-x: visible;
  }
  .table-cards-mobile table,
  .table-cards-mobile tbody {
    display: block;
  }
  .table-cards-mobile tr {
    display: block;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  .table-cards-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    font-size: 0.85rem;
  }
  .table-cards-mobile td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--gray-500);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 12px;
    flex-shrink: 0;
  }
  /* Action buttons in a row */
  .table-cards-mobile .card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
  }
  .table-cards-mobile .card-actions a,
  .table-cards-mobile .card-actions button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.75rem;
    gap: 4px;
  }
  /* Ensure forms inside card-actions don't break layout */
  .table-cards-mobile .card-actions form {
    display: inline-flex;
  }
}

/* ----- 2. STICKY BOTTOM ACTION BAR ----- */
.mobile-action-bar {
  display: none;
}
@media (max-width: 767.98px) {
  .mobile-action-bar {
    display: flex;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--gray-200);
    padding: 12px 16px;
    gap: 10px;
    z-index: 1025;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    margin-top: 16px;
  }
  .mobile-action-bar .btn {
    flex: 1;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
  }
  .mobile-action-bar .btn-icon-only {
    flex: 0 0 48px;
    min-width: 48px;
    font-size: 1.2rem;
  }
}

/* ----- 3A. FLOATING QUICK ADD BUTTON (FAB) ----- */
.mobile-fab {
  display: none;
}
@media (max-width: 767.98px) {
  .mobile-fab {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    box-shadow: 0 4px 20px rgba(14,165,233,0.4);
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
  }
  .mobile-fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 10px rgba(14,165,233,0.3);
  }
}

/* ----- 3B. RECENT ACTIVITY FEED (Mobile Dashboard) ----- */
.mobile-activity-feed {
  display: none;
}
@media (max-width: 767.98px) {
  .mobile-activity-feed {
    display: block;
  }
  .activity-feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
  }
  .activity-feed-item:last-child {
    border-bottom: none;
  }
  .activity-feed-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
  }
  .activity-feed-icon.payment { background: #ecfdf5; color: #059669; }
  .activity-feed-icon.cron { background: #f0f9ff; color: #0284c7; }
  .activity-feed-icon.ticket { background: #fef2f2; color: #dc2626; }
  .activity-feed-icon.fulfillment { background: #fffbeb; color: #d97706; }
  .activity-feed-text {
    flex: 1;
    min-width: 0;
  }
  .activity-feed-text .label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .activity-feed-text .time {
    font-size: 0.7rem;
    color: var(--gray-400);
  }
}

/* ----- 6B. BOTTOM TAB BAR (Mobile Client Navigation) ----- */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 767.98px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--gray-200);
    z-index: 1030;
    padding: 4px 0 env(safe-area-inset-bottom, 8px);
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    font-size: 0.65rem;
    color: var(--gray-400);
    text-decoration: none;
    gap: 2px;
  }
  .mobile-nav-item i { font-size: 1.3rem; }
  .mobile-nav-item.active { color: var(--brand-500); }
  .mobile-nav-item.active i { color: var(--brand-500); }
  /* Add bottom padding to main content so it doesn't get hidden behind nav */
  .saas-main { padding-bottom: 80px !important; }
  /* Offset FAB when bottom nav is visible */
  .mobile-fab { bottom: 90px; }
}

/* ----- 4. ACCORDION HELP SYSTEM ----- */
.help-search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}
.help-search-bar .form-control {
  padding-left: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  min-height: 48px;
}
.help-search-bar .bi-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1.1rem;
}
.help-category-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.help-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  user-select: none;
  min-height: 48px;
}
.help-category-header:hover {
  background: var(--gray-50);
}
.help-category-header .bi-chevron-down {
  margin-left: auto;
  transition: transform 0.2s ease;
  color: var(--gray-400);
}
.help-category-header[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}
.help-category-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--gray-100);
}
.help-category-body.show {
  display: block;
}
.help-faq-item {
  border-bottom: 1px solid var(--gray-100);
}
.help-faq-item:last-child {
  border-bottom: none;
}
.help-faq-question {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--gray-700);
  min-height: 44px;
  user-select: none;
}
.help-faq-question:hover { color: var(--brand-600); }
.help-faq-answer {
  display: none;
  padding: 0 0 12px 24px;
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.6;
}
.help-faq-answer.show {
  display: block;
}

/* ----- MOBILE NAVIGATION IMPROVEMENTS ----- */
@media (max-width: 767.98px) {
  /* Make hamburger more prominent */
  .saas-topbar button[data-bs-toggle="offcanvas"] {
    min-width: 44px;
    min-height: 44px;
  }
  /* Compact page header */
  .page-header h1 {
    font-size: 1.15rem;
  }
  .page-header {
    margin-bottom: 0.75rem;
  }
}

/* ----- DASHBOARD MOBILE OVERHAUL ----- */
@media (max-width: 767.98px) {
  /* Stat cards stay 2 per row (col-md-6 on mobile) */
  .stat-card {
    padding: 1rem;
  }
  .stat-card .stat-value {
    font-size: 1.3rem;
  }
  .stat-card .stat-label {
    font-size: 0.7rem;
  }
  /* Quick actions become icon grid */
  .quick-action-link {
    min-height: 44px;
    padding: 8px 12px;
    gap: 8px;
  }
  .quick-action-link .qal-icon {
    font-size: 1.2rem;
  }
  /* At a Glance panel compact */
  .card-modern .card-body .py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
}

/* ----- ICON-ONLY ACTION BUTTONS (Compact) ----- */
.btn-icon-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
@media (max-width: 767.98px) {
  .btn-icon-action {
    font-size: 0.75rem;
    padding: 6px 10px;
    min-height: 40px;
  }
}

/* ----- SWIPE HINT FOR TABLE CARDS ----- */
.swipe-hint { display: none; text-align: center; font-size: 0.7rem; color: var(--gray-400); padding: 4px 0; }
@media (max-width: 767.98px) {
  .table-cards-mobile .swipe-hint {
    display: block;
  }
}

/* ----- BULK ACTIONS BAR ----- */
.bulk-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid var(--brand-600, #0284c7);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1030;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  flex-wrap: wrap;
}
@media (max-width: 767.98px) {
  .bulk-actions-bar {
    padding: 10px 12px;
    gap: 8px;
    font-size: 0.85rem;
  }
  .bulk-actions-bar .form-select-sm {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  .bulk-actions-bar .btn-sm {
    font-size: 0.8rem;
    padding: 4px 10px;
  }
}
/* ── Payment method radio buttons (onboarding wizard) ──────── */
.payment-method-input {
    width: 1.5em;
    height: 1.5em;
    margin-top: 0.1em;
    cursor: pointer;
}
.payment-method-label {
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
}
.payment-method-radio {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
    min-width: 140px;
    justify-content: center;
}
.payment-method-radio:has(.payment-method-input:checked) {
    border-color: var(--brand-600);
    background: var(--brand-100);
}
@media (max-width: 767.98px) {
    .payment-method-radio {
        flex: 1 1 45%;
        min-width: 120px;
    }
}

/* ── Card header gradients (admin edit_client_campaign) ───── */
.card-header-gradient-brand {
    background: linear-gradient(135deg, #bae6fd, #7dd3fc);
    color: #111827;
    font-weight: 600;
}
.card-header-gradient-success {
    background: linear-gradient(135deg, #bbf7d0, #86efac);
    color: #111827;
    font-weight: 600;
}
.card-header-gradient-indigo {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #111827;
    font-weight: 600;
}
.card-header-gradient-cyan {
    background: linear-gradient(135deg, #a5f3fc, #67e8f9);
    color: #111827;
    font-weight: 600;
}
.card-header-gradient-amber {
    background: linear-gradient(135deg, #fef08a, #fde047);
    color: #111827;
    font-weight: 600;
}
.card-header-gradient-gray {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #111827;
    font-weight: 600;
}

/* ── Cron manager utility classes ──────────────────────────── */
.cron-step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.cron-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cron-icon-box i {
    font-size: 1.4rem;
}
.cron-health-ok {
    background: #f0fdf4;
    border-left: 4px solid var(--success);
}
.cron-health-warn {
    background: #fffbeb;
    border-left: 4px solid var(--accent);
}
.cron-error-block {
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.75rem;
}
.cron-warn-block {
    background: #fffbeb;
    color: #92400e;
    font-size: 0.78rem;
}
.cron-info-block {
    background: #f0f9ff;
}
.cron-output {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.7rem;
    white-space: pre-wrap;
}
.cron-spinner-overlay {
    background: rgba(255,255,255,0.85);
    border-radius: inherit;
    z-index: 5;
}

/* ── Breadcrumbs ──────────────────────────────── */
.breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 0.85rem; }
.breadcrumb-item a { color: var(--brand-600); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #6b7280; }