/* =============================================
   Smart-Bus-Guard — Unified Blue Theme
   Colors: #007bff (Primary), #e3f2fd (Light)
   ============================================= */

/* ===== CSS Variables ===== */
:root {
  --primary: #007bff;
  --primary-light: #e3f2fd;
  --primary-dark: #0056b3;
  --primary-gradient: linear-gradient(135deg, #007bff 0%, #0056b3 100%);

  --bg: #f0f4f8;
  --bg-white: #ffffff;
  --card-bg: #ffffff;
  --border: #dee8f1;
  --border-light: #e8eff7;

  --text-main: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-white: #ffffff;

  --success: #10b981;
  --success-bg: #d1fae5;
  --success-light: #ecfdf5;

  --grey: #6b7280;
  --grey-bg: #e5e7eb;
  --grey-light: #f3f4f6;

  --danger: #ef4444;
  --danger-bg: #fee2e2;

  --warning: #f59e0b;
  --warning-bg: #fef3c7;

  --absent: #ef4444;
  --absent-bg: #fee2e2;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
  --shadow-blue: 0 4px 14px rgba(0, 123, 255, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* ===== Layout ===== */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  background: var(--primary-gradient);
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  box-shadow: 0 2px 16px rgba(0, 123, 255, 0.25);
}

.navbar-brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

/* Nav Links */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links li a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.nav-links li a.active {
  color: var(--primary);
  background: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav-links li a .nav-icon {
  font-size: 1.1rem;
}

/* Hamburger Menu (Mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 2.5px;
  background: #ffffff;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(4px);
}
.nav-overlay.active { display: block; }

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-white);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 1.5rem 2rem;
    gap: 0.25rem;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li a {
    color: var(--text-main);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .nav-links li a:hover {
    background: var(--primary-light);
    color: var(--primary);
  }

  .nav-links li a.active {
    background: var(--primary-light);
    color: var(--primary);
  }
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: var(--transition);
}

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

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* =============================================
   STAT CARDS (Dashboard Summary)
   ============================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .stat-info h4 {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 2px;
}

.stat-card .stat-info .stat-number {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Stat card color variants */
.stat-card.total .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.total .stat-number { color: var(--primary); }
.stat-card.total::before { background: var(--primary-gradient); }

.stat-card.on-bus .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card.on-bus .stat-number { color: var(--success); }
.stat-card.on-bus::before { background: linear-gradient(90deg, #10b981, #34d399); }

.stat-card.off-bus .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card.off-bus .stat-number { color: var(--warning); }
.stat-card.off-bus::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-card.absent .stat-icon { background: var(--absent-bg); color: var(--absent); }
.stat-card.absent .stat-number { color: var(--absent); }
.stat-card.absent::before { background: linear-gradient(90deg, #ef4444, #f87171); }

/* =============================================
   DASHBOARD — Layout
   ============================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Camera / Last Scan Section */
.camera-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0a0a0a;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

/* Recent Scans List */
.recent-scan-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scan-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.scan-item:last-child {
  border-bottom: none;
}

.scan-item:hover {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding-left: 1rem;
}

.scan-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.scan-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  border: 2px solid var(--primary-light);
}

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

.scan-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.scan-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.scan-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* =============================================
   STATUS BADGES / PILLS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.on-bus,
.badge.bg-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge.off-bus,
.badge.bg-secondary {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge.absent {
  background: var(--absent-bg);
  color: var(--absent);
}

/* Pulse dot animation for On Bus */
.badge.on-bus::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* =============================================
   STUDENTS TABLE (students.php)
   ============================================= */
.search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 3rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

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

/* Table Wrapper */
.table-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrapper thead th {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-wrapper tbody td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  vertical-align: middle;
}

.table-wrapper tbody tr {
  transition: var(--transition);
}

.table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

.table-wrapper tbody tr:hover {
  background: #f8fbff;
}

/* Row status highlighting */
.table-wrapper tbody tr.row-on-bus {
  background: #ecfdf5;
}
.table-wrapper tbody tr.row-on-bus:hover {
  background: #d1fae5;
}

.table-wrapper tbody tr.row-off-bus {
  background: #fffbeb;
}
.table-wrapper tbody tr.row-off-bus:hover {
  background: #fef3c7;
}

.table-wrapper tbody tr.row-absent {
  background: #fef2f2;
}
.table-wrapper tbody tr.row-absent:hover {
  background: #fee2e2;
}

/* Student cell with avatar */
.student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-cell img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
  border: 2px solid var(--border);
}

.student-cell .avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  flex-shrink: 0;
}

.student-cell span {
  font-weight: 500;
}

/* Mobile table cards */
@media (max-width: 768px) {
  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody tr {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    gap: 0.5rem;
    align-items: center;
  }

  .table-wrapper tbody td {
    padding: 0;
    border: none;
    font-size: 0.85rem;
  }

  .table-wrapper tbody td:nth-child(1) { /* # */
    display: none;
  }

  .table-wrapper tbody td:nth-child(2) { /* Name */
    flex: 1;
    min-width: 0;
  }

  .table-wrapper tbody td:nth-child(3) { /* Student ID */
    font-size: 0.78rem;
    color: var(--text-muted);
    width: 100%;
    order: 5;
  }

  .table-wrapper tbody td:nth-child(4) { /* Grade/Class */
    font-size: 0.78rem;
    color: var(--text-muted);
    width: 50%;
    order: 6;
  }

  .table-wrapper tbody td:nth-child(5) { /* Status */
    order: 3;
    margin-left: auto;
  }

  .table-wrapper tbody td:nth-child(6) { /* Last Seen */
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 50%;
    order: 7;
    text-align: right;
  }
}

/* =============================================
   CLASS CARDS (classes.php)
   ============================================= */
.grade-section {
  margin-bottom: 2.5rem;
}

.grade-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.grade-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.grade-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.grade-header .grade-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* Class Cards Grid */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.class-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.5s ease forwards;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: height 0.3s ease;
}

.class-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.class-card:hover::before {
  height: 6px;
}

.class-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.class-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.class-card-total {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-muted);
}

/* Status Bar inside class card */
.status-bar-wrap {
  margin-bottom: 0.75rem;
}

.status-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}

.status-bar-fill {
  height: 100%;
  transition: width 0.6s ease;
}

.bar-on-bus { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-off-bus { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-absent { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Status Detail row inside class card */
.status-detail {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-on-bus { background: var(--success); }
.dot-off-bus { background: var(--warning); }
.dot-absent { background: var(--absent); }

.status-item strong {
  color: var(--text-main);
}

/* Grade Color Themes */
.grade-1 .grade-icon { background: linear-gradient(135deg, #007bff, #3395ff); }
.grade-1 .class-card::before { background: linear-gradient(90deg, #007bff, #3395ff); }

.grade-2 .grade-icon { background: linear-gradient(135deg, #0056b3, #007bff); }
.grade-2 .class-card::before { background: linear-gradient(90deg, #0056b3, #007bff); }

.grade-3 .grade-icon { background: linear-gradient(135deg, #0dcaf0, #20c9dc); }
.grade-3 .class-card::before { background: linear-gradient(90deg, #0dcaf0, #20c9dc); }

.grade-4 .grade-icon { background: linear-gradient(135deg, #6610f2, #8540f5); }
.grade-4 .class-card::before { background: linear-gradient(90deg, #6610f2, #8540f5); }

.grade-5 .grade-icon { background: linear-gradient(135deg, #6f42c1, #8b5cf6); }
.grade-5 .class-card::before { background: linear-gradient(90deg, #6f42c1, #8b5cf6); }

.grade-6 .grade-icon { background: linear-gradient(135deg, #d63384, #e85dad); }
.grade-6 .class-card::before { background: linear-gradient(90deg, #d63384, #e85dad); }

/* =============================================
   CLASS DETAIL PAGE
   ============================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.back-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.class-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.class-title-row h1 {
  margin: 0;
  font-size: 1.6rem;
}

.badge-grade {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}

/* Mini Stats Row */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.mini-stat {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
}

.mini-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mini-stat h4 {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.mini-stat .val {
  font-size: 1.75rem;
  font-weight: 700;
}

.val.total { color: var(--primary); }
.val.on-bus { color: var(--success); }
.val.off-bus { color: var(--warning); }
.val.absent { color: var(--absent); }

/* Student List Items */
.student-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  transition: var(--transition);
  animation: fadeSlideUp 0.35s ease forwards;
}

.student-list-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.student-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.student-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.student-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.student-name-id h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 2px 0;
}

.student-name-id p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.student-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.last-seen {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  min-width: 80px;
}

/* Status Pills (For class detail) */
.status-pill {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.pill-on-bus { background: var(--success-bg); color: var(--success); }
.pill-off-bus { background: var(--warning-bg); color: var(--warning); }
.pill-absent { background: var(--absent-bg); color: var(--absent); }
.pill-unknown { background: #e2e8f0; color: #64748b; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 1.25rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-blue);
  transform: translateY(-1px);
}

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

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

/* =============================================
   SKELETON LOADING
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, #e8eff7 25%, #dde6f0 50%, #e8eff7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 140px;
  border-radius: var(--radius-lg);
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes countUp {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-in {
  animation: fadeSlideUp 0.5s ease forwards;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer a {
  color: var(--primary);
  font-weight: 500;
}

.footer-researchers {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.footer-sep {
  margin: 0 6px;
  color: var(--text-muted);
}

.footer-contact {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 600px) {
  .footer-researchers {
    font-size: 0.72rem;
  }
  .footer-sep {
    display: none;
  }
}

/* =============================================
   RESPONSIVE UTILITIES
   ============================================= */
@media (max-width: 600px) {
  .container {
    width: 95%;
    padding: 1.25rem 0;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-card .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .stat-card .stat-info .stat-number {
    font-size: 1.5rem;
  }

  .class-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .class-card {
    padding: 1rem;
  }

  .status-detail {
    flex-direction: column;
    gap: 3px;
  }

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

  .student-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .student-right {
    width: 100%;
    justify-content: space-between;
  }

  .mini-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection color */
::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}