/* Everly Tea POS — shared styles. Mirrors UChick's Compose look (Ui.kt): dark gradient background,
   gradient cards with a thin accent line, gold-gradient serif titles, red-gradient primary buttons.
   Colours come from CSS variables set by common.js applyTheme() (the 9 UChick themes). */
:root {
  --deepRed: #8b0d0d; --crimson: #d71919; --flame: #f04a20; --amber: #f7931e; --sun: #ffd43b;
  --leaf: #8fb326; --olive: #4e3f0c; --black: #140906; --panel: #26110a; --fg: #fff4e0; --muted: #cdb894;
  --goldLight: #ffe57f; --line: rgba(247,147,30,.25);
  --bgTop: #8b0d0d; --bgUpper: #2e0e07; --bgBottom: #221b07; --cardTop: #2c150b; --cardBottom: #1c0d07;
  --sun16: rgba(255,212,59,.16); --sun35: rgba(255,212,59,.35); --sun60: rgba(255,212,59,.6);
  --gold45: rgba(255,229,127,.45); --flame28: rgba(240,74,32,.28);
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans); color: var(--fg); font-size: 15px; line-height: 1.4;
  background: var(--black) linear-gradient(180deg, var(--bgTop) 0%, var(--bgUpper) 28%, var(--black) 75%, var(--bgBottom) 100%) fixed;
  min-height: 100vh; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--sun); }

/* ---- text styles ---- */
.title {
  font-family: var(--serif); font-weight: 700; margin: 0; line-height: 1.1;
  background: linear-gradient(120deg, var(--goldLight), var(--sun), var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.label { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); }
.money {
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--goldLight), var(--sun), var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section { margin: 18px 0 10px; }
.section .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section .l { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; color: var(--sun); font-weight: 600; }
.section .r { font-size: 11.5px; color: var(--muted); }
.section::after { content: ""; display: block; height: 1px; margin-top: 6px; background: linear-gradient(90deg, var(--sun60), transparent); }

/* ---- surfaces ---- */
.card {
  background: linear-gradient(180deg, var(--cardTop), var(--cardBottom));
  border: 1px solid var(--line); border-radius: var(--r);
}
.pad { padding: 14px; }
.status-box {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--sun16), rgba(0,0,0,0)); border: 1px solid var(--sun35);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--leaf); flex: none; }
.dot.off { background: var(--crimson); }

/* ---- buttons ---- */
.btn {
  border-radius: 10px; padding: 11px 14px; font-weight: 600; font-size: 14.5px; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 1px solid var(--line); color: var(--fg);
  background: linear-gradient(180deg, var(--cardTop), var(--cardBottom));
  min-height: 44px; transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
a.btn, a.icon-btn { text-decoration: none; color: var(--fg); }
.btn.primary { color: #fff; border-color: var(--gold45); background: linear-gradient(135deg, var(--flame), var(--crimson), var(--deepRed)); }
.btn.gold { color: #2a1a00; border-color: var(--gold45); background: linear-gradient(135deg, var(--goldLight), var(--sun), var(--amber)); }
.btn.ghost { background: transparent; }
.btn.ok { color: #10200a; background: linear-gradient(135deg, #c9f08a, var(--leaf)); border-color: rgba(255,255,255,.25); }
.btn.big { min-height: 56px; font-size: 16.5px; }
.btn.block { width: 100%; }
.btn[disabled] { filter: grayscale(.7) brightness(.7); cursor: not-allowed; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; font-size: 18px; flex: none;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: rgba(0,0,0,.18); font-size: 13.5px; font-weight: 600;
}
.chip.on { color: #2a1a00; border-color: transparent; background: linear-gradient(135deg, var(--goldLight), var(--sun), var(--amber)); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.bayar { background: rgba(255,212,59,.18); color: var(--sun); border: 1px solid var(--sun35); }
.badge.proses { background: rgba(240,74,32,.18); color: #ffb199; border: 1px solid rgba(240,74,32,.45); }
.badge.siap { background: rgba(143,179,38,.22); color: #d8f59a; border: 1px solid rgba(143,179,38,.55); }
.badge.selesai { background: rgba(255,255,255,.08); color: var(--muted); border: 1px solid rgba(255,255,255,.15); }
.badge.batal { background: rgba(0,0,0,.3); color: var(--muted); border: 1px solid rgba(255,255,255,.12); text-decoration: line-through; }
.badge.pay { background: rgba(0,0,0,.25); border: 1px solid var(--line); color: var(--fg); }

/* ---- forms ---- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0,0,0,.28); color: var(--fg); min-height: 44px;
}
.input:focus { outline: 2px solid var(--sun60); outline-offset: 1px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.2); }
.seg button { border: 0; border-radius: 9px; padding: 10px 8px; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); min-height: 44px; }
.seg button.on { color: #2a1a00; background: linear-gradient(135deg, var(--goldLight), var(--sun), var(--amber)); }

/* ---- qty stepper ---- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: rgba(0,0,0,.2); font-size: 20px; color: var(--fg); }
.stepper span { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- sheet / dialog ---- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: min(560px, 100%); max-height: 92dvh; overflow: auto; border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, var(--cardTop), var(--black)); border: 1px solid var(--line); border-bottom: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .2s ease;
}
@media (min-width: 720px) { .scrim { align-items: center; } .sheet { border-radius: 18px; border-bottom: 1px solid var(--line); } }
.sheet { position: relative; }
.sheet h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; padding-right: 52px; }
.sheet .close { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,.35); }
@keyframes up { from { transform: translateY(24px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  padding: 11px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px);
  background: linear-gradient(135deg, var(--flame), var(--crimson), var(--deepRed)); color: #fff; border: 1px solid var(--gold45);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: up .2s ease; pointer-events: none;
}

/* ---- photo + sold-out stamp (UChick "HABIS") ---- */
.photo { position: relative; overflow: hidden; background: rgba(0,0,0,.25); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.soldout .photo img, .soldout .tile-body { filter: grayscale(.85) brightness(.55); }
.stamp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  border: 3px solid #ff4d4d; color: #ff4d4d; font-weight: 900; letter-spacing: .12em; padding: 3px 10px;
  border-radius: 6px; font-size: 18px; background: rgba(20,0,0,.35); text-shadow: 0 1px 0 rgba(0,0,0,.5);
}

/* ---- layout helpers ---- */
.wrap { width: min(1100px, 100%); margin: 0 auto; padding: 0 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---- top bar ---- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 0 8px; }
.topbar .title { font-size: 24px; }
.topbar .sub { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 13px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }

/* ---- QR box ---- */
.qrbox { background: #fff; border-radius: 14px; padding: 12px; width: min(300px, 80vw); margin: 0 auto; }
.qrbox svg { display: block; width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Light themes (e.g. Everly Pink): fix colours that assume a dark background ---- */
:root[data-light] { color-scheme: light; }
:root[data-light] .btn.gold, :root[data-light] .chip.on, :root[data-light] .seg button.on { color: #fff; }
:root[data-light] .input, :root[data-light] select.input, :root[data-light] textarea.input { background: #fff; }
:root[data-light] .chip:not(.on) { background: rgba(255,255,255,.7); }
:root[data-light] .seg { background: rgba(255,255,255,.55); }
:root[data-light] .stepper button { background: rgba(35,31,32,.05); }
:root[data-light] .badge.proses { background: rgba(184,80,110,.12); color: #8e3552; border-color: rgba(184,80,110,.4); }
:root[data-light] .badge.siap { background: rgba(78,122,46,.14); color: #2f5a16; border-color: rgba(78,122,46,.45); }
:root[data-light] .badge.selesai, :root[data-light] .badge.batal { background: rgba(35,31,32,.05); border-color: rgba(35,31,32,.15); }
:root[data-light] .badge.pay { background: #fff; }
:root[data-light] .qrbox { box-shadow: 0 0 0 1px var(--line); }
:root[data-light] .card { box-shadow: 0 6px 18px rgba(142,53,82,.08); }
:root[data-light] .photo { background: #f6dde4; }

/* ---- Instagram "Follow us" button ---- */
.btn.ig-btn { color: #fff; border: 1px solid rgba(255,255,255,.35); text-decoration: none; white-space: nowrap;
  background: linear-gradient(45deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%); }
.btn.ig-btn svg { width: 20px; height: 20px; flex: none; }
a.btn.ig-btn { color: #fff; }
.btn.ig-btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 999px; }
.btn.ig-btn.sm svg { width: 17px; height: 17px; }
