:root {
  --bg: #f7ecd4;
  --bg2: #faefdc;
  --panel: #fff7e7;
  --panel2: #fffaf0;
  --text: #1f2937;
  --muted: #6b7280;
  --border: rgba(120, 92, 45, .24);
  --accent: #296117;
  --accent2: #3f7d22;
  --gold: #f2cc83;
  --danger: #b91c1c;
  --dangerSoft: rgba(185, 28, 28, .1);
  --warn: #b45309;
  --warnSoft: rgba(180, 83, 9, .12);
  --ok: #15803d;
  --okSoft: rgba(21, 128, 61, .11);
  --info: #2563eb;
  --infoSoft: rgba(37, 99, 235, .1);
  --shadow: 0 18px 45px rgba(83, 63, 34, .13);
  --radius: 22px;
  --radius2: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  font-size: 15px;
}

html[data-theme="dark"] {
  --bg: #141a26;
  --bg2: #202d42;
  --panel: #202d42;
  --panel2: #26364e;
  --text: #f9fafb;
  --muted: #9ca3af;
  --border: rgba(148, 163, 184, .38);
  --accent: #f2cc83;
  --accent2: #ffe7ae;
  --gold: #f2cc83;
  --danger: #f87171;
  --dangerSoft: rgba(239, 68, 68, .14);
  --warn: #fbbf24;
  --warnSoft: rgba(245, 158, 11, .14);
  --ok: #4ade80;
  --okSoft: rgba(34, 197, 94, .13);
  --info: #93c5fd;
  --infoSoft: rgba(96, 165, 250, .14);
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 204, 131, .45), transparent 34rem),
    radial-gradient(circle at top right, rgba(41, 97, 23, .12), transparent 32rem),
    var(--bg);
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel2) 88%, white 12%);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 11px;
  outline: none;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: color-mix(in srgb, var(--panel2) 82%, black 18%);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 999;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
}

.topbar {
  padding: 16px 22px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbarInner {
  width: min(1840px, calc(100% - 10px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.homeLink {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel2);
  font-weight: 800;
}

.homeLogo {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  object-fit: contain;
  background: var(--accent);
}

.brandMark {
  display: grid;
  place-items: center;
  font-weight: 950;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 14px 28px rgba(41, 97, 23, .18);
}

html[data-theme="dark"] .brandMark {
  color: #1f2937;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.topActions,
.headActions,
.sectionActions,
.machineActions,
.orderActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.topActions {
  justify-content: flex-end;
}

.btn,
.smallBtn {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(83, 63, 34, .06);
}

.btn {
  padding: 10px 14px;
}

.smallBtn {
  min-width: 31px;
  height: 31px;
  padding: 0 9px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .btn.primary {
  color: #1f2937;
}

.dangerBtn {
  color: var(--danger);
}

.fileBtn {
  position: relative;
  overflow: hidden;
}

.fileBtn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.propertiesToggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.22rem;
  line-height: 1;
}

.propertiesOverlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .24);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 90;
}

.propertiesOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

.propertiesDrawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.propertiesDrawer.open {
  transform: translateX(0);
}

.drawerHeader {
  min-height: 76px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawerHeader h2 {
  margin: 0;
  font-size: 1rem;
}

.drawerHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.drawerClose {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.drawerBody {
  padding: 16px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.drawerSection {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel2);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.drawerSection h3 {
  margin: 0;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}

.drawerNote {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

.drawerFooter {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
}

.page {
  width: min(1840px, calc(100% - 28px));
  margin: 20px auto 48px;
  display: grid;
  gap: 18px;
}

.heroGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.mainGrid {
  display: grid;
  grid-template-columns: 315px minmax(620px, 1fr) 430px;
  gap: 18px;
  align-items: start;
}

.leftCol,
.rightCol {
  display: grid;
  gap: 18px;
}

.panel {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panelHead {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stickyPanelHead {
  position: static;
  top: auto;
  z-index: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background: transparent;
  backdrop-filter: none;
}

.stickyPanelHead > div:first-child {
  display: block;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 240px;
  max-width: 520px;
}

.stickyPanelHead .headActions {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-end;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  min-width: max-content;
}

.stickyPanelHead .headActions .btn {
  white-space: nowrap;
  flex: 0 0 auto;
  padding-inline: 12px;
}

.stickyPanelHead h2 {
  margin: 0;
  padding: 0;
  line-height: 1.15;
}

.stickyPanelHead p {
  margin: 4px 0 0;
  padding: 0;
  line-height: 1.35;
}

.panelHead h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.panelHead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.panelBody {
  padding: 16px;
}

.formGrid {
  display: grid;
  gap: 12px;
}

.formGrid.two {
  grid-template-columns: repeat(2, 1fr);
}

.formGrid.three {
  grid-template-columns: repeat(3, 1fr);
}

.kpiGrid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpiCard {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel2);
  min-height: 104px;
}

.kpiLabel {
  color: var(--muted);
  font-size: .84rem;
}

.kpiValue {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 950;
  letter-spacing: -.06em;
}

.kpiHint {
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
}

.kpiCard.ok {
  background: var(--okSoft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}

.kpiCard.warn {
  background: var(--warnSoft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.kpiCard.danger {
  background: var(--dangerSoft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.workflow {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.workflow article {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel2);
}

.workflow strong {
  display: block;
  margin-bottom: 6px;
}

.workflow span {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.ok {
  color: var(--ok);
  background: var(--okSoft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}

.badge.warn {
  color: var(--warn);
  background: var(--warnSoft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.badge.danger {
  color: var(--danger);
  background: var(--dangerSoft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.badge.info {
  color: var(--info);
  background: var(--infoSoft);
  border-color: color-mix(in srgb, var(--info) 35%, transparent);
}

.filterBar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 190px 190px;
  gap: 10px;
  margin-bottom: 18px;
}

.machineList {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.machineCard {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel2);
  overflow: hidden;
  font-size: .95rem;
}

.machineCard.collapsed .machineContent {
  display: none;
}

.machineCard.collapsed .machineHeader {
  border-bottom: 0;
}

.machineCard.critical {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
  background:
    linear-gradient(90deg, var(--dangerSoft), transparent 44%),
    var(--panel2);
}

.machineHeader {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.machineHeader > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.machineHeader h3 {
  margin: 0;
  font-size: 1.07rem;
  letter-spacing: -.03em;
}

.machineHeader .machineActions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: flex-start;
  white-space: nowrap;
  min-width: max-content;
}

.machineHeader .machineActions .smallBtn {
  flex: 0 0 auto;
}

.machineMeta {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.machineContent {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(285px, .93fr);
  gap: 0;
}

.machineColumn {
  padding: 14px;
  display: grid;
  gap: 13px;
  min-width: 0;
}

.machineColumn + .machineColumn {
  border-left: 1px solid var(--border);
}

.collapseBtn {
  min-width: 38px;
  font-size: .95rem;
}

.subBox {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 58%, transparent);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.subHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.subHead h4 {
  margin: 0;
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inlineGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  min-width: 0;
}

.inlineGrid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inlineGrid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.machineColumn + .machineColumn .inlineGrid.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.orderEditor .inlineGrid.four {
  grid-template-columns: minmax(112px, .78fr) minmax(0, 1.22fr);
}

.orderEditor .inlineGrid.four label:nth-child(4) {
  grid-column: 1 / -1;
}

.dateInputGroup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel2) 88%, white 12%);
}

html[data-theme="dark"] .dateInputGroup {
  background: color-mix(in srgb, var(--panel2) 82%, black 18%);
}

.dateInputGroup input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dateInputGroup input[type="date"] {
  min-width: 0;
  padding-inline: 8px;
}

.dateInputGroup input + input {
  border-left: 1px solid var(--border);
}

html[data-theme="dark"] .dateInputGroup input[type="date"] {
  color-scheme: dark;
}

.orderList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orderItem {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel2) 80%, white 20%);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

html[data-theme="dark"] .orderItem {
  background: color-mix(in srgb, var(--panel2) 82%, black 18%);
}

.orderItem.dragging {
  opacity: .45;
}

.dragHandle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 50%, transparent);
  color: color-mix(in srgb, var(--text) 82%, black 18%);
  cursor: grab;
  font-weight: 950;
}

.orderSummary {
  min-width: 0;
}

.orderSummary strong {
  display: block;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orderSummary span {
  color: var(--muted);
  font-size: .8rem;
}

.orderEditor {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.timeBlockList {
  display: grid;
  gap: 8px;
}

.timeBlock {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel2) 80%, white 20%);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px auto;
  gap: 6px;
  align-items: end;
  min-width: 0;
}

.timeBlock input {
  padding-inline: 8px;
}

html[data-theme="dark"] .timeBlock {
  background: color-mix(in srgb, var(--panel2) 82%, black 18%);
}

.warningList {
  display: grid;
  gap: 10px;
}

.warningItem {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent);
  background: var(--warnSoft);
  color: var(--warn);
  font-size: .88rem;
  line-height: 1.35;
  font-weight: 700;
}

.warningItem.danger {
  border-color: color-mix(in srgb, var(--danger) 34%, transparent);
  background: var(--dangerSoft);
  color: var(--danger);
}

.pdfGrid {
  display: grid;
  gap: 12px;
}

.pdfCard {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.pdfCard h3 {
  margin: 0;
  font-size: 1rem;
}

.pdfCard p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.38;
}

.storageBox {
  display: grid;
  gap: 12px;
}

.storageGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.storageMetric {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 56%, transparent);
  border-radius: 16px;
  padding: 12px;
}

.storageMetric span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.storageMetric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.storageActions {
  display: grid;
  gap: 8px;
}

.storageNote {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
}

.timelineGrid {
  display: grid;
  gap: 7px;
  overflow-x: auto;
}

.timelineRow {
  min-width: 540px;
  display: grid;
  grid-template-columns: 92px repeat(var(--slot-count), minmax(42px, 1fr));
  gap: 5px;
  align-items: center;
  font-size: .76rem;
}

.slot,
.slotHead {
  min-height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  white-space: nowrap;
}

.slot.load {
  background: var(--infoSoft);
  border-color: color-mix(in srgb, var(--info) 26%, transparent);
  color: var(--info);
  font-weight: 900;
}

.slot.over {
  background: var(--dangerSoft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
  font-weight: 900;
}

.deviationItem {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel2);
  display: grid;
  gap: 8px;
}

.deviationItem p {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel2) 58%, transparent);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.printArea {
  display: none;
}

@media (max-width: 1500px) {
  .mainGrid {
    grid-template-columns: 300px minmax(620px, 1fr);
  }

  .rightCol {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1120px) {
  .topbarInner,
  .heroGrid,
  .mainGrid {
    grid-template-columns: 1fr;
  }

  .stickyPanelHead {
    flex-direction: column;
    align-items: flex-start;
  }

  .stickyPanelHead > div:first-child {
    max-width: none;
    min-width: 0;
  }

  .stickyPanelHead .headActions {
    justify-content: flex-start;
    align-self: stretch;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .topActions {
    justify-content: flex-start;
  }

  .rightCol {
    grid-template-columns: 1fr;
  }

  .kpiGrid,
  .workflow {
    grid-template-columns: repeat(2, 1fr);
  }

  .filterBar,
  .machineContent {
    grid-template-columns: 1fr;
  }

  .machineColumn + .machineColumn {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .dateInputGroup {
    grid-template-columns: 1fr;
  }

  .dateInputGroup input + input {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  html {
    font-size: 14px;
  }

  .page {
    width: min(100% - 18px, 1840px);
  }

  .topbar {
    position: static;
  }

  .stickyPanelHead {
    position: static;
  }

  .kpiGrid,
  .workflow,
  .inlineGrid,
  .inlineGrid.three,
  .inlineGrid.four,
  .machineColumn + .machineColumn .inlineGrid.four,
  .orderEditor .inlineGrid.four,
  .timeBlock {
    grid-template-columns: 1fr;
  }

  .orderEditor .inlineGrid.four label:nth-child(4) {
    grid-column: auto;
  }

  .machineHeader {
    display: grid;
  }

  .machineHeader .machineActions {
    justify-content: flex-start;
  }

  .orderItem {
    grid-template-columns: auto 1fr;
  }

  .orderActions {
    grid-column: 1 / -1;
  }
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body {
    background: white !important;
  }

  .topbar,
  .page,
  .toast,
  .skip-link,
  .propertiesOverlay,
  .propertiesDrawer {
    display: none !important;
  }

  .printArea {
    display: block !important;
  }

  body.print-dept_a .printPage:not([data-print-dept="dept_a"]),
  body.print-dept_b .printPage:not([data-print-dept="dept_b"]) {
    display: none !important;
  }

  .printPage {
    color: #111827;
    background: white;
    font-family: Arial, sans-serif;
    page-break-after: always;
  }

  .printHeader {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #111827;
    padding-bottom: 8mm;
    margin-bottom: 7mm;
  }

  .printHeader h1 {
    margin: 0;
    font-size: 18pt;
  }

  .printHeader p {
    margin: 2mm 0 0;
    font-size: 9pt;
    color: #374151;
  }

  .printMeta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3mm;
    margin-bottom: 7mm;
  }

  .printMeta div {
    border: 1px solid #d1d5db;
    padding: 3mm;
    font-size: 8.5pt;
  }

  .printMeta b {
    display: block;
    font-size: 7.5pt;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 1mm;
  }

  .printTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.9pt;
  }

  .printTable th,
  .printTable td {
    border: 1px solid #d1d5db;
    padding: 2.1mm;
    vertical-align: top;
    text-align: left;
  }

  .printTable th {
    background: #f3f4f6;
  }

  .printNote {
    margin-top: 7mm;
    font-size: 8pt;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 3mm;
  }
}