:root {
  --bg: #eceeef;
  --panel: #f8f9f9;
  --white: #ffffff;
  --text: #26282b;
  --muted: #70757c;
  --line: #d7dade;
  --line-dark: #c5c9ce;
  --topbar: #2d2f31;
  --topbar-active: #1769d2;
  --blue: #0878e8;
  --blue-dark: #0665c2;
  --blue-soft: #eaf4ff;
  --green: #65c232;
  --green-dark: #55a82a;
  --danger: #d9534f;
  --shadow: 0 12px 30px rgba(23, 30, 38, 0.12);
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #161718;
  overflow: hidden;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: 100vw;
  height: 100vh;
  min-width: 960px;
  min-height: 620px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 62px;
  flex: 0 0 62px;
  background: linear-gradient(#343638, #292b2d);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 2px 8px rgba(0,0,0,.18);
  z-index: 5;
}

.top-tabs, .top-actions { display: flex; align-items: center; gap: 10px; }

.top-tab {
  border: 0;
  color: #eef0f2;
  background: rgba(0,0,0,.14);
  border-radius: 3px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.top-tab:hover { background: rgba(255,255,255,.08); }
.top-tab.is-active { background: var(--topbar-active); box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset; }

.save-button, .icon-button, .close-button {
  border: 0;
  color: #fff;
  cursor: pointer;
}

.save-button {
  background: var(--green);
  border-radius: 4px;
  padding: 11px 20px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .03em;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset;
}
.save-button:hover { background: var(--green-dark); }

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 900;
  background: rgba(255,255,255,.12);
}
.icon-button:hover { background: rgba(255,255,255,.2); }

.close-button {
  background: transparent;
  color: #ddd;
  font-size: 42px;
  line-height: 1;
  width: 42px;
  height: 42px;
  font-weight: 200;
}
.close-button:hover { color: #fff; }

.workspace { min-height: 0; flex: 1; display: flex; }

.order-panel {
  width: 330px;
  flex: 0 0 330px;
  background: #f0f1f2;
  border-right: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.product-name {
  min-height: 56px;
  background: #f7f7f7;
  border-bottom: 1px solid var(--line);
  padding: 18px 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
}

.selection-area { min-height: 0; flex: 1; display: flex; flex-direction: column; background: #f6f7f7; }

.selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  color: #686d73;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.selection-count {
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: #dfe3e7;
  color: #44484d;
  display: inline-grid;
  place-items: center;
  letter-spacing: 0;
}

.empty-selection {
  margin: auto 24px;
  color: #777c82;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  line-height: 1.4;
  font-size: 13px;
}
.empty-selection strong { color: #4f5358; font-size: 14px; }
.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #e2e6e9;
  display: grid;
  place-items: center;
  color: #8b9096;
  font-size: 26px;
}

.selected-items { overflow: auto; padding: 4px 0 18px; }
.selected-items:empty { display: none; }

.selected-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid #e0e2e4;
  background: rgba(255,255,255,.58);
}
.selected-line:hover { background: #fff; }
.selected-line-main { min-width: 0; }
.selected-line-group { color: #899098; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.selected-line-name { margin-top: 3px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-line-qty { color: #61666c; font-size: 12px; font-weight: 700; }
.selected-line-price { color: #1769d2; font-size: 12px; font-weight: 800; min-width: 48px; text-align: right; }
.remove-line {
  border: 0;
  background: transparent;
  color: #a0a5aa;
  cursor: pointer;
  padding: 3px;
  font-size: 18px;
}
.remove-line:hover { color: var(--danger); }

.order-footer { background: #eceeef; border-top: 1px solid var(--line-dark); padding: 10px 12px 0; }
.variant-label { font-size: 12px; font-weight: 800; color: #4d5156; margin: 0 2px 8px; letter-spacing: .05em; }
.variant-card {
  min-height: 56px;
  border-radius: 4px;
  background: linear-gradient(#0b83ec, #056fd4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 2px 5px rgba(0,74,160,.22);
}
.variant-card strong { font-size: 14px; }
.variant-card span { font-size: 12px; }
.total-row {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 14px;
}
.total-row strong { font-size: 25px; font-weight: 500; }

.content-panel { min-width: 0; flex: 1; background: var(--white); overflow: auto; }
.view { display: none; min-height: 100%; }
.view.is-active { display: block; }

.section-switcher {
  display: flex;
  gap: 0;
  padding: 14px 18px 0;
  background: #f5f6f7;
  border-bottom: 1px solid var(--line);
}

.section-button {
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #e9ebed;
  color: #666b71;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
  border-radius: 5px 5px 0 0;
}
.section-button:hover { background: #f3f4f5; }
.section-button.is-active { background: #fff; color: #1769d2; position: relative; top: 1px; }

.group-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 18px;
  border-bottom: 1px solid #e4e6e8;
  background: #fff;
  scrollbar-width: thin;
}
.group-tab {
  white-space: nowrap;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: #575c62;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.group-tab:hover { border-color: #9abce2; color: #1769d2; }
.group-tab.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.group-tab.has-selection::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #65c232;
  margin-left: 7px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}

.group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 22px 14px;
}
.group-header h1 { margin: 4px 0 6px; font-size: 20px; letter-spacing: .02em; }
.group-header p { margin: 0; color: #777c82; font-size: 13px; line-height: 1.45; }
.group-eyebrow, .page-kicker { color: #1769d2; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.rule-badge {
  border: 1px solid #cdd3d8;
  background: #f6f7f8;
  color: #62676d;
  border-radius: 999px;
  padding: 8px 11px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.modifier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
  padding: 0 22px 28px;
}

.modifier-card {
  min-height: 94px;
  border: 1px solid #d3d6d9;
  border-radius: 5px;
  background: linear-gradient(#fff, #fafafa);
  color: #3e4247;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  position: relative;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
  user-select: none;
}
.modifier-card:hover { border-color: #8fb8e5; box-shadow: 0 5px 15px rgba(0,78,163,.08); transform: translateY(-1px); }
.modifier-card.is-selected { border: 2px solid var(--blue); background: var(--blue-soft); padding: 11px; }
.modifier-name { font-size: 14px; font-weight: 800; line-height: 1.25; }
.modifier-dose { margin-top: 5px; color: #7d8288; font-size: 11px; font-weight: 700; }
.modifier-price { margin-top: 7px; color: #555a60; font-size: 13px; }
.modifier-price.is-free { color: #6b7177; }
.modifier-price.is-paid { color: #1769d2; font-weight: 800; }
.selected-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.quantity-control {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #cdd8e5;
  padding: 2px;
}
.quantity-control button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #eef4fb;
  color: #1769d2;
  cursor: pointer;
  font-weight: 900;
}
.quantity-control button:hover { background: #dcecff; }
.quantity-control span { min-width: 14px; font-weight: 900; font-size: 12px; }

.information-view { padding: 34px; background: #f5f6f7; }
.info-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.info-page-heading.compact { align-items: flex-start; }
.info-page-heading h1 { margin: 7px 0 7px; font-size: 30px; }
.info-page-heading p { margin: 0; color: #70757c; max-width: 730px; line-height: 1.5; }
.price-hero { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 15px 20px; box-shadow: var(--shadow); min-width: 180px; text-align: right; }
.price-hero span { display: block; color: #7d838a; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.price-hero strong { display: block; margin-top: 4px; color: #1769d2; font-size: 30px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; min-height: 190px; box-shadow: 0 6px 16px rgba(35,43,52,.05); }
.metric-number { color: #1769d2; font-weight: 900; font-size: 25px; }
.metric-card h2 { font-size: 16px; margin: 16px 0 8px; }
.metric-card p { color: #747980; margin: 0; line-height: 1.48; font-size: 13px; }
.example-table-card { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: 0 6px 16px rgba(35,43,52,.05); }
.card-heading-row h2 { font-size: 18px; margin: 6px 0 16px; }
.example-table-wrap { overflow-x: auto; }
.example-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.example-table th { background: #f1f3f5; color: #666b71; text-align: left; font-size: 11px; letter-spacing: .06em; padding: 11px 12px; }
.example-table td { border-top: 1px solid #e3e5e7; padding: 13px 12px; }
.example-table td:last-child { color: #1769d2; font-weight: 900; white-space: nowrap; }

.steps-list { display: grid; gap: 12px; max-width: 980px; }
.step-card { display: grid; grid-template-columns: 74px 1fr; align-items: start; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.step-card > span { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: #eaf4ff; color: #1769d2; font-weight: 900; }
.step-card h2 { margin: 3px 0 6px; font-size: 16px; }
.step-card p { margin: 0; color: #73787e; line-height: 1.5; font-size: 13px; }

.discount-lock-card { max-width: 760px; margin: 40px auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 42px; box-shadow: var(--shadow); }
.lock-symbol { width: 74px; height: 74px; border-radius: 50%; background: #eaf4ff; color: #1769d2; display: grid; place-items: center; margin: 0 auto 20px; font-size: 34px; font-weight: 900; }
.discount-lock-card h1 { margin: 8px 0 10px; }
.discount-lock-card > p { color: #70757c; line-height: 1.55; }
.policy-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; text-align: left; }
.policy-list div { background: #f5f7f9; border: 1px solid #e0e4e7; border-radius: 6px; padding: 12px; font-size: 13px; font-weight: 700; }
.policy-list span { color: var(--green-dark); margin-right: 7px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19,22,25,.56);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(620px, 95vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  padding: 28px;
  position: relative;
}
.modal h2 { font-size: 24px; margin: 7px 0 18px; }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: #777; font-size: 30px; cursor: pointer; }
.modal-close:hover { color: #222; }
.summary-list { border: 1px solid #e1e3e5; border-radius: 7px; overflow: hidden; }
.summary-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #e7e9eb; font-size: 13px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row strong { font-weight: 800; }
.summary-row span:last-child { color: #1769d2; font-weight: 900; }
.summary-total { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 15px; background: #f2f7fd; border-radius: 7px; }
.summary-total strong { color: #1769d2; font-size: 24px; }
.modal-warning { border-radius: 7px; padding: 12px; background: #fff5e7; color: #8b5b14; border: 1px solid #f3d5a8; font-size: 13px; line-height: 1.45; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.primary-button, .secondary-button { border-radius: 5px; padding: 11px 15px; font-weight: 800; font-size: 12px; cursor: pointer; }
.primary-button { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { color: #1769d2; background: #fff; border: 1px solid #9fc1e5; }
.secondary-button:hover { background: #f1f7fd; }
.owner-modal { width: min(700px, 95vw); }
.owner-notes p { color: #555b61; line-height: 1.55; }
.notice-box { margin-top: 18px; background: #eef5fd; border-left: 4px solid #1769d2; padding: 13px 14px; color: #44515e; font-size: 13px; line-height: 1.5; }
code { background: #eef0f2; border-radius: 3px; padding: 2px 5px; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 18px);
  background: #26292c;
  color: #fff;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 70;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .modifier-grid { grid-template-columns: repeat(2, minmax(190px, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-height: 720px) {
  .topbar { height: 54px; flex-basis: 54px; }
  .top-tab { padding-top: 9px; padding-bottom: 9px; }
  .modifier-card { min-height: 80px; }
  .group-header { padding-top: 14px; }
}
