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

body {
  font-family: "Noto Sans Thai", sans-serif;
  background: #f8f9fa;
  color: #2c3e50;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

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

/* ถ้าต้องการใส่ภาพพื้นหลัง */
.hero-section.with-bg {
  background-image: url("../images/herobg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Overlay ทับรูปภาพให้มืดลงเพื่อให้ข้อความอ่านง่าย */
.hero-section.with-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.85) 0%,
    rgba(118, 75, 162, 0.85) 100%
  );
  z-index: 0;
}

/* ทำให้เนื้อหาอยู่เหนือ overlay */
.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-icon {
  font-size: 5rem;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 2;
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.hero-text p {
  font-size: 1.25rem;
  opacity: 0.95;
  margin: 0;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.hero-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.hero-badges .badge {
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Stats Cards - Horizontal Style 2 */
.stats-section {
  padding: 2.5rem 0;
  background: #f8f9fa;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.stat-card.primary::before {
  background: #667eea;
}
.stat-card.success::before {
  background: #10b981;
}
.stat-card.warning::before {
  background: #f59e0b;
}
.stat-card.refresh::before {
  background: linear-gradient(180deg, #667eea, #764ba2);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card.primary .stat-icon-wrapper {
  background: linear-gradient(135deg, #667eea20, #667eea10);
}

.stat-card.success .stat-icon-wrapper {
  background: linear-gradient(135deg, #10b98120, #10b98110);
}

.stat-card.warning .stat-icon-wrapper {
  background: linear-gradient(135deg, #f59e0b20, #f59e0b10);
}

.stat-card.refresh .stat-icon-wrapper {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon {
  font-size: 2rem;
}

.stat-card.primary .stat-icon {
  color: #667eea;
}
.stat-card.success .stat-icon {
  color: #10b981;
}
.stat-card.warning .stat-icon {
  color: #f59e0b;
}
.stat-card.refresh .stat-icon {
  color: white;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
}

.stat-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-card.refresh {
  cursor: pointer;
  user-select: none;
}

.stat-card.refresh:active {
  transform: scale(0.98);
}

.stat-card.refresh .stat-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card.refresh .stat-label {
  color: #475569;
  font-weight: 600;
}

/* Table Section */
.table-section {
  padding: 2rem 0;
}

.table-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-datetime {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: #64748b;
}

.table-datetime > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-responsive {
  padding: 0;
}

#studentsTable {
  margin: 0;
  width: 100%;
}

#studentsTable thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 1rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

#studentsTable tbody td {
  padding: 1rem;
  vertical-align: middle;
  font-size: 0.95rem;
  border-bottom: 1px solid #f1f5f9;
}

#studentsTable tbody tr:hover {
  background: #f8fafc;
}

.applicant-no {
  font-weight: 700;
  color: #667eea;
  font-size: 1.1rem;
}

/* Status Badges - Smaller */
.stats-section {
  padding: 20px 0;
  background: transparent;
}

/* ปรับการวาง Grid: 2 คอลัมน์บนจอใหญ่, 1 คอลัมน์บนจอเล็ก */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-horizontal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem;
  display: flex; /* ทำให้ไอคอนกับเนื้อหาขนานกัน */
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: default;
}

.stat-horizontal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* สไตล์ไอคอน */
.stat-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* สไตล์เนื้อหา */
.stat-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
}

.stat-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

.stat-subtext {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

/* สีแต่ละประเภท */
.primary .stat-icon-wrapper {
  background: #eff6ff;
  color: #3b82f6;
}
.success .stat-icon-wrapper {
  background: #f0fdf4;
  color: #22c55e;
}
.warning .stat-icon-wrapper {
  background: #fffbeb;
  color: #f59e0b;
}
.refresh .stat-icon-wrapper {
  background: #f8fafc;
  color: #64748b;
}
.refresh {
  cursor: pointer;
  border-style: dashed;
}

/* สไตล์พื้นฐานของ Badge */
/* สไตล์พื้นฐานของ Badge */
.status-badge {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.status-badge i {
  font-size: 0.6rem;
}

/* 1. รอชำระเงิน (pending_payment) */
.status-pending-payment {
  background-color: #ffeded;
  color: #b91c1c;
  border: 1px solid #ff9696;
}

/* 2. รอตรวจสอบ (pending_verify) */
.status-pending-verify {
  background-color: #fff4d7;
  color: #d49100;
  border: 1px solid #ffdc7b;
}

/* 3. สมัครเสร็จสิ้น (completed) */
.status-completed {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #98c2a7;
}

/* 4. ติดต่อเจ้าหน้าที่ (fb_contact) */
.status-fb-contact {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

/* 5. ยกเลิก (cancel) */
.status-cancel {
  background-color: #fafbfb;
  color: #000000;
  border: 1px solid #bdbdbd;
}

/* ตกแต่งตารางเพิ่มเติม */
.table-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ปรับปรุงสำหรับมือถือ */
@media (max-width: 576px) {
  .stat-horizontal-card {
    padding: 1rem;
    gap: 1rem;
  }
  .stat-icon-wrapper {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  .stat-number {
    font-size: 1.5rem;
  }
}

/* Action Cards - Compact */
.action-section {
  padding: 2rem 0;
}

.action-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  height: 100%;
  transition: all 0.3s ease;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.action-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.action-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.action-card h5 {
  font-size: 1rem;
  color: #667eea;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.btn-action {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 0.75rem;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.btn-action-outline {
  background: white;
  border: 2px solid #667eea;
  color: #667eea;
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-action-outline:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Empty State */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state i {
  font-size: 4rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.empty-state h4 {
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #94a3b8;
}

/* DataTables Custom Styling */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  padding: 1rem 1.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 1rem 1.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }

  .hero-icon {
    font-size: 4rem;
  }

  .hero-text h1 {
    font-size: 1.75rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-icon-wrapper {
    width: 56px;
    height: 56px;
  }

  .stat-icon {
    font-size: 1.5rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-datetime {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .action-card {
    margin-bottom: 1rem;
  }
}
