/* admin.css — 함께워크 ON 백오피스 디자인 시스템 (다크 사이드바 + 밝은 본문 프리미엄 대시보드)
   ※ tab-*.js / core.js 가 사용하는 컴포넌트 클래스명은 그대로 보존하고 스타일만 재작성. */

/* ─────────────────────────── 토큰 ─────────────────────────── */
:root {
  /* 브랜드 그린 */
  --green: #1a8b46; --green-d: #157038; --green-l: #22a155; --green-soft: #e9f6ee;
  /* 사이드바(다크 slate) */
  --side-bg: #0f172a; --side-bg2: #1e293b; --side-line: #1e2a3d;
  --side-ink: #cbd5e1; --side-ink-dim: #7689a3; --side-brand: #f1f5f9;
  /* 본문(밝음) */
  --bg: #f8fafc; --panel: #ffffff; --panel2: #fbfcfe;
  --line: #e6e9ee; --line2: #eef2f6;
  --ink: #1e293b; --ink2: #334155; --muted: #64748b; --soft: #94a3b8;
  --danger: #dc2626; --danger-d: #b91c1c; --danger-soft: #fef2f2;
  --warn: #d97706; --warn-soft: #fffbeb; --ok: #059669; --ok-soft: #ecfdf5;
  /* 형태 */
  --radius: 14px; --radius-md: 10px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow: 0 4px 12px rgba(15,23,42,.07), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 18px 48px rgba(15,23,42,.20);
  --ring: 0 0 0 3px rgba(26,139,70,.18);
  /* 간격 */
  --sp1: 4px; --sp2: 8px; --sp3: 12px; --sp4: 16px; --sp5: 20px; --sp6: 24px; --sp8: 32px;
  --side-w: 250px; --top-h: 60px;
  --t: .15s ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Pretendard", "Pretendard Variable", -apple-system, system-ui, "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--green-d); text-decoration: none; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; background: var(--line2); padding: 1px 6px; border-radius: 5px; }
::selection { background: rgba(26,139,70,.18); }

/* ─────────────────────────── 레이아웃 ─────────────────────────── */
.bo-layout { display: flex; min-height: 100vh; }

/* 사이드바 (다크) */
.bo-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w);
  background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; z-index: 60;
  border-right: 1px solid var(--side-line);
  transition: transform .25s ease;
}
.bo-brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--side-line); }
.brand-logo { font-size: 17px; font-weight: 800; color: var(--side-brand); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.brand-logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(26,139,70,.22); }
.brand-sub { font-size: 11.5px; color: var(--side-ink-dim); margin-top: 4px; padding-left: 19px; }

.bo-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav-group-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--side-ink-dim); padding: 8px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  border-radius: var(--radius-sm); color: var(--side-ink); cursor: pointer;
  font-weight: 600; font-size: 13.5px; border: 0; background: none; width: 100%; text-align: left;
  transition: background var(--t), color var(--t);
}
.nav-item:hover { background: var(--side-bg2); color: #fff; }
.nav-item.active { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(26,139,70,.35); }
.nav-item .ic { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; opacity: .92; }
.nav-item .ic svg { width: 18px; height: 18px; }

.bo-user { border-top: 1px solid var(--side-line); padding: 14px; display: flex; align-items: center; gap: 10px; }
.bo-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 34px; }
.bo-user .u-meta { flex: 1; min-width: 0; }
.bo-user .u-name { font-size: 13px; font-weight: 700; color: var(--side-brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-user .u-role { font-size: 11px; color: var(--side-ink-dim); }
.bo-user .logout { background: none; border: 1px solid var(--side-line); color: var(--side-ink-dim); border-radius: 7px; padding: 6px 8px; cursor: pointer; font-size: 11.5px; transition: var(--t); }
.bo-user .logout:hover { color: #fff; border-color: var(--side-ink-dim); background: var(--side-bg2); }

/* 메인 영역 */
.bo-main { margin-left: var(--side-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 상단바 (밝음) */
.bo-topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 26px;
}
.bo-title { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.bo-topbar .spacer { flex: 1; }
.hamburger { display: none; border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 38px; height: 38px; font-size: 17px; cursor: pointer; color: var(--ink2); }
.hamburger:hover { background: var(--line2); }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--green-d); background: var(--green-soft); padding: 6px 12px; border-radius: 999px; }
.live-badge .blink { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.8s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* 본문 */
.bo-content { flex: 1; padding: 26px; max-width: 1160px; width: 100%; }

/* 스크림(모바일 드로어 오버레이) */
.bo-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }

/* ─────────────────────────── 패널·섹션 ─────────────────────────── */
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.panel-head h2 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.panel-head .desc { color: var(--muted); font-size: 13px; }
.panel-head .spacer { flex: 1; }

.section {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.section > h3 { margin: 0 0 16px; font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.section > h3 .sub { font-weight: 400; color: var(--soft); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ─────────────────────────── 버튼 ─────────────────────────── */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 600; font-family: inherit; transition: var(--t);
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.2;
}
.btn:hover { background: var(--line2); border-color: #d7dde5; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 1px 2px rgba(26,139,70,.3); }
.btn.primary:hover { background: var(--green-d); border-color: var(--green-d); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-d); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line2); color: var(--ink2); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ─────────────────────────── 폼 ─────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.field-hint { color: var(--soft); font-size: 11.5px; }
.inp {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--ink); transition: border-color var(--t), box-shadow var(--t);
}
.inp::placeholder { color: var(--soft); }
.inp:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
select.inp { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
textarea.inp { resize: vertical; min-height: 76px; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; padding: 4px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; cursor: pointer; user-select: none; transition: var(--t); background: #fff; }
.chip:hover { border-color: #cfd6df; }
.chip input { accent-color: var(--green); }
.chip.on { background: var(--green-soft); border-color: var(--green); color: var(--green-d); font-weight: 600; }

/* S9: 동적 리스트 에디터(혜택·기간별 가격) */
.list-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.row-edit { display: flex; gap: 8px; align-items: center; }
.row-edit .inp { flex: 1; min-width: 0; }
.pp-row { display: flex; gap: 8px; align-items: center; }
.pp-row .inp { flex: 1; min-width: 0; }
.pp-row .inp:first-child { max-width: 90px; }
/* S9: 초대 발급 결과 카드 */
.result-card { border: 1px solid var(--green); background: var(--green-soft); }
.kv-inline { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.kv-inline b { font-size: 16px; color: var(--green-d); }

/* ─────────────────────────── 테이블 ─────────────────────────── */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.tbl thead th { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; background: var(--panel2); border-bottom: 1px solid var(--line); }
table.tbl tbody tr { transition: background var(--t); }
table.tbl tbody tr:hover td { background: var(--panel2); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; }
.tag.on { background: var(--ok-soft); color: var(--ok); }
.tag.off { background: #f1f5f9; color: var(--soft); }
.tag.blue { background: var(--green-soft); color: var(--green-d); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.tag.green { background: var(--green-d); color: #fff; }   /* S9: 비상주 등급(tier) 배지 */

/* ─────────────────────────── 카드 그리드(상품) ─────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow-sm); transition: box-shadow var(--t), transform var(--t); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .price { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.card .meta { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card .card-foot { display: flex; gap: 7px; margin-top: auto; padding-top: 8px; }

/* ─────────────────────────── 빈 상태 / 로딩 ─────────────────────────── */
.empty { text-align: center; color: var(--soft); padding: 56px 20px; font-size: 13.5px; }
.loading { color: var(--soft); padding: 60px; text-align: center; font-size: 13.5px; }
.loading::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 9px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; vertical-align: -4px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────── 토스트 ─────────────────────────── */
#toast.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .28s cubic-bezier(.2,.8,.2,1); z-index: 200; box-shadow: var(--shadow-lg);
}
#toast.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.toast.err { background: var(--danger); }
#toast.toast.ok { background: #0f172a; }

/* ─────────────────────────── 모달 ─────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: flex-start; justify-content: center; padding: 52px 16px; z-index: 100; overflow: auto; backdrop-filter: blur(2px); }
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 720px; }
@keyframes pop { from { transform: translateY(-10px) scale(.98); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line2); }
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; flex: 1; }
.modal-x { border: none; background: none; font-size: 24px; line-height: 1; color: var(--soft); cursor: pointer; transition: var(--t); border-radius: 7px; width: 32px; height: 32px; }
.modal-x:hover { color: var(--ink); background: var(--line2); }
.modal-form { padding: 20px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line2); }
.confirm-msg { padding: 24px 22px; font-size: 14px; color: var(--ink2); }

/* ─────────────────────────── 좌석 배치도 에디터 ─────────────────────────── */
.layout-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.zone-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.zone-pill { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink2); transition: var(--t); }
.zone-pill:hover { border-color: var(--green); color: var(--green-d); }
.zone-pill.active { background: var(--green); color: #fff; border-color: var(--green); }
.grid-canvas { background: var(--panel2) repeating-linear-gradient(0deg, transparent, transparent 59px, var(--line2) 59px, var(--line2) 60px), repeating-linear-gradient(90deg, transparent, transparent 59px, var(--line2) 59px, var(--line2) 60px); border: 1px solid var(--line); border-radius: var(--radius-md); min-height: 360px; }
.grid-stack-item-content { position: relative; background: var(--green-soft); border: 1.5px solid var(--green); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--green-d); font-size: 13px; cursor: move; }
.grid-stack-item-content.fixed { background: var(--warn-soft); border-color: var(--warn); color: #92400e; }
.grid-stack-item-content .seat-del { position: absolute; top: 3px; right: 5px; font-size: 13px; color: var(--danger); cursor: pointer; opacity: 0; transition: var(--t); }
.grid-stack-item:hover .seat-del { opacity: 1; }
.layout-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.layout-legend .sw { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }

/* ─────────────────────────── 유틸 ─────────────────────────── */
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0; }

/* ─────────────────────────── 반응형 ─────────────────────────── */
@media (max-width: 768px) {
  .bo-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .bo-layout.nav-open .bo-sidebar { transform: translateX(0); }
  .bo-layout.nav-open .bo-scrim { opacity: 1; pointer-events: auto; }
  .bo-main { margin-left: 0; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .bo-content { padding: 18px 16px; }
  .bo-topbar { padding: 0 16px; }
  .bo-title { font-size: 16px; }
  .section { padding: 18px 16px; }
}
@media (min-width: 769px) {
  .bo-scrim { display: none; }
}

/* ════════════════════════ S3 — 출입·좌석운영(실시간/로그/도어/QR) ════════════════════════ */

/* 상단바 사용자 페이지 보기 */
.view-user { white-space: nowrap; }
.poll-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--green-d); }
.poll-badge .blink { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 1.2s ease-in-out infinite; }

/* 필터 바 */
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 700; }
.filter-field .inp { min-width: 130px; }
.list-meta { color: var(--soft); font-size: 12px; margin-top: 12px; text-align: right; }
.tag.dir-in { background: var(--green-soft); color: var(--green-d); }
.tag.dir-out { background: #f1f5f9; color: var(--ink2); }
.tag.dir-step { background: var(--warn-soft); color: var(--warn); }

/* 실시간 현황 — KPI */
.live-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.lstat { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 10px; text-align: center; background: #fff; }
.lstat .ls-val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.lstat .ls-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.lstat.oc .ls-val { color: var(--green-d); } .lstat.av .ls-val { color: var(--ink2); }
.lstat.ot .ls-val { color: var(--warn); } .lstat.mt .ls-val { color: var(--soft); } .lstat.nw .ls-val { color: #6366f1; }

/* 실시간 배치도 */
.live-wrap { margin-top: 4px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; margin: 14px 0; }
.seat-live { position: relative; min-height: 64px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; transition: var(--t); padding: 6px 4px; min-width: 0; }
.seat-live:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.seat-live .sl-label { font-weight: 800; font-size: 13px; }
.seat-live .sl-meta { font-size: 10.5px; opacity: .85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-live .sl-nw { position: absolute; top: 3px; right: 4px; font-size: 9px; font-weight: 800; background: #6366f1; color: #fff; border-radius: 4px; padding: 1px 3px; }
.seat-live.av { background: #fff; border-color: var(--line); color: var(--ink2); }
.seat-live.oc { background: var(--green-soft); border-color: var(--green); color: var(--green-d); }
.seat-live.ot { background: var(--warn-soft); border-color: var(--warn); color: #92400e; }
.seat-live.mt { background: #f1f5f9; border-color: #cbd5e1; color: var(--soft); cursor: not-allowed; }
.seat-live.soon { box-shadow: 0 0 0 2px rgba(217,119,6,.45); }
.live-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.live-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.live-legend .sw { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--line); display: inline-block; }
.live-legend .sw.av { background: #fff; } .live-legend .sw.oc { background: var(--green-soft); border-color: var(--green); }
.live-legend .sw.ot { background: var(--warn-soft); border-color: var(--warn); } .live-legend .sw.mt { background: #f1f5f9; }
.live-legend .sw.soon-sw { box-shadow: 0 0 0 2px rgba(217,119,6,.45); }
.live-legend .nw-lg .sw { background: #6366f1; color: #fff; font-size: 9px; font-weight: 800; display: grid; place-items: center; border: 0; }
.ops-seat { font-size: 13.5px; margin: 0 0 14px; color: var(--ink2); }

/* 도어 제어판 */
.door-adapter { display: flex; align-items: center; gap: 12px; border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px; }
.door-adapter.sim { background: var(--warn-soft); border: 1px solid #fcd34d; }
.door-adapter.live { background: var(--ok-soft); border: 1px solid #6ee7b7; }
.door-adapter .da-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.door-adapter.sim .da-dot { background: var(--warn); } .door-adapter.live .da-dot { background: var(--ok); }
.door-adapter .da-title { font-weight: 800; font-size: 13.5px; }
.door-adapter .da-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.door-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.door-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); }
.door-card .dc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.door-card .dc-name { font-size: 15px; font-weight: 800; }
.door-card .dc-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.5px; margin-bottom: 14px; }
.door-card .dc-meta span:nth-child(even) { text-align: right; font-weight: 600; }
.door-card .btn { width: 100%; justify-content: center; }

/* 좌석 QR */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.qr-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 14px; text-align: center; box-shadow: var(--shadow-sm); }
.qr-card .qr-label { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.qr-card .qr-zone { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.qr-box { width: 132px; height: 132px; margin: 0 auto; display: grid; place-items: center; }
.qr-box img, .qr-box canvas { display: block; }
.qr-empty { width: 132px; height: 132px; display: grid; place-items: center; background: var(--panel2); border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--soft); font-size: 12px; white-space: pre-line; text-align: center; }
.qr-token { font-size: 10px; color: var(--soft); margin-top: 8px; word-break: break-all; }
.qr-actions { margin-top: 12px; }

/* 인쇄: 좌석 QR만 보이게 */
@media print {
  .bo-sidebar, .bo-topbar, .bo-scrim, .panel-head .desc, .panel-head .spacer, .panel-head button, .no-print, .qr-actions { display: none !important; }
  .bo-main { margin: 0 !important; }
  .bo-content { padding: 0 !important; }
  .section.seatqr-print { border: 0; box-shadow: none; padding: 0; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .qr-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}

/* 출입·좌석운영 반응형 */
@media (max-width: 768px) {
  .live-stats { grid-template-columns: repeat(3, 1fr); }
  .live-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; padding: 10px; }
}

/* ════════════════════════ S5 — 회의실 예약 캘린더(FullCalendar 6 공용·user+BO) ════════════════════════ */
.rcal-host { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; overflow: hidden; margin-top: 6px; }
.rcal-host .fc { font-size: 12.5px; }
.rcal-host .fc .fc-timegrid-slot { height: 1.7em; }
.rcal-host .fc .fc-col-header-cell-cushion,
.rcal-host .fc .fc-timegrid-axis-cushion { font-size: 11.5px; color: var(--muted); }
.rcal-host .fc .fc-event { border-radius: 5px; font-size: 11.5px; padding: 1px 3px; cursor: pointer; }
/* 내 예약 / 타인 예약(익명) / BO 예약 / 휴업 */
.rcal-host .fc-event.fc-mine { background: var(--green); border-color: var(--green-d); color: #fff; }
.rcal-host .fc-event.fc-taken { background: #e2e8f0; border-color: #cbd5e1; color: #64748b; }
.rcal-host .fc-event.fc-bo-res { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.rcal-host .fc-bg-event.fc-closed { background: repeating-linear-gradient(45deg, rgba(148,163,184,.30), rgba(148,163,184,.30) 6px, rgba(148,163,184,.14) 6px, rgba(148,163,184,.14) 12px); opacity: 1; }
.rcal-host .fc-bg-event.fc-closed .fc-event-title { color: #475569; font-weight: 700; font-size: 10.5px; }
.rcal-host .fc .fc-timegrid-now-indicator-line { border-color: var(--danger); }

/* BO 포인트 잔액·증감 색 */
.pt-balance-bo { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 2px; }
.pt-balance-bo span { color: var(--muted); font-weight: 700; font-size: 13px; }
.pt-balance-bo b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
table.tbl td.plus-amt { color: var(--green-d); font-weight: 700; }
table.tbl td.minus-amt { color: var(--danger); font-weight: 700; }

/* ═══════════════ S6 — 대시보드 · 알림(서브탭/검수) ═══════════════ */
/* 서브탭(알림 관리 내부 전환) */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 18px; }
.subtab { appearance: none; border: 0; background: none; padding: 9px 14px; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--ink2); }
.subtab.active { color: var(--green-d); border-bottom-color: var(--green); }
.sub-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.sub-head h3 { font-size: 16px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.sub-head .desc { color: var(--muted); font-size: 12.5px; }
.sub-head .spacer { flex: 1; }

/* 금일 요약·통계 스탯 카드 */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.dstat { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 13px 14px; box-shadow: var(--shadow-sm); }
.dstat .ds-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.dstat .ds-val { font-size: 21px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; }

/* 가동률(좌석·회의실) */
.dash-occ { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .dash-occ { grid-template-columns: 1fr; } }
.occ-card { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.occ-gauge { position: relative; width: 96px; height: 96px; flex: 0 0 auto; }
.gauge-ring { width: 96px; height: 96px; border-radius: 50%; }
.occ-gauge::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--panel); }
.occ-gauge .occ-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 2; }
.occ-gauge .occ-center b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: block; }
.occ-gauge .occ-center span { font-size: 11px; color: var(--muted); font-weight: 700; }
.occ-legend { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.occ-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.occ-row .or-label { color: var(--ink2); flex: 1; }
.occ-row .or-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.or-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--soft); }
.or-dot.oc { background: var(--green); } .or-dot.av { background: var(--line); border: 1px solid var(--soft); }
.or-dot.ot { background: var(--warn); } .or-dot.mt { background: var(--danger); } .or-dot.nw { background: #6366f1; }

/* KPI */
.dash-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kcard { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); padding: 16px 14px; text-align: center; box-shadow: var(--shadow-sm); }
.kcard .k-val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--green-d); }
.kcard .k-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 5px; }

/* 할 일 */
.dash-todos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.td-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); box-shadow: var(--shadow-sm); overflow: hidden; }
.td-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.td-head .td-title { font-size: 13.5px; font-weight: 800; flex: 1; }
.td-count { font-size: 12px; font-weight: 800; min-width: 22px; text-align: center; border-radius: 999px; padding: 2px 8px; background: var(--green-soft); color: var(--green-d); }
.td-count.zero { background: var(--line2); color: var(--soft); }
.td-count.amber { background: var(--warn-soft); color: var(--warn); }
.td-count.danger { background: var(--danger-soft); color: var(--danger); }
.td-list { display: flex; flex-direction: column; }
.td-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line2); padding: 10px 14px; cursor: pointer; }
.td-item:first-child { border-top: 0; }
.td-item:hover { background: var(--panel2); }
.td-item .ti-main { font-size: 13px; font-weight: 700; color: var(--ink); }
.td-item .ti-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.td-empty { padding: 14px; color: var(--soft); font-size: 12.5px; text-align: center; }
.td-more { width: 100%; border: 0; border-top: 1px solid var(--line2); background: var(--panel2); padding: 8px; font-size: 12px; font-weight: 700; color: var(--green-d); cursor: pointer; }

/* ═══ S7: 접근성 공통 ═══ */
/* 키보드 포커스 표시 — 인터랙티브 요소 전반(btn/inp는 별도 정의, 그 외 보강) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
.nav-item:focus-visible, .modal-x:focus-visible, .hamburger:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px; box-shadow: var(--ring);
}
/* 스크린리더 전용(시각적 숨김) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ═══ S7: BO 센터 위치·지오펜싱(tab-center) ═══ */
.geo-form .geo-search { display: flex; gap: 8px; margin-bottom: 10px; }
.geo-form .geo-search .inp { flex: 1; }
.geo-map { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel2); margin-bottom: 12px; }
.geo-map-fallback { width: 100%; min-height: 92px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.geo-radius-row { display: flex; align-items: center; gap: 10px; }
.geo-radius-row .geo-range { flex: 1; accent-color: var(--green); }
.geo-radius-row .inp { width: 90px; }
.geo-unit { font-size: 12.5px; color: var(--muted); font-weight: 700; }
@media (max-width: 720px) { .geo-map { height: 240px; } }

/* ═══════════════════ S10 — 실시간 도면 고도화(tab-live) + 이용 통계(tab-usage-stats) ═══════════════════ */

/* 혼잡도 바 */
.live-congest { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.live-congest .lc-pct { font-size: 13px; font-weight: 800; color: var(--green-d); white-space: nowrap; }
.live-congest .lc-bar { flex: 1; height: 9px; border-radius: 999px; background: var(--line2); overflow: hidden; }
.live-congest .lc-bar span { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .4s ease; }
.live-congest .lc-sub { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* 구역 클러스터 도면 */
.live-board { display: flex; flex-direction: column; gap: 16px; max-height: 64vh; overflow: auto; padding: 2px; margin: 14px 0; }
.live-cluster { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel2); padding: 12px 14px 14px; }
.live-cluster-label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--ink2); margin-bottom: 10px; }
.live-cluster-label .lcl-count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.live-cluster-label .lcl-av { font-size: 11.5px; font-weight: 700; color: var(--green-d); }
.live-cluster .live-grid { margin: 0; background: transparent; border: 0; padding: 0; }
.live-grid.coords { grid-auto-rows: 64px; }
/* 좌석 만료임박 분 배지 + 정비 클릭 가능 */
.seat-live .sl-soon { position: absolute; bottom: 3px; right: 4px; font-size: 9px; font-weight: 800; background: var(--warn); color: #fff; border-radius: 4px; padding: 1px 3px; }
.seat-live.mt { cursor: pointer; }
.ops-seat { font-size: 13.5px; margin: 0 0 10px; color: var(--ink2); line-height: 1.5; }

/* 이용 통계 — 필터 */
.stats-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.stats-f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.stats-f .inp { min-width: 140px; }
.kcard .k-sub { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 4px; }

/* 시간대별 막대 */
.stat-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 160px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel2); padding: 12px 10px 6px; }
.stat-hours .sh-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.stat-hours .sh-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.stat-hours .sh-bar { width: 72%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--green); transition: height .35s ease; }
.stat-hours .sh-bar.zero { background: var(--line); min-height: 2px; }
.stat-hours .sh-x { font-size: 9.5px; color: var(--soft); font-variant-numeric: tabular-nums; height: 11px; }

/* 구역별 가로 막대 */
.stat-zone-list { display: flex; flex-direction: column; gap: 10px; }
.stat-zone-list .szrow { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; }
.stat-zone-list .sz-name { font-size: 13px; font-weight: 800; color: var(--ink); }
.stat-zone-list .sz-bar-wrap { height: 14px; border-radius: 999px; background: var(--line2); overflow: hidden; }
.stat-zone-list .sz-bar { height: 100%; border-radius: 999px; background: var(--green); min-width: 3px; transition: width .35s ease; }
.stat-zone-list .sz-meta { text-align: right; white-space: nowrap; }
.stat-zone-list .sz-meta b { font-size: 13px; font-weight: 800; color: var(--green-d); }
.stat-zone-list .sz-meta span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }

/* 일별 추이 막대 */
.stat-days { display: flex; align-items: end; gap: 6px; height: 170px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel2); padding: 12px 12px 6px; overflow-x: auto; }
.stat-days .sd-col { flex: 1 0 32px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.stat-days .sd-val { font-size: 11px; font-weight: 800; color: var(--ink2); font-variant-numeric: tabular-nums; }
.stat-days .sd-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.stat-days .sd-bar { width: 60%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--green-d); transition: height .35s ease; }
.stat-days .sd-bar.zero { background: var(--line); }
.stat-days .sd-x { font-size: 10px; color: var(--soft); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .stat-zone-list .szrow { grid-template-columns: 84px 1fr; }
  .stat-zone-list .sz-meta { grid-column: 2; text-align: left; }
  .stat-hours { height: 130px; }
}
