:root {
  --bg: #171615;
  --panel: #23211f;
  --panel-2: #2d2a27;
  --line: #403c37;
  --text: #f5f0e9;
  --muted: #aaa096;
  --accent: #df5a35;
  --accent-dark: #a73d22;
  --good: #5eb77b;
  --warn: #e6b75c;
  --bad: #dc6a5d;
  --radius: 14px;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button, input, textarea { font: inherit; }
button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 85ms ease, filter 85ms ease, box-shadow 85ms ease, background-color 100ms ease, border-color 100ms ease;
  transform: translateY(0) scale(1);
  transform-origin: center;
}
button:not(:disabled):active,
button.press-feedback {
  transform: translateY(4px) scale(.92) !important;
  filter: brightness(.72) saturate(1.15) !important;
  box-shadow: inset 0 4px 9px rgba(0, 0, 0, .48), 0 0 0 2px rgba(255,255,255,.16) !important;
}
button.tap-confirm {
  animation: mingaTapConfirm 180ms ease-out;
}
@keyframes mingaTapConfirm {
  0% { transform: translateY(4px) scale(.92); filter: brightness(.72); }
  55% { transform: translateY(2px) scale(.96); filter: brightness(.86); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

button:disabled {
  transform: none !important;
  filter: none !important;
}
.hidden { display: none !important; }
.muted, .microcopy { color: var(--muted); }
.microcopy { font-size: 12px; line-height: 1.4; margin: 10px 0 0; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin-top: 0; }
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--accent); color: white; font-size: 28px; font-weight: 900; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); padding: 11px 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(223, 90, 53, .16); }
textarea { min-height: 72px; resize: vertical; }
.form-error { color: var(--bad); min-height: 20px; margin: 0; font-size: 13px; }
.btn { border: 0; border-radius: 11px; padding: 12px 15px; color: var(--text); font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: white; }
.btn.primary:active { background: var(--accent-dark); }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--line); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.compact { width: auto; padding: 8px 11px; font-size: 13px; }
.app-shell { min-height: 100dvh; }
.topbar { min-height: 64px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top-actions, .inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-pill.good { background: rgba(94, 183, 123, .15); color: var(--good); }
.status-pill.bad { background: rgba(220, 106, 93, .15); color: var(--bad); }
.status-pill.warn { background: rgba(230, 183, 92, .15); color: var(--warn); }
.status-pill.neutral { background: var(--panel-2); color: var(--muted); }
.tabbar { height: 52px; display: flex; gap: 6px; align-items: center; padding: 7px 12px; background: rgba(23, 22, 21, .96); border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 25; overflow-x: auto; }
.tab { white-space: nowrap; border: 0; border-radius: 999px; padding: 9px 14px; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }
.tab:not(.active):active, .tab.press-feedback:not(.active) { background: var(--panel-2); color: var(--text); }
.tab.active { background: var(--accent); color: white; }
.screen { display: none; min-height: calc(100dvh - 116px); }
.screen.active { display: block; }
.order-layout.active { display: grid; grid-template-columns: minmax(0, 1fr) 370px; }
.menu-panel { min-width: 0; padding: 18px; }
.cart-panel { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: calc(100dvh - 116px); position: sticky; top: 116px; max-height: calc(100dvh - 116px); }
.cart-head, .cart-foot { padding: 16px; }
.cart-head { border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 12px; }
.cart-foot { border-top: 1px solid var(--line); margin-top: auto; display: grid; gap: 9px; }
.total-row { display: flex; align-items: center; justify-content: space-between; font-size: 21px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 0; }
.menu-content { display: grid; gap: 20px; }
.category-block h3 { margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.product-card { min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 13px; text-align: left; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
.product-card:active, .product-card.press-feedback { border-color: var(--accent); background: var(--panel-2); }
.product-card strong { font-size: 15px; }
.product-card span { color: var(--accent); font-weight: 900; }
.cart-empty, .empty-state { padding: 28px 14px; text-align: center; color: var(--muted); }
.cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.cart-name { font-weight: 750; line-height: 1.25; }
.cart-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.qty-controls { display: flex; align-items: center; gap: 7px; }
.qty-button { width: 31px; height: 31px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 18px; box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.qty-value { min-width: 20px; text-align: center; font-weight: 800; }
.page-screen { padding: 20px; max-width: 980px; margin: 0 auto; width: 100%; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 18px; }
.admin-list { display: grid; gap: 14px; }
.admin-category { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.admin-category-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.admin-product { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto auto; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.add-product-form { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; margin-top: 12px; }
.danger { color: var(--bad); }
.summary-hero { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 14px; }
.summary-total { font-size: clamp(34px, 8vw, 54px); color: var(--accent); font-weight: 900; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.info-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.info-card strong { display: block; margin-bottom: 5px; }
.order-list { display: grid; gap: 8px; }
.order-entry { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); max-width: min(520px, calc(100vw - 28px)); background: #35312e; border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 850px) {
  .order-layout.active { display: block; }
  .cart-panel { position: static; max-height: none; min-height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .cart-items { max-height: 360px; }
  .topbar { align-items: flex-start; }
  .status-pill { display: none; }
}
@media (max-width: 620px) {
  .topbar { padding: 9px 11px; }
  .tabbar { top: 60px; }
  .menu-panel, .page-screen { padding: 13px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-category-head { grid-template-columns: 1fr auto; }
  .admin-category-head .category-delete { grid-column: 2; }
  .admin-product { grid-template-columns: 1fr 95px; }
  .admin-product .save-product, .admin-product .delete-product { width: 100%; }
  .add-product-form { grid-template-columns: 1fr 95px; }
  .add-product-form button { grid-column: 1 / -1; }
  .section-head { align-items: flex-start; }
  .order-entry { grid-template-columns: 1fr auto; }
  .order-entry .reprint { grid-column: 1 / -1; }
}
