.distribution-boot,
.distribution-access { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.distribution-boot { align-content: center; gap: 16px; color: var(--muted); }
.distribution-boot .brand-mark { margin: 0 auto; }
.access-card { width: min(430px, calc(100% - 32px)); padding: 34px; border: 1px solid var(--line); border-radius: 10px; background: #0a1727; }
.access-card .brand-mark { margin: 0 auto 20px; }
.access-card p { margin: 12px 0 24px; color: var(--muted); }
.action-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.distribution-page { padding: 28px clamp(20px, 4vw, 54px) 60px; }
.week-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.week-navigation, .toolbar-actions { display: flex; align-items: end; gap: 10px; }
.week-navigation label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.week-navigation input { min-width: 185px; }
.week-arrow { min-height: 46px; min-width: 46px; font-size: 18px; }
.settings-status { min-height: 30px; display: inline-flex; align-items: center; color: var(--green); font-size: 12px; font-weight: 800; }
.settings-status.pending, .settings-status.saving { color: var(--amber); }
.settings-status.error { color: var(--danger); }
.distribution-metrics { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.setup-card, .draft-card { margin-top: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, #0a1727e8, #091421d9); }
.draft-card { margin-top: 0; min-height: 260px; }
.schedule-heading { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.draft-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.run-picker { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.run-picker select { min-width: 210px; min-height: 40px; padding: 6px 9px; }
.show-time-control { min-height: 40px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: #081523; color: #c9d9e8; font-size: 11px; font-weight: 800; cursor: pointer; }
.show-time-control input { width: 22px; height: 22px; min-height: 22px; accent-color: #2f83c5; }
.schedule-view-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #07111e; }
.schedule-view-toggle button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.schedule-view-toggle button.active { background: var(--accent-soft); color: #fff; }
.workflow-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.workflow-guide article { display: flex; align-items: flex-start; gap: 11px; min-height: 96px; padding: 15px; border: 1px solid #224463; border-radius: 8px; background: #0b2136; }
.workflow-guide article > span { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 6px; background: #1f6ba6; color: #fff; font-weight: 900; }
.workflow-guide p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.details-copy { color: var(--muted); font-size: 12px; line-height: 1.5; }
details { border: 0; }
summary { min-height: 54px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
summary > span, summary strong, summary small { display: block; }
summary small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.rules-table th, .rules-table td { white-space: nowrap; }
.rules-table .employee-cell { min-width: 210px; white-space: normal; }
.employee-cell strong, .employee-cell span { display: block; }
.employee-cell span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.rule-check { display: grid; place-items: center; }
.rule-check input { width: 36px; height: 36px; min-height: 36px; margin: 0; appearance: none; border: 2px solid #3e73a4; border-radius: 5px; background-color: #0a2947; background-position: center; background-repeat: no-repeat; background-size: 26px 26px; cursor: pointer; }
.rule-check input:hover { border-color: #84c5f4; background-color: #103b63; }
.rule-check input:checked { border-color: #9bd2ff; background-color: #155486; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); box-shadow: 0 0 0 3px #5ba8ff24; }
.rule-check input:focus-visible { outline: 3px solid #78bfff; outline-offset: 3px; }
.automatic-value { display: inline-flex; min-width: 46px; min-height: 30px; align-items: center; justify-content: center; padding: 4px 8px; border: 1px solid #315a82; border-radius: 4px; background: #0a2947; color: #9bd2ff; font-size: 11px; font-weight: 800; }
.fixed-select { min-width: 150px; min-height: 38px; padding: 6px 9px; }
.empty-draft { min-height: 150px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.warning-list { display: grid; gap: 8px; margin-bottom: 15px; }
.schedule-warning { padding: 11px 13px; border-left: 3px solid #f3b65c; background: #f3b65c12; color: #f7d7a6; font-size: 12px; }
.readiness-panel { margin: 0 0 18px; padding: 18px; border: 1px solid #315879; border-radius: 8px; background: #091a2a; }
.readiness-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.readiness-heading h4 { margin: 2px 0 0; font-size: 18px; }
.readiness-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.readiness-badge { flex: 0 0 auto; min-height: 30px; padding: 6px 10px; border: 1px solid #436580; border-radius: 999px; background: #15283a; color: #b7cee1; font-size: 11px; font-weight: 850; }
.readiness-badge.ready { border-color: #3e8e72; background: #174638; color: #a3e8ce; }
.readiness-badge.attention, .readiness-badge.error { border-color: #a46c38; background: #442d17; color: #ffd29c; }
.readiness-checklist { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 8px; margin-top: 15px; }
.readiness-item { min-height: 66px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #294965; border-radius: 7px; background: #081523; }
.readiness-item .readiness-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #1b523f; color: #b8f1db; font-weight: 900; }
.readiness-item.problem { border-color: #8d5d35; background: #3a27192b; }
.readiness-item.problem .readiness-icon { background: #6a3c20; color: #ffd29c; }
.readiness-item.info .readiness-icon { background: #19486b; color: #b6ddfa; }
.readiness-item strong, .readiness-item small { display: block; }
.readiness-item strong { font-size: 12px; }
.readiness-item small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.readiness-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #263f58; }
.readiness-actions span { margin-left: auto; color: var(--muted); font-size: 10px; }
.schedule-table-host { min-width: 0; }
.roster-table-shell { overflow-x: auto; overflow-y: visible; max-height: none; border: 1px solid #203c57; border-radius: 7px; }
.roster-table { width: 100%; min-width: 1320px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.roster-table th, .roster-table td { border-right: 1px solid #203c57; border-bottom: 1px solid #203c57; }
.roster-table tr:last-child > * { border-bottom: 0; }
.roster-table tr > *:last-child { border-right: 0; }
.roster-table thead th { position: sticky; top: 0; z-index: 3; height: 58px; padding: 9px; background: #0e2237; color: #8ebde2; text-align: center; }
.roster-table thead th span, .roster-table thead th strong { display: block; }
.roster-table thead th span { font-size: 11px; text-transform: uppercase; }
.roster-table thead th strong { margin-top: 3px; color: #fff; font-size: 14px; }
.roster-table .roster-corner { left: 0; z-index: 5; width: 245px; text-align: left; }
.roster-employee { position: sticky; left: 0; z-index: 2; width: 245px; padding: 13px 14px; background: #0a1929; text-align: left; }
.roster-employee strong, .roster-employee span { display: block; white-space: normal; }
.roster-employee strong { color: #fff; font-size: 13px; line-height: 1.35; }
.roster-employee span { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.roster-day { height: 76px; padding: 6px; vertical-align: middle; background: #081523; }
.roster-cell-button { width: 100%; min-height: 60px; padding: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: center; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.roster-cell-button:hover { outline: 2px solid #5ba8ff88; outline-offset: 5px; }
.cell-edit-label { margin-top: 3px; color: #a8d8fb; font-size: 9px; font-weight: 800; }
.workplace-list { display: grid; gap: 3px; }
.workplace-chip { padding: 5px 7px; border: 1px solid #3c79a9; border-radius: 5px; background: #123c60; }
.workplace-chip strong { display: block; color: #fff; font-size: 11px; line-height: 1.15; }
.workplace-chip { display: flex; align-items: center; justify-content: center; gap: 4px; }
.department-shape { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; color: #fff; }
.workplace-bacteriology { border-color: #268e86; background: #11514d; }
.workplace-ifa { border-color: #bd7830; background: #684018; }
.workplace-clinic { border-color: #785da7; background: #443266; }
.workplace-blood { border-color: #ad5366; background: #662c3c; }
.workplace-pcr { border-color: #367eb8; background: #18476e; }
.workplace-mpo_smears { border-color: #5d9e4f; background: #315a29; }
.workplace-quality_control { border-color: #4aa0a8; background: #1c555c; }
.workplace-night { border-color: #6172c3; background: #303970; }
.shift-time { display: block; margin-top: 7px; color: #8eabc3; font-size: 10px; font-weight: 700; }
.day-off-cell { background: repeating-linear-gradient(135deg, #0a1724 0, #0a1724 8px, #0d1c2b 8px, #0d1c2b 16px); vertical-align: middle; text-align: center; }
.day-off { color: #5f7a91; font-size: 11px; font-weight: 700; }
.manual-day-off { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 9px; border: 1px solid #be9245; border-radius: 999px; background: #4b3516; color: #ffd78e; font-size: 11px; font-weight: 850; text-align: center; }
.manual-day-off-cell { background: repeating-linear-gradient(135deg, #2e2413 0, #2e2413 8px, #392a15 8px, #392a15 16px); }
.manual-day-off-card { border-color: #80632f; background: linear-gradient(145deg, #261e13, #171811); }
.unassigned-cell { background: #2a1f13; }
.unassigned-shift { display: block; color: #f1bd6e; font-size: 11px; font-weight: 800; }
.schedule-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.schedule-legend span { display: inline-flex; align-items: center; gap: 7px; }
.schedule-legend i { width: 18px; height: 18px; border: 1px solid #3c79a9; border-radius: 4px; background: #123c60; }
.schedule-legend .legend-off { background: repeating-linear-gradient(135deg, #0a1724 0, #0a1724 4px, #142638 4px, #142638 8px); }
.auto-cell-note { margin: 2px 0 10px; padding: 12px 14px; display: grid; gap: 4px; border: 1px solid #3d78a8; border-radius: 6px; background: #123c602e; }
.auto-cell-note span { color: #b7cee1; font-size: 12px; line-height: 1.45; }
.manual-override-note { margin: 2px 0 14px; padding: 12px 14px; display: grid; gap: 4px; border-left: 3px solid #f3b65c; background: #f3b65c12; }
.manual-override-note span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.department-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.department-option { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 10px 12px; border: 1px solid #2b5275; border-radius: 6px; background: #0a2034; cursor: pointer; }
.department-option input { width: 30px; height: 30px; min-height: 30px; accent-color: #2778b8; }
.department-option span, .department-option strong, .department-option small { display: block; }
.department-option small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.department-option.selected { border-color: #6eb9f0; background: #10395a; }
.department-option.disabled { opacity: .46; cursor: not-allowed; }
.department-option.day-off-option { border-color: #735b35; background: #271d10; }
.department-option.day-off-option.selected { border-color: #d4a552; background: #553b14; }
.department-option.day-off-option input { accent-color: #d4a552; }
.cell-editor-actions { display: grid; grid-template-columns: 0.8fr 1.35fr 0.8fr 1fr; gap: 10px; }
.cell-editor-actions button { min-height: 46px; }
.auto-cell-button { border-color: #58a9e6; background: #0c3150; color: #e1f3ff; font-weight: 850; }
.auto-cell-button:hover { background: #12466f; }
.danger-outline { border-color: #8f4550; color: #ffabb3; }
.day-schedule { display: grid; gap: 14px; }
.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(72px, 1fr)); gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.day-tabs button { min-height: 54px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: #081523; color: var(--muted); cursor: pointer; }
.day-tabs button span, .day-tabs button strong { display: block; }
.day-tabs button span { font-size: 10px; text-transform: uppercase; }
.day-tabs button strong { margin-top: 3px; color: #fff; font-size: 13px; }
.day-tabs button.active { border-color: #6eb9f0; background: var(--accent-soft); }
.day-employee-list { display: grid; gap: 8px; }
.day-employee-card { min-height: 78px; padding: 12px 14px; display: grid; grid-template-columns: minmax(190px, 1fr) minmax(220px, 1.4fr) auto; align-items: center; gap: 14px; border: 1px solid #203c57; border-radius: 7px; background: #081523; }
.day-employee-card.editable { border-color: #2e5678; }
.day-employee-main strong, .day-employee-main span { display: block; }
.day-employee-main span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.day-employee-work .workplace-list { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.edit-cell-button { min-height: 42px; padding: 0 14px; border: 1px solid #4c8fbd; border-radius: 6px; background: #0b2942; color: #cdeaff; font-weight: 800; cursor: pointer; }
.print-schedule { display: none; }
.draft-state { display: inline-flex; margin-left: 8px; padding: 3px 7px; border-radius: 999px; background: #f3b65c22; color: #f3c876; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.draft-state.published { background: #48d59720; color: var(--green); }
.busy { opacity: .65; pointer-events: none; }

.cleaning-card { margin-top: 22px; padding: 22px; border: 1px solid #315879; border-radius: 8px; background: linear-gradient(145deg, #0b1d2de8, #091421d9); }
.cleaning-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.cleaning-heading h3 { margin: 2px 0 0; font-size: 20px; }
.cleaning-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cleaning-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.cleaning-badge { min-height: 31px; display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid #436580; border-radius: 999px; background: #15283a; color: #b7cee1; font-size: 11px; font-weight: 850; white-space: nowrap; }
.cleaning-badge.ready, .cleaning-badge.published { border-color: #3e8e72; background: #174638; color: #a3e8ce; }
.cleaning-badge.attention, .cleaning-badge.error { border-color: #a46c38; background: #442d17; color: #ffd29c; }
.cleaning-badge.legacy { border-color: #536d82; background: #172735; color: #b8c9d7; }
.cleaning-days { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 8px; margin-top: 16px; }
.cleaning-day { min-height: 66px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #294965; border-radius: 7px; background: #081523; }
.cleaning-day-date { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; background: #123c60; color: #dff2ff; font-size: 10px; font-weight: 900; text-align: center; text-transform: uppercase; }
.cleaning-day strong, .cleaning-day span, .cleaning-day small { display: block; }
.cleaning-day span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.cleaning-day small { color: #9bc5e4; font-size: 10px; font-weight: 800; text-align: right; }
.cleaning-rule-note { margin-top: 12px; padding: 12px 14px; display: grid; gap: 5px; border-left: 3px solid #58a9e6; background: #123c602b; }
.cleaning-rule-note strong { color: #e4f4ff; font-size: 12px; }
.cleaning-rule-note span { color: #a9bfd2; font-size: 11px; line-height: 1.45; }
.cleaning-assignment-list { display: grid; gap: 14px; margin-top: 14px; }
.cleaning-task-group { padding: 12px; border: 1px solid #315878; border-radius: 9px; background: #071522; }
.cleaning-task-group.unassigned-group { border-color: #8d5d35; background: #2e21182b; }
.cleaning-task-group-heading { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px 10px; border-bottom: 1px solid #294965; }
.cleaning-task-group-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.cleaning-task-group-title h4, .cleaning-task-group-title small { display: block; }
.cleaning-task-group-title h4 { margin: 0; color: #edf7ff; font-size: 14px; }
.cleaning-task-group-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.cleaning-task-group-day { min-width: 54px; min-height: 34px; display: inline-grid; place-items: center; padding: 5px 8px; border-radius: 7px; background: #174b74; color: #e7f6ff; font-size: 10px; font-weight: 900; text-align: center; text-transform: uppercase; }
.cleaning-task-group.unassigned-group .cleaning-task-group-day { background: #5a3b20; color: #ffe0b5; }
.cleaning-task-group-count { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #102b40; color: #a9d2ee; font-size: 10px; font-weight: 900; }
.cleaning-task-group.unassigned-group .cleaning-task-group-count { background: #4a321e; color: #ffd39e; }
.cleaning-day-task-list { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 9px; margin-top: 10px; }
.cleaning-task { min-height: 90px; display: grid; grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.35fr); align-items: center; gap: 13px; padding: 12px 13px; border: 1px solid #294965; border-radius: 7px; background: #081725; }
.cleaning-task.unassigned { border-color: #8d5d35; background: #3a27192b; }
.cleaning-task.pcr-task { border-color: #367eb8; background: #12345166; }
.cleaning-task-room strong, .cleaning-task-room span, .cleaning-task-room small { display: block; }
.cleaning-task-room strong { color: #fff; font-size: 13px; line-height: 1.3; }
.cleaning-task-room span { margin-top: 4px; color: #8ebde2; font-size: 10px; font-weight: 800; }
.cleaning-task-room small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.cleaning-pcr-label { display: inline-flex !important; width: max-content; padding: 3px 6px; border-radius: 999px; background: #1b5d8e; color: #d8efff !important; }
.cleaning-task-control { min-width: 0; }
.cleaning-edit-controls { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(210px, 1.3fr); align-items: end; gap: 8px; }
.cleaning-task-control label { display: grid; gap: 5px; color: #9db4c8; font-size: 10px; font-weight: 800; }
.cleaning-task-control select { width: 100%; min-height: 46px; padding: 7px 9px; border: 1px solid #3e6a8e; border-radius: 6px; background: #071522; color: #edf7ff; }
.cleaning-task-control select:focus-visible { outline: 3px solid #78bfff; outline-offset: 2px; }
.cleaning-task-control select:disabled { opacity: .82; border-color: #294965; color: #c3d4e2; }
.cleaning-day-help { display: block; margin-top: 6px; color: #f2c98f; font-size: 9px; line-height: 1.35; }
.cleaning-assignment-value { min-height: 54px; display: grid; align-content: center; padding: 9px 11px; border: 1px solid #294965; border-radius: 6px; background: #091927; }
.cleaning-assignment-value strong, .cleaning-assignment-value span { display: block; }
.cleaning-assignment-value strong { color: #eef8ff; font-size: 12px; }
.cleaning-assignment-value span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.cleaning-source { display: inline-flex; width: max-content; margin-top: 5px; padding: 2px 6px; border-radius: 999px; background: #153a58; color: #9dd2f7; font-size: 9px; font-weight: 850; }
.cleaning-source.manual { background: #59411f; color: #f4ce8e; }
.cleaning-stale-control { display: grid; gap: 7px; }
.cleaning-stale-control small { color: #f1c98d; font-size: 10px; line-height: 1.35; }
.cleaning-stale-control button { width: 100%; min-height: 42px; }
.cleaning-readonly-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.cleaning-card.cleaning-busy .cleaning-assignment-list { opacity: .62; }

.excel-import-dialog { width: min(1180px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 1px solid #315879; border-radius: 12px; background: #071320; color: #e7f0f8; box-shadow: 0 24px 80px #000b; }
.excel-import-dialog::backdrop { background: #020812d9; backdrop-filter: blur(3px); }
.excel-import-shell { max-height: calc(100vh - 34px); overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.excel-import-heading { position: sticky; top: -24px; z-index: 8; margin: -24px -24px 18px; padding: 20px 24px; align-items: flex-start; border-bottom: 1px solid #203c57; background: #071320f2; backdrop-filter: blur(10px); }
.excel-import-heading h3 { margin: 2px 0 0; font-size: clamp(20px, 3vw, 28px); }
.excel-import-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.excel-import-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.excel-import-steps span { min-height: 42px; display: grid; place-items: center; border: 1px solid #263f58; border-radius: 6px; background: #091827; color: #738da3; font-size: 12px; font-weight: 850; }
.excel-import-steps span.active { border-color: #68b7ef; background: #123c60; color: #fff; }
.excel-import-steps span.complete { border-color: #397c6b; color: #83d7bd; }
.excel-import-upload { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(240px, 1fr) minmax(230px, .9fr) auto; align-items: end; gap: 14px; padding: 18px; border: 1px solid #284a68; border-radius: 8px; background: #0a1d30; }
.excel-import-upload h4, .excel-import-section h4 { margin: 0; font-size: 16px; }
.excel-import-upload p, .excel-import-section-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.excel-file-picker { display: grid; gap: 6px; color: #b7cee1; font-size: 11px; font-weight: 800; }
.excel-file-picker input { width: 100%; min-height: 46px; padding: 7px; border: 1px dashed #4e84ae; border-radius: 6px; background: #071522; color: #cfe7f8; }
.excel-file-picker input::file-selector-button { min-height: 32px; margin-right: 9px; padding: 0 10px; border: 0; border-radius: 4px; background: #245f8d; color: #fff; font-weight: 800; cursor: pointer; }
.excel-blank-option { min-height: 46px; display: grid; grid-template-columns: 28px 1fr; align-items: center; column-gap: 9px; padding: 8px 10px; border: 1px solid #294965; border-radius: 6px; background: #071522; cursor: pointer; }
.excel-blank-option input { grid-row: 1 / 3; width: 26px; height: 26px; min-height: 26px; accent-color: #2778b8; }
.excel-blank-option span { font-size: 12px; font-weight: 800; }
.excel-blank-option small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.excel-import-progress { margin: 14px 0; padding: 12px 14px; border-left: 3px solid #68b7ef; background: #123c6033; color: #cdeaff; font-size: 12px; font-weight: 750; }
.excel-import-review { display: grid; gap: 16px; margin-top: 16px; }
.excel-list-details { min-width: 0; }
.excel-list-details > summary { display: list-item; min-height: 44px; padding: 12px 0; cursor: pointer; color: #dcefff; font-weight: 750; }
.excel-list-details > summary > span:not(.excel-collapse-hint) { display: inline; }
.excel-collapse-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.excel-preview-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.excel-preview-controls label { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
.excel-preview-controls select { width: 100%; min-width: 0; min-height: 48px; padding: 8px; border: 1px solid #3e6a8e; border-radius: 5px; background: #071522; color: #edf7ff; font-size: 16px; }
.excel-preview-controls > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.excel-preview-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; scroll-margin-top: 155px; }
.excel-preview-pagination button { min-height: 44px; padding: 8px; }
.excel-preview-pagination span { text-align: center; font-size: 12px; color: var(--muted); }
/* Grid items must be allowed to shrink independently of the wide desktop table. */
.excel-import-shell > *, .excel-import-review > *, .excel-import-upload > *,
.excel-import-summary > *, .excel-import-section > *, .excel-import-mapping-list > *,
.excel-mapping-row > *, .excel-preview-host, .excel-preview-table-shell { min-width: 0; }
.excel-import-summary strong, .excel-import-summary span { overflow-wrap: anywhere; }
.excel-import-summary { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(110px, .6fr)); gap: 8px; }
.excel-import-summary > div { min-height: 68px; display: grid; align-content: center; padding: 11px 13px; border: 1px solid #25445f; border-radius: 7px; background: #091927; }
.excel-import-summary strong, .excel-import-summary span { display: block; }
.excel-import-summary strong { color: #fff; font-size: 16px; }
.excel-import-summary span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.excel-import-section { padding: 17px; border: 1px solid #233f58; border-radius: 8px; background: #081725; }
.excel-import-section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.excel-import-mapping-list { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 8px; }
.excel-mapping-row { min-height: 68px; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(210px, 1.1fr); align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #284b69; border-radius: 6px; background: #0a2033; }
.excel-mapping-row.unresolved { border-color: #b8793b; background: #442d172e; }
.excel-mapping-row strong, .excel-mapping-row small { display: block; overflow-wrap: anywhere; }
.excel-mapping-row small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.excel-mapping-row select, .excel-preview-table select { width: 100%; min-height: 44px; padding: 7px 9px; border: 1px solid #3e6a8e; border-radius: 5px; background: #071522; color: #edf7ff; }
.excel-preview-metrics { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 7px; margin-bottom: 12px; }
.excel-preview-metrics > div { min-height: 62px; display: grid; place-items: center; align-content: center; padding: 8px; border: 1px solid #294965; border-radius: 6px; background: #091927; text-align: center; }
.excel-preview-metrics strong, .excel-preview-metrics span { display: block; }
.excel-preview-metrics strong { font-size: 20px; }
.excel-preview-metrics span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.excel-preview-metrics .ready strong { color: #8eddbd; }
.excel-preview-metrics .conflict strong, .excel-preview-metrics .blocked strong { color: #f3be72; }
.excel-preview-host { min-height: 86px; }
.excel-preview-placeholder { min-height: 86px; display: grid; place-items: center; padding: 16px; border: 1px dashed #365673; border-radius: 6px; color: var(--muted); text-align: center; }
.excel-preview-placeholder.success { border-color: #397c6b; color: #8eddbd; }
.excel-preview-table-shell { max-height: 50vh; overflow: auto; border: 1px solid #294965; border-radius: 6px; }
.excel-preview-table { width: 100%; min-width: 850px; border-collapse: collapse; }
.excel-preview-table th, .excel-preview-table td { padding: 9px 10px; border-right: 1px solid #233f58; border-bottom: 1px solid #233f58; text-align: left; font-size: 11px; }
.excel-preview-table th { position: sticky; top: 0; z-index: 2; background: #0d263b; color: #99c5e7; font-size: 10px; text-transform: uppercase; }
.excel-preview-table tr:last-child td { border-bottom: 0; }
.excel-preview-table th:last-child, .excel-preview-table td:last-child { border-right: 0; }
.excel-preview-table td strong, .excel-preview-table td small { display: block; }
.excel-preview-table td small { margin-top: 3px; color: var(--muted); }
.excel-preview-table tr.status-existing_conflict { background: #5032182b; }
.excel-preview-table tr.status-unmatched_employee, .excel-preview-table tr.status-ambiguous_employee, .excel-preview-table tr.status-invalid, .excel-preview-table tr.status-published_overlap { background: #55232a2e; }
.excel-row-status { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 8px; border-radius: 4px; background: #19334a; color: #b7cee1; font-weight: 800; }
.excel-row-status.status-ready { background: #1b523f; color: #a3e8ce; }
.excel-row-status.status-unmatched_employee, .excel-row-status.status-ambiguous_employee, .excel-row-status.status-invalid, .excel-row-status.status-published_overlap { background: #652e37; color: #ffc1c8; }
.excel-import-confirm-bar { position: sticky; bottom: -24px; z-index: 7; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -24px -24px; padding: 15px 24px; border-top: 1px solid #294965; background: #071320f2; backdrop-filter: blur(10px); }
.excel-import-confirm-bar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.excel-import-confirm-bar button { min-width: 230px; }
.excel-import-history { margin-top: 18px; padding: 0 17px 12px; border: 1px solid #233f58; border-radius: 8px; background: #081725; }
.excel-import-history-list { display: grid; gap: 7px; }
.excel-history-item { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #284b69; border-radius: 6px; background: #091927; }
.excel-history-item strong, .excel-history-item span { display: block; }
.excel-history-item span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.excel-history-item.undone { opacity: .62; }

@media (max-width: 1100px) {
    .distribution-metrics { grid-template-columns: repeat(2, 1fr); }
    .week-toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-actions { justify-content: flex-end; }
    .workflow-guide { grid-template-columns: 1fr; }
    .schedule-heading { align-items: stretch; flex-direction: column; }
    .draft-actions { justify-content: flex-start; }
    .excel-import-upload { grid-template-columns: 1fr 1fr; }
    .excel-import-mapping-list { grid-template-columns: 1fr; }
    .readiness-checklist { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .cleaning-heading { align-items: stretch; flex-direction: column; }
    .cleaning-heading-actions { justify-content: space-between; }
    .cleaning-day-task-list { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .distribution-page { padding: 20px 14px 40px; }
    .distribution-metrics { grid-template-columns: 1fr; }
    .week-navigation { display: grid; grid-template-columns: auto 1fr auto; }
    .week-navigation label { min-width: 0; }
    .week-navigation input { min-width: 0; width: 100%; }
    .toolbar-actions { display: grid; grid-template-columns: 1fr; }
    .settings-status { justify-content: center; }
    .setup-card, .draft-card, .cleaning-card { margin-top: 16px; padding: 14px; }
    .draft-card { margin-top: 0; }
    .workflow-guide article { min-height: 0; }
    details { margin-top: 10px; }
    summary { min-height: 48px; display: flex; align-items: center; padding: 12px 0; }
    .rules-table { min-width: 1120px; }
    .rules-table .employee-cell { min-width: 170px; }
    .roster-table-shell { margin-inline: -14px; border-radius: 0; }
    .roster-table { min-width: 1050px; }
    .roster-table .roster-corner, .roster-employee { width: 160px; }
    .roster-employee { padding: 10px; }
    .roster-employee strong { font-size: 12px; }
    .roster-day { height: 72px; padding: 5px; }
    .workplace-chip { padding: 5px; }
    .schedule-legend { gap: 10px 14px; }
    .readiness-panel { padding: 14px; }
    .readiness-heading { flex-direction: column; gap: 10px; }
    .readiness-checklist { grid-template-columns: 1fr; }
    .readiness-actions { align-items: stretch; flex-direction: column; }
    .readiness-actions button { width: 100%; min-height: 46px; }
    .readiness-actions span { margin-left: 0; text-align: center; }
    .cleaning-heading-actions { align-items: stretch; flex-direction: column; }
    .cleaning-heading-actions button { width: 100%; min-height: 48px; }
    .cleaning-badge { align-self: flex-start; }
    .cleaning-days { grid-template-columns: 1fr; }
    .cleaning-task-group { padding: 10px; }
    .cleaning-task-group-heading { align-items: flex-start; }
    .cleaning-task-group-title { align-items: flex-start; }
    .cleaning-task-group-count { margin-top: 3px; }
    .cleaning-task { grid-template-columns: 1fr; gap: 9px; }
    .cleaning-edit-controls { grid-template-columns: 1fr; }
    .cleaning-task-control select { min-height: 50px; }
    .cleaning-rule-note { padding: 11px 12px; }
    .draft-state { margin: 5px 0 0; }
    .department-options { grid-template-columns: 1fr; }
    .draft-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .schedule-view-toggle { grid-column: 1 / -1; }
    .run-picker { grid-column: 1 / -1; }
    .run-picker select { width: 100%; }
    .show-time-control { grid-column: 1 / -1; justify-content: center; }
    .draft-actions > button { width: 100%; }
    .day-tabs { grid-template-columns: repeat(7, 72px); margin-inline: -14px; padding-inline: 14px; }
    .day-employee-card { grid-template-columns: 1fr auto; gap: 10px; }
    .day-employee-work { grid-column: 1 / -1; }
    .edit-cell-button { grid-column: 2; grid-row: 1; }
    .cell-editor-actions { grid-template-columns: 1fr; }
    .excel-import-dialog { width: 100vw; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .excel-import-shell { max-height: 100dvh; padding: 14px; }
    .excel-import-heading { top: -14px; margin: -14px -14px 14px; padding: 14px; }
    .excel-import-heading { flex-direction: row; gap: 10px; }
    .excel-import-heading > div { min-width: 0; flex: 1; }
    .excel-import-heading .eyebrow { display: none; }
    .excel-import-heading p:not(.eyebrow) { font-size: 12px; }
    .excel-import-heading #closeExcelImport { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 8px; }
    .excel-import-steps { gap: 4px; }
    .excel-import-steps span { min-height: 38px; font-size: 10px; }
    .excel-import-upload { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    .excel-import-upload > button { width: 100%; min-height: 48px; }
    .excel-import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .excel-preview-controls { grid-template-columns: minmax(0, 1fr); }
    .excel-import-summary > div:first-child { grid-column: 1 / -1; }
    .excel-import-section { padding: 13px; }
    .excel-import-section-title { align-items: stretch; flex-direction: column; }
    .excel-import-mapping-list { grid-template-columns: minmax(0, 1fr); }
    .excel-mapping-row { grid-template-columns: 1fr; }
    .excel-mapping-row select, .excel-preview-table select { min-width: 0; max-width: 100%; min-height: 48px; font-size: 16px; }
    .excel-mapping-row small, .excel-blank-option small, .excel-import-summary span { font-size: 12px; }
    .excel-blank-option { grid-template-columns: 28px minmax(0, 1fr); }
    .excel-blank-option span { font-size: 14px; overflow-wrap: anywhere; }
    .excel-import-section-title button { min-height: 48px; white-space: normal; }
    .excel-preview-metrics { grid-template-columns: repeat(2, 1fr); }
    .excel-preview-metrics > div:first-child { grid-column: 1 / -1; }
    .excel-preview-table-shell { max-height: none; overflow: visible; margin: 0; border: 0; border-radius: 0; }
    .excel-preview-table { display: block; min-width: 0; width: 100%; }
    .excel-preview-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .excel-preview-table tbody { display: grid; gap: 12px; }
    .excel-preview-table tr { display: grid; min-width: 0; padding: 12px; border: 1px solid #294965; border-radius: 8px; background: #091927; }
    .excel-preview-table td { display: block; min-width: 0; padding: 7px 0; border: 0; font-size: 14px; overflow-wrap: anywhere; }
    .excel-preview-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
    .excel-preview-table td small { font-size: 12px; }
    .excel-row-status { max-width: 100%; white-space: normal; }
    .excel-import-confirm-bar { bottom: -14px; align-items: stretch; flex-direction: column; gap: 8px; margin: 0 -14px -14px; padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .excel-import-confirm-bar button { width: 100%; min-width: 0; min-height: 50px; }
    .excel-history-item { align-items: stretch; flex-direction: column; }
    .excel-history-item button { width: 100%; min-height: 44px; }
}

@media (max-width: 390px) {
    .week-navigation { gap: 6px; }
    .week-arrow { min-width: 44px; padding-inline: 8px; }
    .week-navigation input { padding-inline: 8px; font-size: 13px; }
    .roster-table { min-width: 980px; }
    .roster-table .roster-corner, .roster-employee { width: 145px; }
}

@media print {
    @page { size: A4 landscape; margin: 9mm; }
    html, body { width: 100% !important; margin: 0 !important; padding: 0 !important; background: #fff !important; color: #000 !important; color-scheme: light !important; }
    html, body, #distributionApp, #distributionApp .workspace, .distribution-page, .draft-card, #printScheduleGrid { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
    body.print-distribution-only .cleaning-print-page { display: none !important; }
    body > * { display: none !important; }
    #distributionApp { display: block !important; width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
    #distributionApp > * { display: none !important; }
    #distributionApp .workspace, #distributionApp .distribution-page, #distributionApp .draft-card, #printScheduleGrid { display: block !important; }
    #distributionApp .workspace > *, #distributionApp .distribution-page > *, #distributionApp .draft-card > * { display: none !important; }
    #distributionApp .workspace > .distribution-page, #distributionApp .distribution-page > .draft-card, #distributionApp .draft-card > #printScheduleGrid { display: block !important; }
    #distributionApp .workspace, .distribution-page, .draft-card, #printScheduleGrid { width: 100% !important; max-width: none !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: #fff !important; }
    .print-schedule { width: 100% !important; max-width: none !important; margin: 0 !important; }
    .print-schedule h1 { margin: 0 0 2mm; color: #000; font-size: 13pt; line-height: 1.05; }
    .cleaning-print-page { break-before: page; page-break-before: always; break-inside: avoid-page; page-break-inside: avoid; padding-top: 0; color: #000; }
    .cleaning-print-page > h1 { margin-bottom: 1mm; font-size: 12pt; }
    .cleaning-print-reminder { margin: 2mm 0; color: #000; font-size: 20pt; font-weight: 900; line-height: 1.1; text-align: center; break-inside: avoid; }
    .cleaning-print-page p { margin: 0 0 2mm; color: #333; font-size: 8pt; line-height: 1.1; }
    .cleaning-print-day { margin: 0 0 2.5mm; break-inside: avoid; page-break-inside: avoid; }
    .cleaning-print-day:last-child { margin-bottom: 0; }
    .cleaning-print-day h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 4mm; margin: 0 0 1mm; padding-bottom: .8mm; border-bottom: .4mm solid #222; color: #000; font-size: 10.5pt; line-height: 1.05; }
    .cleaning-print-day h2 small { color: #333; font-size: 8pt; font-weight: 700; }
    .cleaning-print-table { width: 100%; border: .25mm solid #444; border-collapse: collapse; table-layout: fixed; }
    .cleaning-print-table th, .cleaning-print-table td { height: 8mm; padding: 1mm 2mm; border: .2mm solid #666; background: #fff !important; color: #000 !important; font-size: 8.5pt; line-height: 1.1; text-align: left; }
    .cleaning-print-table th { height: 6mm; font-size: 7.5pt; text-transform: uppercase; }
    .cleaning-print-table th:nth-child(1) { width: 6%; text-align: center; }
    .cleaning-print-table th:nth-child(2) { width: 39%; }
    .cleaning-print-table th:nth-child(3) { width: 55%; }
    .cleaning-print-table .cleaning-print-number { text-align: center; font-weight: 700; }
    .print-schedule .roster-table-shell { width: 100% !important; max-width: none !important; max-height: none; margin: 0 !important; overflow: visible; border: 0 !important; border-radius: 0; box-sizing: border-box; }
    .print-schedule .roster-table { width: 100% !important; min-width: 0 !important; max-width: none !important; border: .25mm solid #444 !important; border-collapse: collapse !important; table-layout: fixed; box-sizing: border-box; page-break-inside: avoid; break-inside: avoid-page; }
    .print-schedule .roster-table th, .print-schedule .roster-table td { border: .2mm solid #666 !important; }
    .print-schedule .roster-table tr:last-child > * { border-bottom: .2mm solid #666 !important; }
    .print-schedule .roster-table tr > *:last-child { border-right: .2mm solid #666 !important; }
    .print-schedule .roster-table thead { display: table-header-group; }
    .print-schedule .roster-table tbody {
        background: repeating-linear-gradient(135deg, #fff 0, #fff 4.6mm, #b8b8b8 4.6mm, #b8b8b8 4.8mm) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-schedule .roster-table tbody tr { page-break-inside: avoid; break-inside: avoid; }
    .print-schedule .roster-table tbody th, .print-schedule .roster-table tbody td { position: static; height: var(--print-row-height, 15mm); padding: 0 3px; background: #fff !important; color: #000 !important; }
    .print-schedule .roster-table tbody td.day-off-cell {
        background: transparent !important;
    }
    .print-schedule .manual-day-off-cell .manual-day-off { display: none !important; }
    .print-schedule .day-off-kind .day-off { display: none !important; }
    .print-schedule .vacation-cell .day-off {
        display: inline-block;
        padding: 1mm 2mm;
        background: #fff !important;
        color: #444 !important;
    }
    .print-schedule .roster-table thead th { height: 30px; background: #fff !important; color: #000 !important; }
    .print-schedule .roster-corner, .print-schedule .roster-employee { width: 22%; }
    .print-schedule .roster-day { min-height: 0; vertical-align: middle; }
    .print-schedule .roster-employee strong { font-size: 9pt; line-height: 1.05; }
    .print-schedule .roster-employee span { margin-top: 1px; font-size: 7pt; line-height: 1; }
    .print-schedule .roster-table thead th span { font-size: 8pt; }
    .print-schedule .roster-table thead th strong { margin-top: 1px; font-size: 10pt; }
    .print-schedule .roster-employee strong, .print-schedule .roster-table thead th strong, .print-schedule .workplace-chip strong { color: #000; }
    .print-schedule .roster-employee span, .print-schedule .shift-time, .print-schedule .day-off { color: #444; }
    .print-schedule .workplace-list { gap: 0; }
    .print-schedule .workplace-chip { padding: 0 2px; border-color: #777; border-radius: 2px; background: #fff !important; }
    .print-schedule .workplace-chip strong { font-size: 8pt; line-height: 1; }
    .print-schedule .department-shape { width: 2.6mm; height: 2.6mm; flex-basis: 2.6mm; color: #000; }
    .print-schedule .shift-time { margin-top: 1px; font-size: 7pt; line-height: 1; }
    .print-schedule .day-off { font-size: 8pt; }
}
