/* ─── 멍냥패스 사장님 센터 (대시보드) ───
 * 이용자 카드 공용 요소(🎁 배지·칩·후기)는 style.css에 있음
 * 디자인 시스템: 그레이 캔버스 + 흰 패널 + 절제된 오렌지 (style.css 토큰 사용) */

body.biz { background: var(--bg-soft); }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid .span2 { grid-column: 1 / -1; }
.field.align-end, .toggle.align-end { align-self: end; }
.field select {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; background: var(--bg-soft); color: var(--ink);
}
.btn-ghost.danger { color: var(--no); border-color: #f3caca; }
.btn-ghost.danger:hover { background: var(--no-bg); }
.empty.small { padding: 14px 0; font-size: 0.9rem; }
.api-desc a, .insight a, .coupon-limit a { color: var(--brand-text); font-weight: 700; }

/* ─── 상단바 ─── */
.biz-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: baseline; gap: 10px; }
.biz-brand { font-weight: 800; color: var(--brand-text); text-decoration: none; font-size: 1.05rem; letter-spacing: -0.01em; }
.biz-title { font-weight: 700; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#store-switch {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); font-size: 0.92rem; max-width: 240px;
}
.plan-badge {
  padding: 4px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; text-decoration: none;
  background: var(--bg-fill); color: var(--ink-soft);
}
.plan-badge.plan-plus { background: var(--brand-tint); color: var(--brand-text); }
.plan-badge.plan-pro { background: var(--ok-bg); color: var(--ok); }

/* ─── 레이아웃 ─── */
.biz-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.biz-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 74px; align-self: start; }
.biz-nav a {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: background 0.12s;
}
.biz-nav a:hover { background: rgba(255, 255, 255, 0.7); }
.biz-nav a.active { background: #fff; color: var(--brand-text); box-shadow: var(--shadow); }
.nav-badge { margin-left: auto; background: var(--no); color: #fff; font-size: 0.72rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; font-style: normal; }
.biz-main { min-width: 0; }
.view-head { margin-bottom: 14px; }
.view-head h2 { font-size: 1.4rem; letter-spacing: -0.02em; }
.view-sub { margin-top: 4px; font-size: 0.9rem; color: var(--ink-soft); max-width: 720px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 .panel, .side-stack .panel, .biz-main > .panel { margin-top: 16px; }
.side-stack { display: flex; flex-direction: column; }
.rules-grid { grid-template-columns: 1.3fr 1fr; }
.panel h3 { font-size: 1rem; margin-bottom: 10px; letter-spacing: -0.01em; }

/* ─── KPI ─── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 4px; }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 14px; text-align: left; }
.stat-tile .stat-num { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.stat-tile .stat-label { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--ink-faint); }
.stat-tile .stat-sub { display: block; margin-top: 5px; font-size: 0.74rem; color: var(--brand-text); font-weight: 600; }
.stat-tile.warn .stat-sub { color: var(--no); }

/* ─── 규정 상태·시뮬레이터 ─── */
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sim-list { display: flex; flex-direction: column; gap: 8px; }
.sim-row {
  display: grid; grid-template-columns: 110px auto 1fr; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: var(--radius-sm); background: var(--bg-soft); border-left: 3px solid var(--line); font-size: 0.86rem;
}
.sim-row.v-ok { border-left-color: var(--ok); }
.sim-row.v-cond { border-left-color: #f59e0b; }
.sim-row.v-no { border-left-color: var(--no); }
.sim-who { font-weight: 700; }
.sim-detail { color: var(--ink-soft); font-size: 0.8rem; }
.sim-list.compact .sim-row { grid-template-columns: 100px auto 1fr; padding: 7px 11px; }
.rule-text { font-size: 0.95rem; line-height: 1.6; padding: 13px 15px; background: var(--brand-tint); border-left: 3px solid var(--brand); border-radius: 8px; }
.rule-text.small { font-size: 0.85rem; margin: 10px 0; }
.todo-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.todo-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; background: var(--bg-soft); border-radius: var(--radius-sm); font-size: 0.88rem; }
.todo-list li.done { color: var(--ink-faint); justify-content: center; }
.todo-list .btn-ghost.slim { text-decoration: none; white-space: nowrap; }

/* ─── 쿠폰 ─── */
.coupon-list { display: flex; flex-direction: column; gap: 10px; }
.coupon-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.coupon-card.st-ended, .coupon-card.st-soldout { opacity: 0.6; }
.coupon-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coupon-head .event-badge { margin: 0; }
.coupon-state { font-size: 0.76rem; font-weight: 700; color: var(--ink-soft); padding: 2px 8px; border-radius: 999px; background: var(--bg-fill); }
.st-active .coupon-state { background: var(--ok-bg); color: var(--ok); }
.coupon-meta { margin-top: 6px; font-size: 0.82rem; color: var(--ink-faint); }
.coupon-card .biz-actions { margin-top: 8px; }

/* ─── 손님 소리 ─── */
.voice-item { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 10px; }
.voice-item.denied { border-left: 3px solid var(--no); }
.voice-text { font-size: 0.92rem; }
.voice-meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.reply-form input { flex: 1 1 220px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.9rem; background: var(--bg-soft); }
.reply-form input:focus { outline: none; border-color: var(--brand); background: #fff; }
.voice-item .link-btn { display: inline-block; margin-top: 8px; font-size: 0.84rem; text-decoration: none; }

/* ─── 리포트 (차트 계열색: 노출=오렌지, 클릭=블루 — CVD 검증 통과 조합) ─── */
.day-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; position: relative; padding-bottom: 26px; }
.day-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; width: 100%; justify-content: center; }
.day-bars span { display: block; width: 38%; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-imp { background: #ff6f0f; }
.bar-clk { background: #3182f6; }
.day-label { font-size: 0.74rem; color: var(--ink-faint); }
.day-val { font-size: 0.7rem; color: var(--ink-soft); }
.chart-legend { position: absolute; bottom: 0; left: 0; font-size: 0.76rem; color: var(--ink-soft); }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 8px; vertical-align: middle; }
.chart-legend .lg.imp { background: #ff6f0f; }
.chart-legend .lg.clk { background: #3182f6; }
.insight-line { font-size: 0.9rem; margin-bottom: 10px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 100px; align-items: center; gap: 10px; }
.bar-label { font-size: 0.83rem; }
.bar-track { background: var(--bg-fill); border-radius: 4px; height: 18px; overflow: hidden; display: block; }
.bar-fill { display: block; height: 100%; background: #ff6f0f; border-radius: 0 4px 4px 0; min-width: 3px; }
.bar-fill.excluded { background: repeating-linear-gradient(45deg, #c3c9d0, #c3c9d0 4px, #dde1e6 4px, #dde1e6 8px); }
.bar-value { font-size: 0.8rem; color: var(--ink-soft); }
.insight { margin-top: 14px; padding: 13px 15px; background: var(--brand-tint); border: 1px solid var(--brand-tint-line); border-radius: var(--radius-sm); font-size: 0.9rem; line-height: 1.55; }
.comp-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.comp-table th, .comp-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.comp-table th { color: var(--ink-faint); font-weight: 600; font-size: 0.78rem; }
.lock-card { text-align: center; padding: 24px 16px; background: var(--bg-soft); border-radius: 14px; border: 1px dashed var(--line); }
.lock-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.lock-card p { font-size: 0.9rem; margin-bottom: 8px; }
.lock-sub { color: var(--ink-faint); font-size: 0.82rem !important; }
.lock-card .btn-secondary { text-decoration: none; display: inline-block; }

/* ─── 요금제 ─── */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 4px; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px 22px; display: flex; flex-direction: column; gap: 6px; }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan-card.plan-plus h3 { color: var(--brand-text); }
.plan-card.plan-pro h3 { color: var(--ok); }
.plan-card h3 { font-size: 1.2rem; }
.plan-tag { font-size: 0.84rem; color: var(--ink-faint); }
.plan-price { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 8px; }
.plan-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; flex: 1; margin-bottom: 12px; }
.plan-current { text-align: center; font-weight: 700; color: var(--brand-text); padding: 10px; background: var(--brand-tint); border-radius: var(--radius-sm); }
.plan-card .btn-primary.slim { width: 100%; }
.plan-card .btn-ghost { width: 100%; }
.fee-note p { font-size: 0.9rem; color: var(--ink-soft); }
.fee-note strong { color: var(--ink); }
.chip-boost { padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; background: var(--brand-tint); color: var(--brand-text); }

/* ─── 온보딩 오버레이 ─── */
.onboarding { position: fixed; inset: 0; z-index: 30; overflow-y: auto; background: var(--bg-soft); padding: 32px 16px; }
.ob-card { max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lift); overflow: hidden; }
.ob-head { position: relative; padding: 30px 28px 20px; text-align: center; background: #fff; border-bottom: 1px solid var(--line); }
.ob-brand { color: var(--brand-text); font-weight: 800; text-decoration: none; font-size: 0.9rem; }
.ob-head h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin-top: 6px; }
.ob-tagline { color: var(--ink-soft); font-size: 0.95rem; margin-top: 4px; }
.ob-progress { list-style: none; display: flex; justify-content: center; gap: 18px; margin-top: 18px; font-size: 0.84rem; color: var(--ink-faint); }
.ob-progress li { display: flex; align-items: center; gap: 6px; }
.ob-progress li span { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-fill); font-size: 0.78rem; font-weight: 700; }
.ob-progress li.active { color: var(--brand-text); font-weight: 700; }
.ob-progress li.active span, .ob-progress li.done span { background: var(--brand); color: #fff; }
.ob-close { position: absolute; top: 14px; right: 14px; border: 0; background: var(--bg-fill); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--ink-soft); }
.ob-step { padding: 26px 28px 30px; }
.ob-step h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.ob-step .api-desc { margin-bottom: 14px; }
.consent { margin-top: 14px; font-size: 0.86rem; }
.new-store { margin-top: 14px; padding: 16px; background: var(--bg-soft); border-radius: 14px; }
.ob-done { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.ob-why { padding: 14px 16px; background: var(--brand-tint); border: 1px solid var(--brand-tint-line); border-radius: var(--radius-sm); font-size: 0.92rem; line-height: 1.6; }
.ob-why ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.biz-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.biz-actions .api-status { margin-top: 0; }

/* ─── 매장 안내판 (인쇄) ─── */
.signage { position: fixed; inset: 0; z-index: 40; background: var(--bg-soft); overflow-y: auto; padding: 30px 16px; }
.signage-sheet { max-width: 640px; margin: 0 auto; background: #fff; border: 6px solid var(--brand); border-radius: 22px; padding: 36px 34px; text-align: center; }
.signage-top { font-size: 1.1rem; font-weight: 800; color: var(--brand-text); letter-spacing: 1px; }
.signage-sheet h1 { font-size: 2rem; letter-spacing: -0.02em; margin: 8px 0 14px; }
.sg-text { font-size: 1.15rem; line-height: 1.7; padding: 14px 18px; background: var(--brand-tint); border-radius: 14px; }
.sg-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 0.95rem; }
.sg-table th, .sg-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.sg-table th { font-size: 0.8rem; color: var(--ink-faint); }
.sg-foot { margin-top: 20px; font-size: 0.92rem; line-height: 1.6; }
.sg-qr { display: inline-block; margin-top: 8px; padding: 26px 18px; border: 2px dashed var(--line); border-radius: var(--radius-sm); color: var(--ink-faint); font-size: 0.8rem; }
.signage-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
@media print {
  body.biz { background: #fff; }
  .no-print, .biz-topbar, .biz-layout, .onboarding { display: none !important; }
  .signage { position: static; padding: 0; background: #fff; }
  .signage-sheet { border-width: 6px; }
}

/* ─── 모바일 ─── */
@media (max-width: 820px) {
  .biz-layout { grid-template-columns: 1fr; gap: 12px; padding: 12px 12px 50px; }
  .biz-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .biz-nav a { white-space: nowrap; padding: 10px 13px; font-size: 0.86rem; background: #fff; border: 1px solid var(--line); }
  .biz-nav a.active { border-color: var(--brand); }
  .grid-2, .rules-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .sim-row, .sim-list.compact .sim-row { grid-template-columns: 1fr auto; }
  .sim-detail { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 110px 1fr 90px; }
  .day-bars { height: 80px; }
  .topbar-right { width: 100%; }
  #store-switch { flex: 1 1 140px; max-width: none; }
}

/* 폼 입력 — style.css는 text/number만 다루므로 email/date 보완 */
.field input[type="email"], .field input[type="date"] {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; background: var(--bg-soft); color: var(--ink);
}
.field input[type="email"]:focus, .field input[type="date"]:focus { outline: none; border-color: var(--brand); background: #fff; }

/* 규정 폼 fieldset — 기본 테두리 제거, 토글 가로 배치 */
#rule-form fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
#rule-form fieldset legend { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; padding: 0; }
#rule-form fieldset .toggle { display: inline-flex; margin-right: 8px; }
#rule-form .toggles { margin-top: 14px; }
#rule-form > .field { margin-top: 14px; }
/* 온보딩 약관 체크 간격 */
.ob-step .consent { display: inline-flex; margin: 18px 0 2px; }
