:root {
  --bg: #fff8ed;
  --surface: #ffffff;
  --ink: #1d1b18;
  --muted: #756f67;
  --line: #eadfce;
  --brand: #dc5b2b;
  --brand-2: #7a2f15;
  --green: #168a45;
  --green-soft: #e7f7ed;
  --amber: #d88c00;
  --shadow: 0 14px 34px rgba(64, 45, 25, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
body.cart-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -.02em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--brand); color: white; font-size: 22px; box-shadow: var(--shadow); }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pill { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 9px 13px; font-size: 13px; font-weight: 800; }

.layout { padding: 22px; max-width: 1440px; margin: 0 auto; }
.customer-layout { padding-right: 72px; }
.hero { padding: 24px; border-radius: 28px; background: linear-gradient(135deg, #2a120a, #6f2b13); color: white; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: '◌'; position: absolute; right: 18px; top: -36px; font-size: 180px; opacity: .08; }
.hero h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 52px); line-height: .98; letter-spacing: -.05em; }
.hero p { margin: 0; color: #f7d5c8; max-width: 720px; }
.category-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.category-btn { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 9px 14px; font-weight: 800; color: var(--muted); }
.category-btn.active { background: var(--ink); color: white; border-color: var(--ink); }
/* Kategori Utama (opsional, di atas sub-kategori) -- disembunyikan lewat
   [hidden] kalau belum ada barang yang dikelompokkan. */
.category-group-row { margin-bottom: 8px; }
.category-group-btn { border-color: var(--brand); color: var(--brand); }
.category-group-btn.active { background: var(--brand); color: white; border-color: var(--brand); }
.menu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.menu-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 12px; min-height: 174px; box-shadow: 0 7px 18px rgba(64,45,25,.06); display: flex; flex-direction: column; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.menu-card.selected { border-color: rgba(220,91,43,.55); box-shadow: 0 9px 22px rgba(220,91,43,.11); }
.menu-card-top { position: relative; margin-bottom: 10px; }
.menu-emoji { font-size: 34px; }
.selected-badge { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; min-width: 34px; height: 28px; justify-content: center; border-radius: 999px; background: #fff0e8; color: var(--brand-2); font-size: 12px; font-weight: 900; padding: 0 9px; box-shadow: 0 3px 8px rgba(64,45,25,.18); }
.menu-card h3 { margin: 0 0 3px; font-size: 15px; line-height: 1.25; }
.menu-card .category { display: inline-block; font-size: 11px; font-weight: 800; color: var(--brand-2); background: #fff1df; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; margin-bottom: 6px; }
.menu-card .bottom { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-weight: 900; color: var(--brand-2); }
.add-btn { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--brand); color: white; font-size: 22px; font-weight: 900; }
.menu-stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: #fffaf4; padding: 3px; }
.menu-stepper-btn { width: 34px; height: 34px; border: 0; border-radius: 10px; background: white; color: var(--ink); font-size: 19px; font-weight: 900; }
.menu-stepper-plus { background: var(--brand); color: white; }
.menu-stepper-qty { min-width: 22px; text-align: center; font-size: 13px; font-weight: 1000; }

.menu-photo-btn { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 14px; }
.menu-photo-btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.photo-modal-backdrop { position: fixed; z-index: 90; inset: 0; background: rgba(29,27,24,.55); display: grid; place-items: center; padding: 18px; }
.photo-modal-card { position: relative; width: min(420px, 100%); max-height: min(86vh, 640px); overflow: auto; background: white; border-radius: 24px; box-shadow: 0 28px 70px rgba(0,0,0,.28); }
.photo-modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; background: rgba(255,255,255,.92); }
.photo-modal-img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #fff1df; border-radius: 24px 24px 0 0; }
.photo-modal-info { padding: 16px 18px 20px; }
.photo-modal-info h3 { margin: 4px 0 6px; font-size: 19px; line-height: 1.25; }
.photo-modal-info .price { font-size: 18px; }

.cart-handle {
  position: fixed; z-index: 66; right: 0; top: 47%; transform: translateY(-50%);
  width: 54px; height: 68px; border: 1px solid #d8c7b2; border-right: 0; border-radius: 18px 0 0 18px;
  background: rgba(255,255,255,.96); box-shadow: -8px 10px 24px rgba(64,45,25,.12);
  display: grid; place-items: center; transition: transform .2s ease, opacity .18s ease, background .18s ease;
}
.cart-handle.has-items { background: var(--brand); border-color: var(--brand); color: white; }
.cart-handle.drawer-open { opacity: 0; pointer-events: none; transform: translate(12px,-50%); }
.cart-handle-icon { font-size: 23px; line-height: 1; }
.cart-handle-count {
  position: absolute; top: -8px; left: -8px; min-width: 25px; height: 25px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: white;
  border: 2px solid white; font-size: 11px; font-weight: 1000;
}
.cart-handle.bump { animation: cartBump .4s ease; }

.cart-backdrop {
  position: fixed; z-index: 54; inset: 0; background: rgba(29,27,24,.28); opacity: 0; pointer-events: none;
  transition: opacity .22s ease; backdrop-filter: blur(2px);
}
.cart-backdrop.open { opacity: 1; pointer-events: auto; }

.cart-panel {
  background: white; border: 1px solid var(--line); padding: 18px; box-shadow: var(--shadow); overflow: auto;
}
.cart-drawer {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, calc(100vw - 54px)); max-height: none;
  border-radius: 28px 0 0 28px; transform: translateX(105%); transition: transform .24s cubic-bezier(.2,.8,.2,1);
  overscroll-behavior: contain; padding: 22px 20px 26px;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 8px; }
.cart-drawer h2 { margin: 1px 0 0; font-size: 24px; }
.cart-kicker { color: var(--brand); font-size: 11px; font-weight: 1000; text-transform: uppercase; letter-spacing: .08em; }
.cart-close-btn { width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line); background: #fffaf4; font-size: 24px; line-height: 1; font-weight: 700; }
.checkout-note { color: var(--muted); font-size: 11px; line-height: 1.4; margin: -2px 0 10px; }

.muted { color: var(--muted); font-size: 13px; }
.cart-list { display: grid; gap: 12px; margin: 16px 0; }
.cart-item { border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.cart-item-head { display: flex; justify-content: space-between; gap: 8px; }
.cart-item h4 { margin: 0; font-size: 14px; }
.qty-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.qty-btn { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line); background: #fffaf4; font-weight: 900; }
.note-input, .text-input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; outline: none; background: #fffcf8; }
.note-input:focus, .text-input:focus, textarea:focus { border-color: #c99670; box-shadow: 0 0 0 3px rgba(220,91,43,.10); }
.note-input { margin-top: 9px; font-size: 12px; }
.field { margin-top: 12px; }
.field label { display: block; font-size: 12px; font-weight: 900; margin-bottom: 6px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 1px dashed var(--line); margin-top: 10px; }
.total-row strong { font-size: 22px; }
.primary-btn { width: 100%; border: 0; border-radius: 16px; padding: 15px 16px; background: var(--brand); color: white; font-weight: 900; font-size: 16px; box-shadow: 0 10px 20px rgba(220,91,43,.22); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.secondary-btn { border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; background: white; font-weight: 800; }
.danger-btn { border: 1px solid #f0c2c2; color: #9b2d2d; border-radius: 14px; padding: 11px 14px; background: #fff5f5; font-weight: 800; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; border: 1px dashed var(--line); border-radius: 16px; }

.order-screen { min-height: calc(100vh - 75px); display: grid; place-items: center; padding: 24px; }
.status-card { width: min(760px, 100%); background: white; border: 1px solid var(--line); border-radius: 32px; padding: 34px; text-align: center; box-shadow: var(--shadow); }
.status-icon { width: 94px; height: 94px; border-radius: 28px; display: grid; place-items: center; margin: 0 auto 18px; font-size: 48px; background: #fff1df; }
.status-card.ready { background: var(--green-soft); border-color: #b9e5c8; }
.status-card.ready .status-icon { background: var(--green); color: white; animation: pulse 1.2s infinite; }
.status-card h1 { margin: 0; font-size: clamp(32px, 6vw, 64px); letter-spacing: -.05em; }
.order-no { font-size: clamp(38px, 8vw, 84px); font-weight: 1000; color: var(--brand-2); letter-spacing: -.05em; margin: 10px 0; }
.ready .order-no { color: var(--green); }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 18px; }
.progress-step { padding: 10px 6px; border-radius: 12px; background: #f3eee7; color: var(--muted); font-size: 12px; font-weight: 900; }
.progress-step.active { background: var(--ink); color: white; }
.ready-action { width: 100%; margin-top: 18px; border: 0; border-radius: 18px; padding: 18px; font-size: 18px; font-weight: 1000; background: var(--green); color: white; }
.hidden { display: none !important; }

@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }
@keyframes cartBump { 0%,100%{transform:translateY(-50%) scale(1)} 45%{transform:translateY(-50%) scale(1.12)} }

/* Cashier */
.cashier-wrap { max-width: 1500px; margin: 0 auto; padding: 22px; }
.cashier-header { display:flex; align-items:end; justify-content:space-between; gap:18px; margin-bottom:18px; }
.cashier-header h1 { margin:0; font-size: clamp(30px,4vw,48px); letter-spacing:-.05em; }
.stats { display:flex; flex-wrap:wrap; gap:10px; }
.stat { background:white; border:1px solid var(--line); border-radius:16px; padding:10px 14px; min-width:110px; }
.stat b { display:block; font-size:22px; }
.columns { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; align-items:start; }
.column { background:rgba(255,255,255,.6); border:1px solid var(--line); border-radius:24px; padding:14px; min-height:360px; }
.column-title { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.column-title h2 { margin:0; font-size:17px; }
.badge { min-width:28px; height:28px; display:grid; place-items:center; padding:0 8px; border-radius:999px; background:var(--ink); color:white; font-size:12px; font-weight:900; }
.order-card { background:white; border:1px solid var(--line); border-radius:20px; padding:15px; box-shadow:0 7px 18px rgba(64,45,25,.05); margin-bottom:12px; }
.order-card.ready { border-color:#a8d8b8; box-shadow:0 8px 20px rgba(22,138,69,.08); }
.order-top { display:flex; justify-content:space-between; gap:12px; align-items:start; }
.order-top h3 { margin:0; font-size:24px; letter-spacing:-.04em; }
.time { font-size:12px; color:var(--muted); }
.customer-meta { margin:5px 0 10px; color:var(--muted); font-size:12px; }
.order-items { list-style:none; padding:0; margin:10px 0; display:grid; gap:7px; }
.order-items li { border-top:1px solid #f2ebe2; padding-top:7px; font-size:13px; }
.order-items b { color:var(--brand-2); }
.item-note { color:#8a5a37; font-size:12px; margin-top:2px; }
.general-note { padding:9px 10px; border-radius:12px; background:#fff8dc; color:#6b5312; font-size:12px; margin:10px 0; }
.order-total { display:flex; justify-content:space-between; font-weight:900; margin:12px 0; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.action-btn { flex:1; min-width:110px; border:0; border-radius:12px; padding:10px; font-weight:900; }
.action-prep { background:#fff0ce; color:#6d4800; }
.action-ready { background:var(--green); color:white; }
.action-done { background:#252321; color:white; }
.action-cancel { background:#fff0f0; color:#9c2e2e; }
.done-list { margin-top:16px; }
.done-row { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:13px; }

@media (max-width: 1180px) {
  .menu-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .menu-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .columns { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .topbar { padding: 11px 14px; }
  .layout, .cashier-wrap { padding: 14px; }
  .customer-layout { padding-right: 64px; }
  .menu-grid { grid-template-columns: 1fr 1fr; gap:10px; }
  .menu-card { min-height:160px; padding:13px; }
  .menu-stepper { gap: 2px; }
  .menu-stepper-btn { width: 30px; height: 32px; }
  .cart-handle { width: 50px; height: 64px; }
  .cart-drawer { width: calc(100vw - 42px); border-radius: 22px 0 0 22px; padding: 18px 15px 24px; }
  .cashier-header { align-items:start; flex-direction:column; }
}
