:root {
  --navy: #151c28;
  --navy-2: #202a3a;
  --blue: #327df0;
  --blue-strong: #1966dd;
  --blue-soft: #eaf3ff;
  --orange: #ef8a39;
  --ink: #273244;
  --muted: #718096;
  --line: #dde4ec;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --success: #179c67;
  --shadow: 0 10px 30px rgba(34, 50, 73, 0.08);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 400;
  line-height: 1.45;
}
h1, h2, h3, h4, h5, h6, strong, b { font-weight: 600; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(50, 125, 240, .25);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
  background: var(--navy);
  color: white;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(145deg, #4e93fb, #286ddb); font-weight: 700;
}
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: 6px; }
.main-nav button, .main-nav a {
  position: relative; min-width: 70px; border: 0; background: transparent; color: #8f98a8;
  display: grid; place-items: center; font-size: 1rem; font-weight: 500; text-decoration: none;
}
.main-nav button.active, .main-nav a.active { color: white; }
.main-nav button.active::after, .main-nav a.active::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 3px; border-radius: 3px; background: var(--blue); }
.main-nav button:disabled { cursor: default; }
.top-status { position: relative; margin-left: auto; display: flex; align-items: center; gap: 14px; color: #cbd2dd; font-size: .875rem; }
.store-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #344052; border-radius: 999px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #42d392; box-shadow: 0 0 0 3px rgba(66,211,146,.13); }
.top-datetime { min-width: 88px; display: grid; line-height: 1.15; text-align: right; }
.top-date { color: #aab4c3; font-size: .72rem; font-weight: 500; }
.top-datetime strong { margin-top: 4px; color: #eef2f7; font-size: .9rem; }
.shell-menu-trigger {
  width: 38px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px;
  background: transparent; color: #d6dde7; font-size: 1.55rem; font-weight: 600; line-height: 1;
}
.shell-menu-trigger:hover, .shell-menu-trigger[aria-expanded="true"] { background: #263142; color: white; }
.shell-menu {
  position: absolute; z-index: 1000; top: calc(100% + 14px); right: 0; width: min(430px, calc(100vw - 24px));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 22px;
  border: 1px solid #e5e9ef; border-radius: 24px; background: rgba(255,255,255,.98); color: #4c5a6e;
  box-shadow: 0 24px 60px rgba(14, 24, 39, .24);
}
.shell-menu[hidden] { display: none; }
.shell-menu::before {
  content: ""; position: absolute; top: -8px; right: 12px; width: 16px; height: 16px;
  background: white; border-top: 1px solid #e5e9ef; border-left: 1px solid #e5e9ef; transform: rotate(45deg);
}
.shell-action {
  min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 6px; border: 0; border-radius: 16px; background: transparent; color: #4d5b6f; font-weight: 500;
}
.shell-action:hover { background: #f4f6f9; color: #273244; }
.shell-action-icon {
  width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px;
  background: #f0f2f5; color: #697789; font-size: 1.8rem; font-weight: 500;
}
.shell-action[data-shell-action="refresh"] .shell-action-icon { color: #0caf75; }
.shell-action[data-shell-action="restart"] .shell-action-icon { color: #327df0; }
.shell-action[data-shell-action="exit"] .shell-action-icon { color: #f04b5e; }
.shell-action-toast, .shell-restore {
  position: fixed; z-index: 1200; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 12px 18px; border: 0; border-radius: 12px; background: #151c28; color: white;
  font-size: .86rem; font-weight: 600; box-shadow: 0 12px 32px rgba(15,24,38,.28);
}
.shell-action-toast[hidden], .shell-restore[hidden] { display: none; }
body.shell-minimized .app-shell > main { display: none !important; }
body.shell-minimized .app-shell { min-height: 52px; }
body.shell-minimized { min-height: 100vh; background: #e9edf2; }
body.shell-expanded-view { overflow: hidden; }
body.shell-expanded-view .app-shell {
  position: fixed; z-index: 1100; inset: 0; overflow: auto; background: var(--canvas);
}
body.shell-large-view { zoom: 1.25; }

.data-source-indicator {
  position: fixed !important; z-index: 42; left: 12px !important; right: auto !important; bottom: 12px !important;
  width: min(260px, calc(100vw - 24px)); display: grid !important; gap: 2px; padding: 9px 11px !important;
  border: 1px solid rgba(126, 146, 171, .24); border-radius: 11px; background: rgba(255, 255, 255, .94) !important;
  color: #637187 !important; box-shadow: 0 7px 22px rgba(26, 42, 64, .11); pointer-events: none;
  font-size: .66rem !important; line-height: 1.35; backdrop-filter: blur(8px);
}
.data-source-indicator strong { color: #2d3c51 !important; font-size: .71rem; }
.data-source-indicator span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-source-indicator small { color: #8c98a8; font-size: .58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.order-booking-embedded .data-source-indicator { display: none !important; }

@media (max-width: 780px) {
  .data-source-indicator { left: 8px !important; bottom: 8px !important; width: min(220px, calc(100vw - 16px)); padding: 7px 9px !important; }
  .data-source-indicator small { display: none; }
}

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 390px; min-height: calc(100vh - 52px); }
.catalog-panel { min-width: 0; padding: 18px 24px 28px; overflow: auto; }
.order-panel { position: sticky; top: 0; height: calc(100vh - 52px); display: flex; flex-direction: column; background: white; border-left: 1px solid var(--line); }

.progress-strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-bottom: 16px; }
.progress-step { display: flex; align-items: center; gap: 6px; min-width: 0; color: #9aa6b6; font-size: .72rem; font-weight: 500; white-space: nowrap; }
.progress-step::before { content: ""; width: 100%; height: 4px; border-radius: 4px; background: #dfe5ec; }
.progress-step span { display: none; }
.progress-step.done::before { background: var(--blue); }
.progress-step.current::before { background: linear-gradient(90deg, var(--blue) 55%, #dfe5ec 55%); }

.category-row { display: flex; gap: 4px; padding: 4px; overflow-x: auto; background: #e9edf2; border-radius: 14px; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-tab { flex: 1 0 130px; min-height: 48px; padding: 9px 16px; border: 0; border-radius: 11px; background: transparent; color: #657184; font-weight: 500; }
.category-tab.active { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(30, 48, 70, .08); }

.catalog-heading, .section-heading, .order-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-heading { margin: 22px 2px 14px; }
.eyebrow { margin: 0 0 4px; color: #8b98a9; font-size: .72rem; font-weight: 600; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: -.03em; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.count-label { margin: 0; color: var(--muted); font-size: .875rem; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.product-card {
  position: relative; min-height: 124px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); text-align: left;
  box-shadow: 0 1px 2px rgba(30,42,60,.03); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: #a9c8f8; box-shadow: var(--shadow); }
.product-card:active { transform: translateY(0); }
.product-card.in-cart { border-color: var(--blue); background: linear-gradient(145deg, #fff, #f1f7ff); }
.product-name { font-weight: 600; font-size: 1rem; }
.product-description { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.product-bottom { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-price { font-weight: 600; }
.add-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-strong); font-size: 1.15rem; line-height: 1; }
.cart-count { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 6px; border-radius: 99px; background: var(--blue); color: white; font-size: .74rem; font-weight: 600; }

.options-zone { margin-top: 22px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.active-item-badge { padding: 7px 10px; border-radius: 9px; background: var(--blue-soft); color: var(--blue-strong); font-size: .8rem; font-weight: 600; }
.option-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 14px; }
.option-chip {
  min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; color: var(--ink); text-align: left;
}
.option-chip strong { display: block; font-size: .88rem; }
.option-chip span { color: var(--muted); font-size: .76rem; }
.option-chip.selected { border-color: var(--blue); background: var(--blue-soft); }
.option-check { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #c9d2df; border-radius: 6px; color: transparent; }
.option-chip.selected .option-check { border-color: var(--blue); background: var(--blue); color: white; }
.empty-inline { grid-column: 1 / -1; padding: 18px; border: 1px dashed #d3dbe6; border-radius: 12px; color: var(--muted); text-align: center; font-size: .875rem; }

.booking-form { display: grid; grid-template-columns: 1.2fr .8fr 1.35fr .8fr; gap: 14px; margin-top: 16px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.form-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: #4f5d70; font-size: .82rem; font-weight: 600; }
.field-label span { color: #9ba7b7; font-weight: 500; }
.input-with-icon { position: relative; }
.input-with-icon svg { position: absolute; left: 12px; top: 50%; width: 18px; transform: translateY(-50%); fill: none; stroke: #8a97a7; stroke-width: 2; }
.input-with-icon input { padding-left: 38px; }
input, select, textarea { width: 100%; border: 1px solid #d8e0e9; border-radius: 10px; background: white; color: var(--ink); }
input, select { height: 44px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; }
.customer-picker { position: relative; }
.customer-results { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; right: 0; max-height: 228px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 14px 35px rgba(27, 43, 65, .16); }
.customer-result { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 10px; border: 0; border-radius: 9px; background: white; color: var(--ink); text-align: left; }
.customer-result:hover { background: #f3f7fc; }
.customer-result small { display: block; margin-top: 2px; color: var(--muted); }
.customer-result em { color: var(--blue-strong); font-size: .75rem; font-style: normal; }
.selected-customer { margin-top: 7px; padding: 9px 11px; border-radius: 10px; background: var(--blue-soft); color: #245699; font-size: .8rem; }
.selected-customer-memo { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(36, 86, 153, .16); color: #4f6075; line-height: 1.45; }
.selected-customer-memo b { margin-right: 7px; color: #245699; font-size: .72rem; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.time-button { height: 44px; border: 1px solid #d8e0e9; border-radius: 9px; background: white; color: #536174; font-size: .78rem; font-weight: 500; }
.time-button.selected { border-color: var(--blue); background: var(--blue); color: white; }
.memo-section { grid-column: 1 / -1; }

.order-header { padding: 22px 22px 17px; border-bottom: 1px solid var(--line); }
.text-button { border: 0; background: transparent; color: #8a96a5; font-size: .8rem; font-weight: 500; }
.text-button:hover { color: #d24343; }
.order-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.order-empty { height: 100%; min-height: 230px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.order-empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 18px; background: #f0f4f8; color: #9aa7b7; font-size: 1.8rem; }
.order-empty strong { display: block; margin-bottom: 5px; color: #566478; }
.order-empty p { margin: 0; font-size: .84rem; }
.order-item { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; transition: border-color .15s, background .15s; }
.order-item + .order-item { margin-top: 9px; }
.order-item.active { border-color: var(--blue); background: #f7fbff; }
.order-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.order-item-select { flex: 1; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 600; }
.remove-item { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #f2f4f7; color: #8d98a7; }
.remove-item:hover { background: #fff0f0; color: #cf3b3b; }
.order-options { margin: 7px 0 10px; color: #718096; font-size: .76rem; }
.order-options:empty { margin: 3px 0; }
.order-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quantity-control { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 10px; background: #edf1f6; }
.quantity-control button { width: 31px; height: 31px; border: 0; border-radius: 8px; background: white; color: #536174; font-size: 1.1rem; }
.quantity-control strong { min-width: 30px; text-align: center; }
.item-total { font-size: .96rem; }

.order-summary { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: #fbfcfe; }
.discount-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 13px; color: #667387; font-size: .84rem; }
.money-input { display: flex; align-items: center; gap: 5px; }
.money-input input { width: 104px; height: 36px; text-align: right; }
.summary-lines { margin: 0; }
.summary-lines div { display: flex; justify-content: space-between; margin: 7px 0; font-size: .86rem; }
.summary-lines dt { color: #758195; }
.summary-lines dd { margin: 0; font-weight: 500; }
.summary-lines .total-line { align-items: baseline; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #cfd7e2; }
.total-line dt { color: var(--ink); font-weight: 600; }
.total-line dd { color: var(--blue-strong); font-size: 1.55rem; letter-spacing: -.03em; }
.order-button { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 0 18px; border: 0; border-radius: 13px; background: var(--blue); color: white; font-weight: 600; box-shadow: 0 8px 18px rgba(50,125,240,.2); }
.order-button:hover:not(:disabled) { background: var(--blue-strong); }
.order-button:disabled { background: #cfd7e2; box-shadow: none; cursor: not-allowed; }
.order-button strong { font-size: 1.05rem; }
.validation-hint { min-height: 18px; margin: 8px 0 0; color: #8a96a5; font-size: .75rem; text-align: center; }
.validation-hint.error { color: #d14b4b; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 30px; transform: translateX(-50%); padding: 12px 18px; border-radius: 10px; background: var(--navy); color: white; font-size: .86rem; font-weight: 500; box-shadow: 0 12px 32px rgba(15,24,38,.25); }
.success-dialog { width: min(420px, calc(100% - 32px)); padding: 32px; border: 0; border-radius: 22px; color: var(--ink); text-align: center; box-shadow: 0 30px 70px rgba(17, 30, 49, .28); }
.success-dialog::backdrop { background: rgba(16, 26, 41, .62); backdrop-filter: blur(3px); }
.success-dialog .order-button { justify-content: center; }
.success-icon { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: #e5f7ef; color: var(--success); font-size: 1.8rem; font-weight: 700; }
.success-dialog > p:not(.eyebrow) { margin: 10px 0 20px; color: var(--muted); }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .option-list { grid-template-columns: repeat(2, 1fr); }
  .booking-form { grid-template-columns: 1fr 1fr; }
  .memo-section { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .topbar { height: 60px; padding: 0 14px; gap: 10px; }
  .brand > span:last-child, .top-status .store-pill { display: none; }
  .main-nav { margin: 0 auto; }
  .main-nav button, .main-nav a { min-width: 58px; }
  .main-nav button:not(.active), .main-nav a:not(.active) { display: none; }
  .top-status { gap: 7px; }
  .top-datetime { min-width: 76px; }
  .shell-menu { position: fixed; top: 60px; right: 10px; }
  .workspace { display: block; }
  .catalog-panel { padding: 14px; overflow: visible; }
  .order-panel { position: static; height: auto; min-height: 480px; border: 1px solid var(--line); border-radius: 18px 18px 0 0; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-height: 116px; }
  .booking-form { grid-template-columns: 1fr; }
  .memo-section { grid-column: auto; }
  .order-list { min-height: 260px; }
  .progress-strip { display: none; }
}

@media (max-width: 430px) {
  .product-grid, .option-list { grid-template-columns: 1fr; }
  .product-card { min-height: 100px; }
  .category-tab { flex-basis: 108px; }
  .top-status strong { font-size: .75rem; }
  .top-date { font-size: .65rem; }
  .shell-menu { grid-template-columns: repeat(2, 1fr); padding: 14px; }
  .shell-action { min-height: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
