/* ============================================================
   Food Court UNUSIDA — shared styles (customer, kantin, dev)
   Simpel, senada, rapi & nyaman.
   ============================================================ */
:root {
  color-scheme: light dark;
  --brand:       #1B5E3F;
  --brand-dark:  #134430;
  --brand-soft:  #E6F2EC;
  --accent:      #C8962E;
  --accent-soft: #F9EED6;
  --bg:          #F6F3EB;
  --surface:     #FFFFFF;
  --surface-2:   #FAF8F3;
  --text:        #1A211E;
  --muted:       #68736D;
  --line:        #E5E0D3;
  --danger:      #D14343;
  --danger-soft: #FCEAEA;
  --warn:        #9A6A12;
  --warn-soft:   #FEF3DA;
  --info:        #2563A8;
  --info-soft:   #E8F0FA;

  /* Warna teks & elemen senada */
  --brand-ink:   #134430;
  --danger-ink:  #B91C1C;
  --accent-ink:  #7A4B00;
  --cash-ink:    #6E4B0B;  --cash-ink-2: #8A6A1B;  --cash-ink-3: #5A3F0A;
  --brand-line:  #C2DFD0;  --warn-line: #F0DCA8;   --info-line: #C7DDF5;
  --fill:        #E6E3DA;
  --fill-soft:   #EFECE4;
  --switch-off:  #CFCBC0;
  --field:       #FAF8F3;
  --hover:       #EDEAE1;  --hover-ghost: #F1EFE7;  --hover-soft: #D7EBDF;  --hover-danger: #F8D8D8;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow-sm:   0 1px 2px rgba(24,34,29,.05), 0 1px 4px rgba(24,34,29,.04);
  --shadow:      0 4px 14px rgba(24,34,29,.07);
  --shadow-lg:   0 10px 32px rgba(24,34,29,.14);
  --font:        "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display:"Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Dark mode: netral charcoal-slate senada (bukan hijau tua, tidak warna-warni) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --brand:       #228B5D;
    --brand-dark:  #1B704B;
    --bg:          #121417;   /* charcoal netral bersih */
    --surface:     #1A1D21;   /* kartu abu gelap senada */
    --surface-2:   #21252B;   /* permukaan lapis kedua */
    --text:        #ECEFF4;
    --muted:       #949BA6;
    --line:        #2B3038;

    --brand-soft:  rgba(46, 160, 110, 0.16);
    --brand-ink:   #7CE0B3;
    --brand-line:  rgba(46, 160, 110, 0.30);

    --accent-soft: rgba(212, 160, 56, 0.15);
    --accent-ink:  #F0C975;

    --warn-soft:   rgba(212, 160, 56, 0.14);
    --warn:        #F0C975;
    --warn-line:   rgba(212, 160, 56, 0.28);

    --danger-soft: rgba(220, 76, 76, 0.16);
    --danger-ink:  #F59E9E;

    --info-soft:   rgba(74, 144, 226, 0.16);
    --info:        #93C5FD;
    --info-line:   rgba(74, 144, 226, 0.28);

    --cash-ink:    #F2D28B;  --cash-ink-2: #E2BE6F;  --cash-ink-3: #F9E5B4;

    --fill:        #282D35;  --fill-soft:   #22262D;  --switch-off: #434A54;
    --field:       #16191D;
    --hover:       #242930;  --hover-ghost: #22262D;  --hover-soft: rgba(46, 160, 110, 0.24);  --hover-danger: rgba(220, 76, 76, 0.24);

    --shadow-sm:   0 1px 3px rgba(0,0,0,.35);
    --shadow:      0 4px 16px rgba(0,0,0,.42);
    --shadow-lg:   0 12px 36px rgba(0,0,0,.60);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 800; font-style: normal; line-height: 1.25; letter-spacing: -.02em; }
h3, h4 { font-family: var(--font); font-weight: 700; font-style: normal; line-height: 1.3; letter-spacing: -.01em; }
code { font-family: var(--font-mono); font-size: .9em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 26px; height: 26px; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
  transition: background .15s, transform .08s, opacity .15s;
  text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { background: var(--brand-dark); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.sm    { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover-ghost); }
.btn.soft  { background: var(--brand-soft); color: var(--brand-ink); }
.btn.soft:hover  { background: var(--hover-soft); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #B83636; }
.btn.danger-soft { background: var(--danger-soft); color: var(--danger-ink); }
.btn.danger-soft:hover { background: var(--hover-danger); }
.btn.icon   { padding: 0; width: 40px; min-height: 40px; }
.btn.icon.sm { width: 32px; min-height: 32px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Form ---------- */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 68px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.hint { font-size: 12px; color: var(--muted); }
.input-group { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-group > span { padding-left: 12px; color: var(--muted); font-weight: 600; }
.input-group .input { border: 0; box-shadow: none; background: transparent; }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; }

/* ---------- Kartu & lencana ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  background: var(--fill-soft); color: var(--muted);
}
.badge.green { background: var(--brand-soft); color: var(--brand-ink); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red   { background: var(--danger-soft); color: var(--danger-ink); }
.badge.blue  { background: var(--info-soft); color: var(--info); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Status kosong / memuat / error ---------- */
.state { text-align: center; padding: 44px 20px; color: var(--muted); }
.state .ico { width: 38px; height: 38px; margin: 0 auto 10px; opacity: .5; }
.state h3 { color: var(--text); font-size: 15.5px; margin-bottom: 4px; }
.state.error { color: var(--danger-ink); }
.spinner { width: 21px; height: 21px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg,#ECEAE2 25%,#F5F4EE 50%,#ECEAE2 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; display: grid; gap: 7px; width: min(92vw, 400px); pointer-events: none; }
.toast {
  background: #252B28; color: #fff; padding: 11px 15px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; animation: toast-in .22s ease;
}
.toast.error   { background: var(--danger); }
.toast.success { background: var(--brand-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Modal / bottom-sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15,20,18,.5); display: flex; align-items: flex-end; justify-content: center; animation: fade .16s ease; }
.sheet {
  background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); animation: slide-up .2s ease; box-shadow: var(--shadow-lg);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h3 { font-size: 17px; }
.sheet-head p  { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.form-error { color: var(--danger-ink); font-size: 13px; background: var(--danger-soft); padding: 9px 12px; border-radius: 8px; margin-top: 10px; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 20px; }
  .sheet   { border-radius: 18px; }
}
@keyframes fade     { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: .6; } }

/* ---------- Upload gambar ---------- */
.dropzone {
  position: relative; display: grid; place-items: center; text-align: center; gap: 4px;
  min-height: 130px; padding: 14px; border: 2px dashed var(--switch-off); border-radius: var(--radius);
  background: var(--field); color: var(--muted); cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.dropzone:hover  { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input  { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone img    { max-height: 170px; width: auto; margin: 0 auto; border-radius: 8px; }
.dropzone .ico   { width: 28px; height: 28px; }
.dropzone strong { color: var(--text); font-size: 13.5px; }
.dropzone small  { font-size: 12px; }

/* ---------- Placeholder gambar senada ---------- */
.ph { display: grid; place-items: center; background: linear-gradient(135deg, #E8F2EC, #F4EFE3); color: #547A65; }
.ph .ico { width: 26px; height: 26px; opacity: .75; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 9px; white-space: nowrap; position: relative;
}
.tab:hover  { background: var(--hover); }
.tab.active { background: var(--brand-soft); color: var(--brand-ink); }
.tab .count { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; }

/* ---------- Chip filter ---------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 0%, var(--brand-soft) 0, transparent 50%), var(--bg); }
.login-box  { width: 100%; max-width: 368px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 22px; box-shadow: var(--shadow); }
.login-box .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 14px; }
.login-box .logo .ico { width: 24px; height: 24px; }
.login-box h1 { font-size: 21px; }
.login-box > p { color: var(--muted); margin: 4px 0 18px; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 0 50px;
  border-radius: 0 0 26px 26px; overflow: hidden;
  background: radial-gradient(circle at 90% -10%, rgba(200,150,46,.24), transparent 45%),
              linear-gradient(145deg, #134430 0%, #1B5E3F 60%, #246F4B 100%);
}
.hero::after {
  content: ""; position: absolute; right: -55px; top: 36px;
  width: 200px; height: 200px; border-radius: 50%;
  border: 32px solid rgba(255,255,255,.05); pointer-events: none;
}
.hero .hi  { opacity: .85; font-size: 13.5px; margin-top: 10px; }
.hero h1   { font-size: 24px; margin-top: 2px; }
.hero-card {
  position: relative; z-index: 2; margin: -34px 0 0;
  background: var(--surface); border-radius: 20px; padding: 15px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 11px; text-align: center; }
.mini-stats > div {
  padding: 8px 6px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.mini-stats b    { display: block; font-size: 18px; font-weight: 700; color: var(--brand-ink); }
.mini-stats span { font-size: 11px; color: var(--muted); }

/* ---------- Tabbar: bawah di HP, atas di desktop ---------- */
.tabbar {
  position: fixed; z-index: 50; left: 10px; right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: flex; gap: 3px; padding: 5px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
}
.tabbar .tab, .tabbar a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 7px 4px; border: 0; border-radius: 15px;
  background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600;
  text-decoration: none; position: relative; transition: background .13s, color .13s;
  -webkit-tap-highlight-color: transparent;
}
.tabbar .tab.active, .tabbar a.active { background: var(--brand-soft); color: var(--brand-ink); }
.tabbar .tab.active .ico, .tabbar a.active .ico { stroke-width: 2.3; }
.tabbar .count {
  position: absolute; top: 2px; left: calc(50% + 6px); right: auto;
  background: var(--danger); color: #fff; border-radius: 999px;
  min-width: 17px; height: 17px; font-size: 10px; font-style: normal;
  display: grid; place-items: center; padding: 0 4px;
}
body.has-tabbar { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .hero { border-radius: 0 0 32px 32px; }
}

/* ---------- Dark mode: komponen senada ---------- */
@media (prefers-color-scheme: dark) {
  .skeleton { background: linear-gradient(90deg,#1A1D21 25%,#242930 50%,#1A1D21 75%); background-size: 200% 100%; }
  .tabbar { background: rgba(26, 29, 33, .95); border-color: var(--line); }
  .hero {
    background: radial-gradient(circle at 90% -10%, rgba(200,150,46,.18), transparent 45%),
                linear-gradient(145deg, #172A22 0%, #1B4332 60%, #20503C 100%);
  }
  .hero .meja-chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
  .ph { background: linear-gradient(135deg, #1E252B, #252A2E); color: #7CE0B3; }
  .login-wrap { background: radial-gradient(circle at 20% 0%, rgba(46,160,110,.12) 0, transparent 50%), var(--bg); }
  .toast { background: #242930; border: 1px solid rgba(255,255,255,.08); }
  .overlay { background: rgba(0,0,0,.65); }
  .qr-live, .qris-img { background: #fff; }
}


/* ---------- Dekorasi & Polesan Visual Modern ---------- */
body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(27, 94, 63, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(200, 150, 46, 0.06) 0%, transparent 40%),
    radial-gradient(rgba(27, 94, 63, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 22px 22px;
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(circle at 15% 0%, rgba(46, 160, 110, 0.08) 0%, transparent 45%),
      radial-gradient(circle at 85% 10%, rgba(200, 150, 46, 0.05) 0%, transparent 40%),
      radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  }
}

.hero {
  box-shadow: 0 10px 30px rgba(19,68,48,.20);
}
.hero::before {
  content: ""; position: absolute; left: -40px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,150,46,.22), transparent 70%);
  pointer-events: none;
}
.hero-card {
  box-shadow: var(--shadow-lg);
}
.mini-stats { gap: 0; }
.mini-stats > div { background: transparent; border: 0; border-radius: 0; padding: 4px 6px; }
.mini-stats > div + div { border-left: 1px solid var(--line); }
.mini-stats b { font-size: 20px; font-style: normal; }

/* Aksen kapsul vertikal di KIRI judul seksi */
.sec-head h2, .section-title h2 {
  display: inline-flex; align-items: center; gap: 9px;
}
.sec-head h2::before, .section-title h2::before {
  content: "";
  width: 5px; height: 19px; border-radius: 99px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 100%);
  flex: none;
}

/* Kartu statistik rapi dengan gradasi elegan */
.stat {
  border-top: 3px solid var(--brand-line);
}
.stat.money {
  background: linear-gradient(135deg, #134430 0%, #1B5E3F 100%);
  border: 1px solid #134430;
  box-shadow: 0 6px 18px rgba(19, 68, 48, 0.2);
}

.card { transition: box-shadow .2s, border-color .2s, transform .2s; }
.btn { box-shadow: 0 2px 5px rgba(19,68,48,.16), inset 0 1px 0 rgba(255,255,255,.14); letter-spacing: .005em; }
.btn.ghost, .btn.soft, .btn.danger-soft { box-shadow: none; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tabbar { box-shadow: 0 8px 28px rgba(19,68,48,.16); }
.tabbar .tab.active, .tabbar a.active { box-shadow: inset 0 0 0 1px var(--brand-line); }
::selection { background: var(--brand-soft); color: var(--text); }


/* Angka rapi sejajar (tabular-nums) & monospace untuk kode antrian / QR */
.stat .v, .rk-table .n, .price, .total, .pay-amount, .bar-row b, .top-list .q, .queue b { font-variant-numeric: tabular-nums; }
.queue b, .meja code { font-family: var(--font-mono); }

/* Tabbar tetap di bawah pada mobile; desktop dock disesuaikan di panel masing-masing */
.tabbar .count { position: absolute; }
