/* ============================================================
   QpayMoney 점주 웹포스 — 반응형 (폰·태블릿·PC)
   고객 화면과 통일된 톤: 코랄 포인트 + 먹색
   ============================================================ */
:root {
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --ink: #1C1C1A;
  --ink-soft: #6B6B66;
  --brand: #FF5A3C;
  --brand-dark: #E8462B;
  --green: #1F7A55;
  --amber: #DD6B20;
  --red: #E53E3E;
  --line: #E6E7EA;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo','Pretendard','Malgun Gothic',sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 76px; /* 하단 탭바 공간 */
  letter-spacing: -0.01em;
}

/* ── 상단 헤더 ── */
.top {
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky; top: 0; z-index: 20;
}
.top h1 { margin: 0; font-size: 17px; font-weight: 800; }
.conn {
  font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
  background: var(--green); display: inline-flex; align-items: center; gap: 6px;
}
.conn::before { content:''; width:6px; height:6px; border-radius:50%; background:#fff; }
.conn.off { background: var(--red); }

/* ── 페이지(탭별 화면) ── */
.page { display: none; padding: 16px; max-width: 1100px; margin: 0 auto; }
.page.active { display: block; }
.page h2 { font-size: 16px; font-weight: 800; margin: 0 0 12px; }

/* ── 주문 카드 ── */
.orders-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.orders-head h2 { margin: 0; }
.view-toggle { display: flex; background: #EEF0F3; border-radius: 999px; padding: 3px; gap: 2px; }
.view-toggle button {
  border: none; background: transparent; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.view-toggle button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.floor-filter-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: #FEF3C7; color: #92400e; font-weight: 700; font-size: 13px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 12px;
}
.floor-filter-bar button {
  border: none; background: #92400e; color: #fff; font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-family: inherit;
}

/* ── 테이블 배치도 (주문탭 조회 + 설정탭 편집 공용) ── */
.floor-canvas, .layout-canvas {
  position: relative;
  background: repeating-linear-gradient(0deg, #FAFAFA, #FAFAFA 24px, #F2F3F5 25px),
              repeating-linear-gradient(90deg, transparent, transparent 24px, #F2F3F5 25px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 220px;
  margin-bottom: 14px;
  overflow: auto;
}
.table-box {
  position: absolute;
  width: 64px; height: 64px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
}
.table-box.clickable { cursor: pointer; }
.table-box.clickable:active { transform: scale(0.96); }
.table-box.draggable { cursor: grab; }
.table-box.dragging { cursor: grabbing; box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 5; }
.table-box.st-empty { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.table-box.st-active { background: var(--brand); border-color: var(--brand-dark); color: #fff; }
.table-box.st-unpaid { background: var(--red); border-color: #B91C1C; color: #fff; animation: pulseUnpaid 1.4s infinite; }
@keyframes pulseUnpaid { 0%,100%{box-shadow:0 0 0 0 rgba(229,62,62,.5);} 50%{box-shadow:0 0 0 8px rgba(229,62,62,0);} }

/* ── 배치 오브젝트(계산대/출입문/벽 등) ── */
.layout-obj {
  position: absolute;
  min-width: 70px; height: 50px;
  border-radius: 10px;
  background: #F4F1EA;
  border: 2px dashed #C9C2B4;
  color: #6B6355;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 11px; font-weight: 700;
  padding: 4px 8px;
  touch-action: none;
  user-select: none;
}
.layout-obj .obj-icon { font-size: 16px; line-height: 1; }
.layout-obj .obj-label { white-space: nowrap; }
.layout-obj.draggable { cursor: grab; }
.layout-obj.dragging { cursor: grabbing; box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 5; }
.layout-obj .obj-del {
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff; border: 2px solid #fff;
  font-size: 13px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.layout-obj.obj-wall { background: #6B6B66; border: none; color: #fff; border-radius: 4px; }
.layout-obj.obj-wall .obj-icon { display: none; }

.floor-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-soft); margin: -6px 0 14px; flex-wrap: wrap; }
.floor-legend span { display: inline-flex; align-items: center; gap: 5px; }
.floor-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.orders-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.order {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--brand);
}
.order.fresh { animation: pop 0.4s ease; border-left-color: var(--amber); }
@keyframes pop { 0%{transform:scale(0.97);} 50%{transform:scale(1.01);} 100%{transform:scale(1);} }
.order .top-row { display: flex; justify-content: space-between; align-items: center; }
.order .table-no { font-size: 22px; font-weight: 800; }
.order .src {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: #EEF2F7; color: var(--ink-soft); margin-left: 8px;
}
.order .src.staff { background:#FEF3C7; color:#92400e; }
.order .src.unpaid { background:#FEE2E2; color:#B91C1C; }
.b-pay { background: #2B6CB0; }
.order .ono { font-size: 12px; color: #A0A0A0; }
.order .item-main { font-weight: 600; font-size: 15px; margin-top: 10px; }
.order .item-opts { margin: 3px 0 8px 2px; display: flex; flex-wrap: wrap; gap: 5px; }
.order .opt-chip { font-size: 12.5px; background:#FEF3C7; color:#92400e; font-weight:700; padding:3px 9px; border-radius:7px; }
.order .total { font-weight: 800; text-align: right; color: var(--brand-dark); margin: 8px 0; font-size: 16px; }
.order .state { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btns button {
  flex: 1 1 calc(50% - 4px); min-width: 0;
  padding: 13px 8px; border: none; border-radius: 11px;
  font-size: 15px; font-weight: 800; color: #fff; cursor: pointer; white-space: nowrap;
}
.b-cook { background: var(--amber); }
.b-serve { background: var(--green); }
.b-cancel { background: var(--red); }
.btns button:active { filter: brightness(0.92); }
.btns button.done {
  background: #E2E4E8; color: #9AA0AA;
  filter: grayscale(1); cursor: default; box-shadow: none;
}
.btns button.done:active { filter: grayscale(1); }
.btns button.muted {
  background: #E2E4E8; color: #9AA0AA;
  filter: grayscale(1); box-shadow: none;
}
.btns button.muted:active { filter: grayscale(1) brightness(0.95); }
.empty { color: var(--ink-soft); text-align: center; padding: 50px 0; font-size: 14px; }

/* ── 메뉴 관리(품절) ── */
.menu-row {
  background: var(--card); padding: 14px 16px; border-radius: 12px;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow);
}
.menu-row .mname { font-weight: 700; font-size: 15px; }
.menu-row .mprice { color: var(--ink-soft); font-size: 13px; font-weight: 600; margin-left: 6px; }
.toggle { padding: 10px 16px; border-radius: 10px; border: none; font-weight: 800; color: #fff; font-size: 14px; cursor: pointer; }
.on-sale { background: var(--green); }
.sold-out { background: #A0AEC0; }

/* ── 직접주문(포스) ── */
.pos-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pos-menus { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pos-menu {
  background: var(--card); border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left; border: 2px solid transparent;
}
.pos-menu:active { border-color: var(--brand); }
.pos-menu.sold { opacity: 0.45; pointer-events: none; }
.pos-menu .pm-name { font-weight: 700; font-size: 15px; }
.pos-menu .pm-price { color: var(--brand-dark); font-weight: 800; font-size: 14px; margin-top: 6px; }
.pos-cat-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.pos-cat-tabs::-webkit-scrollbar { display: none; }
.pos-cat {
  white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer;
}
.pos-cat.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 직접주문 장바구니 패널 */
.pos-cart {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  position: sticky; bottom: 86px;
}
.pos-cart h3 { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.pc-table {
  margin-bottom: 14px;
}
.pc-table label { font-size: 14px; font-weight: 700; display: block; margin-bottom: 6px; }
.pc-table-row { display: flex; align-items: center; gap: 8px; }
.pc-table input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; min-width: 0;
}
.pc-pick-btn {
  flex-shrink: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.pc-pick-btn:active { background: var(--bg); }
.pc-items { margin-bottom: 12px; }
.pc-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pc-item:last-child { border-bottom: none; }
.pc-item .pci-name { font-size: 14px; font-weight: 600; }
.pc-stepper { display: flex; align-items: center; gap: 12px; }
.pc-stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 17px; cursor: pointer; }
.pc-stepper .q { font-weight: 800; min-width: 20px; text-align: center; }
.pc-empty { color: var(--ink-soft); font-size: 13px; text-align: center; padding: 24px 0; }
.pc-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; margin: 14px 0; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pay-method {
  padding: 14px 8px; border: 2px solid var(--line); border-radius: 11px; background: var(--card);
  font-weight: 800; font-size: 15px; cursor: pointer; color: var(--ink-soft);
}
.pay-method.sel { border-color: var(--brand); color: var(--brand-dark); background: #FFF1ED; }
.pos-submit {
  width: 100%; background: var(--brand); color: #fff; border: none; padding: 16px;
  border-radius: 13px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.pos-submit:disabled { background: #CBD5E0; cursor: not-allowed; }
.pos-submit:active:not(:disabled) { background: var(--brand-dark); }
.pos-submit-later {
  width: 100%; background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
  padding: 15px; border-radius: 13px; font-size: 15px; font-weight: 800; cursor: pointer; margin-top: 8px;
}
.pos-submit-later:disabled { color: #CBD5E0; border-color: var(--line); cursor: not-allowed; }
.pos-submit-later:active:not(:disabled) { background: var(--bg); }

/* ── 하단 탭바 ── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 10px 0 12px;
  font-size: 11px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tabbar button .ic { font-size: 22px; line-height: 1; }
.tabbar button.active { color: var(--brand); }
.tabbar .badge {
  position: absolute; top: 6px; margin-left: 18px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; line-height: 16px; border-radius: 999px; padding: 0 4px;
}

/* ── 반응형: 태블릿/PC ── */
@media (min-width: 700px) {
  body { padding-bottom: 0; }
  .tabbar { position: sticky; top: 51px; border-top: none; border-bottom: 1px solid var(--line); }
  .tabbar button { flex-direction: row; gap: 7px; padding: 14px 0; font-size: 14px; }
  .tabbar button .ic { font-size: 18px; }
  .orders-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .pos-menus { grid-template-columns: repeat(3, 1fr); }
  .pos-cart { position: sticky; top: 110px; bottom: auto; }
}
@media (min-width: 1000px) {
  .orders-grid { grid-template-columns: repeat(3, 1fr); }
  .pos-menus { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ── 직접주문 옵션 시트 ── */
.pci-opt { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; font-weight: 500; }
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(28,28,26,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 50;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.pos-opt-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-radius: 22px 22px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 51; transform: translateY(100%);
  transition: transform .28s cubic-bezier(0.2,0.85,0.2,1);
  max-height: 84vh; overflow-y: auto;
}
.pos-opt-sheet.show { transform: translateY(0); }
.pos-opt-sheet .grip { width: 40px; height: 4px; background: var(--line); border-radius: 999px; margin: 8px auto 16px; }
.pos-sheet-name { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.opt-group { margin-bottom: 18px; }
.opt-group h4 { font-size: 14px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 7px; }
.opt-group h4 .req { font-size: 10px; font-weight: 800; color: var(--brand-dark); background: #FFF1ED; padding: 2px 6px; border-radius: 5px; }
.opt-group h4 .opt-mark { font-size: 10px; font-weight: 700; color: var(--ink-soft); background: var(--line); padding: 2px 6px; border-radius: 5px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt-row:last-child { border-bottom: none; }
.opt-row .opt-label { font-size: 15px; font-weight: 500; }
.opt-row .opt-right { display: flex; align-items: center; gap: 12px; }
.opt-row .opt-price { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.opt-row .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .12s ease; }
.opt-row.checkbox .mark { border-radius: 7px; }
.opt-row.selected .mark { background: var(--brand); border-color: var(--brand); }
.opt-row.selected .mark::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translateY(-1px); }
.opt-row.selected .opt-label { font-weight: 700; }
.pos-qty-row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; font-size: 15px; font-weight: 700; }

/* ── 메뉴 관리 ── */
.mm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mm-head h2 { margin: 0; }
.mm-add-btn { background: var(--brand); color: #fff; border: none; padding: 11px 16px; border-radius: 11px; font-size: 14px; font-weight: 800; cursor: pointer; }
.mm-add-btn:active { background: var(--brand-dark); }
.mm-cat-title { font-size: 13px; font-weight: 800; color: var(--ink-soft); margin: 18px 2px 8px; }
.mm-info { display: flex; flex-direction: column; gap: 2px; }
.menu-row .mprice { margin-left: 0; }
.mm-desc { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.mm-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.mm-edit { background: var(--card); border: 1px solid var(--line); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.mm-edit:active { background: var(--bg); }
.mm-field { margin-bottom: 14px; }
.mm-field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.mm-field input, .mm-field select, .mm-field textarea {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: var(--card); resize: vertical;
}
.mm-field-row { display: flex; gap: 12px; }
.mm-field-row .mm-field { flex: 1; min-width: 0; }
.amenity-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.amenity-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px;
  border: 1.5px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700;
  cursor: pointer; user-select: none; background: var(--card);
}
.amenity-chip input { width: auto; accent-color: var(--brand); }
.amenity-chip:has(input:checked) { border-color: var(--brand); background: #FFF1ED; color: var(--brand-dark); }
.mm-del-btn { width: 100%; background: var(--card); color: var(--red); border: 1.5px solid #FECACA; padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; margin-top: 8px; }
.mm-del-btn:active { background: #FEF2F2; }
.mm-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mm-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.mm-thumb.empty { display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 22px; }
.photo-upload { display: flex; gap: 14px; align-items: flex-start; }
.photo-preview { width: 90px; height: 90px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { font-size: 12px; color: var(--ink-soft); }
.photo-actions { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.photo-btn { padding: 11px 14px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; text-align: center; }
.photo-btn:active { background: var(--bg); }
.photo-btn.del { color: var(--red); border-color: #FECACA; }
.photo-btn.ai { background: linear-gradient(135deg, #7C3AED, #A855F7); color: #fff; border: none; }
.photo-btn.ai:active { filter: brightness(0.92); }
.photo-hint { font-size: 11.5px; color: var(--brand-dark); line-height: 1.4; }
.ai-prompt { display: flex; gap: 8px; margin-top: 10px; }
.ai-prompt input { flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; }
.ai-gen-btn { padding: 11px 18px; border: none; border-radius: 10px; background: linear-gradient(135deg, #7C3AED, #A855F7); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; }
.ai-gen-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── 옵션 편집기 ── */
.opt-editor-sub { font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.opt-editor { display: flex; flex-direction: column; gap: 12px; }
.opt-grp { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.opt-grp-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-grp-name { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-weight: 700; font-family: inherit; }
.opt-grp-del { width: 32px; height: 32px; border: none; background: #FEE2E2; color: var(--red); border-radius: 8px; font-size: 14px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.opt-grp-flags { display: flex; gap: 16px; margin-bottom: 10px; font-size: 13px; }
.opt-grp-flags label { display: flex; align-items: center; gap: 5px; font-weight: 600; cursor: pointer; }
.opt-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.opt-item-row { display: flex; gap: 6px; align-items: center; }
.oi-name { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.oi-price { flex: 0 0 64px; width: 64px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; text-align: right; }
.oi-won { flex: 0 0 auto; font-size: 12px; color: var(--ink-soft); }
.oi-del { flex: 0 0 26px; width: 26px; height: 28px; border: none; background: var(--card); color: var(--ink-soft); border-radius: 7px; font-size: 12px; cursor: pointer; }
.opt-item-add { width: 100%; padding: 8px; border: 1px dashed var(--line); background: var(--card); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.opt-add-group { width: 100%; margin-top: 10px; padding: 12px; border: 1.5px dashed var(--brand); background: #FFF7F5; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--brand-dark); cursor: pointer; }
.opt-add-group:active { background: #FFF1ED; }

/* ── 미결제 결제 모달 ── */
.pay-amount { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; padding: 14px 16px; background: var(--bg); border-radius: 12px; }
.pay-amount > span:first-child { font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.pay-amount > span:last-child { font-size: 22px; font-weight: 800; color: var(--brand-dark); }
.pay-modal-methods { margin-bottom: 16px; }
.quick-amt { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.quick-amt button { padding: 10px 4px; border: 1px solid var(--line); background: var(--card); border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; }
.quick-amt button:active { background: var(--bg); }
.change-row { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; background: #F0FDF4; border-radius: 12px; margin-bottom: 14px; }
.change-row > span:first-child { font-size: 14px; font-weight: 700; color: var(--green); }
.change-row > span:last-child { font-size: 22px; font-weight: 800; color: var(--green); }
.change-row #changeAmount.short { color: var(--red); }
.terminal-guide { padding: 20px 16px; background: var(--bg); border-radius: 12px; text-align: center; font-size: 14px; line-height: 1.7; color: var(--ink); margin-bottom: 14px; }

/* ── 부분결제(각자계산) ── */
.pay-progress { background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #9A3412; margin-bottom: 14px; }
.pay-progress .rem { color: var(--brand-dark); }
.pp-hint { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.pp-hint-sub { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.pp-items { margin-bottom: 14px; }
.pp-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pp-item:last-child { border-bottom: none; }
.pp-check { cursor: pointer; flex-shrink: 0; }
.pp-box { display: block; width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 7px; transition: all .12s; }
.pp-item.checked .pp-box { background: var(--brand); border-color: var(--brand); position: relative; }
.pp-item.checked .pp-box::after { content: ''; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.pp-body { flex: 1; min-width: 0; }
.pp-name { font-size: 15px; font-weight: 700; }
.pp-opt { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pp-unit { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.pp-qty { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pp-qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 17px; cursor: pointer; }
.pp-qty button:active { background: var(--bg); }
.pp-selq { font-weight: 800; min-width: 18px; text-align: center; }
.pp-allpaid { text-align: center; color: var(--green); font-weight: 700; padding: 20px 0; font-size: 14px; }
.pp-sum-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; background: var(--bg); border-radius: 10px; margin-bottom: 14px; }
.pp-sum-row > span:first-child { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.pp-sum-row > span:last-child { font-size: 18px; font-weight: 800; }
.pp-edit-note { font-size: 11px; font-weight: 600; color: var(--brand-dark); }

/* ── 매출/통계 ── */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 16px 12px; box-shadow: var(--shadow); text-align: center; }
.sc-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-bottom: 6px; }
.sc-value { font-size: 19px; font-weight: 800; color: var(--ink); }
.stat-card:first-child .sc-value { color: var(--brand-dark); }
.stat-section { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.stat-section h3 { font-size: 15px; font-weight: 800; margin: 0 0 14px; }
.ss-sub { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.ss-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ss-head h3 { margin: 0; }
.period-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 3px; }
.period-tabs .pt { border: none; background: none; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.period-tabs .pt.active { background: var(--card); color: var(--brand-dark); box-shadow: var(--shadow); }

/* 막대 그래프 */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; overflow-x: auto; padding-top: 20px; }
.bar-col { flex: 1; min-width: 36px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-val { font-size: 10px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; white-space: nowrap; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 70%; max-width: 32px; background: linear-gradient(to top, var(--brand), #FF8A6E); border-radius: 6px 6px 0 0; min-height: 3px; transition: height .4s ease; }
.bar-label { font-size: 11px; color: var(--ink-soft); font-weight: 600; margin-top: 6px; white-space: nowrap; }

/* 결제수단별 */
.method-row { margin-bottom: 14px; }
.method-row:last-child { margin-bottom: 0; }
.mr-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.mr-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.mr-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mr-amt { font-size: 14px; font-weight: 800; }
.mr-pct { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-left: 4px; }
.mr-bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.mr-bar > div { height: 100%; border-radius: 999px; transition: width .4s ease; }

/* 인기 메뉴 */
.pop-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pop-row:last-child { border-bottom: none; }
.pop-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); color: var(--ink-soft); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pop-rank.top { background: var(--brand); color: #fff; }
.pop-name { flex: 1; font-size: 14px; font-weight: 700; }
.pop-qty { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.pop-rev { font-size: 13px; font-weight: 800; color: var(--brand-dark); min-width: 70px; text-align: right; }

/* ── 일별 매출 캘린더 ── */
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; font-size: 16px; font-weight: 800; cursor: pointer; color: var(--ink); }
.cal-nav button:active { background: var(--bg); }
.cal-nav span { font-size: 15px; font-weight: 800; min-width: 68px; text-align: center; }
.cal-month-total { font-size: 13px; font-weight: 700; color: var(--brand-dark); margin-bottom: 12px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wday { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); padding-bottom: 6px; }
.cal-wday.sun { color: #E53E3E; }
.cal-wday.sat { color: #2B6CB0; }
.cal-cell { aspect-ratio: 1; border-radius: 8px; background: var(--bg); padding: 5px; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.cal-cell.empty { background: transparent; }
.cal-cell.lv1 { background: #FFEDE8; }
.cal-cell.lv2 { background: #FFD0C2; }
.cal-cell.lv3 { background: #FFB199; }
.cal-cell.today { outline: 2px solid var(--brand); }
.cal-day { font-size: 12px; font-weight: 700; color: var(--ink); }
.cal-rev { font-size: 10.5px; font-weight: 800; color: var(--brand-dark); margin-top: auto; align-self: flex-end; }

/* 4탭이 되면서 탭바 폭 조정 */
@media (min-width: 700px) {
  .tabbar button { font-size: 13px; }
}

/* ── 매장 설정: 테이블 & QR ── */
.set-hint { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.5; }
.table-list { }
.table-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: none; }
.tr-name { font-size: 16px; font-weight: 800; }
.tr-actions { display: flex; gap: 8px; }
.tr-qr { background: var(--ink); color: #fff; border: none; padding: 9px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; }
.tr-del { background: var(--card); color: var(--red); border: 1px solid #FECACA; padding: 9px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; }
.qr-print-area { text-align: center; padding: 10px 0 4px; }
.qr-store { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.qr-table-label { font-size: 16px; color: var(--ink-soft); font-weight: 700; margin-bottom: 18px; }
.qr-box { display: inline-block; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr-box img, .qr-box canvas { display: block; }
.qr-guide { margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }
.qr-url { font-size: 11px; color: var(--ink-soft); word-break: break-all; text-align: center; margin: 12px 0; padding: 8px; background: var(--bg); border-radius: 8px; }

/* ── 매장 설정: 적립 프로그램(포인트/스탬프) ── */
.loy-block {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.loy-block-head { display: flex; justify-content: space-between; align-items: center; }
.loy-title { font-size: 15px; font-weight: 800; }
.loy-switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.loy-switch input { opacity: 0; width: 0; height: 0; }
.loy-slider {
  position: absolute; inset: 0; background: #D8DADF; border-radius: 999px;
  cursor: pointer; transition: background .15s ease;
}
.loy-slider::before {
  content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.loy-switch input:checked + .loy-slider { background: var(--brand); }
.loy-switch input:checked + .loy-slider::before { transform: translateX(18px); }
.loy-fields { margin-top: 12px; transition: opacity .15s ease; }
.loy-fields.disabled { opacity: .4; pointer-events: none; }

/* ── 고객 적립 조회(직접주문 탭 공용 스타일) ── */
.loy-lookup-box {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 12px;
}
.loy-lookup-row { display: flex; gap: 8px; }
.loy-lookup-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; min-width: 0;
}
.loy-lookup-row button {
  flex-shrink: 0; padding: 10px 14px; border: none; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.loy-summary { display: flex; gap: 10px; margin-top: 12px; }
.loy-summary-card {
  flex: 1; background: var(--bg); border-radius: 10px; padding: 12px; text-align: center;
}
.loy-summary-card .n { font-size: 20px; font-weight: 800; color: var(--brand-dark); }
.loy-summary-card .l { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; margin-top: 2px; }
.loy-reward-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.loy-reward-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px;
}
.loy-reward-item.used { opacity: .55; }
.loy-reward-item .lr-label { font-weight: 700; }
.loy-reward-item .lr-date { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.loy-reward-item .lr-btn {
  border: none; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.loy-reward-item .lr-used-tag {
  font-size: 11px; font-weight: 700; color: var(--ink-soft); background: #E6E7EA;
  padding: 5px 10px; border-radius: 999px;
}

/* ── 로그인/회원가입 ── */
.auth-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 100;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: 20px; box-shadow: var(--shadow); padding: 32px 26px;
}
.auth-logo { font-size: 24px; font-weight: 800; text-align: center; }
.auth-sub { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 4px 0 22px; }
.auth-tabs { display: flex; background: #EEF0F3; border-radius: 999px; padding: 3px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; border: none; background: transparent; padding: 9px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.auth-msg { text-align: center; font-size: 12.5px; color: var(--red); margin-top: 10px; min-height: 16px; }

/* ── 계정/매장 전환 ── */
#storeSwitcherSelect {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff;
}

/* ── 소셜 로그인(구글/카카오) — 인증 화면 ── */
.social-login-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.social-btn {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.social-btn:active { filter: brightness(0.97); }
.social-btn.google { color: #3c4043; }
.social-btn.kakao { background: #FEE500; border-color: #FEE500; color: #191919; }
.social-btn b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.social-btn.google b { background: #4285F4; }
.social-btn.kakao b { background: #191919; color: #FEE500; }
.loy-or-divider {
  display: flex; align-items: center; gap: 12px;
  text-align: center; font-size: 11.5px; color: var(--ink-soft); font-weight: 600;
  margin: 16px 0;
}
.loy-or-divider::before, .loy-or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── 매장/주차장 사진첩 ── */
.photo-gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px;
}
.gallery-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb-del {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; font-size: 13px; font-weight: 800;
  cursor: pointer; line-height: 1; padding: 0;
}

/* ── 리뷰 관리 ── */
.review-summary { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.review-summary .rv-avg { color: #F5A623; letter-spacing: 1px; }
.review-item { border-top: 1px solid var(--line); padding: 12px 0; }
.review-item:first-child { border-top: none; }
.rv-top { display: flex; justify-content: space-between; align-items: center; }
.rv-stars { color: #F5A623; font-size: 14px; letter-spacing: 1px; }
.rv-date { font-size: 11.5px; color: var(--ink-soft); }
.rv-comment { font-size: 13.5px; margin-top: 6px; line-height: 1.5; }
.rv-reply {
  margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 10px;
  font-size: 12.5px; line-height: 1.5;
}
.rv-reply b { color: var(--brand-dark); margin-right: 4px; }
.rv-reply-form { display: flex; gap: 6px; margin-top: 8px; }
.rv-reply-form input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; font-family: inherit; min-width: 0;
}
.rv-reply-form button {
  flex-shrink: 0; border: none; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-family: inherit;
}

/* 매장 승인/구독 상태 배너 */
#approvalBanner .apv-banner-in { padding: 12px 20px; font-size: 14px; line-height: 1.5; }
#approvalBanner .apv-banner-in b { font-weight: 800; }
#approvalBanner.apv-tone-info { background: linear-gradient(90deg,#E8F1FF,#EAF6FF); border-bottom: 1px solid #C8DDF5; }
#approvalBanner.apv-tone-info .apv-banner-in { color: #1a56b0; }
#approvalBanner.apv-tone-warn { background: linear-gradient(90deg,#FFF3D6,#FFE8D6); border-bottom: 1px solid #F0D9A8; }
#approvalBanner.apv-tone-warn .apv-banner-in { color: #7a5a10; }
#approvalBanner.apv-tone-bad { background: linear-gradient(90deg,#FFE2E6,#FFD9DE); border-bottom: 1px solid #F5B8C0; }
#approvalBanner.apv-tone-bad .apv-banner-in { color: #a8232f; }
.fee-peek { border: 1px solid currentColor; background: rgba(255,255,255,.5); color: inherit;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  margin-left: 6px; font-family: inherit; -webkit-user-select: none; user-select: none; }
.fee-amount { font-weight: 800; margin-left: 4px; }
