@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --teal-950: #07292b;
  --teal-900: #0a383a;
  --teal-800: #0e4d4f;
  --teal-700: #156769;
  --mint-300: #7ee2c6;
  --mint-100: #dffaf1;
  --lime-400: #b7f15a;
  --lime-500: #a3e43e;
  --bg-page: #f4f8f7;
  --surface: #ffffff;
  --border: #dce8e6;
  --text-main: #0f2425;
  --text-muted: #556d6e;
  --emerald: #059669;
  --amber: #d97706;
  --rose: #dc2626;
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.hidden {
  display: none !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--teal-950) 0%, var(--teal-800) 100%);
  border-bottom: 1px solid rgba(126, 226, 198, 0.22);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--lime-400);
  color: var(--teal-950);
  font-weight: 800;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(183, 241, 90, 0.28);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand-sub-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--mint-300);
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.15rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-lime {
  background: var(--lime-400);
  color: var(--teal-950);
  box-shadow: 0 6px 18px rgba(183, 241, 90, 0.3);
}

.btn-lime:hover:not(:disabled) {
  background: var(--lime-500);
  transform: translateY(-1px);
}

.btn-teal {
  background: var(--teal-800);
  color: #ffffff;
}

.btn-teal:hover:not(:disabled) {
  background: var(--teal-700);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-outline {
  background: #ffffff;
  color: var(--teal-800);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--teal-700);
  background: #f0f9f7;
}

.btn-danger {
  background: #fef2f2;
  color: var(--rose);
  border-color: #fecaca;
}

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
}

/* Hero / Cards */
.hero-banner {
  background: radial-gradient(circle at top right, rgba(126, 226, 198, 0.22), transparent 52%),
              linear-gradient(140deg, var(--teal-950) 0%, var(--teal-800) 100%);
  color: #ffffff;
  padding: 3.2rem 0;
  border-bottom: 1px solid rgba(126, 226, 198, 0.2);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(126, 226, 198, 0.16);
  color: var(--mint-300);
  border: 1px solid rgba(126, 226, 198, 0.3);
  margin-bottom: 0.85rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 28px rgba(10, 56, 58, 0.05);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.15rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.25rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 1rem 1.1rem;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--teal-900);
  margin-top: 0.2rem;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Forms */
.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--teal-900);
  margin: 0.75rem 0 0.35rem;
}

.field-input, .field-select {
  width: 100%;
  padding: 0.68rem 0.88rem;
  border-radius: 11px;
  border: 1px solid #cbdcd9;
  font-size: 0.92rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--text-main);
}

.field-input:focus, .field-select:focus {
  outline: none;
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px rgba(14, 77, 79, 0.12);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-ok {
  background: #dcfce7;
  color: #166534;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-product {
  background: var(--mint-100);
  color: var(--teal-800);
}

/* Checkout Layout */
.checkout-wrap {
  max-width: 660px;
  margin: 2rem auto 3.5rem;
}

.method-tabs {
  display: flex;
  gap: 0.5rem;
  background: #eaf2f0;
  padding: 0.35rem;
  border-radius: 13px;
  margin: 1.15rem 0;
}

.method-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.method-tab.active {
  background: #ffffff;
  color: var(--teal-900);
  box-shadow: 0 3px 10px rgba(10, 56, 58, 0.08);
}

.qr-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fbfb;
  border: 1px dashed #9fc5c0;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.qr-frame img {
  width: 230px;
  height: 230px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.alert-box {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.85rem;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Admin Orders */
.order-row-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fbfdfd;
  align-items: center;
}

.slip-thumb {
  width: 68px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 41, 43, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 90;
}

.modal-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.25rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.modal-box img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .order-row-card {
    grid-template-columns: 1fr;
  }
}
