/* 2027 JW 국제대회 — 관리자 화면 (객실현황 웹 관리자 시안과 같은 레이아웃: 왼쪽 검은 메뉴 + 카드) */
:root {
  --bg: #f6f6f4;
  --side: #232326;
  --side2: #38383c;
  --accent: #e05a73;
  --ink: #222;
  --muted: #666;
  --muted2: #888;
  --border: #e3e3e0;
  --line: #f0f0ee;
  --input: #ccc;
  --burg: #a3243c;
  --red: #a3243c;
  --burg-soft: #f7e4e8;
  --green: #1f7a4a;
  --green-bg: #e8f5ec;
  --amber: #a86400;
  --amber-bg: #fdf1dc;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted2); }
a { color: inherit; }
b { font-weight: 700; }

/* ---------- 로그인 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--side); }
.login-card { background: #fff; border-radius: 14px; padding: 38px 34px; width: 100%; max-width: 400px; text-align: center; }
.login-mark { width: 38px; height: 38px; margin: 0 auto 14px; border: 2px solid var(--ink); display: grid; place-items: center; font-family: Georgia, serif; font-weight: 700; font-size: 18px; }
.login-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { color: var(--muted); font-size: 13px; margin: 8px 0 24px; line-height: 1.7; }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 12px; margin-bottom: 14px; font-weight: 700; color: var(--muted); }
.login-card input { width: 100%; margin-top: 5px; padding: 11px 12px; font-size: 15px; }

/* ---------- 공통 입력 · 버튼 ---------- */
input, select, textarea {
  border: 1px solid var(--input); border-radius: 6px; padding: 6px 9px; font: inherit; font-size: 13px; font-weight: 500; background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(34, 34, 34, .08); }
input.num { width: 64px; text-align: center; font-weight: 700; }
input.num.w { width: 110px; text-align: right; }
textarea { width: 100%; resize: vertical; line-height: 1.6; font-weight: 400; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--input); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f3f3f1; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--side); border-color: var(--side); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-danger { color: var(--burg); border-color: #e3b5bf; }
.btn-danger:hover { background: var(--burg-soft); }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.error-msg { color: var(--burg); font-size: 12.5px; font-weight: 700; min-height: 18px; white-space: pre-line; }
.error-msg.ok { color: var(--green); }
.hint { font-size: 12px; color: var(--muted2); margin: 6px 0 10px; line-height: 1.65; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 10px 0; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--side); }

/* ---------- 레이아웃: 왼쪽 메뉴 + 본문 ---------- */
.adm { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.adm-side { background: var(--side); color: #cfcfcf; padding: 22px 0 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.adm-side .lg { display: flex; gap: 10px; align-items: center; padding: 0 20px 20px; }
.adm-side .lg i { width: 30px; height: 30px; border: 1.5px solid #fff; color: #fff; display: grid; place-items: center; font-style: normal; font-family: Georgia, serif; font-weight: 700; font-size: 15px; flex: none; }
.adm-side .lg b { display: block; color: #fff; font-size: 14px; font-weight: 800; }
.adm-side .lg small { display: block; color: #9a9a9f; font-size: 11.5px; }
/* 지점 선택 카드 (왼쪽 메뉴 맨 위) — 킨텍스 버건디 · 인천 네이비 */
.bsb { padding: 0 14px 16px; margin-bottom: 10px; border-bottom: 1px solid #3a3a3f; }
.bsb:empty { display: none; }
.bsb .h { font-size: 11px; color: #8a8a90; font-weight: 700; letter-spacing: .06em; margin: 0 6px 8px; }
.bsb button { display: block; width: 100%; text-align: left; background: #2d2d31; border: 1px solid #414146; border-radius: 11px; padding: 10px 12px; margin-bottom: 6px; font: inherit; cursor: pointer; }
.bsb button b { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #fff; font-weight: 800; }
.bsb button b i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.bsb button small { display: block; font-size: 11.5px; color: #a6a6ab; margin: 3px 0 0 18px; font-weight: 600; }
.bsb button:hover:not(:disabled) { border-color: #6a6a70; }
.bsb button.on { background: var(--c); border-color: var(--c); box-shadow: 0 6px 16px -8px var(--c); }
.bsb button.on small { color: rgba(255, 255, 255, .88); }
.bsb button.on b i { background: #fff; }
.bsb button:disabled { opacity: .4; cursor: not-allowed; }
.cur-br { display: inline-flex; align-items: center; align-self: center; background: var(--c); color: #fff; font-size: 13px; font-weight: 800; border-radius: 8px; padding: 4px 10px; white-space: nowrap; }
#admin-tabs { display: flex; flex-direction: column; }
#admin-tabs .tab { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; color: #bdbdbd; font-size: 13px; cursor: pointer; text-decoration: none; border-left: 3px solid transparent; }
#admin-tabs .tab:hover { color: #fff; background: #2d2d31; }
#admin-tabs .tab.active { background: var(--side2); color: #fff; font-weight: 700; border-left-color: var(--accent); padding-left: 20px; }
#admin-tabs .tab em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
#admin-tabs .tab em:empty { display: none; }
.side-sec { margin: 22px 20px 0; padding-top: 16px; border-top: 1px solid #3a3a3f; }
.side-h { font-size: 11px; font-weight: 700; color: #8a8a90; letter-spacing: .06em; margin-bottom: 6px; }
.side-sec a { display: block; color: #d6d6d6; font-size: 12.5px; text-decoration: none; padding: 4px 0; }
.side-sec a:hover { color: #fff; }
.side-sec p { font-size: 11px; color: #8a8a90; margin-top: 6px; line-height: 1.5; }
.side-foot { margin-top: auto; padding: 16px 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #bdbdbd; }
.side-foot > span, .side-foot > div:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot button { white-space: nowrap; flex: none; background: none; border: 1px solid #55555a; color: #d6d6d6; border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 11.5px; cursor: pointer; }
.side-foot button:hover { border-color: #aaa; color: #fff; }
.adm-main { padding: 24px 28px 60px; min-width: 0; }
.adm-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.adm-head h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.adm-head span { font-size: 12.5px; color: var(--muted2); }

/* 탭 본문 = 카드 2열 그리드 */
.tab-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start; }
.tab-body > * { grid-column: 1 / -1; min-width: 0; }
.tab-body > .half { grid-column: auto; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.card h5, .card .sub-h { margin: 0 0 12px; font-size: 14px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card h5 > span, .card .sub-h > span { font-size: 11.5px; font-weight: 600; color: var(--muted2); }
.card h5 .h-r { display: flex; gap: 8px; align-items: center; }
.card h6 { margin: 18px 0 8px; font-size: 13px; font-weight: 800; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.card h6 span { font-size: 11.5px; font-weight: 600; color: var(--muted2); }
#resv-list .card { margin-bottom: 18px; }
#resv-list .card:last-child { margin-bottom: 0; }
/* 픽업: 화면이 넓으면 두 지점을 나란히 */
#pickup-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 1060px), 1fr)); gap: 18px; align-items: start; }

/* 라벨-값 줄 */
.fr { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 600; }
.fr:last-of-type { border-bottom: none; }
.fr > input:not(.num), .fr > select { width: 100%; max-width: 440px; }
.fr .ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink); font-weight: 500; }
.fr .ctl em { font-style: normal; font-size: 11.5px; color: var(--muted2); }
.frs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.frs .fr:last-of-type { border-bottom: 1px solid var(--line); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ta { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.guide-edit { min-height: 230px; font-size: 12.5px; }
.guide-edit.short { min-height: 100px; }
.savebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.savebar .error-msg { text-align: left; }
.addrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* 필터 · 도구줄 */
.filters, .toolbar, .applybar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.toolbar { justify-content: space-between; }
.applybar { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fgrp { display: flex; align-items: center; gap: 6px; }
.fgrp.grow { flex: 1; min-width: 220px; }
.fgrp.grow input { width: 100%; }
.filters select { max-width: 170px; }
.fl { font-size: 11.5px; font-weight: 700; color: var(--muted2); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.kpi .k-label { font-size: 11.5px; color: var(--muted2); font-weight: 700; }
.kpi .k-val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted2); }

/* 표 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { text-align: left; font-size: 11px; color: var(--muted2); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #ddd; white-space: nowrap; background: #fff; position: sticky; top: 0; }
table.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.wrap { white-space: normal; min-width: 160px; }
table.tbl td input { padding: 5px 7px; }
table.tbl select.inline { padding: 3px 6px; font-size: 12px; }
.resv-tbl b.ref, #audit-table td:nth-child(4), #user-table td:first-child b { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.exp-bad { color: var(--burg); font-weight: 700; }
.pick-tbl td, .pick-tbl th { text-align: center !important; }
.pick-tbl td:first-child, .pick-tbl th:first-child { text-align: left !important; }
.pick-tbl .pc-main { font-weight: 700; font-variant-numeric: tabular-nums; }
.pick-tbl .pc-sub { font-size: 10.5px; color: var(--muted2); }
.pick-tbl .pc-full { background: var(--burg-soft); }
.pick-tbl tr.tot td { background: #fafaf8; font-weight: 700; }

/* 예약 목록 — 폭에 따라 열이 늘어남 (좁으면 c2~c4 열을 접어서 옆 칸 아래 f2~f4 줄로, 아주 넓으면 c5 열 추가) */
.resv-wrap { container-type: inline-size; }
.resv-tbl td { word-break: keep-all; }
.resv-tbl .fold { display: none; margin-top: 3px; white-space: nowrap; }
.resv-tbl .fold select { margin: 2px 0; }
.resv-tbl .f-line { font-size: 12px; }
.resv-tbl .btn-ic { padding: 2px 7px; }
.resv-tbl .c5 { display: none; }
.resv-tbl .memo-cell { min-width: 160px; max-width: 300px; }
.resv-tbl td.contact { white-space: normal; overflow-wrap: anywhere; max-width: 210px; }
.resv-tbl tr.note-row td { padding-top: 0; }
table.resv-tbl td, table.resv-tbl th { padding-left: 6px; padding-right: 6px; }
.resv-tbl .acts { display: grid; grid-template-columns: auto auto; gap: 4px; justify-content: start; }
.resv-tbl .acts .btn { width: 100%; }
.resv-tbl tr:has(+ tr.note-row) td { border-bottom: none; }
@container (min-width: 1800px) {
  .resv-tbl .c5 { display: table-cell; }
  .resv-tbl .nc5, .resv-tbl tr.note-row:not(.keep) { display: none; }
}
@container (max-width: 1439px) { .resv-tbl .c4 { display: none; } .resv-tbl .f4 { display: block; } }
@container (max-width: 1274px) { .resv-tbl .c3 { display: none; } .resv-tbl .f3 { display: block; } }
@container (max-width: 1099px) {
  .resv-tbl .c2 { display: none; } .resv-tbl .f2 { display: block; }
  .resv-tbl .rt-cell, .resv-tbl .act-cell { white-space: normal; }
  .resv-tbl .rt-cell { min-width: 120px; }
  .resv-tbl .act-cell { min-width: 110px; }
  .resv-tbl .act-cell .btn { margin: 1px 0; }
  .resv-tbl .dt-cell { white-space: normal; min-width: 104px; }
  .resv-tbl td.wrap { min-width: 140px; }
}

/* 배지 */
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.off { background: var(--burg-soft); color: var(--burg); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.branch-tag { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 18px; }
.branch-tag.kintex { background: #a3243c; color: #fff; }
.branch-tag.incheon { background: #2b4f86; color: #fff; }
.badge.dark { background: var(--side); color: #fff; }

/* 모달 */
.modal-back { position: fixed; inset: 0; background: rgba(20, 20, 22, .5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; padding: 18px 20px 20px; width: 100%; max-width: 540px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 15px; }
.act-sum { background: #fafaf8; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-bottom: 6px; }
.act-sum b { color: var(--ink); }

/* 블럭 달력 */
.al-monthnav { display: flex; align-items: center; gap: 8px; }
.al-monthnav b { font-size: 14px; min-width: 90px; text-align: center; }
.al-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0 4px; }
.al-wd { text-align: center; font-size: 11px; color: var(--muted2); font-weight: 700; padding: 3px 0; }
.al-wd.sun { color: #c23a3a; }
.al-wd.sat { color: #2750b0; }
.al-cell { min-height: 64px; border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; cursor: pointer; background: #fafaf8; font-size: 11.5px; line-height: 1.35; user-select: none; }
.al-cell:hover:not(.empty):not(.al-past) { border-color: var(--ink); }
.al-cell.empty { border: none; background: transparent; cursor: default; }
.al-cell.al-has { background: #fff; }
.al-cell.al-full { background: var(--burg-soft); }
.al-cell.al-past { opacity: .45; cursor: default; }
.al-cell.al-sel { border: 2px solid var(--ink); padding: 4px 6px; }
.al-day { font-weight: 800; font-size: 12.5px; }
.al-day.sun { color: #c23a3a; }
.al-day.sat { color: #2750b0; }
.al-price { font-weight: 700; font-family: var(--mono); font-size: 11px; }
.al-count { color: var(--muted); }
.al-count small { font-size: 10px; }
.al-tag { color: var(--burg); font-weight: 700; font-size: 11px; }
.al-none { color: #c8c8c4; }

/* 사진 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ph-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.ph-item img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; display: block; }
.ph-tag { font-size: 12.5px; font-weight: 700; margin: 6px 2px; }
.ph-ctrl { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ph-ctrl select, .ph-ctrl input { padding: 3px 6px; font-size: 11.5px; }

/* 아주 넓은 화면: 설정 카드 3개를 한 줄로 */
@media (min-width: 2000px) {
  #tab-settings { grid-template-columns: repeat(3, 1fr); }
}
/* 1280px 이하: 왼쪽 메뉴를 조금 좁혀 표에 자리를 줌 */
@media (max-width: 1280px) and (min-width: 1001px) {
  .adm { grid-template-columns: 184px 1fr; }
  .adm-main { padding: 20px 18px 50px; }
}
@media (max-width: 1000px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; }
  #admin-tabs { flex-direction: row; flex-wrap: wrap; }
  #admin-tabs .tab { border-left: none; border-bottom: 3px solid transparent; padding: 8px 12px; }
  #admin-tabs .tab.active { border-bottom-color: var(--accent); }
  .side-sec { display: none; }
  .bsb { display: flex; gap: 6px; padding: 0 14px 12px; margin-bottom: 6px; }
  .bsb .h { display: none; }
  .bsb button { flex: 1; margin: 0; padding: 8px 10px; min-width: 0; }
  .bsb button b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bsb button small { margin-left: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tab-body { grid-template-columns: 1fr; }
  .tab-body > .half { grid-column: 1 / -1; }
  .frs, .two { grid-template-columns: 1fr; }
  .adm-main { padding: 18px 14px 50px; }
}
.card .kpis { margin-bottom: 14px; }
