:root {
  --green: #2f6b46;      /* 예약가능·기본 버튼 */
  --green-d: #245537;
  --green-l: #e7f1ea;
  --header: #2f4a37;     /* 헤더 다크그린 */
  --orange: #e8894a;     /* 대기·알림 */
  --orange-d: #d9793c;
  --orange-l: #fdeee2;
  --ink: #2b352c;
  --muted: #7d8a80;
  --line: #e0e7e1;
  --bg: #eef2ee;
  --card: #ffffff;
}
* { box-sizing: border-box; }
body {
  font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  margin: 0; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--green-d); }

/* ===== 헤더 ===== */
.app-header { background: linear-gradient(90deg, #2b4433 0%, #345540 100%);
  color: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .14); position: sticky; top: 0; z-index: 100; }
.app-header-inner { max-width: 1320px; margin: 0 auto; padding: 0 22px; height: 70px; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-logo { font-size: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: #a9c6b1; font-weight: 500; }
.header-nav { margin-left: auto; display: flex; gap: 8px; }
.hicon { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 17px; text-decoration: none;
  color: #fff; background: rgba(255, 255, 255, .10); }
.hicon:hover { background: rgba(255, 255, 255, .22); }
.hicon .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

/* ===== 본문 ===== */
.app-body { max-width: 1320px; margin: 0 auto; padding: 20px 22px 40px; }
.dash { display: flex; gap: 20px; align-items: flex-start; }

/* ---- 좌측 필터 ---- */
.filters { flex: 0 0 280px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; box-shadow: 0 2px 12px rgba(47, 74, 55, .05);
  position: sticky; top: 90px; }
.fgroup { margin-bottom: 20px; }
.fgroup:last-of-type { margin-bottom: 12px; }
.flabel { font-size: 14px; font-weight: 700; color: var(--green-d); margin-bottom: 9px; }
.date-input { width: 100%; border: 1px solid #cfd8d0; border-radius: 9px; padding: 12px;
  font-size: 15px; font-weight: 600; color: var(--ink); font-family: inherit; }
.date-input:focus, #name-search:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.quick-dates { display: flex; gap: 6px; margin-top: 8px; }
.quick-dates button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 4px; font-size: 12.5px; color: #566; font-weight: 600; cursor: pointer; font-family: inherit; }
.quick-dates button:hover { border-color: var(--green); color: var(--green-d); background: var(--green-l); }
.region-grid, .kind-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.rgn, .knd { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 4px;
  font-size: 13px; color: #566; font-weight: 600; cursor: pointer; font-family: inherit; }
.rgn:hover, .knd:hover { border-color: var(--green); color: var(--green-d); }
.rgn.active, .knd.active { background: var(--green-d); color: #fff; border-color: var(--green-d); }
#name-search { width: 100%; border: 1px solid #cfd8d0; border-radius: 9px; padding: 11px 12px;
  font-size: 14px; font-family: inherit; }
.fnote { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 4px; }
.fnote b { color: var(--green); }

/* ---- 우측 보드 ---- */
.board { flex: 1; min-width: 0; }
.board-top { display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(47, 74, 55, .05); }
.board-title { font-size: 17px; font-weight: 800; color: var(--green-d); }
.board-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.toggles { margin-left: auto; display: flex; gap: 16px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #566; cursor: pointer; }
.toggle input { display: none; }
.toggle .switch { width: 40px; height: 22px; border-radius: 11px; background: #cdd5ce; position: relative; transition: .2s; flex: 0 0 40px; }
.toggle .switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle input:checked + .switch { background: var(--green); }
.toggle input:checked + .switch::after { transform: translateX(18px); }

/* ---- 카드 ---- */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fcard { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(47, 74, 55, .06); transition: box-shadow .15s; }
.fcard:hover { box-shadow: 0 6px 18px rgba(47, 74, 55, .13); }
.fcard-main { display: flex; gap: 14px; padding: 14px 14px 10px; cursor: pointer; }
.fthumb { flex: 0 0 84px; height: 84px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 34px; background: linear-gradient(135deg, #82bd93, #3f7a55); overflow: hidden; }
.fthumb.camp { background: linear-gradient(135deg, #ecb277, #cf7e3a); }
.fthumb img { width: 100%; height: 100%; object-fit: cover; }
.fbody { flex: 1; min-width: 0; }
.fbadges { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.kbadge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.kbadge.room { background: var(--green-l); color: var(--green-d); }
.kbadge.camp { background: var(--orange-l); color: var(--orange-d); }
.kbadge.park { background: #e6f0e9; color: #1e6b45; border: 1px solid #bcd9c6; }

/* 사이드바 카테고리: 두 곳의 현황을 함께 보여주고, 선택한 쪽만 보드에 렌더한다. */
.cat-nav { display: flex; flex-direction: column; gap: 8px; }
.cat { display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 11px 13px; font-family: inherit; color: #566; }
.cat .cat-name { font-size: 14.5px; font-weight: 700; }
.cat .cat-stat { font-size: 12px; font-weight: 600; color: var(--muted); }
.cat:hover { background: var(--green-l); }
.cat.active { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.cat.active .cat-stat { color: rgba(255, 255, 255, .82); }
.rbadge { font-size: 12px; color: var(--muted); font-weight: 600; }
.card-star { position: absolute; top: 12px; right: 13px; background: none; border: 0; cursor: pointer;
  font-size: 18px; color: #cdd3cd; line-height: 1; padding: 0; z-index: 2; }
.card-star.on { color: #f5b301; }
.fname { font-size: 16px; font-weight: 800; color: #2b352c; margin: 1px 0 2px; }
.forest-link { display: inline-block; font-size: 12px; color: var(--green-d); text-decoration: none; margin-bottom: 3px; }
.forest-link:hover { text-decoration: underline; }
.fsummary { font-size: 13px; color: #66756b; }
.fsummary .av { color: var(--green-d); font-weight: 700; }
.fsummary .wt { color: var(--orange-d); font-weight: 700; }
.fchecked { font-size: 11px; color: #97a49c; margin-top: 2px; }
.fcard-foot { display: flex; align-items: center; gap: 10px; padding: 0 14px 14px; }
.status-chip { font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 8px; white-space: nowrap; }
.status-chip.ok { background: var(--green-l); color: var(--green-d); }
.status-chip.no { background: #eef0ee; color: #8a948c; }
.act-btn { margin-left: auto; flex: 1; border: 0; border-radius: 9px; padding: 11px; font-size: 14px;
  font-weight: 700; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 6px; font-family: inherit; }
.act-btn.reserve { background: var(--green); }
.act-btn.reserve:hover { background: var(--green-d); }
.act-btn.alert { background: var(--orange); }
.act-btn.alert:hover { background: var(--orange-d); }
.act-btn:disabled { opacity: .55; cursor: default; }

/* ---- 카드 펼침(시설 상세) ---- */
.fdetail { border-top: 1px solid var(--line); padding: 12px 14px; background: #fafcfa; display: none; }
.fcard.open .fdetail { display: block; }
.fac-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fac { font-size: 13px; border-radius: 12px; padding: 4px 11px; font-weight: 600; background: var(--green-l); color: var(--green-d); }
.fac.camp { background: var(--orange-l); color: var(--orange-d); }
.fac.wait { background: #fff3e0; color: #b26a00; }
.fac.soldout { background: #eef0ee; color: #9aa39c; font-weight: 400; }
.fac-price { font-size: 12px; color: #66756b; white-space: nowrap; font-weight: 600; }
.rsv { margin-left: auto; background: var(--green); color: #fff; border: 0; border-radius: 7px;
  padding: 6px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit;
  text-decoration: none; display: inline-block; }
.rsv:hover { background: var(--green-d); }
.rsv.wait { background: var(--orange); }
.rsv:disabled { opacity: .6; cursor: default; }
.fac-alert { margin-left: auto; background: var(--orange); color: #fff; border: 0; border-radius: 7px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.fac-alert:hover { background: var(--orange-d); }
.fac-alert:disabled { opacity: .6; cursor: default; }
.rsv-msg { font-size: 12px; color: #66756b; margin-left: 8px; }
.refresh-row { margin-bottom: 10px; }
.live-refresh { background: #fff; color: var(--green-d); border: 1px solid var(--green);
  border-radius: 7px; padding: 6px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  white-space: nowrap; font-family: inherit; }
.live-refresh:hover { background: var(--green-l); }
.live-refresh:disabled { opacity: .6; cursor: default; }
.live-note { font-size: 12px; color: #9aa39c; }
.detail-hint { font-size: 12px; color: #9aa39c; margin-top: 8px; }
.detail-hint a { color: var(--green-d); }

#board-msg { color: var(--muted); font-size: 14px; padding: 30px 6px; }

@media (max-width: 1100px) { .card-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .dash { flex-direction: column; }
  .filters { position: static; width: 100%; }
  .brand-sub { display: none; }
}

/* ===== 관심조건 페이지(표/폼) ===== */
.app-body h1 { font-size: 21px; font-weight: 800; margin: 4px 0 16px; }
.app-body form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.app-body form button, .app-body .btn { background: var(--green); color: #fff; border: 0;
  border-radius: 8px; padding: 9px 18px; font-weight: 700; cursor: pointer; }
.app-body input, .app-body select { border: 1px solid #cfd8d0; border-radius: 8px; padding: 8px 10px; font-family: inherit; }
table { border-collapse: collapse; width: 100%; background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(47, 74, 55, .05); margin-top: 12px; }
th, td { border: 1px solid var(--line); padding: .6rem .7rem; text-align: left; font-size: 14px; }
th { background: var(--green-l); color: var(--green-d); font-weight: 700; }

.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--line); margin-top: 20px; }

/* ===== 월별현황 버튼 + 모달 ===== */
.month-btn { border: 0; background: var(--green-l); color: var(--green-d); border-radius: 9px;
  padding: 11px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.month-btn:hover { background: #d3e6d9; }
.modal { position: fixed; inset: 0; background: rgba(20, 30, 22, .5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-panel { background: #fff; border-radius: 14px; width: min(1120px, 96vw); max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 12px 44px rgba(0, 0, 0, .32); overflow: hidden; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head span { font-weight: 800; font-size: 16px; color: var(--green-d); }
.modal-close { margin-left: auto; background: none; border: 0; font-size: 18px; cursor: pointer; color: #888; }
.modal-legend { padding: 8px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.modal-legend .lg { display: inline-block; min-width: 22px; text-align: center; border-radius: 4px;
  padding: 1px 4px; margin: 0 3px 0 12px; font-weight: 700; }
.modal-legend .lg.ok { background: var(--green-l); color: var(--green-d); }
.modal-legend .lg.wait { background: var(--orange-l); color: var(--orange-d); }
.modal-legend .lg.no { background: #eef0ee; color: #99a; }
.modal-legend .lg.none { background: #f7f7f7; border: 1px solid var(--line); }
.modal-body { overflow: auto; padding: 8px; }
.month-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.month-table th, .month-table td { border: 1px solid #eef0ee; padding: 4px 6px; text-align: center; white-space: nowrap; }
.month-table thead th { position: sticky; top: 0; background: #f4f6f4; z-index: 2; font-weight: 700; color: #556; }
.month-table thead th.sun { color: #d9534f; }
.month-table thead th.sat { color: #337ab7; }
.month-table .mrow, .month-table .mrow-h { position: sticky; left: 0; background: #fff; z-index: 1;
  text-align: left; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.month-table thead .mrow-h { z-index: 3; background: #f4f6f4; }
.mc { font-weight: 700; }
.mc.ok { background: var(--green-l); color: var(--green-d); }
.mc.wait { background: var(--orange-l); color: var(--orange-d); font-size: 11px; }
.mc.no { color: #c2c5cf; }
.mc.none { background: #fafafa; }

/* 즐겨찾기 목록 모달 */
.fav-panel { width: min(520px, 96vw); }
.fav-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fav-row:last-child { border-bottom: 0; }
.fav-row:hover { background: var(--green-l); }
.fav-star2 { color: #f5b301; font-size: 17px; cursor: pointer; }
.fav-nm { flex: 1; font-weight: 700; color: #2b352c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-rg { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fav-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.fav-badge.ok { background: var(--green-l); color: var(--green-d); }
.fav-badge.wait { background: var(--orange-l); color: var(--orange-d); }
.fav-badge.no { background: #eef0ee; color: #99a; }
