:root {
  --bg: radial-gradient(circle at top, #fef3c7, #e2e8f0 45%, #cbd5e1);
  --panel: rgba(255, 255, 255, 0.82);
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  --shadow-card: 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 6px 14px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #e2e8f0; }
body { background: var(--bg); }
button, input { font: inherit; }
.app-shell { min-height: 100vh; padding: 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, 0.95fr); gap: 12px; max-width: 1400px; margin: 0 auto; }
.panel { background: var(--panel); backdrop-filter: blur(8px); border-radius: var(--radius-xl); box-shadow: var(--shadow); border: 0; }
.panel-left { padding: 18px; }
.panel-right { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.title-block { text-align: center; }
.title-block h1 { margin: 0; font-size: clamp(20px, 2.6vw, 36px); line-height: 1.1; font-weight: 800; }
.title-block p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.search-box { grid-column: 3; display: flex; align-items: center; gap: 8px; background: #f8fafc; border-radius: 16px; padding: 8px 12px; }
.search-box svg { width: 18px; height: 18px; fill: #94a3b8; flex: 0 0 auto; }
.search-box input { width: 100%; border: 0; outline: none; background: transparent; font-size: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { border: 1px solid var(--line); background: white; color: var(--ink); padding: 8px 12px; border-radius: 16px; font-size: 14px; font-weight: 600; }
.tab.active { background: #0f172a; border-color: #0f172a; color: white; }
.product-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.product-card, .grid-spacer { min-height: 82px; }
.product-card { border-radius: 20px; border: 1px solid rgba(0,0,0,0.3); box-shadow: var(--shadow-card); padding: 8px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.product-card:active { transform: scale(0.99); }
.product-card:hover { box-shadow: var(--shadow-card-hover); }
.product-card-top { display: flex; justify-content: flex-end; }
.price-tag { background: rgba(255,255,255,0.3); border-radius: 12px; padding: 2px 8px; font-size: 10px; font-weight: 700; }
.product-name { min-height: 28px; font-size: 11px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-gap-row { grid-column: 1 / -1; height: 8px; }
.grid-spacer.span-2 { grid-column: span 2; }
.grid-spacer.span-3 { grid-column: span 3; }
.order-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.order-header h2 { margin: 0; font-size: 30px; line-height: 1; }
.order-header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.order-actions { display: flex; gap: 8px; }
.btn { border-radius: 16px; padding: 10px 14px; border: 1px solid var(--line); background: white; font-weight: 600; }
.btn:disabled { opacity: 0.45; }
.order-card { border: 1px solid var(--line); background: #f8fafc; border-radius: 16px; padding: 8px; }
.cart-line-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; }
.empty-cart { width: 100%; text-align: center; color: var(--muted); background: white; border: 1px dashed rgba(15,23,42,0.18); border-radius: 16px; padding: 14px; }
.cart-chip { display: flex; align-items: center; gap: 6px; border-radius: 14px; background: white; padding: 6px 8px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); max-width: 100%; }
.cart-chip-name { font-size: 12px; font-weight: 700; }
.cart-chip-meta, .cart-chip-price { font-size: 12px; }
.cart-chip-price { font-weight: 700; }
.icon-btn { width: 24px; height: 24px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; display: grid; place-items: center; }
.received-block label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #475569; }
.received-block input { width: 100%; height: 48px; border-radius: 16px; border: 1px solid var(--line); padding: 0 14px; background: white; font-size: 16px; }
.total-card { border-radius: 24px; background: #0f172a; color: white; padding: 18px; }
.total-row { display: flex; justify-content: space-between; align-items: center; }
.total-row.muted { color: #cbd5e1; font-size: 14px; }
.total-main { font-size: 34px; font-weight: 800; }
.change-row { margin-top: 12px; font-size: 16px; }
.divider { height: 1px; background: #334155; margin: 12px 0; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preset-btn { height: 44px; border-radius: 16px; border: 1px solid var(--line); background: white; font-weight: 600; font-size: 16px; }
.bg-light-yellow { background: #fff6bf; color: #0f172a; }
.bg-rose { background: #f8bfd8; color: #0f172a; }
.bg-yellow { background: #ffe27a; color: #0f172a; }
.bg-white { background: #f8fafc; color: #0f172a; }
.bg-blue { background: #8ec5ff; color: #0f172a; }
.bg-dark-rose { background: #d94b8a; color: white; }
.bg-red { background: #ef4444; color: white; }
.bg-black { background: #111827; color: white; }
.bg-orange { background: #fb923c; color: #0f172a; }
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .topbar { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-header { flex-direction: column; align-items: stretch; }
  .order-actions { width: 100%; }
  .order-actions .btn { flex: 1; }
}
