/* ============================================================
   R.S Group of Education — Custom Stylesheet
   Version : 1.0.0
   Author  : RS Group Dev Team
   ============================================================ */

/* ── 1. CSS Custom Properties ─────────────────────────────── */
:root {
  --primary       : #1565c0;
  --primary-dark  : #0d47a1;
  --success       : #1b6b30;
  --gold          : #d4a017;
  --bg            : #f8fafc;
  --dark          : #0e1754;
  --text          : #343a40;
  --text-muted    : #6c757d;
  --border        : #dee2e6;
  --sidebar-width : 260px;
  --sidebar-bg    : #0e1754;
  --sidebar-text  : #cbd5e0;
  --sidebar-hover : rgba(255,255,255,0.08);
  --card-shadow   : 0 2px 12px rgba(0,0,0,0.08);
  --transition    : all 0.3s ease;

  /* Bootstrap 5 primary override to match logo */
  --bs-primary            : #1565c0;
  --bs-primary-rgb        : 21, 101, 192;
  --bs-link-color         : #1565c0;
  --bs-link-hover-color   : #0d47a1;
  --bs-btn-bg             : #1565c0;
  --bs-btn-border-color   : #1565c0;
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg          : #0f172a;
  --dark        : #f1f5f9;
  --text        : #e2e8f0;
  --text-muted  : #94a3b8;
  --border      : #334155;
  --card-shadow : 0 2px 12px rgba(0,0,0,0.4);
}

/* ── 2. Base Reset & Typography ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: hidden; max-width: 100%; }
/* Dashboard pages have a fixed sidebar — must not clip it */
body.dashboard-body { overflow-x: unset; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background : var(--bg);
  color      : var(--text);
  font-size  : 15px;
  line-height: 1.65;
  transition : background 0.3s, color 0.3s;
}

a                { color: var(--primary); text-decoration: none; }
a:hover          { color: var(--primary-dark); }
img              { max-width: 100%; }
h1,h2,h3,h4,h5,h6 { color: var(--dark); }
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 { color: #f1f5f9; }

/* Override Bootstrap's text-muted & secondary colors in dark mode */
[data-theme="dark"] {
  --bs-secondary-color      : #94a3b8;
  --bs-body-color           : #e2e8f0;
  --bs-secondary-bg         : #1e293b;
  --bs-tertiary-bg          : #0f172a;
  --bs-body-bg              : #0f172a;
  --bs-emphasis-color       : #f8fafc;
}
[data-theme="dark"] .text-muted        { color: #94a3b8 !important; }
[data-theme="dark"] .text-body-secondary { color: #94a3b8 !important; }
[data-theme="dark"] p                  { color: #cbd5e1; }
[data-theme="dark"] .card p            { color: #cbd5e1; }
[data-theme="dark"] .card .text-muted  { color: #94a3b8 !important; }

/* ── 3. Navbar ────────────────────────────────────────────── */
.navbar {
  padding   : 0.8rem 0;
  transition: var(--transition);
}
.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.1) !important;
}
.navbar-brand-icon {
  width        : 44px;
  height       : 44px;
  border-radius: 50%;
  object-fit   : cover;
  flex-shrink  : 0;
  display      : block;
  border       : 2px solid var(--gold);
}
.brand-text {
  font-size  : 1.05rem;
  font-weight: 700;
  color      : var(--dark);
  line-height: 1.2;
}
.brand-text small {
  display      : block;
  font-size    : 0.65rem;
  font-weight  : 400;
  color        : var(--text-muted);
  letter-spacing: 0.04em;
}
[data-theme="dark"] .brand-text { color: #f1f5f9; }
[data-theme="dark"] .navbar      { background: #1e293b !important; }
[data-theme="dark"] .nav-link    { color: #e2e8f0 !important; }

/* Mobile toggler icon — invert to white on dark navbar */
[data-theme="dark"] .navbar-toggler         { border-color: rgba(255,255,255,0.3); }
[data-theme="dark"] .navbar-toggler-icon    { filter: invert(1); }

/* Collapsed mobile menu background in dark mode */
[data-theme="dark"] .navbar-collapse        { background: #1e293b; }
[data-theme="dark"] .navbar-collapse .nav-link { padding: 0.6rem 1rem !important; border-bottom: 1px solid rgba(255,255,255,0.07); }

.nav-link {
  font-weight: 500;
  font-size  : 0.875rem;
  padding    : 0.5rem 0.8rem !important;
  color      : var(--text) !important;
  transition : color 0.2s;
  position   : relative;
}
.navbar-nav .nav-link::after {
  content      : '';
  position     : absolute;
  bottom       : 2px;
  left         : 0.8rem;
  right        : 0.8rem;
  height       : 2px;
  background   : var(--primary);
  border-radius: 1px;
  transform    : scaleX(0);
  transition   : transform 0.25s;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { transform: scaleX(1); }
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: var(--primary) !important; }

/* Dark mode: Bootstrap nav-tabs active tab fix */
[data-theme="dark"] .nav-tabs {
  --bs-nav-tabs-border-color    : #334155;
  --bs-nav-tabs-link-active-bg  : #1e293b;
  --bs-nav-tabs-link-active-color: #e2e8f0;
  --bs-nav-tabs-link-active-border-color: #334155 #334155 #1e293b;
  border-bottom-color           : #334155;
}
[data-theme="dark"] .nav-tabs .nav-link {
  color: #94a3b8;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: #334155;
  color        : #e2e8f0;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
  background  : #1e293b !important;
  color       : #e2e8f0 !important;
  border-color: #334155 #334155 #1e293b;
}
[data-theme="dark"] .tab-content {
  background: #1e293b;
  color     : #e2e8f0;
}

/* ── 4. Hero Section ──────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 55%, #0e1754 100%);
  color     : #fff;
  padding   : 100px 0 80px;
  position  : relative;
  overflow  : hidden;
}
.hero-section::before {
  content       : '';
  position      : absolute;
  inset         : 0;
  background    : url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff0d' d='M0,96L60,112C120,128,240,160,360,165C480,171,600,149,720,138C840,128,960,128,1080,149C1200,171,1320,213,1380,218L1440,224L1440,320L0,320Z'/%3E%3C/svg%3E") no-repeat bottom/cover;
}
.hero-section h1 {
  font-size  : clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  color      : #fff;
}
.hero-section .lead {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  opacity  : 0.9;
}
.hero-badge {
  display      : inline-block;
  background   : rgba(255,255,255,0.15);
  border       : 1px solid rgba(255,255,255,0.3);
  padding      : 0.3rem 1rem;
  border-radius: 50px;
  font-size    : 0.78rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.hero-stats      { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-stat-item h3 { font-size: 2rem; font-weight: 800; color: #fff; margin: 0; }
.hero-stat-item p  { font-size: 0.78rem; opacity: 0.8; margin: 0; }

/* ── 5. Section Helpers ───────────────────────────────────── */
.section-badge {
  display        : inline-block;
  background     : rgba(21,101,192,0.1);
  color          : var(--primary);
  padding        : 0.25rem 0.85rem;
  border-radius  : 50px;
  font-size      : 0.75rem;
  font-weight    : 600;
  letter-spacing : 0.06em;
  text-transform : uppercase;
  margin-bottom  : 0.5rem;
}
.section-title {
  font-size  : clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
}
.section-divider {
  width        : 56px;
  height       : 4px;
  background   : var(--primary);
  border-radius: 2px;
  margin       : 0.75rem 0 1rem;
}
section { padding: 70px 0; }
.bg-light-custom { background: #f0f4ff !important; }
[data-theme="dark"] .bg-light-custom { background: #0f172a !important; }

/* ── 6. Service & Feature Cards ───────────────────────────── */
.card {
  border       : none;
  border-radius: 14px;
  box-shadow   : var(--card-shadow);
  transition   : var(--transition);
  background   : #fff;
}
.card:hover {
  transform : translateY(-5px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.13);
}
[data-theme="dark"] .card {
  background: #1e293b;
  color     : #e2e8f0;
}
.service-icon {
  width          : 64px;
  height         : 64px;
  background     : rgba(21,101,192,0.1);
  color          : var(--primary);
  border-radius  : 16px;
  display        : flex;
  align-items    : center;
  justify-content: center;
  font-size      : 1.6rem;
  margin-bottom  : 1rem;
  transition     : var(--transition);
}
.card:hover .service-icon {
  background: var(--primary);
  color     : #fff;
}

/* ── 7. Course Cards ──────────────────────────────────────── */
.course-card .card-img-top {
  height    : 185px;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}
.course-badge {
  position: absolute;
  top     : 12px;
  left    : 12px;
}

/* ── 8. Blog Cards ────────────────────────────────────────── */
.blog-card .card-img-top {
  height    : 200px;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}
.blog-meta          { font-size: 0.8rem; color: var(--text-muted); }
.blog-meta i        { color: var(--primary); }
.text-truncate-2    {
  display           : -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow          : hidden;
}

/* ── 9. Job Cards ─────────────────────────────────────────── */
.job-card {
  border-left  : 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding      : 1rem 1.25rem;
  background   : #fff;
  box-shadow   : var(--card-shadow);
  transition   : var(--transition);
}
.job-card:hover {
  border-left-color: var(--success);
  transform        : translateX(4px);
}
[data-theme="dark"] .job-card { background: #1e293b; }
.job-tag {
  display      : inline-block;
  background   : rgba(21,101,192,0.1);
  color        : var(--primary);
  font-size    : 0.72rem;
  padding      : 0.18rem 0.6rem;
  border-radius: 50px;
  font-weight  : 500;
}

/* ── 10. Testimonials ─────────────────────────────────────── */
.testimonial-card {
  background   : #fff;
  border-radius: 16px;
  padding      : 1.5rem;
  box-shadow   : var(--card-shadow);
}
[data-theme="dark"] .testimonial-card { background: #1e293b; }
.testimonial-card .stars { color: #f59e0b; }
.testimonial-avatar {
  width        : 52px;
  height       : 52px;
  border-radius: 50%;
  object-fit   : cover;
}

/* ── 11. Footer ───────────────────────────────────────────── */
footer                        { background: var(--dark); color: #adb5bd; }
footer h5, footer h6          { color: #fff; }
footer a                      { color: #adb5bd; font-size: 0.875rem; transition: color 0.2s; }
footer a:hover                { color: var(--primary); }
.footer-brand-text            { font-size: 1.05rem; font-weight: 700; color: #fff; }
.social-links a {
  width          : 36px;
  height         : 36px;
  background     : rgba(255,255,255,0.1);
  border-radius  : 8px;
  display        : inline-flex;
  align-items    : center;
  justify-content: center;
  color          : #fff !important;
  transition     : var(--transition);
}
.social-links a:hover { background: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding   : 1rem 0;
  font-size : 0.82rem;
}

/* ── 12. Page Banner (inner pages) ───────────────────────── */
.page-banner {
  background: linear-gradient(135deg, #1565c0, #0e1754);
  color     : #fff;
  padding   : 60px 0 50px;
}
.page-banner h1               { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; color: #fff; }
.breadcrumb-item a            { color: rgba(255,255,255,0.7); }
.breadcrumb-item.active       { color: rgba(255,255,255,0.9); }
.breadcrumb-item+.breadcrumb-item::before { color: rgba(255,255,255,0.5); }

/* ── 13. Gallery ──────────────────────────────────────────── */
.gallery-item {
  position     : relative;
  overflow     : hidden;
  border-radius: 12px;
  aspect-ratio : 4/3;
  cursor       : pointer;
}
.gallery-item img           { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img     { transform: scale(1.08); }
.gallery-overlay {
  position       : absolute;
  inset          : 0;
  background     : rgba(21,101,192,0.5);
  display        : flex;
  align-items    : center;
  justify-content: center;
  opacity        : 0;
  transition     : opacity 0.3s;
  color          : #fff;
  font-size      : 2.2rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ── 14. Dashboard Layout ─────────────────────────────────── */
.dashboard-wrapper          { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.sidebar {
  width         : var(--sidebar-width);
  background    : var(--sidebar-bg);
  display       : flex;
  flex-direction: column;
  position      : fixed;
  top           : 0;
  left          : 0;
  height        : 100vh;
  z-index       : 1000;
  transition    : width 0.3s ease;
  overflow-y    : auto;
  overflow-x    : hidden;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar        { width: 4px; }
.sidebar::-webkit-scrollbar-track  { background: transparent; }
.sidebar::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.2); border-radius:2px; }
.sidebar-brand {
  padding      : 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink  : 0;
}
.sidebar-brand-text { font-size: 0.92rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-brand-text small { display: block; font-size: 0.62rem; color: rgba(255,255,255,0.45); }
.sidebar-nav         { padding: 1rem 0; flex: 1; }
.nav-section-title {
  font-size     : 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color         : rgba(255,255,255,0.3);
  padding       : 0.8rem 1.5rem 0.3rem;
  font-weight   : 600;
}
.sidebar-nav .nav-item a {
  display       : flex;
  align-items   : center;
  gap           : 0.75rem;
  padding       : 0.58rem 1.5rem;
  color         : var(--sidebar-text);
  font-size     : 0.85rem;
  font-weight   : 500;
  transition    : var(--transition);
  border-left   : 3px solid transparent;
  text-decoration: none;
  white-space   : nowrap;
  overflow      : hidden;
}
.sidebar-nav .nav-item a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-item a.active {
  background      : rgba(21,101,192,0.2);
  color           : #fff;
  border-left-color: var(--primary);
}
.sidebar-nav .nav-item a i { width: 18px; text-align: center; font-size: 0.88rem; opacity: 0.75; }
.sidebar-nav .nav-item a.active i { opacity: 1; }
.sidebar-footer {
  padding      : 1rem 1.5rem;
  border-top   : 1px solid rgba(255,255,255,0.1);
  flex-shrink  : 0;
}
.sidebar-user          { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-user-avatar {
  width          : 36px;
  height         : 36px;
  border-radius  : 50%;
  background     : var(--primary);
  display        : flex;
  align-items    : center;
  justify-content: center;
  color          : #fff;
  font-weight    : 700;
  font-size      : 0.82rem;
  flex-shrink    : 0;
}
.sidebar-user-info     { flex: 1; overflow: hidden; }
.sidebar-user-name     { font-size: 0.8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role     { font-size: 0.68rem; color: rgba(255,255,255,0.45); }

/* Main content */
.main-content {
  flex          : 1;
  margin-left   : var(--sidebar-width);
  display       : flex;
  flex-direction: column;
  transition    : margin-left 0.3s ease;
  min-height    : 100vh;
}

/* ── Mini sidebar (collapsed on desktop) ────────────────── */
.sidebar.sidebar-collapsed {
  width: 64px;
}
.sidebar.sidebar-collapsed + .sidebar-overlay + .main-content,
.sidebar.sidebar-collapsed ~ .main-content {
  margin-left: 64px;
}
/* Hide text labels, section titles, footer info in mini mode */
.sidebar.sidebar-collapsed .sidebar-brand-text,
.sidebar.sidebar-collapsed .nav-section-title,
.sidebar.sidebar-collapsed .sidebar-user-info,
.sidebar.sidebar-collapsed .sidebar-user-name,
.sidebar.sidebar-collapsed .sidebar-user-role {
  display: none;
}
/* Center icons in mini mode */
.sidebar.sidebar-collapsed .sidebar-brand {
  padding    : 1rem 0;
  display    : flex;
  justify-content: center;
}
.sidebar.sidebar-collapsed .sidebar-nav .nav-item a {
  justify-content: center;
  padding        : 0.7rem 0;
  border-left    : none;
  border-radius  : 0;
  position       : relative;
  font-size      : 0;        /* hides text nodes without touching HTML */
}
.sidebar.sidebar-collapsed .sidebar-nav .nav-item a i {
  width    : auto;
  font-size: 1.1rem;         /* restore icon size explicitly */
  opacity  : 0.85;
  margin   : 0;
}
.sidebar.sidebar-collapsed .sidebar-footer {
  padding        : 0.75rem 0;
  display        : flex;
  justify-content: center;
}
.sidebar.sidebar-collapsed .sidebar-user {
  justify-content: center;
}
/* Tooltip on hover in mini mode — label set via JS from link text */
.sidebar.sidebar-collapsed .sidebar-nav .nav-item a {
  position: relative;
  overflow: visible;
}
.sidebar.sidebar-collapsed .sidebar-nav .nav-item a::after {
  content   : attr(data-label);
  position  : fixed;
  left      : 72px;
  background: #1e293b;
  color     : #f1f5f9;
  padding   : 0.3rem 0.75rem;
  border-radius: 6px;
  font-size : 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  opacity   : 0;
  transition: opacity 0.15s;
  z-index   : 2000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  border    : 1px solid rgba(255,255,255,0.1);
}
.sidebar.sidebar-collapsed .sidebar-nav .nav-item a:hover::after {
  opacity: 1;
}
.top-navbar {
  background  : #fff;
  border-bottom: 1px solid var(--border);
  padding     : 0.75rem 1.5rem;
  display     : flex;
  align-items : center;
  gap         : 1rem;
  position    : sticky;
  top         : 0;
  z-index     : 100;
  box-shadow  : 0 1px 4px rgba(0,0,0,0.06);
}
[data-theme="dark"] .top-navbar { background: #1e293b; border-bottom-color: #334155; }
.sidebar-toggle-btn {
  background: none;
  border    : 1px solid var(--border);
  border-radius: 8px;
  padding   : 0.38rem 0.6rem;
  cursor    : pointer;
  color     : var(--text-muted);
  transition: var(--transition);
}
.sidebar-toggle-btn:hover { background: var(--bg); color: var(--primary); }
.top-navbar-title { font-size: 1rem; font-weight: 600; flex: 1; }
.page-content      { padding: 1.5rem; flex: 1; }
[data-theme="dark"] .page-content { background: var(--bg); }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display : none;
  position: fixed;
  inset   : 0;
  background: rgba(0,0,0,0.5);
  z-index : 998;
}
/* Keep top-navbar above the overlay so hamburger stays clickable */
.top-navbar { z-index: 999 !important; }

/* ── 15. Stat Cards (Dashboard) ───────────────────────────── */
.stat-card {
  border-radius: 16px;
  padding      : 1.3rem 1.5rem;
  border       : none;
  box-shadow   : var(--card-shadow);
  position     : relative;
  overflow     : hidden;
  color        : #fff;
  height       : 100%;
}
.stat-card::after {
  content      : '';
  position     : absolute;
  top          : -20px;
  right        : -20px;
  width        : 90px;
  height       : 90px;
  border-radius: 50%;
  background   : rgba(255,255,255,0.1);
}
.stat-card .stat-icon {
  width          : 48px;
  height         : 48px;
  border-radius  : 12px;
  display        : flex;
  align-items    : center;
  justify-content: center;
  font-size      : 1.2rem;
  background     : rgba(255,255,255,0.18);
  margin-bottom  : 0.75rem;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; margin-bottom: 0.2rem; }
.stat-card .stat-label { font-size: 0.78rem; opacity: 0.85; }
.stat-card .stat-change { font-size: 0.73rem; opacity: 0.75; }
.stat-card.primary-card, .stat-card.primary { background: linear-gradient(135deg,#1565c0,#0d47a1); }
.stat-card.success-card, .stat-card.success { background: linear-gradient(135deg,#1b6b30,#145a2c); }
.stat-card.warning-card, .stat-card.warning { background: linear-gradient(135deg,#f59e0b,#d97706); }
.stat-card.danger-card,  .stat-card.danger  { background: linear-gradient(135deg,#dc3545,#b02a37); }
.stat-card.info-card,    .stat-card.info    { background: linear-gradient(135deg,#0dcaf0,#0aa2c0); }
.stat-card.purple-card,  .stat-card.purple  { background: linear-gradient(135deg,#6f42c1,#5a32a3); }

/* ── 16. Table Styles ─────────────────────────────────────── */
.table-card {
  background   : #fff;
  border-radius: 14px;
  box-shadow   : var(--card-shadow);
  overflow     : hidden;
}
[data-theme="dark"] .table-card { background: #1e293b; }
.table-card .table-header {
  padding        : 1rem 1.25rem;
  border-bottom  : 1px solid var(--border);
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  flex-wrap      : wrap;
  gap            : 0.75rem;
}
[data-theme="dark"] .table-card .table-header { border-bottom-color: #334155; }
.table-card .table-header h6 { font-weight: 600; margin: 0; }
.table thead th {
  background    : #f8fafc;
  border-bottom : 2px solid var(--border);
  font-size     : 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight   : 600;
  color         : var(--text-muted);
  padding       : 0.75rem 1rem;
  cursor        : pointer;
  white-space   : nowrap;
  user-select   : none;
}
[data-theme="dark"] .table thead th { background: #0f172a; color: #94a3b8; border-bottom-color: #334155; }
.table thead th:hover { background: #e9ecef; }
[data-theme="dark"] .table thead th:hover { background: #1e293b; }
.table thead th .sort-icon      { margin-left: 4px; opacity: 0.35; font-size: 0.68rem; }
.table thead th.sort-asc .sort-icon,
.table thead th.sort-desc .sort-icon { opacity: 1; color: var(--primary); }
.table tbody td {
  padding    : 0.72rem 1rem;
  font-size  : 0.875rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(222,226,230,0.6);
}
[data-theme="dark"] .table tbody td { border-bottom-color: #334155; color: #e2e8f0; }
.table tbody tr:last-child td   { border-bottom: none; }
.table tbody tr:hover           { background: rgba(21,101,192,0.03); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,0.03); }
/* Override Bootstrap's white table-bg in dark mode */
[data-theme="dark"] .table {
  --bs-table-bg       : transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.04);
  --bs-table-hover-bg : rgba(255,255,255,0.04);
  --bs-table-color    : #e2e8f0;
  color               : #e2e8f0;
}
[data-theme="dark"] .table > :not(caption) > * { background-color: transparent; }
[data-theme="dark"] .table > :not(caption) > * > * { color: #e2e8f0; background-color: transparent; }
.table-search { max-width: 240px; font-size: 0.875rem; }
.badge-status { font-size: 0.68rem; padding: 0.3em 0.65em; border-radius: 50px; font-weight: 600; }

/* ── 17. Form Styles ──────────────────────────────────────── */
.form-label { font-size: 0.875rem; font-weight: 500; margin-bottom: 0.35rem; }
.form-control, .form-select {
  border-radius: 8px;
  border       : 1.5px solid var(--border);
  font-size    : 0.875rem;
  padding      : 0.5rem 0.8rem;
  transition   : var(--transition);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select   { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.form-control:focus,
.form-select:focus                  { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,0.15); }
.form-control.is-invalid            { border-color: #dc3545; }
.invalid-feedback                   { font-size: 0.75rem; }
.form-section-title {
  font-size     : 0.82rem;
  font-weight   : 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color         : var(--text-muted);
  border-bottom : 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom : 1rem;
}
/* Password toggle */
.password-field { position: relative; }
.password-toggle {
  position : absolute;
  right    : 10px;
  top      : 50%;
  transform: translateY(-50%);
  background: none;
  border   : none;
  color    : var(--text-muted);
  cursor   : pointer;
  z-index  : 5;
}

/* ── 18. Login Pages ──────────────────────────────────────── */
.login-wrapper {
  min-height     : 100vh;
  display        : flex;
  align-items    : center;
  justify-content: center;
  background     : linear-gradient(135deg,#1565c0 0%,#0e1754 100%);
  padding        : 2rem 1rem;
}
.login-card {
  background   : #fff;
  border-radius: 20px;
  padding      : 2.5rem;
  width        : 100%;
  max-width    : 420px;
  box-shadow   : 0 20px 60px rgba(0,0,0,0.22);
}
[data-theme="dark"] .login-card { background: #1e293b; color: #e2e8f0; }
.login-logo {
  width          : 60px;
  height         : 60px;
  /* background     : var(--primary); */
  border-radius  : 16px;
  display        : flex;
  align-items    : center;
  justify-content: center;
  color          : #fff;
  font-size      : 1.4rem;
  font-weight    : 800;
  margin         : 0 auto 1.5rem;
}
.login-title    { font-size: 1.4rem; font-weight: 700; }
.login-subtitle { font-size: 0.85rem; color: var(--text-muted); }

/* ── 19. Modal Enhancements ───────────────────────────────── */
.modal-header {
  background   : linear-gradient(135deg,#1565c0,#0d47a1);
  color        : #fff;
  border-radius: 12px 12px 0 0;
}
.modal-header .btn-close { filter: invert(1); }
.modal-content {
  border-radius: 12px;
  border       : none;
  box-shadow   : 0 20px 50px rgba(0,0,0,0.2);
}
[data-theme="dark"] .modal-content  { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .modal-body     { background: #1e293b; }
[data-theme="dark"] .modal-footer   { background: #1e293b; border-top-color: #334155; }

/* ── 20. Chart Containers ─────────────────────────────────── */
.chart-container {
  background   : #fff;
  border-radius: 14px;
  box-shadow   : var(--card-shadow);
  padding      : 1.4rem;
}
[data-theme="dark"] .chart-container { background: #1e293b; }
.chart-container canvas { max-height: 280px; }

/* ── 21. Progress Bars ────────────────────────────────────── */
.progress      { border-radius: 50px; height: 8px; }
.progress-bar  { border-radius: 50px; }

/* ── 22. Timeline ─────────────────────────────────────────── */
.timeline             { position: relative; padding-left: 2rem; }
.timeline::before {
  content      : '';
  position     : absolute;
  left         : 0.45rem;
  top          : 0;
  bottom       : 0;
  width        : 2px;
  background   : var(--border);
}
.timeline-item        { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before {
  content      : '';
  position     : absolute;
  left         : -1.62rem;
  top          : 0.3rem;
  width        : 12px;
  height       : 12px;
  border-radius: 50%;
  background   : var(--primary);
  border       : 2px solid #fff;
  box-shadow   : 0 0 0 2px var(--primary);
}

/* ── 23. Back to Top ──────────────────────────────────────── */
#backToTop {
  position     : fixed;
  bottom       : 2rem;
  right        : 2rem;
  width        : 44px;
  height       : 44px;
  background   : var(--primary);
  color        : #fff;
  border       : none;
  border-radius: 12px;
  display      : flex;
  align-items  : center;
  justify-content: center;
  cursor       : pointer;
  opacity      : 0;
  visibility   : hidden;
  transition   : var(--transition);
  z-index      : 999;
  box-shadow   : 0 4px 12px rgba(21,101,192,0.4);
}
#backToTop.visible      { opacity: 1; visibility: visible; }
#backToTop:hover        { background: var(--primary-dark); transform: translateY(-2px); }

/* ── 24. Dark Mode Toggle Button ──────────────────────────── */
.dark-mode-toggle {
  width          : 38px;
  height         : 38px;
  border-radius  : 8px;
  border         : 1px solid var(--border);
  background     : #fff;
  cursor         : pointer;
  display        : flex;
  align-items    : center;
  justify-content: center;
  font-size      : 1rem;
  transition     : var(--transition);
  color          : var(--text-muted);
}
.dark-mode-toggle:hover              { background: var(--bg); color: var(--primary); }
[data-theme="dark"] .dark-mode-toggle { background: #1e293b; border-color: #334155; color: #f8fafc; }

/* ── 25. Notification Badge ───────────────────────────────── */
.notif-badge {
  position     : absolute;
  top          : -4px;
  right        : -4px;
  width        : 16px;
  height       : 16px;
  background   : #dc3545;
  border-radius: 50%;
  font-size    : 0.6rem;
  color        : #fff;
  display      : flex;
  align-items  : center;
  justify-content: center;
  font-weight  : 700;
}

/* ── 26. Utility Helpers ──────────────────────────────────── */
.cursor-pointer   { cursor: pointer; }
.rounded-12       { border-radius: 12px !important; }
.rounded-16       { border-radius: 16px !important; }
.fw-semibold      { font-weight: 600 !important; }
.bg-primary-subtle  { background: rgba(21,101,192,0.1) !important; color: var(--primary); }
.bg-success-subtle  { background: rgba(27,107,48,0.1)  !important; color: var(--success); }
.bg-warning-subtle  { background: rgba(245,158,11,0.12) !important; color: #d97706; }
.bg-danger-subtle   { background: rgba(220,53,69,0.1)   !important; color: #dc3545; }
.bg-purple-subtle   { background: rgba(111,66,193,0.1)  !important; color: #6f42c1; }

/* ── 27. Responsive Adjustments ──────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar               { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .sidebar.sidebar-open  { transform: translateX(0); }
  .sidebar-overlay.show  { display: block; }
  .main-content          { margin-left: 0 !important; overflow-x: hidden; }
  section                { padding: 50px 0; }
}
@media (max-width: 767.98px) {
  .hero-stats     { gap: 1.2rem; }
  .hero-section   { padding: 70px 0 55px; }
  .page-content   { padding: 1rem; }
  .top-navbar     { padding: 0.65rem 1rem; }
}
@media (max-width: 575.98px) {
  .stat-card .stat-value { font-size: 1.5rem; }
  .login-card            { padding: 1.75rem 1.5rem; }
  .stat-card             { padding: 1rem 1.2rem; }
}
