@charset "utf-8";

/* =========================
   RoomRentalCalendar CSS
========================= */
:root{
  --rcal-h: 650px;
  --rcal-h-week: 900px;
  --rcal-gap: 8px;
  --rcal-pad: 10px;
  --rcal-cell-pad: 8px;
  --rcal-items-max: 120px;
}

#rentalCalendar{
  margin-bottom: 32px;
  display:flex;
  flex-direction:column;
  min-height:0;
}

/* =========================
   기본 레이아웃
========================= */
.rcal-wrap{
  width:100%;
  height:var(--rcal-h);
  border:1px solid #ddd;
  border-radius:12px;
  overflow:hidden;
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:#fff;
  display:flex;
  flex-direction:column;
  min-height:0;
}

.rcal-wrap.mode-week{
  height:var(--rcal-h-week);
}

.rcal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  background:#f7f7f7;
  border-bottom:1px solid #eee;
  flex:0 0 auto;
  gap:10px;
}

.rcal-left{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.rcal-right{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.rcal-title{
  font-weight:800;
  margin-left:6px;
  font-size:16px;
}

.rcal-btn{
  border:1px solid #ddd;
  background:#fff;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
  white-space:nowrap;
  transition:all .15s ease;
}

.rcal-btn:hover{
  background:#fafafa;
}

.rcal-btn.active{
  border-color:#333;
  font-weight:800;
}

/* =========================
   상단 라벨(legend)
========================= */
#rentalCalendar .rcal-legend{
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
  align-items:center;
  margin:10px 0 12px;
  padding:0 14px;
  box-sizing:border-box;
  flex:0 0 auto;
}

#rentalCalendar .rcal-legend-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-size:12px;
  line-height:1;
  cursor:pointer;
  transition:all .15s ease;
}

#rentalCalendar .rcal-legend-item:hover{
  background:#f8fafc;
  border-color:#cbd5e1;
}

#rentalCalendar .rcal-legend-item.on{
  border-color:#333;
  background:#f8fafc;
  font-weight:700;
}

#rentalCalendar .rcal-legend-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  flex:0 0 auto;
  display:inline-block;
}

/* 전체 */
#rentalCalendar .rcal-legend-item[data-room=""] .rcal-legend-dot{
  background:#64748b;
}

/* 교육장별 색상 */
#rentalCalendar .legend-007001000{ background:#8BC34A; }
#rentalCalendar .legend-007002000{ background:#03A9F4; }
#rentalCalendar .legend-007003000{ background:#9C27B0; }
#rentalCalendar .legend-007004000{ background:#E91E63; }

/* =========================
   그리드
========================= */
.rcal-grid{
  padding:var(--rcal-pad);
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.rcal-dow{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:var(--rcal-gap);
  padding:6px 2px 10px;
  color:#666;
  font-size:12px;
  flex:0 0 auto;
}

.rcal-dow div{
  text-align:center;
}

.rcal-days{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:var(--rcal-gap);
  flex:1 1 auto;
  min-height:0;
}

/* =========================
   날짜 셀
========================= */
.rcal-day{
  border:1px solid #ddd;
  border-radius:12px;
  background:#fff;
  padding:var(--rcal-cell-pad);
  display:flex;
  flex-direction:column;
  min-height:0;
  position:relative;
  min-width:0;
  transition:box-shadow .12s ease, transform .12s ease, border-color .12s ease;
}

.rcal-day.out{
  background:#fafafa;
  color:#bbb;
}

.rcal-day.today{
  border-color:#333;
}

.rcal-day:hover{
  border-color:#10b981;
  box-shadow:0 6px 16px rgba(16,185,129,.18);
  transform:translateY(-1px);
  cursor:pointer;
}

.rcal-day.is-selected{
  border-color:#10b981 !important;
  box-shadow:0 6px 14px rgba(16,185,129,.22);
}

.rcal-day.today.is-selected{
  border-color:#059669 !important;
  box-shadow:0 10px 22px rgba(5,150,105,.28);
}

.rcal-day-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:6px;
  flex:0 0 auto;
  gap:6px;
  background:transparent;
}

.rcal-day-head-left{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.rcal-day-num{
  font-weight:800;
  font-size:13px;
  line-height:1.2;
}

.rcal-holiday{
  font-size:11px;
  color:#e53935;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 주말/공휴일 날짜 색 */
.rcal-day.sun .rcal-day-num{
  color:#e53935;
}

.rcal-day.sat .rcal-day-num{
  color:#1e88e5;
}

.rcal-day.holiday .rcal-day-num{
  color:#e53935;
  font-weight:700;
}

.rcal-day.out.sun .rcal-day-num,
.rcal-day.out.sat .rcal-day-num,
.rcal-day.out .rcal-holiday,
.rcal-day.out .rcal-day-num{
  opacity:.65;
}

/* =========================
   아이템 영역(스크롤)
========================= */
.rcal-items{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:4px;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:4px;
}

.rcal-wrap:not(.mode-week) .rcal-items{
  max-height:var(--rcal-items-max);
}

.rcal-wrap.mode-week .rcal-items{
  max-height:calc(100% - 28px);
}

.rcal-items::-webkit-scrollbar{
  width:8px;
}

.rcal-items::-webkit-scrollbar-thumb{
  background:#d6d6d6;
  border-radius:999px;
}

.rcal-items::-webkit-scrollbar-track{
  background:transparent;
}

/* =========================
   일정 아이템
========================= */
.rcal-item{
  margin:2px 0;
  padding:2px 4px;
  border-radius:4px;
  background:transparent !important;
  border-left:0 !important;
  box-shadow:none !important;
  font-size:12px;
  cursor:pointer;
}

.rcal-item:hover{
  background:transparent !important;
}

.rcal-item .time{
  display:none !important;
}

.rcal-item .room{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  line-height:1.35;
  word-break:break-word;
  white-space:normal;
  font-weight:700;
}

/* 라벨 + 시간 줄 */
.rcal-item .event-time-row {
  display:flex;
  align-items:center;
  gap:4px;
  font-size:11px;
  margin-bottom:2px;
  white-space:nowrap;
}

/* 시간 텍스트 */
.rcal-item .event-time {
  font-weight:700;
}

/* 라벨 + 제목 1줄 */
.rcal-item .event-name-row{
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:4px;
  min-width:0;
}

/* 텍스트 */
.rcal-item .event-text{
  flex:1 1 auto;
  word-break:break-word;
  min-width:0;
}

/* 색상은 EVENT_TYPE 기준 */
.rcal-item .room.type-HOLIDAY{
  color:#e53935;
  font-weight:700;
}

.rcal-item .room.type-CLASS{
  color:#2e7d32;
  font-weight:700;
}

.rcal-item .room.type-RENT{
  color:#1565c0;
  font-weight:700;
}

/* 링크형 아이템 대응 */
.rcal-wrap a.rcal-item{
  display:block;
  color:inherit;
  text-decoration:none;
  font-family:inherit;
  font-size:inherit;
  font-weight:inherit;
  line-height:inherit;
}

.rcal-wrap a.rcal-item *{
  color:inherit;
  font-family:inherit;
}

a.rcal-item{
  text-decoration:none;
}

a.rcal-item:hover{
  text-decoration:none;
}

/* =========================
   ROOM BADGE
========================= */
.rcal-item .room-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 5px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  color:#fff;
  margin-right:4px;
  line-height:1.4;
  white-space:nowrap;
  flex:0 0 auto;
}

/* 색상 (legend와 동일) */
.rcal-item[data-room-val="007001000"] .room-badge{
  background:#8BC34A;
}

.rcal-item[data-room-val="007002000"] .room-badge{
  background:#03A9F4;
}

.rcal-item[data-room-val="007003000"] .room-badge{
  background:#9C27B0;
}

.rcal-item[data-room-val="007004000"] .room-badge{
  background:#E91E63;
}

/* =========================
   리스트 뷰
========================= */
.rental-list-wrap{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:0;
  display:none;
  background:#fff;
}

.rental-list-wrap::-webkit-scrollbar{
  width:10px;
  height:10px;
}

.rental-list-wrap::-webkit-scrollbar-thumb{
  background:#d6d6d6;
  border-radius:999px;
}

.rental-list-wrap::-webkit-scrollbar-track{
  background:transparent;
}

.rental-list-wrap table{
  width:100%;
  min-width:1480px;
  margin-bottom:0;
  background:#fff;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
}

.rental-list-wrap thead{
  position:relative;
  z-index:3;
}

.rental-list-wrap thead tr{
  box-shadow:0 2px 4px rgba(0,0,0,0.05);
}

.rental-list-wrap thead th{
  position:sticky;
  top:0;
  z-index:10;
  background:#f1f5f9;
  color:#111827;
  border-bottom:2px solid #cbd5e1;
  border-right:1px solid #cbd5e1;
  text-align:center;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
  vertical-align:middle;
  padding:12px 10px;
}

.rental-list-wrap thead th:last-child{
  border-right:none;
}

.rental-list-wrap tbody{
  position:relative;
  z-index:1;
}

.rental-list-wrap tbody tr{
  border-bottom:1px solid #e2e8f0;
}

.rental-list-wrap tbody tr:nth-child(even){
  background:#fafafa;
}

.rental-list-wrap tbody tr:hover{
  background:#f1f5f9;
}

.rental-list-wrap tbody td{
  font-size:13px;
  color:#111827;
  vertical-align:middle;
  padding:10px 12px;
  border-right:1px solid #e5e7eb;
  border-bottom:1px solid #e5e7eb;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  background:transparent;
}

.rental-list-wrap tbody td:last-child{
  border-right:none;
}

.rental-list-wrap td:nth-child(1),
.rental-list-wrap td:nth-child(2),
.rental-list-wrap td:nth-child(6){
  text-align:center;
}

/* 컬럼 너비 */
.rental-list-wrap th:nth-child(1),
.rental-list-wrap td:nth-child(1){ width:120px; }

.rental-list-wrap th:nth-child(2),
.rental-list-wrap td:nth-child(2){ width:140px; }

.rental-list-wrap th:nth-child(3),
.rental-list-wrap td:nth-child(3){ width:260px; }

.rental-list-wrap th:nth-child(4),
.rental-list-wrap td:nth-child(4){ width:320px; }

.rental-list-wrap th:nth-child(5),
.rental-list-wrap td:nth-child(5){ width:130px; }

.rental-list-wrap th:nth-child(6),
.rental-list-wrap td:nth-child(6){ width:120px; }

.rental-list-wrap th:nth-child(7),
.rental-list-wrap td:nth-child(7){ width:390px; }

#rentalList{
  flex:1 1 auto;
  min-height:0;
}

#rentalListBody tr{
  cursor:pointer;
}

#rentalListBody tr.is-selected td{
  background:#eefbf5 !important;
}

#rentalListBody tr:hover td{
  background:#f8fafc;
}

/* =========================
   버튼 바
========================= */
.rent-toggle-bar{
  width:100%;
  margin:18px 0;
}

.btn.apply{
  width:100%;
  background:#06573d;
  color:#fff;
  border:0;
  border-radius:16px;
  padding:22px 0;
  font-size:26px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(0,0,0,0.18);
  transition:all .15s ease;
}

.btn.apply:hover{
  transform:translateY(-2px);
  filter:brightness(.95);
}

/* 입력폼 기본 숨김 */
.rent-form.is-hidden{
  display:none;
}

/* 더보기/팝업 사용 안 함 */
.rcal-more{
  display:none !important;
}

.rcal-pop{
  display:none !important;
}

/* =========================
   대관 신청 폼
========================= */
.rent-form{
  background:#fff;
  border:1px solid #e8e8e8;
  border-radius:16px;
  padding:22px;
}

.rent-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
}

.f-item{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.f-span-3{
  grid-column:1 / -1;
}

.f-label{
  font-weight:700;
  color:#222;
}

.req{
  color:#e11d48;
}

.f-control input,
.f-control textarea,
.f-control select{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:12px;
  font-size:14px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
  background:#fff;
}

.f-control textarea{
  resize:vertical;
  min-height:220px;
}

.f-control input:focus,
.f-control textarea:focus,
.f-control select:focus{
  border-color:#10b981;
  box-shadow:0 0 0 3px rgba(16,185,129,.15);
}

.f-actions{
  margin-top:10px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

.f-notice{
  margin-top:14px;
  padding:10px 12px;
  border-radius:12px;
  background:#f8fafc;
  color:#475569;
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
}

.f-notice .i{
  width:18px;
  height:18px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  flex:0 0 auto;
  margin-top:1px;
  font-size:12px;
}

.f-footer{
  margin-top:18px;
  display:flex;
  gap:12px;
  justify-content:center;
}

.btn{
  border:0;
  border-radius:10px;
  padding:12px 18px;
  font-weight:800;
  cursor:pointer;
  font-size:14px;
}

.btn.primary{
  background:#10b981;
  color:#fff;
}

.btn.primary:hover{
  filter:brightness(.95);
}

.btn.gray{
  background:#94a3b8;
  color:#fff;
}

.btn.gray:hover{
  filter:brightness(.95);
}

.btn.ghost{
  background:#fff;
  border:1px solid #e5e7eb;
  color:#334155;
  padding:10px 14px;
  font-weight:700;
}

.btn.ghost:hover{
  background:#f8fafc;
}

/* =========================
   반응형: 태블릿
========================= */
@media (max-width:1024px){
  :root{
    --rcal-h: 600px;
    --rcal-h-week: 820px;
    --rcal-gap: 6px;
    --rcal-pad: 8px;
    --rcal-cell-pad: 7px;
    --rcal-items-max: 110px;
  }

  .rcal-head{
    padding:10px 12px;
  }

  .rcal-title{
    font-size:14px;
  }

  .rcal-btn{
    padding:6px 9px;
    border-radius:9px;
  }

  .rental-list-wrap table{
    min-width:1380px;
  }
}

/* =========================
   반응형: 모바일
========================= */
@media (max-width:768px){
  :root{
    --rcal-h: 560px;
    --rcal-h-week: 760px;
    --rcal-gap: 5px;
    --rcal-pad: 6px;
    --rcal-cell-pad: 6px;
    --rcal-items-max: 96px;
  }

  .rcal-head{
    padding:10px;
    align-items:flex-start;
    flex-direction:column;
  }

  .rcal-left,
  .rcal-right{
    width:100%;
  }

  .rcal-right{
    justify-content:flex-end;
  }

  .rcal-dow{
    font-size:11px;
    padding:4px 2px 8px;
  }

  .rcal-day-num{
    font-size:12px;
  }

  .rcal-item{
    font-size:11px;
    padding:2px 3px;
  }

  .rcal-item .event-time-row{
    font-size:10px;
  }

  #rentalCalendar .rcal-legend{
    padding:10px 14px 12px;
  }

  #rentalCalendar .rcal-legend-item{
    font-size:11px;
    padding:5px 9px;
  }

  .rent-grid{
    grid-template-columns:repeat(2, 1fr);
  }

  .f-span-3{
    grid-column:1 / -1;
  }

  .rental-list-wrap table{
    min-width:1320px;
  }
}

/* =========================
   작은 모바일
========================= */
@media (max-width:560px){
  .rent-form{
    padding:16px;
    border-radius:14px;
  }

  .rent-grid{
    grid-template-columns:1fr;
  }

  .f-footer{
    flex-direction:column;
  }

  .btn{
    width:100%;
  }

  .f-actions{
    justify-content:stretch;
    flex-direction:column;
  }

  .btn.ghost{
    width:100%;
  }
}

/* =========================
   모바일 월간: 가로 스크롤
========================= */
@media (max-width:480px){
  :root{
    --rcal-h: 520px;
    --rcal-h-week: 720px;
    --rcal-gap: 4px;
    --rcal-pad: 6px;
    --rcal-cell-pad: 6px;
    --rcal-items-max: 84px;
  }

  .rcal-btn{
    padding:5px 8px;
    font-size:12px;
  }

  .rcal-title{
    font-size:13px;
  }

  .rcal-wrap:not(.mode-week) .rcal-grid{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:14px;
  }

  .rcal-wrap:not(.mode-week) .rcal-dow,
  .rcal-wrap:not(.mode-week) .rcal-days{
    min-width:640px;
  }

  .rcal-wrap{
    border-radius:10px;
  }

  .rcal-day{
    border-radius:10px;
  }

  .rental-list-wrap table{
    min-width:1280px;
  }
}

/* =========================
   큰 화면
========================= */
@media (min-width:1400px){
  :root{
    --rcal-h: 700px;
    --rcal-h-week: 980px;
    --rcal-items-max: 140px;
  }
}

/* =========================
   주간 모드 모바일 폭 확장
========================= */
@media (max-width:768px){
  .rcal-wrap.mode-week .rcal-grid{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .rcal-wrap.mode-week .rcal-dow,
  .rcal-wrap.mode-week .rcal-days{
    min-width:980px;
  }

  .rcal-wrap.mode-week .rcal-days{
    grid-template-columns:repeat(7, minmax(130px, 1fr));
  }

  .rcal-wrap.mode-week .rcal-dow{
    grid-template-columns:repeat(7, minmax(130px, 1fr));
  }
}

/* =========================
   rentalCalendar legend 보강
========================= */
#rentalCalendar .rcal-legend-item{
  cursor: pointer;
}

#rentalCalendar .rcal-legend-item.on{
  border-color: #333;
  background: #f8fafc;
  font-weight: 700;
}

#rentalCalendar .rcal-legend-swatch{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  border-left: 3px solid transparent;
}

/* 전체는 점 숨김 */
#rentalCalendar .rcal-legend-item[data-room=""] .rcal-legend-swatch{
  display: none;
}