/* ═════════════════ 화면 골격 · 로그인 · 관리 화면 (P2 · 2026-11-11) ═════════════════
 * style.css 다음에 읽는다. 왼쪽 메뉴 + 상단 바. 좁은 화면(≤ 960px)에서는 메뉴가 서랍이 된다.
 * 여기 규칙이 style.css 의 옛 .topbar·.wrap 규칙을 덮는다 (같은 이름을 다시 정의).
 * 색은 전부 style.css 의 토큰(--ink-*, --surface 등)으로 — 밝기 전환이 그대로 따라온다.
 */
/*
 * 글꼴 — Pretendard 를 프로그램에 함께 싣는다 (결정 D7). 전에는 이름만 지정돼 있어서
 * 설치 안 된 PC 에서는 기본 글꼴로 보였다. 한글 서브셋(KS X 1001) 3굵기 · 약 0.8MB ·
 * OFL-1.1 (fonts/Pretendard-LICENSE.txt). 서브셋에 없는 음절은 다음 글꼴이 채운다.
 */
@font-face { font-family:'Pretendard'; font-weight:400; font-style:normal; font-display:swap;
  src:url('/fonts/Pretendard-Regular.subset.woff2') format('woff2'); }
@font-face { font-family:'Pretendard'; font-weight:600; font-style:normal; font-display:swap;
  src:url('/fonts/Pretendard-SemiBold.subset.woff2') format('woff2'); }
@font-face { font-family:'Pretendard'; font-weight:700 900; font-style:normal; font-display:swap;
  src:url('/fonts/Pretendard-Bold.subset.woff2') format('woff2'); }

:root { --side-w: 216px; }

.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.shell { display:flex; min-height:100vh; }
.shell.hide { display:none !important; }
.main { flex:1; min-width:0; display:flex; flex-direction:column; }

.sidebar {
  width:var(--side-w); flex:none; background:var(--brand-900); color:rgba(255,255,255,.78);
  position:sticky; top:0; height:100vh; display:flex; flex-direction:column; padding:14px 10px; z-index:40;
}
.sidebar .brand { color:#fff; padding:4px 8px 16px; font-size:13.5px; }
.side-nav { flex:1; overflow-y:auto; }
.side-group { margin-bottom:14px; }
.side-label { font-size:10.5px; letter-spacing:.06em; opacity:.55; padding:0 10px 4px; }
.side-item {
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:6px;
  color:inherit; text-decoration:none; font-size:13px; font-weight:600;
}
.side-item:hover { background:rgba(255,255,255,.08); color:#fff; }
.side-item.on { background:rgba(255,255,255,.14); color:#fff; box-shadow:inset 3px 0 0 #5FD3A0; }
.side-item:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline:2px solid #5FD3A0; outline-offset:2px; }
.side-ico { width:18px; text-align:center; opacity:.85; }
.side-foot { padding:8px 10px 0; border-top:1px solid rgba(255,255,255,.1); font-size:11px; }
.side-foot .sub { color:rgba(255,255,255,.5); }
.sidebar-scrim { display:none; }

.topbar { background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30; }
.topbar-inner { max-width:none; height:50px; padding:0 20px; gap:12px; }
.topbar-title { font-size:15px; font-weight:700; letter-spacing:-.2px; color:var(--ink-900); white-space:nowrap; }
.topbar-meta .btn { background:transparent; color:var(--ink-700); border:1px solid transparent; }
.topbar-meta .btn:hover { background:var(--surface-3); color:var(--ink-900); }
.topbar .queue-chip { background:var(--brand-50); color:var(--brand-700); }
.icon-btn { min-width:32px; justify-content:center; }
.menu-btn { display:none; }
.wrap { max-width:1440px; width:100%; }

.user-menu { position:relative; }
.user-btn { display:flex; align-items:center; gap:7px; }
.avatar {
  width:24px; height:24px; border-radius:50%; background:var(--brand-700); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size:11.5px; font-weight:700;
}
.user-pop {
  position:absolute; right:0; top:calc(100% + 6px); min-width:220px; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh-3); padding:6px; z-index:60;
}
.user-pop-head { padding:8px 10px; border-bottom:1px solid var(--line-2); margin-bottom:4px; display:flex; flex-direction:column; }
.user-pop a, .user-pop button {
  display:block; width:100%; text-align:left; padding:8px 10px; border-radius:5px; background:none; border:0;
  color:var(--ink-800); font:inherit; font-size:13px; text-decoration:none; cursor:pointer;
}
.user-pop a:hover, .user-pop button:hover { background:var(--surface-3); }

.mode-banner {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 20px;
  background:var(--amber-50); color:var(--amber-700); border-bottom:1px solid var(--line); font-size:12.5px;
}
.mode-banner .btn { margin-left:auto; }

@media (max-width:960px) {
  .sidebar { position:fixed; left:0; top:0; transform:translateX(-100%); transition:transform .18s; box-shadow:var(--sh-3); }
  body.side-open .sidebar { transform:none; }
  body.side-open .sidebar-scrim { display:block; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:35; }
  .menu-btn { display:inline-flex; }
  .topbar-inner { padding:0 12px; }
  #btnRefresh { display:none; }
  .user-btn #userName { display:none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition:none; } }

/* ── 로그인 단계 ── */
.gate-card { max-width:380px; }
.gate-brand { display:flex; align-items:center; gap:8px; font-weight:700; font-size:13px; color:var(--brand-700); margin-bottom:18px; }
.gate-logo { width:22px; height:22px; border-radius:6px; background:var(--brand-700); display:inline-block; }
.gate-step .field { margin-bottom:12px; }
.gate-step .field label { display:block; font-size:12px; color:var(--ink-500); margin-bottom:4px; }
.gate-step .field input { width:100%; }
.otp-input { font-size:22px; letter-spacing:.35em; text-align:center; font-variant-numeric:tabular-nums; }
.btn-link { background:none; border:0; color:var(--brand-700); text-decoration:underline; padding:8px; font-size:12.5px; }
.btn-link:hover { background:none; color:var(--brand-600); }
.enroll-steps { padding-left:18px; font-size:12.5px; color:var(--ink-700); margin-bottom:12px; text-align:left; }
/* 로그인 카드의 안내 띠는 글 한 덩어리다 — .banner 의 가로 배치(아이콘+글)를 쓰면 <b> 마다 칸이 쪼개진다 */
.gate-step .banner { display:block; text-align:left; line-height:1.6; margin-bottom:12px; }
.gate-step .field { text-align:left; }
.codes { text-align:left; }
.enroll-steps li { margin:3px 0; }
.enroll-qr { width:200px; height:200px; margin:6px auto 10px; background:#fff; padding:8px; border-radius:8px; border:1px solid var(--line); }
.enroll-qr svg { width:100%; height:100%; display:block; }
.enroll-key { text-align:center; font-size:12px; margin-bottom:14px; word-break:break-all; }
.codes { columns:2; padding-left:22px; margin:12px 0; font-size:14px; }
.codes li { margin:4px 0; }
.check { display:flex; align-items:center; gap:7px; font-size:13px; margin:6px 0; cursor:pointer; }
.check.dim { opacity:.5; cursor:not-allowed; }

/* ── 공통 보탬 ── */
.pill-warn { background:var(--amber-50); color:var(--amber-700); }
.btn-xs { padding:2px 7px; font-size:11px; }
.banner-info { background:var(--blue-50); color:var(--blue-700); }
.dialog-wide { max-width:640px; }
.dialog-body { margin-top:10px; max-height:min(64vh, 640px); overflow-y:auto; }
.dialog-body .field { margin-bottom:12px; }
.dialog-body .field input, .dialog-body .field select { width:100%; }
.dialog-err { margin-top:10px; }
.kv-list .kv { border-bottom:1px solid var(--line-2); }
.secret-box { font-size:16px; letter-spacing:.06em; background:var(--surface-3); padding:4px 8px; border-radius:5px; user-select:all; }
.empty-state { text-align:center; padding:60px 20px; }
.empty-title { font-size:16px; font-weight:700; margin-bottom:6px; }
.empty-state .btn { margin-top:14px; display:inline-flex; }
.row-dim td { opacity:.55; }
.row-actions { white-space:nowrap; text-align:right; }
.more { display:inline-block; position:relative; }
.more summary { list-style:none; cursor:pointer; }
.more summary::-webkit-details-marker { display:none; }
.more-pop {
  position:absolute; right:0; top:calc(100% + 4px); background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:var(--sh-3); padding:4px; z-index:20; min-width:180px;
}
.more-pop button { display:block; width:100%; text-align:left; background:none; border:0; padding:7px 10px; border-radius:5px; font:inherit; font-size:12.5px; cursor:pointer; color:var(--ink-800); }
.more-pop button:hover { background:var(--surface-3); }
.hotel-picks { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:2px 12px; margin-top:4px; }
.hotel-picks.dim { opacity:.5; }
.perm-group { border:1px solid var(--line-2); border-radius:var(--r); padding:6px 12px 8px; margin-bottom:10px; }
.perm-group legend { font-size:12px; font-weight:700; color:var(--ink-500); padding:0 4px; }
.perm-matrix th.c, .perm-matrix td.c { text-align:center; }
.perm-matrix tr.grp td { background:var(--surface-2); font-weight:700; font-size:12px; color:var(--ink-500); }
.perm-matrix .yes { color:var(--brand-700); }
.perm-matrix .no { color:var(--ink-300); }
.role-acts { display:flex; gap:4px; justify-content:center; margin-top:4px; }
.tabs a.tab { text-decoration:none; display:inline-flex; align-items:center; }

/* 좁은 화면 — 표를 카드로 (data-label 이 칸 이름) */
@media (max-width:760px) {
  .table-cards thead { display:none; }
  .table-cards tr { display:block; border-bottom:1px solid var(--line); padding:8px 12px; }
  .table-cards td { display:flex; justify-content:space-between; gap:12px; border:0; padding:3px 0; }
  .table-cards td[data-label]::before { content:attr(data-label); color:var(--ink-500); font-size:11.5px; flex:none; }
  .table-cards td.row-actions { justify-content:flex-end; padding-top:6px; }
  .codes { columns:1; }
}

/* ── 기간 선택 (P3 · js/period-picker.js) ── */
.period-btn { display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border:1px solid var(--line); border-radius:var(--r);
  background:var(--surface); color:var(--ink-900); font:inherit; font-size:13px; cursor:pointer; }
.period-btn:hover { border-color:var(--ink-300); }
.period-main { font-weight:700; font-variant-numeric:tabular-nums; }
.period-sub { color:var(--ink-500); font-size:12px; }
.period-pop { position:absolute; z-index:80; display:flex; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:var(--sh-3); max-width:calc(100vw - 16px); }
.period-presets { display:flex; flex-direction:column; padding:8px; border-right:1px solid var(--line-2); min-width:132px; }
.period-preset { text-align:left; background:none; border:0; padding:7px 10px; border-radius:5px; font:inherit; font-size:12.5px; color:var(--ink-800); cursor:pointer; }
.period-preset:hover { background:var(--surface-3); }
.period-preset.on { background:var(--brand-50); color:var(--brand-700); font-weight:700; }
.period-cal { padding:8px 12px 10px; }
.cal-nav { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.cal-pair { display:flex; gap:18px; }
.cal-title { text-align:center; font-weight:700; font-size:12.5px; margin:2px 0 6px; }
.cal-grid { border-collapse:collapse; }
.cal-grid th { font-size:11px; color:var(--ink-500); font-weight:600; padding:2px 0; width:32px; }
.cal-grid th.we { color:var(--red-600); }
.cal-grid td { padding:1px 0; }
.cal-day { width:32px; height:28px; border:0; background:none; border-radius:5px; font:inherit; font-size:12px; color:var(--ink-800); cursor:pointer; font-variant-numeric:tabular-nums; }
.cal-day:hover:not(:disabled) { background:var(--surface-3); }
.cal-day.in { background:var(--brand-50); color:var(--brand-700); border-radius:0; }
.cal-day.edge { background:var(--brand-700); color:#fff; border-radius:5px; font-weight:700; }
.cal-day.today { box-shadow:inset 0 0 0 1px var(--brand-700); }
.cal-day:disabled { color:var(--ink-300); cursor:not-allowed; }
.period-foot { display:flex; align-items:center; gap:6px; margin-top:8px; }
.period-foot .spacer { flex:1; }
@media (max-width:700px) {
  .period-pop { flex-direction:column; left:8px !important; right:8px; }
  .period-presets { flex-direction:row; flex-wrap:wrap; border-right:0; border-bottom:1px solid var(--line-2); }
  .cal-pair > .cal:last-child { display:none; }
}

/* ── 필터 칩 · 처리 상세 (P4d) ── */
.chip-bar { display:flex; flex-wrap:wrap; gap:6px; padding:8px 12px 2px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; border:1px solid var(--brand-100);
  background:var(--brand-50); color:var(--brand-700); font:inherit; font-size:12px; cursor:pointer; }
.chip:hover { border-color:var(--brand-700); }
.chip-k { color:var(--ink-500); font-size:11px; }
tr.row-link { cursor:pointer; }
tr.row-link:hover td { background:var(--surface-2); }
tr.row-link:focus-visible { outline:2px solid var(--brand-700); outline-offset:-2px; }
.steps-title { font-size:13px; margin:14px 0 6px; }
.step-list { list-style:none; padding:0; margin:0; }
.step { display:grid; grid-template-columns:150px 1fr 70px; grid-template-areas:"name bar ms" "out out out"; gap:2px 10px; padding:6px 0; border-bottom:1px solid var(--line-2); font-size:12.5px; }
.step-name { grid-area:name; font-weight:600; }
.step-bar { grid-area:bar; align-self:center; height:8px; background:var(--surface-3); border-radius:4px; overflow:hidden; }
.step-bar i { display:block; height:100%; background:var(--brand-700); border-radius:4px; }
.step.challenge .step-bar i { background:var(--amber-700); }
.step.challenge .step-name::before { content:"⚑ "; color:var(--amber-700); }
.step-ms { grid-area:ms; text-align:right; font-variant-numeric:tabular-nums; }
.step-out { grid-area:out; color:var(--ink-700); }
@media (max-width:600px) { .step { grid-template-columns:1fr 64px; grid-template-areas:"name ms" "bar bar" "out out"; } }

/* ── 설정 › 채널 인증 (P4e · 결정 D5) ── */
.auth-list { display:flex; flex-direction:column; }
.auth-row { border-bottom:1px solid var(--line-2); }
.auth-row summary { display:flex; align-items:center; gap:12px; padding:10px 16px; cursor:pointer; list-style:none; }
.auth-row summary::-webkit-details-marker { display:none; }
.auth-row summary:hover { background:var(--surface-2); }
.auth-hotel { font-weight:700; min-width:140px; }
.auth-ch { color:var(--ink-700); min-width:110px; }
.auth-more { margin-left:auto; color:var(--ink-400); transition:transform .15s; }
.auth-row[open] .auth-more { transform:rotate(180deg); }
.auth-body { padding:4px 16px 14px; }
.link-sm { font-size:12px; margin-left:6px; }
@media (max-width:600px) { .auth-row summary { flex-wrap:wrap; gap:6px 10px; } .auth-hotel, .auth-ch { min-width:0; } }

/* 검색칸 — 브라우저 기본 모양(둥근 테두리·지우기 단추)을 다른 입력칸에 맞춘다 */
input[type=search] { -webkit-appearance:none; appearance:none; }

/* ───────── 원격 화면 (2026-11-13 · 계획서 §14) — 에이전트 PC 의 창을 보고 조작 ───────── */
.relay { display:flex; flex-direction:column; gap:8px; }
.relay-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.relay-title { display:flex; align-items:baseline; gap:2px; min-width:0; flex:1 1 200px; font-size:14px; color:var(--ink-900); }
.relay-title b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.relay-ctl { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.relay-who { font-size:12.5px; color:var(--ink-500); margin-right:4px; }
.relay-tabs { max-width:220px; font:inherit; font-size:12.5px; padding:4px 6px; border:1px solid var(--line);
  border-radius:var(--r); background:var(--surface); color:var(--ink-800); }
.relay-hint { font-size:12px; }
.relay-stage { position:relative; background:#111; border:1px solid var(--line); border-radius:var(--r-lg);
  overflow:auto; max-height:calc(100vh - 190px); min-height:240px; }
.relay-stage img { display:block; width:100%; height:auto; user-select:none; -webkit-user-drag:none; touch-action:none; }
.relay-stage.natural img { width:auto; max-width:none; }
/* 내가 조작 중이면 테두리로 알린다 — 보기만 하는 중과 헷갈리지 않게 */
.relay-stage.mine { outline:2px solid var(--brand-600); outline-offset:-2px; }
/* 키보드·한글 조합을 받는 숨은 입력칸 — 보이지 않지만 포커스는 받는다 */
.relay-keys { position:absolute; left:8px; top:8px; width:2px; height:2px; opacity:0; border:0; padding:0;
  resize:none; pointer-events:none; }
.relay-wait { position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:#E5E7EB; font-size:13px; background:rgba(0,0,0,.35); }
.relay-dialog { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center;
  justify-content:center; z-index:80; padding:16px; }
.relay-dialog-box { background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--sh-3); padding:18px; width:min(420px,100%); }
.relay-dialog-head { font-size:12px; color:var(--ink-500); margin-bottom:6px; }
.relay-dialog-msg { white-space:pre-wrap; font-size:14px; color:var(--ink-900); margin-bottom:10px; }
.relay-dialog-box input { width:100%; }
.relay-dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
@media (max-width:640px) { .relay-stage { max-height:none; } .relay-hint { display:none; } .relay-title { flex-basis:100%; } }
/* 지우기·Tab·Enter 버튼은 손가락으로 쓸 때만 (PC 는 키보드가 있다) */
.relay-keyrow { display:none; gap:6px; }
@media (max-width:640px), (pointer:coarse) { .relay-keyrow { display:inline-flex; } }
.relay-title .sub { white-space:nowrap; }
/* 사람 확인 대기 띠 — 캡차·보호 조치·인증 (계획서 §14 R3) */
.relay-banner { background:var(--red-50, #FDECE6); color:var(--ink-900); border-bottom:1px solid var(--line); padding:6px 16px; }
.relay-banner-row { display:flex; align-items:center; gap:10px; font-size:12.5px; padding:3px 0; flex-wrap:wrap; }
.relay-banner-row .btn { margin-left:auto; }
.relay-banner-dot { width:8px; height:8px; border-radius:50%; background:var(--red-600, #C2410C); flex:none;
  animation:relayPulse 1.4s ease-in-out infinite; }
@keyframes relayPulse { 50% { opacity:.35; } }
@media (prefers-reduced-motion: reduce) { .relay-banner-dot { animation:none; } }
/* 원격 화면 확대 (2026-11-23) — 두 손가락 벌리기 또는 －/＋ */
.relay-zoom { display:inline-flex; align-items:center; gap:4px; }
.relay-zoom-val { min-width:42px; text-align:center; font-size:12px; color:var(--ink-500); font-variant-numeric:tabular-nums; }
