/* Fear Free LMS - Design System */
/* Brand Colors from fearfreepets.com / brandfetch */

:root {
  /* Primary Palette */
  --ff-navy: #123d64;
  --ff-navy-light: #1a5280;
  --ff-navy-dark: #0d2d4a;
  --ff-blue: #55acee;
  --ff-blue-light: #7dc0f2;
  --ff-blue-dark: #3a8fd4;
  --ff-white: #ffffff;

  /* Extended Palette */
  --ff-teal: #2ab5b2;
  --ff-teal-light: #3dc9c6;
  --ff-teal-dark: #1f9190;
  --ff-green: #34c759;
  --ff-green-light: #e8f9ed;
  --ff-yellow: #f5a623;
  --ff-yellow-light: #fef6e8;
  --ff-orange: #ff9500;
  --ff-red: #e74c3c;
  --ff-red-light: #fdecea;
  --ff-purple: #6c5ce7;

  /* Neutrals */
  --ff-gray-50: #f8f9fb;
  --ff-gray-100: #f1f3f7;
  --ff-gray-200: #e2e6ee;
  --ff-gray-300: #ccd2dd;
  --ff-gray-400: #9ba3b5;
  --ff-gray-500: #6b7589;
  --ff-gray-600: #4a5568;
  --ff-gray-700: #2d3748;
  --ff-gray-800: #1a202c;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(18,61,100,0.08);
  --shadow-md: 0 4px 12px rgba(18,61,100,0.1);
  --shadow-lg: 0 8px 24px rgba(18,61,100,0.12);
  --shadow-xl: 0 16px 48px rgba(18,61,100,0.15);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

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

body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  background: var(--ff-gray-50);
  color: var(--ff-gray-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ======= TOP NAV ======= */
.topnav {
  background: linear-gradient(135deg, var(--ff-navy) 0%, var(--ff-navy-light) 100%);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topnav .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.topnav .logo-icon {
  height: 40px;
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
}
.topnav .nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}
.topnav .nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}
.topnav .nav-links a:hover,
.topnav .nav-links a.active {
  color: white;
  background: rgba(255,255,255,0.12);
}
.topnav .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topnav .nav-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 18px;
  position: relative;
}
.topnav .nav-icon:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}
.topnav .nav-icon .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--ff-red);
  border-radius: 50%;
  border: 2px solid var(--ff-navy);
}
.topnav .avatar-wrapper {
  position: relative;
}
.topnav .avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--ff-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
  transition: var(--transition-fast);
}
.topnav .avatar:hover {
  border-color: rgba(255,255,255,0.6);
}

/* ======= AVATAR DROPDOWN ======= */
.avatar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--ff-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--ff-gray-200);
  z-index: 200;
  overflow: hidden;
}
.avatar-dropdown.open {
  display: block;
}
.avatar-dropdown .dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--ff-gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-dropdown .dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--ff-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.avatar-dropdown .dropdown-user-info .dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ff-navy);
}
.avatar-dropdown .dropdown-user-info .dropdown-email {
  font-size: 12px;
  color: var(--ff-gray-400);
}
.avatar-dropdown .dropdown-menu {
  padding: 6px 0;
}
.avatar-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ff-gray-600);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}
.avatar-dropdown .dropdown-item:hover {
  background: var(--ff-gray-50);
  color: var(--ff-navy);
}
.avatar-dropdown .dropdown-item .dd-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
}
.avatar-dropdown .dropdown-divider {
  height: 1px;
  background: var(--ff-gray-100);
  margin: 4px 0;
}
.avatar-dropdown .dropdown-item.logout {
  color: var(--ff-red);
}
.avatar-dropdown .dropdown-item.logout:hover {
  background: var(--ff-red-light);
}

/* ======= SEARCH OVERLAY ======= */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  justify-content: center;
  padding-top: 80px;
}
.search-overlay.open {
  display: flex;
}
.search-modal {
  width: 100%;
  max-width: 600px;
  background: var(--ff-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: searchSlideDown 0.2s ease;
}
@keyframes searchSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-modal .search-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--ff-gray-100);
}
.search-modal .search-input-wrap .search-icon {
  font-size: 20px;
  color: var(--ff-gray-400);
}
.search-modal .search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--ff-gray-700);
  background: transparent;
}
.search-modal .search-input-wrap input::placeholder {
  color: var(--ff-gray-300);
}
.search-modal .search-input-wrap .search-shortcut {
  font-size: 11px;
  color: var(--ff-gray-400);
  background: var(--ff-gray-100);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.search-modal .search-results {
  padding: 12px 0;
  overflow-y: auto;
}
.search-modal .search-group-label {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ff-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.search-modal .search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  color: var(--ff-gray-700);
}
.search-modal .search-result-item:hover {
  background: var(--ff-gray-50);
}
.search-modal .search-result-item .result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--ff-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.search-modal .search-result-item .result-text {
  flex: 1;
}
.search-modal .search-result-item .result-title {
  font-size: 14px;
  font-weight: 500;
}
.search-modal .search-result-item .result-meta {
  font-size: 12px;
  color: var(--ff-gray-400);
}

/* ======= BREADCRUMB ======= */
.breadcrumb {
  padding: 12px 32px;
  font-size: 13px;
  color: var(--ff-gray-400);
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--ff-white);
  border-bottom: 1px solid var(--ff-gray-200);
}
.breadcrumb a {
  color: var(--ff-blue);
  text-decoration: none;
}
.breadcrumb span { color: var(--ff-gray-300); }

/* ======= PAGE LAYOUT ======= */
.page-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 32px;
}
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--ff-navy);
}
.page-header .subtitle {
  color: var(--ff-gray-500);
  font-size: 14px;
  margin-top: 4px;
}

/* ======= CARDS ======= */
.card {
  background: var(--ff-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--ff-gray-200);
  transition: var(--transition-normal);
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ff-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ff-navy);
}
.card-body { padding: 20px; }

/* ======= STATS CARDS ======= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--ff-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--ff-gray-200);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition-normal);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue { background: #eaf4fd; color: var(--ff-blue); }
.stat-icon.teal { background: #e6f7f7; color: var(--ff-teal); }
.stat-icon.green { background: var(--ff-green-light); color: var(--ff-green); }
.stat-icon.yellow { background: var(--ff-yellow-light); color: var(--ff-yellow); }
.stat-icon.purple { background: #f0eefa; color: var(--ff-purple); }
.stat-icon.red { background: var(--ff-red-light); color: var(--ff-red); }
.stat-info .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ff-navy);
  line-height: 1.2;
}
.stat-info .stat-label {
  font-size: 13px;
  color: var(--ff-gray-500);
  margin-top: 2px;
}
.stat-info .stat-trend {
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-trend.up { color: var(--ff-green); }
.stat-trend.down { color: var(--ff-red); }

/* ======= COURSE CARDS ======= */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.course-card {
  background: var(--ff-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--ff-gray-200);
  transition: var(--transition-normal);
  cursor: pointer;
}
.course-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.course-thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--ff-navy) 0%, var(--ff-blue) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-thumb .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
}
.course-thumb .ce-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ff-teal);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.course-thumb .course-icon {
  font-size: 48px;
  color: rgba(255,255,255,0.3);
}
.course-body {
  padding: 16px;
}
.course-body .course-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ff-navy);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-body .course-meta {
  font-size: 12px;
  color: var(--ff-gray-400);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
}
.course-progress {
  margin-bottom: 12px;
}
.progress-bar {
  height: 6px;
  background: var(--ff-gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.progress-fill.blue { background: var(--ff-blue); }
.progress-fill.green { background: var(--ff-green); }
.progress-fill.teal { background: var(--ff-teal); }
.progress-fill.yellow { background: var(--ff-yellow); }
.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ff-gray-500);
  margin-top: 6px;
}
.course-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--ff-gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ======= STATUS BADGES ======= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}
.badge.completed { background: var(--ff-green-light); color: #1b7a33; }
.badge.in-progress { background: var(--ff-yellow-light); color: #b37a00; }
.badge.not-started { background: var(--ff-gray-100); color: var(--ff-gray-500); }
.badge.overdue { background: var(--ff-red-light); color: var(--ff-red); }
.badge.certified { background: #e6f7f7; color: var(--ff-teal-dark); }

/* ======= BUTTONS ======= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}
.btn-primary {
  background: var(--ff-blue);
  color: white;
}
.btn-primary:hover { background: var(--ff-blue-dark); }
.btn-secondary {
  background: var(--ff-gray-100);
  color: var(--ff-gray-600);
}
.btn-secondary:hover { background: var(--ff-gray-200); }
.btn-outline {
  background: transparent;
  color: var(--ff-blue);
  border: 1px solid var(--ff-blue);
}
.btn-outline:hover { background: #eaf4fd; }
.btn-teal {
  background: var(--ff-teal);
  color: white;
}
.btn-teal:hover { background: var(--ff-teal-dark); }
.btn-navy {
  background: var(--ff-navy);
  color: white;
}
.btn-navy:hover { background: var(--ff-navy-dark); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ======= TABLES ======= */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table thead th {
  background: var(--ff-gray-50);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ff-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--ff-gray-200);
}
.data-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--ff-gray-100);
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: var(--ff-gray-50);
}

/* ======= SECTION HEADERS ======= */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ff-navy);
}

/* ======= SIDEBAR ======= */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}
.sidebar {
  background: var(--ff-white);
  border-right: 1px solid var(--ff-gray-200);
  padding: 20px 0;
}
.sidebar .sidebar-section {
  margin-bottom: 24px;
}
.sidebar .sidebar-label {
  padding: 0 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ff-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.sidebar .sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--ff-gray-600);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
  border-left: 3px solid transparent;
}
.sidebar .sidebar-item:hover {
  background: var(--ff-gray-50);
  color: var(--ff-navy);
}
.sidebar .sidebar-item.active {
  background: #eaf4fd;
  color: var(--ff-blue);
  border-left-color: var(--ff-blue);
  font-weight: 600;
}
.sidebar .sidebar-item .item-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}
.sidebar .sidebar-item .item-badge {
  margin-left: auto;
  background: var(--ff-blue);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

/* ======= WELCOME BANNER ======= */
.welcome-banner {
  background: linear-gradient(135deg, var(--ff-navy) 0%, var(--ff-navy-light) 50%, var(--ff-teal-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -30px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: 60px;
  width: 300px;
  height: 300px;
  background: rgba(42,181,178,0.15);
  border-radius: 50%;
}
.welcome-banner h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.welcome-banner p {
  font-size: 14px;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* ======= MOBILE MENU TOGGLE ======= */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  order: 99;
  margin-left: 12px;
}

/* ======= FOOTER ======= */
.site-footer {
  background: var(--ff-navy);
  color: rgba(255,255,255,0.7);
  margin-top: 48px;
}
.footer-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-decoration: none;
}
.footer-brand .footer-logo img {
  height: 36px;
  width: auto;
  border-radius: 4px;
}
.footer-brand .footer-logo span {
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 280px;
}
.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition-fast);
}
.footer-social a:hover {
  background: var(--ff-teal);
  color: white;
}
.footer-col h4 {
  color: white;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition-fast);
}
.footer-col ul a:hover {
  color: white;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.footer-bottom a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: var(--transition-fast);
}
.footer-bottom a:hover {
  color: white;
}
.footer-bottom-links {
  display: flex;
  gap: 20px;
}

@media (max-width: 768px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 32px 16px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 16px;
  }
}
@media (max-width: 480px) {
  .footer-main {
    grid-template-columns: 1fr;
  }
}

/* ======= DESIGN LABEL ======= */
.design-label {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--ff-navy);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}

/* ======= BACK TO TOP BUTTON ======= */
.back-to-top {
  position: fixed;
  bottom: 60px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--ff-navy);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 150;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--ff-blue);
}

/* ======= TABLE RESPONSIVE WRAPPER ======= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================= */

/* ---------- Tablet (max-width: 1024px) ---------- */
@media (max-width: 1024px) {
  .page-container {
    padding: 20px 24px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .layout-with-sidebar {
    grid-template-columns: 220px 1fr;
  }
  .topnav {
    padding: 0 20px;
  }
  .topnav .nav-links a {
    padding: 8px 10px;
    font-size: 13px;
  }
  .breadcrumb {
    padding: 10px 24px;
  }
  .welcome-banner {
    padding: 24px;
  }
  .welcome-banner h1 {
    font-size: 20px;
  }
  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ---------- Small Tablet / Large Phone (max-width: 768px) ---------- */
@media (max-width: 768px) {
  /* Nav: show hamburger, hide links */
  .menu-toggle {
    display: block;
  }
  .topnav {
    padding: 0 16px;
    height: 56px;
  }
  .topnav .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--ff-navy);
    flex-direction: column;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99;
  }
  .topnav .nav-links.open {
    display: flex;
  }
  .topnav .nav-links a {
    padding: 12px 24px;
    border-radius: 0;
    font-size: 15px;
  }
  .topnav .nav-right {
    gap: 10px;
  }
  .topnav .logo {
    font-size: 16px;
  }

  /* Breadcrumb */
  .breadcrumb {
    padding: 8px 16px;
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Page container */
  .page-container {
    padding: 16px;
  }
  .page-header h1 {
    font-size: 22px;
  }

  /* Stats: 2 columns */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .stat-info .stat-value {
    font-size: 22px;
  }

  /* Courses: single column */
  .courses-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebar layout: stack */
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--ff-gray-200);
    padding: 12px 0;
  }

  /* Welcome banner */
  .welcome-banner {
    padding: 20px;
    border-radius: var(--radius-md);
  }
  .welcome-banner h1 {
    font-size: 18px;
  }
  .welcome-banner p {
    font-size: 13px;
  }

  /* Cards */
  .card-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-body {
    padding: 16px;
  }

  /* Tables: scroll */
  .data-table {
    min-width: 600px;
  }

  /* Section header */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Design label */
  .design-label {
    font-size: 10px;
    padding: 6px 10px;
    bottom: 8px;
    right: 8px;
  }
}

/* ---------- Phone (max-width: 480px) ---------- */
@media (max-width: 480px) {
  .page-container {
    padding: 12px;
  }
  .page-header h1 {
    font-size: 20px;
  }

  /* Stats: single column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Buttons: full width on small screens */
  .btn-lg {
    width: 100%;
    justify-content: center;
  }

  /* Welcome banner */
  .welcome-banner h1 {
    font-size: 16px;
  }

  /* Course thumb smaller */
  .course-thumb {
    height: 140px;
  }
}
