:root {
  --navy: #173f5f;
  --navy-2: #0e2d45;
  --blue: #2b6f9f;
  --blue-soft: #e4f0f8;
  --green: #2c7a67;
  --green-soft: #e6f4ef;
  --orange: #b8652c;
  --orange-soft: #fce9dc;
  --purple: #69507d;
  --purple-soft: #eee7f3;
  --red: #b14c4c;
  --red-soft: #fdecec;
  --ink: #183042;
  --muted: #657787;
  --line: #dce5eb;
  --bg: #f3f7f9;
  --white: #ffffff;
  --shadow: 0 12px 30px rgba(22, 55, 75, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.product-notice { padding: 16px 20px; border-left: 4px solid var(--blue); color: var(--navy); }
a.button { display: inline-flex; text-decoration: none; justify-content: center; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; color: #fff; background: linear-gradient(180deg, var(--navy-2), var(--navy)); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 7px 22px; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--navy); font-size: 22px; font-weight: 800; box-shadow: 0 7px 18px rgba(0,0,0,.2); }
.brand strong { display: block; font-size: 16px; letter-spacing: .4px; }
.brand span { display: block; margin-top: 3px; color: #b7d0df; font-size: 12px; }
nav { display: grid; gap: 6px; margin-top: 22px; }
.nav-item { border: 0; border-radius: 10px; padding: 12px 13px; color: #d6e5ee; background: transparent; text-align: left; display: flex; align-items: center; gap: 11px; transition: .18s ease; }
.nav-item span { width: 20px; text-align: center; font-size: 18px; opacity: .85; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.15); box-shadow: inset 3px 0 #79bddf; }
.exit-button { margin-top: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 10px 13px; color: #d6e5ee; background: transparent; text-align: left; cursor: pointer; font: inherit; }
.exit-button:hover { color: #fff; background: rgba(196,55,55,.28); }
.exit-button span { display: inline-block; width: 20px; text-align: center; font-size: 18px; margin-right: 7px; }
.sidebar-note { margin-top: 10px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,.08); color: #d6e5ee; font-size: 13px; line-height: 1.55; }
.sidebar-note small { color: #a9c5d6; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #63d6a4; box-shadow: 0 0 0 4px rgba(99,214,164,.13); }

.main { min-width: 0; padding: 0 28px 40px; }
.topbar { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 0; font-size: 25px; font-weight: 750; letter-spacing: .2px; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.version-ribbon { display: inline-flex; margin-bottom: 5px; padding: 3px 8px; border-radius: 999px; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.range-picker { display: flex; align-items: end; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.range-picker label, .form-grid label, dialog label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.range-picker input { width: 144px; }
input, select { min-height: 38px; padding: 7px 10px; border: 1px solid #cad8e0; border-radius: 8px; color: var(--ink); background: #fff; outline: 0; }
input:focus, select:focus { border-color: #72aaca; box-shadow: 0 0 0 3px rgba(43,111,159,.12); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font-size: 27px; line-height: 1; }
.button { min-height: 38px; border: 1px solid #cad8e0; border-radius: 8px; padding: 8px 14px; color: var(--ink); background: #fff; white-space: nowrap; }
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(30,70,95,.1); }
.button.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.button.ghost { background: transparent; }
.button.danger-soft { color: #9f3d3d; border-color: #efc7c7; background: var(--red-soft); }
.button.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }

.page { display: none; }
.page.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { min-height: 102px; padding: 17px 18px; border: 1px solid #e0e8ed; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 9px; color: var(--navy); font-size: 28px; line-height: 1; }
.metric-card small { display: block; margin-top: 8px; color: #81919e; }
.panel { margin-bottom: 18px; border: 1px solid #dfe8ed; border-radius: 14px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { min-height: 78px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e9eef1; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.notice { margin: 14px 18px 0; padding: 12px 14px; border-left: 4px solid #d99b43; border-radius: 7px; background: #fff8e8; color: #6c542d; font-size: 13px; line-height: 1.6; }
.audit-panel { margin: 14px 18px; padding: 16px; border: 1px solid #cfdae5; border-radius: 9px; background: #f8fbff; }
.audit-panel h3 { margin: 0 0 5px; font-size: 17px; }
.audit-panel p { margin: 7px 0; color: #536170; }
.audit-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 12px 0; }
.audit-day { padding: 10px; border-radius: 7px; background: #e9f5ed; border: 1px solid #b8d9c3; }
.audit-day.audit-error { background: #fff1ed; border-color: #e8bbb1; }
.audit-day strong, .audit-day small { display: block; }
.audit-day small { margin-top: 5px; line-height: 1.4; }
.machine-group-start td { border-top: 3px solid #8faec6 !important; }
.hidden { display: none !important; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 20px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.08); }
.legend-fixed { background: var(--blue-soft); }
.legend-auto { background: var(--green-soft); }
.legend-relief { background: #fff3cf; }
.legend-manual { background: var(--orange-soft); }
.legend-special { background: var(--purple-soft); }
.legend-3d { background: #d9f5f4; }
.legend-standby { background: #fff0bf; }
.legend-blank { background: #fff; border-style: dashed !important; }
.legend-rest { background: #eef1f3; }
.legend-history, .legend-manual, .legend-empty { padding: 4px 8px; border-radius: 6px; }
.legend-history { background: var(--blue-soft); }
.legend-manual { background: var(--orange-soft); }
.legend-empty { background: #eef1f3; }

.table-wrap { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { min-width: 105px; padding: 10px 9px; border-right: 1px solid #e4eaee; border-bottom: 1px solid #e4eaee; text-align: center; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 5; color: #fff; background: var(--navy); font-weight: 650; }
th small { display: block; margin-top: 3px; color: #c5dce8; font-weight: 400; }
tbody tr:hover td { background-image: linear-gradient(rgba(38,105,145,.035), rgba(38,105,145,.035)); }
.sticky-grid table th:first-child, .sticky-grid table td:first-child { position: sticky; left: 0; z-index: 4; min-width: 152px; text-align: left; }
.sticky-grid table th:first-child { z-index: 8; background: var(--navy); }
.sticky-grid table td:first-child { background: #fff; }
.person-cell strong { display: block; font-size: 14px; }
.person-cell small { display: block; margin-top: 4px; color: var(--muted); }
.assignment-cell { min-width: 136px; cursor: pointer; transition: filter .12s ease; }
.assignment-cell:hover { filter: brightness(.97); outline: 2px solid rgba(43,111,159,.25); outline-offset: -2px; }
.assignment-cell span { display: block; font-weight: 650; }
.assignment-cell small { display: block; margin-top: 4px; color: #657483; font-size: 11px; }
.cell-fixed { background-color: var(--blue-soft); }
.cell-auto { background-color: var(--green-soft); }
.cell-relief { background-color: #fff3cf; }
.cell-manual { background-color: var(--orange-soft); }
.cell-special { background-color: var(--purple-soft); }
.cell-3d { background-color: #d9f5f4; color: #126765; }
.cell-standby { background-color: #fff4ce; color: #765a08; }
.cell-standby-called { background-color: #ffe0b5; color: #8a4818; }
.cell-blank { color: #8a969e; background: #fff; outline: 1px dashed #cbd5da; outline-offset: -5px; }
.cell-rest { color: #7a8892; background-color: #f0f3f5; }
.cell-locked::after { content: "锁定"; display: inline-block; margin-top: 5px; padding: 1px 5px; border-radius: 8px; color: #8d4b20; background: rgba(255,255,255,.7); font-size: 10px; }

.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; background: #f8fafb; border-bottom: 1px solid #e9eef1; }
.availability-select { width: 100%; min-width: 108px; min-height: 32px; padding: 4px 7px; font-size: 12px; }
.row-tools, .column-tools { display: flex; gap: 4px; justify-content: center; margin-top: 5px; }
.mini { padding: 3px 6px; border: 1px solid #cfdce4; border-radius: 5px; color: var(--muted); background: #fff; font-size: 10px; }
.mini:hover { color: var(--blue); border-color: #86b3cc; }

.subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.subtab { padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; }
.subtab.active { color: #fff; border-color: var(--navy); background: var(--navy); }
.rule-pane { display: none; }
.rule-pane.active { display: block; }
.matrix-wrap th, .matrix-wrap td { min-width: 84px; }
.matrix-wrap th:first-child, .matrix-wrap td:first-child { position: sticky; left: 0; z-index: 4; min-width: 135px; }
.matrix-wrap th:first-child { z-index: 8; }
.matrix-wrap td:first-child { background: #fff; text-align: left; font-weight: 650; }
.overview-wrap { max-height: 74vh; }
.overview-wrap table { width: max-content; min-width: 100%; }
.overview-wrap th, .overview-wrap td { min-width: 88px; max-width: 118px; padding: 8px 6px; font-size: 11px; white-space: normal; }
.overview-wrap th:first-child { position: sticky; left: 0; z-index: 9; min-width: 112px; text-align: left; }
.overview-wrap tbody th:first-child { color: var(--navy); background: #fff; z-index: 4; }
.overview-wrap tbody th small { color: var(--muted); }
.overview-wrap .overview-ct { background: #e5f1fa; color: #194f73; }
.overview-wrap .overview-mri { background: #e7f4eb; color: #246146; }
.overview-wrap .overview-rest { background: #f1f3f5; color: #657580; }
.overview-wrap .overview-special { background: #fff0da; color: #805b27; }
.overview-wrap .overview-empty { color: #a1aab0; }
.overview-wrap .overview-total { font-weight: 700; background: #f7fafb; }
.overview-wrap tfoot th, .overview-wrap tfoot td { color: var(--navy); background: #dceaf2; font-weight: 700; }
.toggle { display: inline-flex; width: 40px; height: 22px; padding: 2px; border: 0; border-radius: 20px; background: #cfd8de; transition: .18s; }
.toggle::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .18s; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(18px); }
.relation-select { min-height: 31px; padding: 3px 6px; font-size: 12px; }
.limit-cell button { width: 70px; min-height: 31px; border: 1px solid #cad8e0; border-radius: 7px; background: #fff; }
.limit-cell button.allowed { color: #236b58; border-color: #a7d3c4; background: var(--green-soft); }
.limit-cell button.blocked { color: #9f3d3d; border-color: #edc4c4; background: var(--red-soft); }

.inline-check { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.inline-check input { min-height: auto; width: 17px; height: 17px; }
.inactive-row { opacity: .58; }
.inactive-row td { background: #f4f6f7; }
.duty-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 18px; padding: 18px; }
.duty-rotation-list { display: grid; gap: 8px; margin-top: 12px; }
.duty-order-row { min-height: 58px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.duty-order-row strong, .duty-order-row small { display: block; }
.duty-order-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.order-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 800; }
.move-buttons { display: flex; gap: 5px; }
.move-buttons button:disabled { opacity: .35; cursor: default; }
.duty-replace-form { align-content: start; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.duty-replace-form h3, .duty-replace-form p { margin: 0; }
.duty-replace-form p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.setting-note { padding: 11px 13px; border: 1px solid #d8e4ea; border-radius: 9px; color: var(--muted); background: #f7fafb; font-size: 12px; line-height: 1.6; }
.holiday-state.on { color: var(--green); font-weight: 700; }

.two-column { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.machine-cards { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.machine-card { padding: 13px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.machine-card strong { display: block; }
.machine-card small { display: block; color: var(--muted); margin-top: 3px; }
.machine-card select { min-height: 32px; padding: 4px 7px; }
.shift-state-group { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-width: 200px; }
.shift-state-button { min-width: 94px; min-height: 50px; padding: 6px 9px; border: 2px solid; border-radius: 9px; display: grid; gap: 2px; font-weight: 800; transition: .15s; }
.shift-state-button strong { font-size: 14px; }
.shift-state-button span { font-size: 11px; }
.shift-state-button.is-open { color: #fff; border-color: #20745f; background: #2c8b72; box-shadow: 0 4px 12px rgba(44,139,114,.2); }
.shift-state-button.is-closed { color: #9b3535; border-color: #d99191; background: #fff0f0; }
.shift-state-button.shift-a-state strong::before { content: "A  "; color: #d9efff; }
.shift-state-button.shift-p-state strong::before { content: "P  "; color: #ffe2c8; }
.shift-state-button.is-closed strong::before { color: inherit; }
.setting-card { padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.setting-switch { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid #afd4c7; border-radius: 9px; color: #226957; background: var(--green-soft); font-weight: 700; }
.setting-switch input { width: 20px; height: 20px; min-height: auto; }
.setting-card .setting-note { flex: 1 1 320px; }
.preview-ok { color: var(--green); font-weight: 700; }
.preview-warning { color: var(--orange); font-weight: 700; }
.form-grid { padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }
.outage-list { padding: 0 18px 18px; display: grid; gap: 8px; }
.outage-item { padding: 10px 12px; border: 1px solid #efcccc; border-radius: 8px; background: var(--red-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }

.history-summary { padding: 14px 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.history-chip { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; color: var(--muted); font-size: 12px; }
.history-chip strong { margin-right: 5px; color: var(--navy); font-size: 16px; }
.shift-a { color: #2b6f9f; }
.shift-p { color: #c66d2f; }
.chart-grid { padding: 0 20px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.chart-card h3, .recommend-panel h3, .data-card h2 { margin: 0; font-size: 16px; }
.chart-card p, .data-card p { margin: 6px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.chart-box { width: 100%; min-height: 280px; overflow-x: auto; }
.chart-box svg { display: block; width: 100%; min-width: 520px; height: auto; }
.recommend-panel { margin: 0 20px 18px; border: 1px solid #d9e7ef; border-radius: 12px; overflow: hidden; background: #f7fbfd; }
.panel-head.compact { min-height: 0; padding: 14px 16px; }
.recommend-grid { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.recommend-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; line-height: 1.65; }
.recommend-card strong { color: var(--navy); }
.recommend-card small { display: block; color: var(--muted); }
.person-explorer { margin: 0 20px 20px; display: grid; grid-template-columns: 238px minmax(0,1fr); gap: 14px; align-items: start; }
.person-list-pane, .person-detail-pane { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; overflow: hidden; }
.person-list-pane { position: sticky; top: 12px; max-height: calc(100vh - 32px); }
.person-list-head { padding: 14px; border-bottom: 1px solid var(--line); }
.person-list-head h3 { margin: 0 0 10px; font-size: 16px; }
.person-list-head input { width: 100%; }
.person-list { max-height: 620px; padding: 8px; overflow-y: auto; }
.person-list-item { width: 100%; padding: 10px 11px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; }
.person-list-item:hover { background: #eef5f8; }
.person-list-item.active { border-color: #9fc6d9; background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.person-list-item span { display: block; font-weight: 700; }
.person-list-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.person-detail-pane .history-summary { padding-top: 12px; }
.person-chart-grid { grid-template-columns: 1fr 1.5fr; }
.person-chart-grid .wide { grid-column: 1 / -1; }
.person-records { max-height: 440px; margin: 0 16px 16px; border: 1px solid var(--line); border-radius: 9px; }
.person-records th, .person-records td { min-width: 90px; }
.person-link { border: 0; padding: 0; color: var(--blue); background: transparent; font-weight: 700; text-decoration: underline; text-decoration-color: #a9c9dc; text-underline-offset: 3px; }
.horizontal-chart { min-width: 380px; padding: 26px 8px 10px; display: grid; gap: 16px; }
.horizontal-row { display: grid; grid-template-columns: 45px 1fr 38px; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; }
.horizontal-row > div { height: 15px; border-radius: 999px; background: #e7edf1; overflow: hidden; }
.horizontal-row i { display: block; min-width: 2px; height: 100%; border-radius: inherit; }
.horizontal-row strong { color: var(--ink); text-align: right; }
.empty-state { padding: 22px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.print-title { display: none; }
.standby-count { width: 88px; min-width: 70px; text-align: center; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.data-card { padding: 24px; overflow: visible; }
.data-card input[type="file"] { display: block; width: 100%; margin: 14px 0 10px; }
.data-card small { display: block; margin-top: 12px; color: var(--muted); line-height: 1.6; }

dialog { width: min(540px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 25px 70px rgba(12,42,62,.3); }
dialog::backdrop { background: rgba(9,32,49,.52); backdrop-filter: blur(2px); }
#assignmentForm, .dialog-form { padding: 20px; display: grid; gap: 14px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; }
.dialog-head h2 { margin: 0; font-size: 20px; }
.dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.dialog-close { border: 0; color: var(--muted); background: transparent; font-size: 26px; }
.edit-machine-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-line { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--ink); }
.check-line input { min-height: auto; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 420px; padding: 12px 16px; border-radius: 9px; color: #fff; background: var(--navy); box-shadow: 0 12px 35px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a43f3f; }
.loading { position: fixed; inset: 0; z-index: 120; display: grid; place-content: center; justify-items: center; gap: 12px; color: #fff; background: rgba(10,36,53,.5); }
.spinner { width: 34px; height: 34px; border: 4px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 72px minmax(0,1fr); }
  .sidebar { padding: 18px 9px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item span { font-size: 20px; }
  .sidebar-note { display: none; }
  .exit-button { font-size: 0; padding: 10px; text-align: center; }
  .exit-button span { font-size: 20px; margin: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .duty-layout { grid-template-columns: 1fr; }
  .chart-grid, .data-grid { grid-template-columns: 1fr; }
  .person-explorer { grid-template-columns: 200px minmax(0,1fr); }
  .person-chart-grid { grid-template-columns: 1fr; }
  .person-chart-grid .wide { grid-column: auto; }
  .recommend-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 10px; flex-direction: row; align-items: center; overflow-x: auto; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand { border: 0; padding: 0 10px 0 0; }
  .brand > div:last-child { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 18px; }
  nav { display: flex; margin: 0; gap: 4px; }
  .nav-item { min-width: 44px; }
  .main { padding: 0 12px 28px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px 0; }
  .range-picker { width: 100%; justify-content: flex-start; }
  .range-picker label { flex: 1; min-width: 138px; }
  .range-picker input { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .machine-cards { grid-template-columns: 1fr; }
  .person-explorer { margin-inline: 10px; grid-template-columns: 1fr; }
  .person-list-pane { position: static; max-height: none; }
  .person-list { max-height: 260px; }
  .duty-layout { padding: 12px; }
  .duty-order-row { grid-template-columns: 34px 1fr; }
  .move-buttons { grid-column: 2; }
  .check-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .actions, .bulk-bar, .legend { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .panel { border: 0; box-shadow: none; }
  .page { display: none !important; }
  #page-schedule { display: block !important; }
  .print-title { display: block; padding: 8px 0 14px; text-align: center; font-size: 18px; font-weight: 700; }
  #confirmationStatus, #generationNotice, #metrics { display: none !important; }
  .table-wrap { overflow: visible; }
  th, td { font-size: 9px; padding: 5px; }
}
.ris-chart { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:8px; margin:12px 0 24px; }
.ris-chart-row { display:grid; grid-template-columns:64px 1fr; align-items:center; gap:7px; background:#f5f9fb; border-radius:7px; padding:7px; font-size:12px; }
.ris-chart-row > div { display:grid; gap:3px; }
.ris-bar { min-width:2px; color:white; border-radius:3px; white-space:nowrap; padding-left:4px; line-height:17px; font-size:10px; }
.ris-bar.ct { background:#2576a5; }
.ris-bar.mri { background:#9c66b5; }
.ris-weekly { display:grid; gap:14px; margin:14px 0 22px; }
.ris-weekly .panel { padding:14px; }
.ris-roster-cell { min-width:130px; vertical-align:top; }
.ris-roster-cell span, .ris-roster-cell small { display:block; }
.ris-roster-cell small { color:#64748b; font-size:11px; margin-top:3px; }
.ris-proposal { background:#fff2cc; }
.ris-proposal .mini { margin-top:5px; }
.secondary-row { background:#e8f3eb; font-weight:700; }
.secondary-select { min-width:105px; }

.demo-runtime-banner{position:relative;z-index:50;padding:12px 20px;background:#eaf5e7;color:#316442;text-align:center;font-size:12px;line-height:1.8}.demo-runtime-banner a{color:inherit}.app-shell{min-height:calc(100vh - 46px)}