/* ============================================================
   App styles (สไตล์ส่วนตัวเพิ่มเติมจาก Tailwind)
   ============================================================ */

* { -webkit-tap-highlight-color: transparent; }

body { -webkit-font-smoothing: antialiased; }

/* Scrollbar สวยๆ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; background-clip: content-box; }

/* Card */
.card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card-pad { padding: 1.25rem; }

/* Stat card */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 90px; height: 90px;
  border-radius: 9999px;
  background: var(--primary-soft);
  z-index: 0;
}
.stat-card > * { position: relative; z-index: 1; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .55rem; border-radius: 9999px;
  font-size: .72rem; font-weight: 600;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-auto     { background: #dbeafe; color: #1e40af; }
.badge-info     { background: var(--primary-soft); color: var(--primary); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: .9rem; border: 1px solid #e5e7eb; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th {
  background: #f9fafb; text-align: left; padding: .7rem .9rem;
  font-weight: 600; color: #6b7280; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;
}
table.tbl td { padding: .8rem .9rem; border-top: 1px solid #f1f5f9; vertical-align: middle; }
table.tbl tbody tr:hover { background: #fafbfc; }

/* Button base */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: .7rem;
  font-size: .875rem; font-weight: 500;
  transition: all .15s; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(.95); }
.btn-ghost { background: #fff; color: #374151; border-color: #e5e7eb; }
.btn-ghost:hover { background: #f9fafb; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* Form input */
.input, .select, .textarea {
  width: 100%; padding: .55rem .8rem; border-radius: .7rem;
  border: 1px solid #d1d5db; background: #fff; font-size: .9rem;
  transition: all .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
label.lbl { display: block; font-size: .82rem; font-weight: 500; color: #374151; margin-bottom: .3rem; }

/* Empty state */
.empty {
  text-align: center; padding: 3rem 1rem; color: #9ca3af;
}
.empty .material-icons-round { font-size: 56px; color: #d1d5db; }

/* Section title */
.section-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.05rem; font-weight: 600; color: #111827; margin-bottom: 1rem;
}

/* Progress bar */
.progress { height: 8px; background: #f1f5f9; border-radius: 9999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 9999px; transition: width .4s; }

/* SweetAlert override ให้เข้ากับ font */
.swal2-popup { font-family: 'Prompt', sans-serif !important; border-radius: 1rem !important; }

/* Mobile sidebar */
@media (max-width: 1023px) {
  #sidebar.open { transform: translateX(0); }
  #sidebarOverlay.show { display: block; }
}
