/* ===== work_add.css - 员工排班 / 门诊排班查看（docs_db/workday.md） ===== */
/* 作用域前缀 .work-add（设置页 .work-add / 门诊排班查看 .worklist-container 复用同一套表格样式），避免污染父框架样式 */

/* ============ 页面标题区 ============ */
.work-add .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9edf4;
}
.work-add .page-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 600;
    color: #1a2634;
}
.work-add .page-header h4 i { color: #0d6efd; }
.work-add .header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* ============ 工具栏（月份 + 筛选/操作） ============ */
.work-add #monthLabel { font-size: 1rem; color: #1a2634; }

/* ============ 消息提示（顶部居中，父框架顶栏高 70px 之下） ============ */
.work-add .toast-container {
    position: fixed;
    top: 82px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    z-index: 1090;
}

/* ============ 提交中按钮（置灰 + 禁用，防重复点击） ============ */
.work-add .btn-busy {
    opacity: .55;
    pointer-events: none;
}

/* ============ 滚动容器 ============ */
.work-add .table-scroll {
    overflow: auto;
    max-height: 65vh;
}

/* ============ 表格骨架 ============ */
.work-add .schedule-table {
    table-layout: fixed;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.work-add .schedule-table th,
.work-add .schedule-table td {
    border-right: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    vertical-align: middle;
}
.work-add .schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: .35rem .15rem;
    background-color: #f1f3f5;
    font-size: .8125rem;
}
.work-add .schedule-table tbody td { padding: 2px; }

/* 首列吸附 */
.work-add .schedule-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #fff;
}
.work-add .schedule-table thead .sticky-col {
    z-index: 4;
    background-color: #f1f3f5;
}
.work-add .schedule-table .col-staff { padding: .35rem .6rem; }

/* 日期格 */
.work-add .day-num { font-weight: 600; line-height: 1.1; }
.work-add .day-week { font-size: .6875rem; color: var(--bs-secondary-color); line-height: 1.2; }
.work-add th.is-weekend { background-color: #e9ecef; }
.work-add th.is-today { background-color: rgba(13, 110, 253, .14); }
.work-add th.is-today .day-num,
.work-add th.is-today .day-week { color: #0d6efd; }

.work-add td.is-weekend { background-color: #fafbfc; }
.work-add td.is-today { background-color: rgba(13, 110, 253, .07); }

/* ============ 班次色块 ============ */
.work-add .shift {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 .2rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
    transition: filter .12s ease, transform .12s ease;
}
.work-add .shift:hover { filter: brightness(.93); transform: translateY(-1px); }

/* 未排班格子 */
.work-add .shift-empty {
    color: #adb5bd;
    font-weight: 400;
    background-color: transparent;
    border: 1px dashed #dee2e6;
    opacity: .55;
}
.work-add .shift-empty:hover { opacity: 1; }

/* 其他门店已排班（多店兼职）：显示兼职且不可编辑 */
.work-add .shift-locked .shift {
    cursor: not-allowed;
    border-style: dashed;
    opacity: .75;
}
.work-add .shift-locked .shift:hover { transform: none; filter: none; }

/* ============ 统计行 ============ */
.work-add .summary-row td { background-color: #fcfcfd; }
.work-add .summary-row td.sticky-col { background-color: #fcfcfd; }
.work-add .total-row td { background-color: #eef1f4; }
.work-add .total-row td.sticky-col { background-color: #eef1f4; }

.work-add .count-cell {
    text-align: center;
    font-size: .75rem;
    padding: .3rem .1rem;
}
.work-add .count-cell .zero { color: var(--bs-secondary-color); opacity: .4; }

.work-add .legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: .35rem;
    vertical-align: middle;
    flex: 0 0 auto;
}

/* ============ 图例 ============ */
.work-add .legend { display: inline-flex; align-items: center; gap: .4rem; }
.work-add .legend .chip { width: 14px; height: 14px; border-radius: 4px; border: 1px solid transparent; }

/* ============ 排班格子弹窗选项 ============ */
.work-add .shift-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background-color: #fff;
    font-weight: 500;
    text-align: left;
}
.work-add .shift-option:hover { background-color: var(--bs-tertiary-bg); }
.work-add .shift-option.active {
    border-color: var(--bs-primary);
    background-color: rgba(13, 110, 253, .06);
    box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .12);
}
.work-add .shift-option .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.work-add .shift-option small { margin-left: auto; font-weight: 400; color: var(--bs-secondary-color); }

/* ============ 班次设置弹窗 ============ */
.work-add #shiftTabs .nav-link {
    font-size: .875rem;
    padding: .4rem .6rem;
}
.work-add .shift-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: #fff;
}
.work-add .shift-row.editing {
    border-color: var(--bs-primary);
    background: rgba(13, 110, 253, .04);
}
.work-add .shift-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* 暂存状态标记 */
.work-add .draft-badge {
    font-size: .6875rem;
    padding: .15rem .45rem;
}

/* 确认框 */
.work-add .confirm-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 193, 7, .15);
    color: #b58100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex: 0 0 auto;
}

/* ============ 窄屏适配 ============ */
@media (max-width: 767.98px) {
    .work-add .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }
    .work-add .header-actions { justify-content: flex-start; }
}

/* ============ 门诊排班查看（todaywork.worklist 只读复用，不可操作） ============ */
/* 铺满今日工作台右侧内容区（flex 纵向布局，表头吸附 + 表格内部滚动） */
.worklist-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.worklist-container > .card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
}
.worklist-container > .card > .card-header,
.worklist-container > .card > .card-footer { flex: 0 0 auto; }
.worklist-container .table-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
}
.worklist-container .shift,
.worklist-container .shift-empty,
.worklist-container .shift-locked .shift { cursor: default; }
.worklist-container .shift:hover { filter: none; transform: none; }
/* 未排班日期保持空白（无"＋"占位；悬停无变化） */
.worklist-container .shift-empty,
.worklist-container .shift-empty:hover { opacity: .35; }

/* ============ 鼠标悬浮：高亮对应列（日期）与行（员工），便于对照查看（两个页面共用） ============ */
.work-add .schedule-table tbody td:not(.sticky-col) { position: relative; }  /* 覆盖层定位（首列 sticky 本身已定位） */
.work-add .schedule-table .hl-row::before,
.work-add .schedule-table .hl-col::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}
.work-add .schedule-table .hl-row::before { background-color: rgba(25, 135, 84, .07); }   /* 行 */
.work-add .schedule-table tbody .hl-col::after { background-color: rgba(13, 110, 253, .13); }  /* 列 */
.work-add .schedule-table thead th.hl-col { background-color: #dbeafe; }  /* 对应日期表头更醒目 */
