/* --------------------------------------------------------------------------
 * 자원예약 — 하루 시간표. 왼쪽 자원 이름 | 오른쪽 시각 칸(한 시간씩, 누르면 예약 창).
 * 예약 막대는 칸 위에 절대 위치(left · width %), 내 예약은 짙게, 승인 대기는 빗금.
 * 좁은 화면은 가로로 민다.
 * -------------------------------------------------------------------------- */
.rsv-scroll {
    overflow-x: auto;
}
.rsv-timeline {
    min-width: 56rem;
}
.rsv-row {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    border-bottom: 1px solid var(--ln);
}
/* 마지막 줄은 카드 테두리가 대신한다(두 줄로 겹쳐 보이지 않게) */
.rsv-timeline > .rsv-row:last-child {
    border-bottom: 0;
}
.rsv-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0.5rem 1rem;
    border-right: 1px solid var(--ln);
}
.rsv-name-title {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rsv-name-meta {
    color: var(--tx-muted);
    font-size: 0.75rem;
}
.rsv-head {
    background: var(--sf-inset);
}
.rsv-hours,
.rsv-track {
    display: grid;
    grid-template-columns: repeat(var(--rsv-hours), minmax(0, 1fr));
}
.rsv-hours > span {
    padding: 0.375rem 0 0.375rem 0.375rem;
    border-left: 1px solid var(--ln);
    color: var(--tx-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.rsv-hours > span:first-child,
.rsv-slot:first-child {
    border-left: 0;
}
.rsv-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--ln);
    background: var(--sf-inset);
    color: var(--tx-strong);
    font-size: 0.8125rem;
    font-weight: 600;
}
.rsv-approval-tag {
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--theme-warning-bg-subtle);
    color: var(--theme-warning-text-emphasis);
    font-size: 0.6875rem;
}
.rsv-track {
    position: relative;
    min-height: 3.25rem;
}
.rsv-slot {
    border-left: 1px dashed var(--ln);
}
a.rsv-slot:hover {
    background: var(--theme-primary-bg-subtle);
}
.rsv-slot.is-past {
    background: repeating-linear-gradient(135deg, transparent 0 6px, var(--sf-inset) 6px 8px);
}
.rsv-block {
    position: absolute;
    top: 0.375rem;
    bottom: 0.375rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0.75rem;
    padding: 0 0.5rem;
    overflow: hidden;
    border-radius: 6px;
    background: color-mix(in srgb, var(--hospital-blue) 14%, var(--sf-card));
    color: var(--tx-strong);
    font-size: 0.75rem;
    line-height: 1.3;
    text-decoration: none;
}
.rsv-block:hover {
    background: color-mix(in srgb, var(--hospital-blue) 22%, var(--sf-card));
    color: var(--tx-strong);
}
.rsv-block.is-mine {
    background: var(--hospital-blue);
    color: #fff;
}
.rsv-block.is-mine:hover {
    color: #fff;
    filter: brightness(1.08);
}
/* 승인 대기 — 흰 칸과 섞이지 않게 주황 빗금(짙은 줄 + 옅은 줄). 내 예약이어도 승인 대기면 이 모양. */
.rsv-block.is-pending {
    background: repeating-linear-gradient(
        135deg,
        color-mix(in srgb, var(--st-warning) 30%, var(--sf-card)) 0 6px,
        color-mix(in srgb, var(--st-warning) 14%, var(--sf-card)) 6px 12px
    );
    color: var(--tx-strong);
}
.rsv-block.is-pending:hover {
    color: var(--tx-strong);
    filter: brightness(0.96);
}
/* 미반납 — 끝났는데 반납하지 않은 차량 · 장비. 막대 자체를 빨강 계열로(내 예약이어도). */
.rsv-block.is-overdue {
    background: color-mix(in srgb, var(--st-danger) 16%, var(--sf-card));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-danger) 55%, transparent);
    color: var(--st-danger);
}
.rsv-block.is-overdue:hover {
    background: color-mix(in srgb, var(--st-danger) 24%, var(--sf-card));
    color: var(--st-danger);
    filter: none;
}
.rsv-block-time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.rsv-block-time,
.rsv-block-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rsv-reject {
    display: flex;
    gap: 0.5rem;
}


/* 휴대폰: 자원 이름 칸을 좁히고(11rem → 7.5rem) 시간을 옆으로 밀어도 왼쪽에 붙어 있게 — 이름 칸이 화면 절반을
   차지해 시간 칸이 서너 개만 보였고, 밀면 어느 자원 줄인지 알 수 없었다. */
@media screen and (max-width: 767.98px) {
    .rsv-timeline {
        min-width: 48rem;
    }
    .rsv-row {
        grid-template-columns: 7.5rem minmax(0, 1fr);
    }
    .rsv-name {
        position: sticky;
        left: 0;
        z-index: 3;
        padding: 0.5rem 0.625rem;
        background: var(--sf-card);
    }
    .rsv-head > .rsv-name {
        background: var(--sf-inset);
    }
}
