/* HUAY RUAY 88 — Admin Dashboard styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
  background: #0a0604; color: #fff7e3;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
a { color: #e7b84b; text-decoration: none; }
a:hover { color: #fff4d0; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 768px) { .app { grid-template-columns: 1fr; } }

/* Sidebar */
.sidebar {
  background: #0f0805; border-right: 1px solid #2a1f10;
  padding: 24px 16px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 24px;
  border-bottom: 1px solid #2a1f10; padding-bottom: 16px;
}
.sidebar .brand .orb {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #e7b84b, #b8860b);
  display: grid; place-items: center; font-weight: bold; color: #0a0604;
}
.sidebar .brand .name { font-weight: bold; font-size: 18px; color: #fff4d0; }
.sidebar .brand .sub { font-size: 11px; color: #b59f76; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  padding: 10px 14px; border-radius: 8px; color: #b59f76;
  display: flex; align-items: center; gap: 10px; font-size: 14px;
  transition: all 0.15s;
}
.sidebar nav a:hover { background: #1a0f08; color: #fff4d0; }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(231,184,75,0.15), transparent);
  color: #e7b84b; border-left: 3px solid #e7b84b; padding-left: 11px;
}
.sidebar .user-card {
  margin-top: auto; padding: 14px; border-radius: 10px;
  background: #1a0f08; font-size: 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .user-card .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e7b84b; color: #0a0604; display: grid;
  place-items: center; font-weight: bold;
}

/* Main content */
.main { padding: 24px 32px; min-width: 0; }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #2a1f10;
}
.page-header h1 { font-size: 24px; color: #fff4d0; }
.page-header .sub { color: #b59f76; font-size: 13px; margin-top: 4px; }

/* Cards / KPIs */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.kpi {
  background: #1a0f08; border: 1px solid #2a1f10; border-radius: 12px;
  padding: 18px 20px;
}
.kpi .label { font-size: 12px; color: #b59f76; margin-bottom: 6px; }
.kpi .value { font-size: 24px; font-weight: bold; color: #fff4d0; }
.kpi .sub { font-size: 11px; color: #7a6a4e; margin-top: 4px; }

/* Tables */
.card {
  background: #1a0f08; border: 1px solid #2a1f10; border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.card-title {
  font-size: 16px; font-weight: bold; color: #fff4d0; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  background: #0f0805; color: #b59f76; font-weight: 600;
  padding: 10px 12px; text-align: left; border-bottom: 1px solid #2a1f10;
}
.tbl td {
  padding: 12px; border-bottom: 1px solid #1f1408; color: #d0c39a;
}
.tbl tr:hover td { background: #221608; }
.tbl .empty { text-align: center; padding: 40px; color: #7a6a4e; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  border: none; cursor: pointer; font-weight: 600;
  transition: all 0.15s; font-family: inherit;
}
.btn-primary { background: #e7b84b; color: #0a0604; }
.btn-primary:hover { background: #f0c761; }
.btn-success { background: #06C755; color: #fff; }
.btn-success:hover { background: #05a847; }
.btn-danger { background: #E5374B; color: #fff; }
.btn-danger:hover { background: #c5273b; }
.btn-secondary { background: #2a1f10; color: #fff4d0; }
.btn-secondary:hover { background: #3a2a16; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: bold;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-approved { background: #DCFCE7; color: #14532D; }
.badge-rejected { background: #FECACA; color: #7F1D1D; }
.badge-info { background: rgba(29, 161, 242, 0.2); color: #1da1f2; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; color: #b59f76; margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: #0f0805; color: #fff4d0; border: 1px solid #2a1f10;
  font-size: 14px; font-family: inherit;
}
.form-input:focus { outline: none; border-color: #e7b84b; }

/* Login page */
.login-page {
  display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(circle at top, #1a0f08, #0a0604);
}
.login-card {
  background: #1a0f08; border: 1px solid #2a1f10;
  border-radius: 16px; padding: 40px; max-width: 380px; width: 90%;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo {
  width: 80px; height: 80px; margin: 0 auto 20px;
  border-radius: 20px; background: linear-gradient(135deg, #e7b84b, #b8860b);
  display: grid; place-items: center; font-size: 36px; font-weight: bold;
  color: #0a0604;
}

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  background: #1a0f08; border: 1px solid #2a1f10; border-radius: 10px;
  padding: 14px 18px; max-width: 340px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: none; animation: slideIn 0.3s ease-out;
}
.toast.show { display: block; }
.toast.success { border-left: 4px solid #06C755; }
.toast.error { border-left: 4px solid #E5374B; }
@keyframes slideIn { from { transform: translateX(400px); } to { transform: translateX(0); } }

/* Utility */
.muted { color: #7a6a4e; }
.text-success { color: #06C755; }
.text-danger { color: #E5374B; }
.text-warning { color: #f59e0b; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.spinner {
  width: 32px; height: 32px; margin: 24px auto;
  border: 3px solid #2a1f10; border-top-color: #e7b84b;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
