:root {
  --teal-900: #0a4f53;
  --teal-700: #0f6f73;
  --teal-100: #dff2f0;
  --pink-500: #ec7fa3;
  --pink-100: #fde6ee;
  --cream: #fffaf2;
  --ink: #163032;
  --muted: #6c7a7a;
  --line: #d9e2df;
  --white: #ffffff;
  --danger: #a33a3a;
  --shadow: 0 12px 34px rgba(15, 64, 67, 0.10);
  --radius: 22px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 8% 5%, rgba(236,127,163,.13), transparent 22rem),
  radial-gradient(circle at 93% 12%, rgba(15,111,115,.12), transparent 24rem),
  var(--cream);
}
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(15,111,115,.25);
  outline-offset: 2px;
}
button, select { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { max-width: 1500px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 4px 2px 18px; }
.topbar h1, h2 { margin: 0; line-height: 1.05; }
.topbar h1 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
.eyebrow { margin: 0 0 6px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; color: var(--teal-700); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.badge { display: inline-flex; align-items: center; min-height: 35px; padding: 0 13px; border-radius: 999px; background: var(--pink-100); color: #8d3150; font-weight: 800; font-size: .82rem; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.8); font-size: 1.4rem; color: var(--ink); }

.tabs { display: inline-flex; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.76); box-shadow: 0 8px 24px rgba(22,48,50,.05); margin-bottom: 18px; }
.tab { min-height: 44px; padding: 0 18px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-weight: 800; }
.tab.active { background: var(--teal-700); color: white; box-shadow: 0 6px 15px rgba(15,111,115,.22); }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: .74rem; }
.tab:not(.active) .count-badge { background: var(--teal-100); color: var(--teal-900); }

.screen { display: none; }
.screen.active { display: block; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); gap: 18px; }
.menu-panel, .cart-panel, .settings-card, .orders-header {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
}
.menu-panel { min-height: 72vh; padding: 22px; }
.cart-panel { align-self: start; position: sticky; top: 18px; padding: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-heading.compact { align-items: center; }
.section-heading h2, .orders-header h2, .settings-card h2 { font-size: 1.45rem; }
.search-box { width: min(280px, 45%); font-size: .77rem; font-weight: 800; color: var(--muted); }
.search-box span { display: block; margin: 0 0 5px 4px; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  padding: 0 13px;
}
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 13px; }
.product-card {
  position: relative;
  min-height: 155px;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(223,242,240,.95), rgba(255,255,255,.94));
  text-align: left;
  color: var(--ink);
  overflow: hidden;
}
.product-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -35px;
  width: 100px;
  height: 100px;
  border: 18px solid rgba(236,127,163,.22);
  border-radius: 50%;
}
.product-card:hover, .product-card:active { transform: translateY(-1px); border-color: rgba(15,111,115,.35); }
.product-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--teal-700); color: white; font-weight: 900; font-size: 1.2rem; margin-bottom: 25px; }
.product-card strong, .product-card span { position: relative; z-index: 1; display: block; }
.product-card strong { max-width: 80%; font-size: 1.05rem; }
.product-card span { margin-top: 6px; font-weight: 900; color: var(--teal-700); }

.text-button { border: 0; background: transparent; color: var(--teal-700); font-weight: 850; padding: 8px; }
.text-button.danger { color: var(--danger); }
.cart-items { display: grid; gap: 9px; max-height: 36vh; overflow: auto; padding-right: 2px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.cart-item-main strong { display: block; }
.cart-item-meta { margin-top: 4px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.cart-item-price { text-align: right; font-weight: 900; color: var(--teal-700); }
.cart-item-actions { display: flex; justify-content: flex-end; gap: 5px; margin-top: 7px; }
.mini-button { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: white; font-weight: 900; color: var(--ink); }
.mini-button.remove { color: var(--danger); }

.empty-state { display: grid; place-items: center; text-align: center; gap: 5px; min-height: 200px; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-state.large { min-height: 50vh; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 6px; border-radius: 18px; background: var(--pink-100); color: #8d3150; font-weight: 900; font-size: 1.35rem; }

.customer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.customer-fields label, .settings-card label, .modifier-dialog label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.totals { display: grid; gap: 10px; padding: 18px 0; margin-top: 8px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.totals .grand-total { padding-top: 14px; border-top: 1px dashed var(--line); color: var(--ink); font-size: 1.3rem; }
.totals .grand-total strong { color: var(--teal-700); font-size: 1.65rem; }
.primary-button, .secondary-button {
  min-height: 50px;
  border-radius: 15px;
  font-weight: 900;
  padding: 0 18px;
}
.primary-button { width: 100%; border: 0; background: var(--teal-700); color: white; box-shadow: 0 9px 22px rgba(15,111,115,.22); }
.primary-button:disabled { cursor: not-allowed; opacity: .4; box-shadow: none; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--teal-900); }
.danger-outline { color: var(--danger); border-color: rgba(163,58,58,.25); }

.orders-header { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; padding: 22px; margin-bottom: 16px; }
.summary-cards { display: flex; gap: 10px; }
.summary-cards div { min-width: 115px; padding: 13px 16px; border-radius: 16px; background: var(--teal-100); }
.summary-cards span, .summary-cards strong { display: block; }
.summary-cards span { color: var(--muted); font-size: .76rem; font-weight: 800; }
.summary-cards strong { margin-top: 5px; font-size: 1.25rem; color: var(--teal-900); }
.header-buttons, .settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.orders-list { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 13px; }
.order-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.9); padding: 18px; box-shadow: 0 8px 24px rgba(22,48,50,.06); }
.order-card-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.order-card-title strong { display: block; font-size: 1.15rem; }
.order-card-title span { color: var(--muted); font-size: .8rem; }
.status-select { width: auto; min-height: 40px; padding: 0 10px; font-size: .82rem; font-weight: 850; }
.order-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: .88rem; }
.order-line:first-of-type { border-top: 0; }
.order-card-footer { display: flex; justify-content: space-between; align-items: end; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.order-card-footer span { color: var(--muted); font-size: .8rem; }
.order-card-footer strong { font-size: 1.35rem; color: var(--teal-700); }

.settings-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.5fr); gap: 16px; }
.settings-card { padding: 22px; align-self: start; }
.settings-card.wide { grid-column: 2; }
.settings-card label { margin-top: 14px; }
.settings-card > .secondary-button { margin-top: 15px; }
.setting-note { color: var(--muted); line-height: 1.5; }
.product-editor { display: grid; gap: 8px; }
.product-edit-row { display: grid; grid-template-columns: 1fr 130px 46px; gap: 8px; align-items: center; }
.product-edit-row input { min-height: 44px; }
.product-edit-row button { height: 44px; }
.file-button { display: inline-flex; align-items: center; justify-content: center; }
.file-button input { display: none; }

dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(6, 34, 36, .55); backdrop-filter: blur(4px); }
.modifier-dialog { width: min(720px, calc(100vw - 30px)); max-height: calc(100vh - 35px); overflow: auto; border-radius: 25px; background: var(--cream); box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.modifier-dialog form { padding: 23px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.dialog-header h2 { font-size: 1.7rem; }
.dialog-price { margin: 7px 0 0; color: var(--teal-700); font-weight: 900; }
fieldset { margin: 20px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; font-weight: 900; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: white; font-weight: 800; font-size: .86rem; }
.choice input:checked + span { border-color: var(--teal-700); background: var(--teal-100); color: var(--teal-900); }
.dialog-footer { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 23px; }
.quantity-control { display: grid; grid-template-columns: 46px 45px 46px; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: white; overflow: hidden; }
.quantity-control button { height: 50px; border: 0; background: white; font-size: 1.3rem; }
.quantity-control strong { text-align: center; }
.receipt-dialog { width: min(390px, calc(100vw - 30px)); border-radius: 25px; padding: 28px; background: white; text-align: center; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.receipt-dialog h2 { font-size: 1.8rem; }
.receipt-dialog p:not(.eyebrow) { color: var(--muted); }
.receipt-dialog > strong { display: block; margin: 18px 0; font-size: 2rem; color: var(--teal-700); }
.receipt-mark { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 17px; border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-size: 1.8rem; font-weight: 900; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); transform: translate(-50%, 150%); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: white; font-weight: 800; box-shadow: var(--shadow); opacity: 0; transition: .22s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1000px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .product-grid { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
  .orders-header { grid-template-columns: 1fr auto; }
  .header-buttons { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .tab { padding: 0 8px; }
  .pos-layout { display: block; }
  .menu-panel { min-height: auto; margin-bottom: 14px; padding: 16px; }
  .cart-panel { position: static; padding: 16px; }
  .product-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .product-card { min-height: 140px; padding: 15px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading.compact { flex-direction: row; align-items: center; }
  .search-box { width: 100%; }
  .customer-fields { grid-template-columns: 1fr; }
  .orders-header { display: block; }
  .summary-cards { margin: 16px 0; }
  .summary-cards div { flex: 1; min-width: 0; }
  .orders-list { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-card.wide { grid-column: auto; }
  .product-edit-row { grid-template-columns: 1fr 100px 44px; }
}
