/* 인계 · 당직 — ward/handovers · ward/duties */

/* 인계장: 근무마다 한 칸 — 넓으면 나란히(D · E · N), 좁으면 위아래 */
.handover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1rem;
    align-items: start;
}

.handover-card {
    border: 1px solid var(--theme-border-color);
    border-radius: var(--theme-border-radius);
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.handover-card.is-empty {
    border-style: dashed;
}

.handover-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.handover-census {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.handover-census > div {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--theme-light);
}

.handover-census dt {
    font-weight: 400;
    color: var(--theme-secondary-color, var(--theme-body-color));
    font-size: 0.8125rem;
}

.handover-census dd {
    margin: 0;
    font-weight: 600;
}

.handover-body {
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
}

.handover-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--theme-border-color);
}

.handover-reader {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8125rem;
    color: var(--theme-primary);
}

/* 작성 창의 현황 칸 — 라벨 위 · 칸 좁게, 한 줄에 나란히 */
.handover-census-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.handover-census-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 5rem;
    font-size: 0.8125rem;
}

/* 당직표 */
.duty-table th,
.duty-table td {
    white-space: nowrap;
}

.duty-table .duty-date {
    width: 8rem;
}

.duty-table .is-sunday {
    color: var(--theme-danger);
}

.duty-table .is-saturday {
    color: var(--theme-primary);
}

.duty-table tr.is-today > * {
    background: var(--theme-light);
}

.duty-table .duty-cell {
    min-width: 7rem;
    padding: 0;
}

.duty-table .duty-cell > * {
    display: block;
    padding: 0.35rem 0.5rem;
    min-height: 2rem;
}

.duty-table .duty-link {
    color: inherit;
    text-decoration: none;
}

.duty-table .duty-link:hover {
    background: var(--theme-light);
}

.duty-table .duty-cell.is-me {
    background: var(--theme-primary-bg-subtle, rgba(13, 110, 253, 0.08));
    font-weight: 600;
}

/* 카드용 머리말('진료 당직')은 표에서는 숨긴다 — .duty-cell > * 의 display:block 이 이기지 않게. */
.duty-table .duty-cell > .mf-card-label {
    display: none;
}
/* 카드(보기만 하는 사람, 1200px 미만): 칸 폭 · 블록 모양을 풀고 '진료 당직 김OO · 이OO' 한 줄로. */
@media screen and (max-width: 1199.98px) {
    .mf-card-table.duty-table .duty-date,
    .mf-card-table.duty-table .duty-cell {
        width: auto;
        min-width: 0;
        white-space: normal;
    }
    .mf-card-table.duty-table .duty-cell > * {
        display: inline;
        min-height: 0;
        padding: 0;
    }
    .mf-card-table.duty-table .duty-cell.is-me {
        padding: 0 0.375rem;
        border-radius: 0.375rem;
    }
}
