/* 근무표를 위한 CSS */
:root {
    --wtm-dept-w: 60px;
    --wtm-name-w: 60px;
    --wtm-day-w: 34px;
    --wtm-week-gap-w: 12px;
    --wtm-editbar-h: 0px;
}

.schedule-page,
.schedule-edit-page {
    --wtm-dept-w: 60px;
    --wtm-name-w: 60px;
    --wtm-day-w: 34px;
    --wtm-week-gap-w: 12px;
    --wtm-sign-w: 0px;
    background: #fff;
}

.schedule-edit-page {
    width: max-content;
    min-width: 100%;
    max-width: none;
}

.schedule-today-badge {
    background-color: cyan;
    font-weight: 700;
    border-radius: 20px;
}

.schedule-next-month {
    opacity: 0.3;
}

.schedule-grid,
.schedule-grid-body {
    background: #fff;
}

.schedule-grid {
    font-size: 0.78rem;
    width: max-content;
    --wtm-pad-x: 0;
    padding: 0 10px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: clip;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.schedule-grid-row {
    display: grid;
    grid-template-columns: var(--wtm-cols);
    align-items: stretch;
}

.schedule-grid-cell {
    text-align: center;
    padding: 2px 1px;
    vertical-align: middle;
    border: 0;
}

.schedule-grid-cell.left1,
.schedule-grid-cell.left2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
    background-clip: padding-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-grid-cell.left1 {
    position: sticky;
    left: 0;
    z-index: 20; /* 일반 데이터 셀보다는 높지만, 상단 헤더보다는 낮게 */
    box-shadow: 1px 0 0 #e2e8f0;
}

.schedule-grid-cell.left2 {
    position: sticky;
    left: var(--wtm-dept-w);
    z-index: 20; /* 일반 데이터 셀보다는 높지만, 상단 헤더보다는 낮게 */
    box-shadow: 1px 0 0 #cbd5e1;
}

.schedule-grid-header {
    position: sticky;
    top: var(--app-sticky-top);
    z-index: 30; /* 좌측 열(20)보다 높게 설정 */
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.schedule-grid-row-head .schedule-grid-cell {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.schedule-grid-row-head .schedule-grid-cell.left1,
.schedule-grid-row-head .schedule-grid-cell.left2,
.schedule-grid-row-head .schedule-grid-cell.head.left1,
.schedule-grid-row-head .schedule-grid-cell.head.left2 {
    position: sticky;
    background: #f8fafc;
    z-index: 40; /* 상단 헤더(30)와 좌측 열(20)이 만나는 지점 */
}

.schedule-grid-row-head .schedule-grid-cell.head.left1 { left: 0; }
.schedule-grid-row-head .schedule-grid-cell.head.left2 { left: var(--wtm-dept-w); }

.schedule-grid-row-data:hover .schedule-grid-cell.day { background-color: #f2f2f2; }

.schedule-grid-row-data:hover .schedule-grid-cell.left1,
.schedule-grid-row-data:hover .schedule-grid-cell.left2 {
    background-color: #f2f2f2;
}

.schedule-grid-cell.day.is-today { background-color: #f1f5f9; }

.schedule-grid-cell.day.has-vacation-lock {
    position: relative;
    background-color: #fff7ed;
}

.schedule-grid-cell.day.has-vacation-lock::after {
    content: "";
    position: absolute;
    right: 3px;
    top: 3px;
    width: 5px;
    height: 5px;
    border-radius: 9999px;
    background: #f97316;
}

.schedule-grid .schedule-grid-cell.day.is-hover {
    background-color: #f2f2f2;
}

.schedule-grid .schedule-grid-cell.head.day.is-hover {
    background-color: #f2f2f2;
}

.schedule-grid .schedule-grid-cell.day.is-hover.is-today {
    background-color: #e5e7eb;
}

.schedule-grid-divider-row .schedule-grid-divider {
    grid-column: 1 / -1;
    height: 1px;
    border-bottom: 1px solid #cbd5e1;
}

.schedule-grid .schedule-grid-cell.week-gap {
    padding: 0 !important;
    border: 0 !important;
    background: transparent;
    pointer-events: none;
}

.schedule-grid-cell.signcol { display: none; }
.print-header { display: none; }

.schedule-edit-slot {
    display: block;
    cursor: pointer;
}

/* 편집 화면 전용 */
.schedule-edit-toolbar {
    position: sticky;
    top: var(--app-sticky-top);
    z-index: 50;
    margin-bottom: 0 !important;
    padding-top: 8px;
    padding-bottom: 8px;
    background: #fff;
}

.schedule-edit-toolbar::before {
    content: none;
}

.module-palette {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 10px 12px 8px;
}

.module-palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.module-palette-title {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    letter-spacing: -0.01em;
}

.schedule-edit-page .schedule-grid-header {
    top: calc(var(--app-sticky-top) + var(--wtm-editbar-h));
}

@media (min-width: 1920px) {
    .schedule-page { padding-top: 0; }

    .schedule-grid-header {
        top: var(--app-sticky-top);
    }
}

@media print {
    .schedule-page-header,
    nav,
    footer {
        display: none !important;
    }

    .schedule-page {
        padding-top: 0 !important;
        margin: 0 !important;
    }

    .schedule-grid-cell.signcol { display: block; }
    .print-header { display: block; }
}
