* { box-sizing: border-box; }
:root {
  --paper: #fffcf7; --cream: #f3ece2; --line: #e3dbcd; --text: #3d3831; --muted: #8a8177;
  --accent: #4a5d45; --warn: #c0584f; --full: #dcebd6;
}
body {
  margin: 0; background: var(--cream); color: var(--text);
  font: 14px/1.5 "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; cursor: pointer; }

/* ---------- 비밀번호 화면 ---------- */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; }
.gate-card { width: min(360px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 32px 26px; text-align: center; }
.gate-card h1 { margin: 0 0 6px; font-size: 20px; }
.gate-card p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.gate-card input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }
.gate-card button { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; }
.gate-error { margin-top: 12px !important; color: var(--warn) !important; }

/* ---------- 상단 막대 ---------- */
.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.sides { display: flex; gap: 6px; }
.side-btn { padding: 7px 16px; border: 1px solid var(--line); background: #fff; border-radius: 20px; color: var(--muted); }
.side-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.counts { margin: 0; color: var(--muted); font-size: 13px; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lock input[type=range] { width: 110px; }
.lock { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.ghost { padding: 7px 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--text); }

/* ---------- 좌우 구성 ---------- */
.body { display: flex; align-items: flex-start; height: calc(100vh - 53px); }
.pool { width: 230px; flex: none; height: 100%; overflow: auto; padding: 14px; background: var(--paper); border-right: 1px solid var(--line); }
.pool h2 { margin: 0 0 4px; font-size: 14px; }
.pool-help { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.pool-list { display: flex; flex-direction: column; gap: 6px; }
.pool.is-over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.floor-wrap { flex: 1; height: 100%; overflow: auto; padding: 24px; }
.floor-box { position: relative; margin: 0 auto; }
.floor { position: relative; transform-origin: 0 0; width: 1040px; margin: 0 auto; background:
  linear-gradient(var(--paper), var(--paper)) padding-box; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- 이름표 ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 12px; white-space: nowrap; touch-action: none; cursor: grab; }
.chip b { font-weight: 600; }
.chip small { color: var(--muted); }
.chip.is-absent { opacity: .45; text-decoration: line-through; }
.chip.is-pending { border-style: dashed; color: var(--muted); }
.chip.dragging { opacity: .4; }
.chip-ghost { position: fixed; z-index: 50; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,.2); }

/* ---------- 테이블 ---------- */
.table { position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; text-align: center; touch-action: none; }
.table.is-full { background: var(--full); border-color: #9bbf8e; }
.table.is-over-capacity { border-color: var(--warn); background: #fbeae9; }
.table.is-over { outline: 3px solid var(--accent); outline-offset: 3px; }
.table .no { font-size: 20px; font-weight: 700; }
.table .cnt { font-size: 12px; color: var(--muted); }
.table.is-over-capacity .cnt { color: var(--warn); font-weight: 600; }
.seat { position: absolute; transform: translate(-50%, -50%); }
.moving .table { cursor: move; box-shadow: 0 0 0 2px var(--accent) inset; }

/* ---------- 단상 · 문 ---------- */
.fixture { position: absolute; transform: translate(-50%, -50%); padding: 12px 26px; border-radius: 8px; font-size: 14px; font-weight: 600; letter-spacing: .08em; touch-action: none; }
.fixture.stage { background: var(--accent); color: #fff; }
.fixture.door { background: #fff; border: 2px dashed var(--muted); color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 20px; background: rgba(58,52,44,.92); color: #fff; font-size: 13px; z-index: 60; }

@media print {
  .bar, .pool, .pool-help { display: none !important; }
  .body, .floor-wrap { height: auto; overflow: visible; padding: 0; }
  .floor { border: 0; }
}
