/* Farm pages use the TailAdmin HTML theme's palette, surfaces and type scale. */
:root {
  color-scheme: light;
  --canvas: var(--color-gray-50, #f9fafb);
  --surface: var(--color-white, #fff);
  --border: var(--color-gray-200, #e4e7ec);
  --text: var(--color-gray-900, #101828);
  --muted: var(--color-gray-600, #475467);
  --quiet: var(--color-gray-500, #667085);
  --ink: var(--color-gray-700, #344054);
  --brand: var(--color-brand-500, #465fff);
  --brand-strong: var(--color-brand-700, #2a31d8);
  --brand-soft: var(--color-brand-50, #ecf3ff);
  --rail: 246px;
  --header: 68px;
  --app-font: Manrope, "Segoe UI", sans-serif;
  font-family: var(--app-font);
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 290px; color: var(--text); background: var(--canvas); font-family: var(--app-font); line-height: 1.5; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, summary, select { touch-action: manipulation; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 41px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); background: var(--surface); font-size: .88rem; font-weight: 580;
  box-shadow: var(--shadow-theme-xs, 0 1px 2px #1018280d); white-space: nowrap; cursor: pointer;
}
button:hover, .button:hover { background: var(--canvas); border-color: #cbd2df; text-decoration: none; }
.primary { color: #fff; background: var(--brand); border-color: var(--brand); font-weight: 620; }
.primary:hover { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.danger { color: #b42318; }
.danger:hover { color: #9c2118; background: #fef3f2; border-color: #fecdca; }
.danger-primary { color: #fff; background: #b42318; border-color: #b42318; }
.danger-primary:hover { color: #fff; background: #912018; border-color: #912018; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.19; font-weight: 650; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; font-weight: 660; line-height: 1.35; letter-spacing: -.018em; overflow-wrap: anywhere; }
small, .muted { color: var(--quiet); }
small { font-size: .79rem; }
p { overflow-wrap: anywhere; }
.quiet { background: none; border: 0; box-shadow: none; color: var(--muted); padding: 4px 7px; min-height: 0; }
.quiet:hover { color: var(--brand-strong); border: 0; background: var(--brand-soft); }
.shell {
  min-height: 100dvh; display: grid;
  grid-template: "sidebar topbar" var(--header) "sidebar main" 1fr / var(--rail) minmax(0, 1fr);
}
.topbar {
  grid-area: topbar; height: var(--header); position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); background: var(--surface); padding: 0 clamp(16px, 3vw, 33px);
}
.topbar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 9px; font-size: .87rem; color: var(--quiet); }
.crumbs a { color: var(--quiet); }
.crumbs [aria-current] { color: var(--text); font-weight: 570; }
.farm-sidebar {
  grid-area: sidebar; height: 100dvh; position: sticky; top: 0; z-index: 30; min-width: 0;
  display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface);
  padding: 24px 16px; overflow-y: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); font-size: 1.26rem; font-weight: 715; line-height: 1.11; letter-spacing: -.045em; }
.brand:hover { text-decoration: none; }
.farm-sidebar .brand { margin: 3px 8px 35px; align-self: flex-start; }
.brand small { display: block; font-size: .72rem; color: var(--quiet); font-weight: 510; letter-spacing: 0; margin-top: 5px; }
.brand-mark {
  display: grid; place-items: center; position: relative; flex: 0 0 auto; overflow: hidden;
  width: 35px; height: 35px; border-radius: 10px; background: var(--brand); color: #fff;
}
.brand-mark i { width: 15px; height: 13px; transform: skewX(-19deg); position: relative; }
.brand-mark i::before, .brand-mark i::after {
  content: ""; height: 5px; border-radius: 1px; background: currentColor; position: absolute; left: 0; right: 0;
}
.brand-mark i::before { top: 0; right: 2px; }
.brand-mark i::after { bottom: 0; left: 2px; }
.side-links { display: grid; gap: 5px; }
.side-links a {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; min-height: 43px;
  color: var(--ink); font-size: .87rem; font-weight: 560; border-radius: 8px;
}
.side-links a:hover { background: var(--canvas); text-decoration: none; }
.side-links a[aria-current] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; }
.icon { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; position: relative; color: inherit; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-menu::before { left: 2px; right: 2px; height: 1.5px; background: currentColor; top: 4px; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.icon-close::before, .icon-close::after { left: 2px; right: 2px; top: 8px; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.icon-close::after { transform: rotate(-45deg); }
.icon-check::before { top: 5px; left: 4px; width: 10px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.icon-grid::before { width: 6px; height: 6px; border: 1.5px solid currentColor; border-radius: 1px; top: 2px; left: 2px; }
.icon-grid::after { width: 6px; height: 6px; border: 1.5px solid currentColor; border-radius: 1px; top: 2px; right: 2px; box-shadow: -8px 8px 0 -1.5px var(--surface), -8px 8px currentColor, 0 8px 0 -1.5px var(--surface), 0 8px currentColor; }
.icon-orders::before { width: 12px; height: 14px; border: 1.5px solid currentColor; border-radius: 2px; left: 3px; top: 2px; }
.icon-orders::after { width: 6px; height: 1.5px; background: currentColor; top: 6px; left: 6px; box-shadow: 0 4px currentColor; }
.icon-queue::before { width: 12px; height: 1.5px; background: currentColor; top: 4px; left: 3px; box-shadow: 0 5px currentColor, 0 10px currentColor; }
.icon-clock::before { inset: 2px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-clock::after { top: 5px; left: 8px; width: 4px; height: 5px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.icon-chart::before { left: 3px; bottom: 3px; width: 3px; height: 5px; background: currentColor; border-radius: 1px; }
.icon-chart::after { left: 8px; bottom: 3px; width: 3px; height: 9px; background: currentColor; border-radius: 1px; box-shadow: 5px -3px currentColor; }
.icon-people::before { width: 6px; height: 6px; border: 1.5px solid currentColor; border-radius: 50%; left: 6px; top: 2px; }
.icon-people::after { width: 13px; height: 6px; border: 1.5px solid currentColor; border-radius: 5px 5px 2px 2px; left: 2.5px; bottom: 2px; }
.icon-settings::before { width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 4px; top: 2.5px; left: 2.5px; transform: rotate(45deg); }
.icon-settings::after { width: 5px; height: 5px; border: 1.5px solid currentColor; border-radius: 50%; top: 6.5px; left: 6.5px; }
.icon-printer::before { width: 16px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; top: 6px; left: 1px; }
.icon-printer::after { width: 9px; height: 15px; border: 1.5px solid currentColor; border-radius: 1px; left: 4.5px; top: 2px; background: linear-gradient(transparent 62%, #fff 62%); clip-path: polygon(0 0,100% 0,100% 33%,0 33%,0 62%,100% 62%,100% 100%,0 100%); }
.icon-button { padding: 0; width: 37px; min-height: 37px; }
.mobile-brand, .mobile-nav-toggle, .nav-overlay { display: none; }
.account { margin: 0; position: relative; }
.account summary { color: var(--text); display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .87rem; font-weight: 600; list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.chevron { width: 6px; height: 6px; border-right: 1.5px solid var(--quiet); border-bottom: 1.5px solid var(--quiet); transform: rotate(45deg); margin: -4px 2px 0; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 680; }
.account-menu {
  position: absolute; top: calc(100% + 13px); right: 0; min-width: 192px; padding: 7px;
  box-shadow: var(--shadow-theme-lg, 0 8px 18px #1018281a);
}
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 8px; color: var(--ink); font-size: .87rem; }
.account-menu a:hover { background: var(--canvas); border-radius: 6px; text-decoration: none; }
.account-role { display: grid; gap: 2px; padding: 7px 8px 9px; border-bottom: 1px solid var(--border); margin-bottom: 3px; }
.account-role strong { font-size: .87rem; }
.main { grid-area: main; width: 100%; max-width: 1760px; margin: 0 auto; padding: 25px clamp(16px, 3vw, 33px) 40px; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 13px; margin-bottom: 20px; }
.page-head p { color: var(--quiet); margin-top: 6px; font-size: .9rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-theme-xs, 0 1px 2px #1018280d); }
.printer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-bottom: 19px; }
.printer { display: flex; flex-direction: column; min-width: 0; padding: 15px 15px 0; }
.printer-top { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.printer-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: #475569; background: #f2f4f7; }
.printer-name { margin-top: 12px; }
.printer-name h2 { font-size: 1.06rem; }
.printer-name p { color: var(--quiet); font-size: .79rem; margin-top: 2px; }
.status {
  display: inline-flex; gap: 5px; align-items: center; padding: 4px 8px; border-radius: 20px; white-space: nowrap;
  color: #475467; background: #f2f4f7; font-size: .74rem; line-height: 1.3; font-weight: 640;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.idle, .status.finished { color: #067647; background: #ecfdf3; }
.status.printing, .status.starting, .status.calibrating { color: #3644d9; background: var(--brand-soft); }
.status.paused, .status.setup, .status.unknown, .status.busy { color: #92470d; background: #fffaeb; }
.status.offline, .status.error, .status.stopped { color: #b42318; background: #fef3f2; }
.status.priority-3 { color: #b42318; background: #fef3f2; }
.status.priority-2 { color: #92470d; background: #fffaeb; }
.printer-data { flex: 1; min-height: 110px; margin: 11px 0 9px; }
.printer-data p { font-size: .84rem; }
.file-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--muted); }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 6px; }
.progress-label strong {
  font-size: 1.58rem; line-height: 1.14; letter-spacing: -.05em; font-weight: 680; font-variant-numeric: tabular-nums;
}
.progress-label span { color: var(--quiet); font-size: .76rem; white-space: nowrap; }
.progress-note { color: var(--quiet); margin-top: 7px; font-size: .75rem; }
progress { display: block; width: 100%; height: 7px; margin: 6px 0; border: 0; border-radius: 10px; background: #eef1f7; appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: #eef1f7; }
progress::-webkit-progress-value { background: var(--brand); border-radius: inherit; }
progress::-moz-progress-bar { background: var(--brand); border-radius: inherit; }
.printer-foot { min-height: 40px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .8rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.printer-foot a { font-weight: 560; }
.printer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.printer-actions .button { min-height: 34px; padding: 5px 10px; font-size: .83rem; }
.camera-panel { padding: 16px; }
.camera-panel video, .camera-panel img { display: block; width: 100%; max-height: 75vh; object-fit: contain; border-radius: 8px; background: #101828; }
.camera-panel video[hidden], .camera-panel img[hidden] { display: none; }
.order-dialog.camera-dialog { width: min(940px, calc(100vw - 24px)); }
.camera-dialog .camera-panel video, .camera-dialog .camera-panel img { max-height: 65dvh; }
.table-panel, .form-panel { margin-bottom: 17px; }
#new, #new-items, #shift-history, #printer-materials, [id^="item-"], [id^="job-"] { scroll-margin-top: calc(var(--header) + 12px); }
tr:target { background: var(--brand-soft); }
.queue-settings { margin-bottom: 6px; min-width: 135px; }
.queue-settings form { min-width: 170px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--quiet); background: var(--canvas); white-space: nowrap; font-size: .76rem; font-weight: 615; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
td { overflow-wrap: anywhere; vertical-align: middle; }
.table-file { min-width: 130px; max-width: 350px; font-weight: 560; }
.table-file > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.row-action { white-space: nowrap; font-weight: 580; }
.empty { padding: 22px 16px; color: var(--quiet); }
.form-panel { padding: 18px; }
.form-panel h2 { margin-bottom: 10px; }
.order-dialog {
  position: fixed; inset: 0; margin: auto; padding: 0; width: min(940px, calc(100% - 24px));
  max-width: none; max-height: calc(100dvh - 24px); overflow: hidden;
  box-shadow: 0 18px 60px #10182838;
}
.order-dialog[open], .order-dialog-form { display: flex; flex-direction: column; min-height: 0; }
.order-dialog::backdrop { background: #10182880; }
body:has(.order-dialog[open]) { overflow: hidden; }
.order-dialog-head, .order-dialog-actions {
  display: flex; flex: none; align-items: center; gap: 8px; padding: 13px clamp(14px, 3vw, 22px);
}
.order-dialog-head { justify-content: space-between; border-bottom: 1px solid var(--border); }
.order-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px clamp(14px, 3vw, 22px); }
.order-dialog-actions { border-top: 1px solid var(--border); flex-wrap: wrap; }
.order-delete-dialog { width: min(440px, calc(100% - 24px)); }
.compact { max-width: 555px; }
.stack { display: grid; gap: 13px; }
[data-order-slice-settings][hidden], [data-order-print-quantity][hidden] { display: none; }
.slice-preview { padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.slice-preview img { width: min(100%, 300px); max-height: 270px; object-fit: contain; }
.slice-preview dl { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.slice-preview dt { color: var(--muted); font-size: .85rem; }
.slice-preview dd { margin: 0; font-weight: 650; }
.slice-preview[hidden], .slice-preview img[hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.form-grid.order-form-grid { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
/* Repeatable positions in the create and edit order forms. */
.order-item-fields { min-width: 0; padding: 0; margin: 0; border: 0; }
.order-item-fields legend { margin-bottom: 8px; color: var(--ink); font-size: .9rem; font-weight: 650; }
.order-item-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(78px, .65fr) minmax(0, 1fr) minmax(170px, 1.25fr) auto;
  gap: 10px; align-items: end; padding: 11px; border: 1px solid var(--border); border-radius: 9px;
}
.order-item-file input { font-size: .79rem; }
.order-item-file input::file-selector-button { margin-right: 7px; color: var(--brand-strong); cursor: pointer; }
.order-item-remove { color: #b42318; min-height: 40px; }
.order-item-remove[hidden], .add-item-row[hidden] { display: none; }
.add-item-row { margin-top: 9px; color: var(--brand-strong); }
@media (max-width: 800px) {
  .order-item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .order-item-row > label:first-child, .order-item-file { grid-column: 1 / -1; }
  .order-item-remove { justify-self: start; }
}
.inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.search { width: 100%; }
.search label { flex: 1; min-width: 155px; }
.search select { width: auto; }
label { display: grid; align-content: start; gap: 6px; font-size: .84rem; color: var(--ink); font-weight: 560; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 11px; color: var(--text); background: var(--surface);
  border: 1px solid #d0d5dd; border-radius: 8px; font-weight: 420; box-shadow: var(--shadow-theme-xs, 0 1px 2px #1018280d);
}
select { padding-right: 27px; }
input:focus, select:focus, textarea:focus { border-color: #8797ff; box-shadow: 0 0 0 3px #465fff1a; outline: 0; }
input::placeholder { color: var(--quiet); }
textarea { resize: vertical; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.check input[type="checkbox"] {
  appearance: auto; flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
  accent-color: var(--brand); background: none; border: 0; box-shadow: none;
}
.check input[type="checkbox"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
details summary { cursor: pointer; color: var(--brand-strong); font-size: .88rem; font-weight: 560; }
details form { margin-top: 12px; }
.account-menu form { margin: 0; }
.order-number { display: inline-block; font-size: .76rem; color: var(--quiet); min-width: 38px; }
.order-title { color: var(--text); font-weight: 650; }
.order-meter { min-width: 102px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.order-meter progress { width: 87px; height: 4px; margin: 5px 0 1px; }
.metrics { display: flex; gap: 7px 17px; flex-wrap: wrap; padding: 8px 0 11px; color: var(--quiet); font-size: .82rem; }
.metrics strong { color: var(--text); margin-left: 3px; }
.order-items-table { min-width: 660px; font-variant-numeric: tabular-nums; }
.order-items-table th, .order-items-table td { padding: 7px 10px; }
.order-items-table tbody th {
  min-width: 120px; background: transparent; color: var(--text); white-space: normal;
  font-size: .86rem; font-weight: 650; overflow-wrap: anywhere;
}
.order-items-table tbody tr:last-child th { border-bottom: 0; }
.order-items-table tfoot { border-top: 1px solid var(--border); background: var(--canvas); font-weight: 650; }
.order-items-table tfoot th { color: var(--text); }
.order-items-table tfoot th, .order-items-table tfoot td { border-bottom: 0; white-space: nowrap; overflow-wrap: normal; }
.order-items-table .order-item-number { width: 1%; white-space: nowrap; overflow-wrap: normal; }
.order-item-material { display: block; font-size: .76rem; font-weight: 500; }
.order-item-count { display: grid; grid-template-columns: 4.35rem 32px; align-items: center; gap: 4px; width: max-content; }
.order-item-count output { grid-column: 1 / -1; min-width: 0; font-size: .73rem; }
.order-item-count output:empty { display: none; }
.order-item-count output:has(.order-count-saved) { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.order-count-error { color: #b42318; }
.order-item-count input { width: 4.35rem; padding: 3px 6px; min-height: 32px; border-radius: 6px; }
.order-item-count button, .order-item-more button { min-height: 32px; border-radius: 6px; }
.order-item-count button { width: 32px; color: var(--brand-strong); }
.order-item-count button:disabled { opacity: .55; cursor: wait; }
.order-item-count:has(.order-count-saved) button { color: #067647; background: #ecfdf3; }
.order-item-file-cell { display: flex; align-items: center; gap: 5px; max-width: 180px; }
.order-item-file-cell a { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-item-more { width: 1%; text-align: right; }
.order-item-more button, .order-item-more .button { padding: 3px 8px; font-size: .81rem; }
.order-item-more .button { min-height: 32px; border-radius: 6px; }
.item-dialog { width: min(840px, calc(100% - 24px)); }
.item-dialog .detail-actions { align-items: start; margin-top: 0; }
.item-dialog .metrics { align-items: center; padding: 0; }
.item-dialog h3 { margin: 0 0 6px; font-size: .87rem; font-weight: 650; }
.detail-actions,.employee-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 12px; }
.detail-actions details { border: 1px solid var(--border); border-radius: 8px; padding: 9px; min-width: 0; }
.attachments { color: var(--quiet); font-size: .87rem; padding-left: 19px; overflow-wrap: anywhere; }
.order-notes { margin-bottom: 14px; color: var(--muted); white-space: pre-wrap; }
.shift-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.shift-card-head h2 { margin-bottom: 4px; }
.shift-members { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 8px 0 0; list-style: none; }
.shift-members li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; }
.shift-members strong { font-size: .88rem; overflow-wrap: anywhere; }
.shift-report-head { padding: 16px; }
.shift-report-head > p { font-size: .82rem; }
.shift-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 9px; margin: 12px 0; }
.shift-totals > div { display: flex; flex-direction: column-reverse; gap: 3px; padding: 10px 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; }
.shift-totals dt { color: var(--quiet); font-size: .79rem; }
.shift-totals dd { margin: 0; color: var(--text); font-size: 1.48rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.shift-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 14px; }
.shift-notes p { color: var(--ink); white-space: pre-wrap; }
.shift-handoff, .forecast-materials { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.shift-handoff > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.shift-handoff h3 { margin: 0 0 6px; font-size: .9rem; font-weight: 650; }
.shift-handoff ul { padding-left: 17px; margin: 0; list-style: disc; font-size: .84rem; overflow-wrap: anywhere; }
.shift-handoff li + li { margin-top: 5px; }
.shift-handoff p { font-size: .84rem; }
.forecast-materials form > label { flex: 1; min-width: 125px; }
.forecast-totals > div { background: var(--surface); }
.forecast-total.error dd { color: #b42318; }
.forecast-total.unknown dd { color: #92470d; }
.forecast-total.idle dd, .forecast-total.finished dd { color: #067647; }
.forecast-heading { margin: 20px 0 12px; }
.forecast-heading p { margin-top: 4px; font-size: .85rem; }
.forecast-order {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.35fr);
  gap: 15px; padding: 15px; margin-bottom: 10px; font-size: .88rem;
}
.forecast-order h3 { margin: 0 0 4px; font-size: .93rem; font-weight: 650; overflow-wrap: anywhere; }
.forecast-order .status { margin-top: 4px; }
.forecast-plan { margin-top: 6px; }
.forecast-actions { list-style: disc; margin: 5px 0 0; padding-left: 18px; }
.forecast-actions li + li { margin-top: 5px; }
.forecast-actions a { white-space: nowrap; }
@media (max-width: 670px) { .forecast-order { grid-template-columns: 1fr; gap: 10px; } }
.divided { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 12px; }
.back { display: inline-block; margin-bottom: 9px; font-size: .86rem; font-weight: 570; }
.notice { padding: 10px 13px; border: 1px solid #abefc6; border-radius: 8px; background: #ecfdf3; color: #067647; margin-bottom: 14px; }
.standalone { min-height: 100dvh; background: var(--surface); }
.standalone > .notice { margin: 15px auto 0; max-width: min(460px, calc(100% - 35px)); }
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-form { width: min(430px, calc(100% - 60px)); justify-self: center; align-self: center; padding: 36px 0; }
.auth-form h1 { font-size: clamp(1.7rem, 3.2vw, 2.24rem); margin-bottom: 8px; }
.auth-form .stack { gap: 16px; margin-top: 23px; }
.auth-form input, .auth-form button { min-height: 44px; }
.auth-link { margin-top: 17px; font-size: .88rem; }
.auth-mobile-brand { display: none; }
.auth-brand {
  display: grid; place-items: center; background-color: #171d54; color: #fff; text-align: center;
  background-image: linear-gradient(#ffffff0b 1px, transparent 1px), linear-gradient(90deg, #ffffff0b 1px, transparent 1px), radial-gradient(ellipse at 50% 44%, #303baf, #171d54 65%);
  background-position: center; background-size: 32px 32px, 32px 32px, 100% 100%;
}
.auth-brand-content { display: grid; justify-items: center; font-size: 1.01rem; color: #c7d2fe; gap: 7px; }
.auth-brand-content .brand-mark { width: 49px; height: 49px; border-radius: 13px; box-shadow: 0 0 0 7px #ffffff18; }
.auth-brand-content strong { color: #fff; font-size: 2.35rem; letter-spacing: -.06em; line-height: 1.1; margin-top: 12px; }
.auth.panel { width: min(440px, calc(100% - 35px)); margin: 0 auto; padding: 25px; transform: translateY(36px); }
.auth.panel p { margin: 10px 0 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; margin: -1px; clip-path: inset(50%); }
@media (min-width: 1180px) { .printer-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 1023px) {
  .shell { display: grid; grid-template: "topbar" var(--header) "main" 1fr / minmax(0,1fr); }
  .mobile-nav-toggle,.mobile-brand { display: inline-flex; }
  .crumbs { display: none; }
  .farm-sidebar { position: fixed; top: var(--header); bottom: 0; left: 0; width: var(--rail); height: auto; transform: translateX(-100%); visibility: hidden; }
  .navigation-open .farm-sidebar { transform: none; visibility: visible; }
  .navigation-open .nav-overlay { display: block; position: fixed; z-index: 25; inset: var(--header) 0 0; width: 100%; height: 100%; background: #10182855; border: 0; border-radius: 0; }
  .employee-grid,.detail-actions,.form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 670px) {
  :root { --header: 60px; }
  .main { padding-top: 17px; }
  .printer-grid,.form-grid,.employee-grid,.detail-actions { grid-template-columns: 1fr; }
  .printer-data { min-height: 77px; }
  .account-name { display: none; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-form { width: min(430px, calc(100% - 46px)); }
  .auth-brand { display: none; }
  .auth-mobile-brand { display: inline-flex; margin-bottom: 22px; }
  th, td { padding: 9px 11px; }
}
