/* Impress Coffee — โทเคนแบรนด์ (ใช้ร่วมกันทุกหน้า) */
:root {
  --ink: #1D1D1F;
  --ground: #F6F3EF;
  --surface: #FFFFFF;
  --accent: #C8541F;
  --accent-soft: #F7E3D8;
  --accent-deep: #8C3A16;
  --teal: #9FDDE0;
  --teal-soft: #E2F3F4;
  --teal-deep: #0E5F63;
  --red: #B3202A;
  --muted: #6B625C;
  --body2: #4A433E;
  --border: #ECE5DE;
  --border-strong: #D8D0C8;
  --line: #04893F;
  --ok: #2F6B3A;
  --ok-soft: #E3F3E9;
  --danger: #A3231C;
  --danger-soft: #FBE9E7;
  --warn: #8A5A00;
  --warn-soft: #FFF3D6;
  --font: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  --display: 'Bai Jamjuree', 'IBM Plex Sans Thai', sans-serif;
  --r-card: 20px;
  --r-ctl: 14px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font-size: 16px; font-weight: 600; text-decoration: none; }
.btn.lg { height: 56px; font-size: 17px; }
.btn.sm { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border-strong); }
.btn.light { background: #EFEAE5; color: var(--ink); }
.btn.white { background: #fff; color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); border: 1.5px solid var(--border-strong); }
.btn.line { background: var(--line); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 600; }
.input, select.input, textarea.input { height: 48px; border: 1.5px solid var(--border-strong); border-radius: var(--r-ctl); background: #fff; padding: 0 14px; outline: none; width: 100%; min-width: 0; }
textarea.input { height: auto; padding: 10px 14px; }
.input:focus { border-color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #EFEAE5; color: var(--body2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: #035E2B; }
.chip.teal { background: var(--teal-soft); color: var(--teal-deep); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--accent-soft); color: var(--accent-deep); }
.chip.dark { background: var(--ink); color: #fff; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; width: min(440px, calc(100% - 32px)); padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 15px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 100; }
.toast.error { background: var(--danger); }
.toast button { width: 36px; height: 36px; margin: -8px -8px -8px 0; border: 0; background: transparent; color: #fff; font-size: 20px; }

.overlay { position: fixed; inset: 0; background: rgba(20,18,17,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 90; }
@media (min-width: 640px) { .overlay { align-items: center; } }
.sheet { background: #fff; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .sheet { border-radius: 24px; } }
.sheet h3 { font-size: 22px; margin-bottom: 8px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 13px; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
