/* Scheduling module only. */
.schedule-import-mapping{display:grid;gap:10px;margin:16px 0}
.schedule-import-mapping h3{margin:0 0 4px}
.schedule-import-mapping .schedule-import-map-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,.9fr);gap:16px;align-items:center;margin:0;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.schedule-import-map-row>span{min-width:0;overflow-wrap:anywhere;line-height:1.6}
.schedule-import-map-row>span:first-child{font-weight:600}
.schedule-import-map-row>select{box-sizing:border-box;min-width:0;width:100%;min-height:44px;padding:9px 12px;font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line-strong);border-radius:7px}
.schedule-import-map-row>.hint{font-size:13px;color:var(--muted)}
@media(max-width:640px){.schedule-import-mapping .schedule-import-map-row{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px}.schedule-import-map-row>select{font-size:16px}}
.schedule-period-closed{opacity:.58}.schedule-field{display:grid;gap:6px;margin:8px 0}.schedule-field input,.schedule-field select{font:inherit;padding:8px;border:1px solid var(--line);border-radius:7px}.schedule-day-meeting{display:block;max-width:110px;white-space:normal;font-weight:400;color:var(--accent)}.schedule-store-entry{display:grid;gap:7px}.schedule-daily-need{padding:5px 0;border-bottom:1px solid var(--line)}
.schedule-toolbar,.schedule-savebar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 14px}.schedule-admin-tabs{margin:0 0 14px}.schedule-toolbar strong{font-size:17px}.schedule-cards,.schedule-store-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.schedule-period-card,.schedule-store-card{font:inherit;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:12px;padding:15px;cursor:pointer;color:var(--ink);display:grid;gap:4px}.schedule-period-card:hover,.schedule-store-card:hover{border-color:var(--accent)}.schedule-progress{color:var(--accent);font-weight:700}.schedule-stat-grid{display:flex;gap:10px;margin-top:16px}.schedule-stat{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 16px;min-width:92px}.schedule-stat strong,.schedule-stat span{display:block}.schedule-stat strong{font-size:20px}.schedule-legend,.schedule-meetings,.schedule-roster-note,.schedule-demand{margin:12px 0;padding:10px 12px;border-radius:10px;background:var(--surface-alt);border:1px solid var(--line)}.schedule-legend-item{display:inline-block;margin:4px 8px 4px 0;padding:2px 6px;background:#fff;border-radius:5px;font-size:12px}.schedule-meetings{border-left:4px solid var(--accent)}.schedule-table-scroll{overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff}.schedule-roster{border-collapse:collapse;min-width:780px;width:100%;font-size:13px}.schedule-roster th,.schedule-roster td{border-bottom:1px solid var(--line);padding:7px;vertical-align:top}.schedule-roster thead th{position:sticky;top:0;background:var(--surface-alt);z-index:1}.schedule-roster tbody th{text-align:left;min-width:155px;background:#fff}.schedule-roster select{width:100%;min-width:72px;font:inherit}.schedule-person-meta,.schedule-person-status{font-size:11px;color:var(--muted)}.schedule-person-status{color:var(--accent)}.schedule-demand summary{cursor:pointer;font-weight:700}.schedule-demand-list{font-size:13px;margin-top:8px}.schedule-savebar{margin-top:14px}.schedule-admin-panel{margin-top:12px}.schedule-settings h2,.schedule-period-admin h2,.schedule-demand-import h2{margin-top:0}.schedule-shift-row,.schedule-capacity-row{display:grid;grid-template-columns:repeat(6,minmax(70px,1fr));gap:6px;margin:6px 0}.schedule-capacity-row{grid-template-columns:minmax(130px,2fr) 1fr 1fr}.schedule-setting,.schedule-target-row input,.schedule-period-admin>input,.schedule-demand-import>input,.schedule-demand-import>select{min-width:0;width:100%;padding:8px;border:1px solid var(--line-strong);border-radius:7px;font:inherit}.schedule-targets{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin:14px 0}.schedule-target-row{display:flex;gap:8px;align-items:center;background:var(--surface-alt);padding:7px;border-radius:8px}.schedule-target-row span{flex:1;min-width:0}.schedule-target-row input{width:82px}.schedule-password{margin:14px 0}.schedule-password input{max-width:340px}.schedule-demand-import{display:grid;gap:10px;max-width:620px}.schedule-reminder-item{padding:8px 0;border-bottom:1px solid var(--line)}
@media(max-width:640px){.schedule-stat-grid{overflow:auto}.schedule-shift-row{grid-template-columns:repeat(2,minmax(0,1fr))}.schedule-capacity-row{grid-template-columns:1fr 1fr}.schedule-capacity-row span{grid-column:1/-1}.schedule-admin-tabs .btn{flex:1}.schedule-table-scroll{margin-left:-4px;margin-right:-4px}.schedule-roster{font-size:12px}.schedule-roster th,.schedule-roster td{padding:5px}.schedule-cards,.schedule-store-grid{grid-template-columns:1fr}}
.schedule-capacity-row{grid-template-columns:minmax(130px,2fr) repeat(4,minmax(70px,1fr))}
@media(max-width:640px){.schedule-capacity-row{grid-template-columns:1fr 1fr}.schedule-capacity-row span{grid-column:1/-1}}
.schedule-templates{margin:18px 0}.schedule-template-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0;padding:8px;background:var(--surface-alt);border-radius:8px}.schedule-template-row>span{min-width:88px;font-weight:600}.schedule-template-row input{max-width:290px}
.schedule-shift-scope{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:4px 0 12px;padding:8px;border:1px solid var(--line);border-radius:8px}.schedule-shift-scope legend{font-size:12px;font-weight:700}.schedule-shift-scope .schedule-field{display:flex;gap:4px;align-items:center;font-size:12px}.schedule-scope-warning{width:100%;color:#9a5a00}

/* 期間與目標：欄位有標題與說明；目標依門市分組 */
.schedule-period-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0 6px}
.schedule-field-block{display:grid;gap:5px}
.schedule-field-block>label{font-size:13px;font-weight:700}
.schedule-field-block>input{min-width:0;width:100%;padding:9px 10px;border:1px solid var(--line-strong);border-radius:8px;font:inherit;background:var(--surface)}
.schedule-field-block>.hint{font-size:12px}
.schedule-period-status{margin:6px 0 16px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.schedule-pill{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;background:var(--surface-alt);border:1px solid var(--line)}
.schedule-pill-open{background:#e4f5ec;color:#1e7a4f;border-color:transparent}
.schedule-pill-closed{background:#fce8e8;color:#b13333;border-color:transparent}
.schedule-pill-before{background:#fdf0dc;color:#96601a;border-color:transparent}
.schedule-targets-head h3{margin:18px 0 4px}
.schedule-target-group{margin:12px 0;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.schedule-target-group-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.schedule-target-group-head strong{flex:1;min-width:0}
.schedule-bulk{width:180px;padding:7px 9px;border:1px solid var(--line-strong);border-radius:7px;font:inherit}
.schedule-target-group .schedule-targets{margin:6px 0 0}
.schedule-target-row small{color:var(--muted);font-weight:400;font-size:11px}
.schedule-unit{flex:none!important;font-size:12px;color:var(--muted)}

/* 班別與人力：表格有欄名、班別依體系分組 */
.schedule-shift-group{margin:10px 0 18px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.schedule-shift-group h4{margin:0 0 8px;font-size:15px}
.schedule-shift-head,.schedule-capacity-head{font-size:12px;font-weight:700;color:var(--muted);margin-bottom:2px}
.schedule-shift-head span,.schedule-capacity-head span{padding:0 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.schedule-capacity-row{grid-template-columns:minmax(130px,2fr) 1fr 1fr 1fr 1fr}
.schedule-capacity-row>span:first-child{align-self:center;font-weight:700}
.schedule-shift-row input[readonly]{background:var(--surface-alt);color:var(--muted)}
.schedule-shift-scope{margin:4px 0 14px}
.schedule-scope-or{font-size:12px;color:var(--muted)}
.schedule-settings h3{margin:22px 0 4px}
@media (max-width:640px){.schedule-shift-row,.schedule-capacity-row{grid-template-columns:repeat(2,minmax(0,1fr))}.schedule-shift-head,.schedule-capacity-head{display:none}.schedule-shift-row input,.schedule-capacity-row input,.schedule-capacity-row select{font-size:13px}}

/* 期間與目標：月份用點的、讀取時整塊擋住、沒填目標的黃底 */
.schedule-month{position:relative}
.schedule-month-toggle{width:100%;text-align:left;padding:9px 10px;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface);font:inherit;cursor:pointer}
.schedule-month-pop{display:none;position:absolute;z-index:30;top:calc(100% + 6px);left:0;min-width:260px;padding:10px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);box-shadow:0 10px 30px rgba(23,39,46,.16)}
.schedule-month.open .schedule-month-pop{display:block}
.schedule-month-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.schedule-month-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.schedule-month-cell{padding:9px 0;border:1px solid var(--line);border-radius:8px;background:var(--surface);font:inherit;cursor:pointer}
.schedule-month-cell:hover{border-color:var(--accent)}
.schedule-month-cell.is-now{border-color:var(--accent);color:var(--accent);font-weight:700}
.schedule-month-cell.is-on{background:var(--topbar);color:#fff;border-color:var(--topbar)}
.schedule-targets-wrap{position:relative}
.schedule-veil{display:none;position:absolute;inset:0;z-index:5;background:rgba(241,238,228,.7);backdrop-filter:blur(1px);align-items:flex-start;justify-content:center;padding-top:40px}
.schedule-targets-wrap.is-busy .schedule-veil{display:flex}
.schedule-targets-wrap.is-busy .schedule-targets-groups{pointer-events:none;user-select:none;opacity:.6}
.schedule-veil-card{position:sticky;top:calc(var(--head-h,0px) + 24px);padding:14px 20px;border-radius:12px;background:var(--surface);border:1px solid var(--line-strong);box-shadow:0 10px 30px rgba(23,39,46,.16);font-weight:700}
.schedule-target-row input.is-empty{background:#fff6cc;border-color:#e6c766}
.schedule-target-row input.is-carried{border-style:dashed;border-color:var(--accent)}

/* 人流匯入：兩張卡，欄位有標題 */
.schedule-demand-import{max-width:none}
.schedule-import-card{padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.schedule-import-card h3{margin:0 0 4px}
.schedule-field-block>select{min-width:0;width:100%;padding:9px 10px;border:1px solid var(--line-strong);border-radius:8px;font:inherit;background:var(--surface)}
.schedule-field-block>input[type=file]{padding:7px}
.schedule-import-card.is-needed{border-color:#e6c766;background:#fffbea;margin:0 0 12px}
.schedule-import-card{margin:0 0 12px}
