* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Kanit", "Sarabun Sans Pro", "Prompt", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ป้องกัน watermark หรือ text ที่ไม่ต้องการ */
body::before,
body::after {
  display: none !important;
  content: none !important;
}

body > .container,
body > .admin-container {
  padding: 20px;
}

.container {
  max-width: 700px;
  margin: 40px auto;
  background: #ffffff;
  padding: 48px;
  border-radius: 32px;
  box-shadow: 0 25px 80px rgba(102, 126, 234, 0.25), 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  border-radius: 32px 32px 0 0;
}

h1 {
  margin-top: 0;
  color: #1e293b;
  font-size: 36px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

h2 {
  margin-top: 0;
  color: #1e293b;
  font-size: 22px;
  font-weight: 600;
}

p {
  color: #475569;
  line-height: 1.6;
  margin: 12px 0;
}

ol {
  padding-left: 24px;
  color: #475569;
  line-height: 1.8;
}

ol li {
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.card {
  margin-top: 24px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.card h2 {
  color: #ffffff;
  margin-bottom: 16px;
  font-size: 20px;
}

.card-info {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.card-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-info-row:last-child {
  border-bottom: none;
}

.card-info-label {
  font-weight: 600;
  opacity: 0.9;
  font-size: 14px;
}

.card-info-value {
  font-weight: 700;
  font-size: 16px;
  text-align: right;
}

.warn {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 24px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 2px solid #667eea;
}

.link-back:hover {
  background: #667eea;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.hint {
  margin-top: 24px;
  padding: 16px;
  font-size: 14px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

code {
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Consolas", monospace;
  font-size: 13px;
  color: #1e293b;
}

/* Table Styles */
.table-container {
  margin-top: 24px;
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 15px;
}

table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s ease;
}

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

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

table td {
  padding: 16px 20px;
  color: #475569;
}

table td:first-child {
  font-weight: 700;
  color: #1e293b;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", "Consolas", monospace;
}

table tbody tr:nth-child(even) {
  background: #f8fafc;
}

table tbody tr:nth-child(even):hover {
  background: #f1f5f9;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  text-align: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0;
}

.stat-card-label {
  font-size: 14px;
  opacity: 0.9;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Navigation Bar */
.main-nav {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: 0;
  padding: 0;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
}

/* ป้องกันไม่ให้มี text หรือ watermark ปรากฏ */
.main-nav::before,
.main-nav::after {
  display: none !important;
  content: none !important;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 16px;
  transition: transform 0.3s ease;
}

.nav-logo-link:hover {
  transform: translateY(-1px);
}

.nav-logo {
  height: 75px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15));
  opacity: 1;
  transition: transform 0.3s ease;
}

.nav-logo-link:hover .nav-logo {
  transform: scale(1.05);
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-title-main {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.15));
}

.nav-title-sub {
  color: #f97316;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.nav-divider {
  height: 3px;
  background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
  width: 100%;
  margin: 0;
}

.nav-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #1e293b;
  transform: translateY(-1px);
}

.nav-link:active {
  background: #e2e8f0;
  transform: translateY(0);
}

.nav-link-admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-link-admin:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
  color: #ffffff !important;
}

/* Responsive Navigation */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 14px;
    padding: 14px 20px;
  }
  
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }
  
  .nav-link {
    font-size: 14px;
    padding: 8px 14px;
    flex: 1;
    min-width: fit-content;
    text-align: center;
  }
  
  .nav-title-main {
    font-size: 20px;
    filter: drop-shadow(0 2px 3px rgba(59, 130, 246, 0.15));
  }
  
  .nav-logo {
    height: 65px;
  }
  
  .nav-title-sub {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 12px 16px;
    gap: 12px;
  }
  
  .nav-menu {
    gap: 4px;
  }
  
  .nav-link {
    font-size: 13px;
    padding: 7px 12px;
  }
  
  .nav-title-main {
    font-size: 18px;
    filter: drop-shadow(0 1px 2px rgba(59, 130, 246, 0.15));
  }
  
  .nav-logo {
    height: 60px;
  }
  
  .nav-logo-link {
    gap: 10px;
  }
  
  .nav-title-sub {
    font-size: 12px;
  }
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 24px;
    border-radius: 16px;
    margin: 20px auto;
  }
  
  h1 {
    font-size: 24px;
  }
  
  table {
    font-size: 14px;
  }
  
  table th,
  table td {
    padding: 12px 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ป้องกันไม่ให้มี watermark หรือ text ที่ไม่ต้องการ */
html::before,
html::after,
*::before:not(.container::before):not(.nav-divider),
*::after:not(.container::after) {
  content: none !important;
}

/* ป้องกัน background images ที่ไม่ต้องการ */
body {
  background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}