/* Shared visual language. Loaded after module layouts; state colors stay semantic. */
:root {
  --bg:#f3f7f4;
  --surface:#fff;
  --ink:#263e31;
  --black:#263e31;
  --muted:#64776b;
  --line:#dce6df;
  --accent:#287746;
  --accent-strong:#287746;
  --accent-deep:#215f39;
  --accent-soft:#edf5ee;
  --soft:#f0f6f1;
  --highlight:#e1eee3;
  --mint:#edf5f0;
  --warn:#99602c;
  --danger:#ad443d;
  --shadow:0 3px 14px rgba(33,74,47,.045);
  --ui-selected:#e4f1e7;
  --ui-selected-border:#87b395;
  --ui-hover:#f0f6f2;
  --ui-control-height:36px;
  --ui-control-radius:6px;
  --ui-control-font:13px;
}
body { background:var(--bg); color:var(--ink); }
.order-created-by { font-size:13px; line-height:1.5; color:var(--muted); margin:4px 0 10px; overflow-wrap:anywhere; }
body #orderCreate #orderAddItem + .wood-form-actions { margin-top:18px; }
body :is(button,input,select,textarea) { font-family:inherit; }
body :is(button,a,input,select,textarea,summary):focus-visible { outline:2px solid #287746; outline-offset:2px; }
body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]) { background:#fff; color:var(--ink); border-color:var(--line); }
body input::placeholder,body textarea::placeholder { color:#748379; opacity:1; }
body :is(input[type=checkbox],input[type=radio]) { accent-color:var(--accent); }

/* Surfaces and navigation */
body :is(.panel,.metric,.material-card,.material-row,.product-row,.order-card,.purchase-card,.wood-batch-card,.report-card,.modal-card,.hub-entry-card,.purchase-entry-card) { border-color:var(--line); background-color:var(--surface); box-shadow:var(--shadow); }
body .topbar { background:#fff; border-color:var(--line); box-shadow:none; }
body .sidebar { background:#f9fbf9; color:var(--ink); border-right:1px solid var(--line); }
body .sidebar :is(.brand,.brand span,.brand small,.user-panel,.user-panel span) { color:var(--muted); }
body .sidebar .user-panel { background:var(--accent-soft); border:1px solid var(--line); }
body .sidebar .user-panel button { background:#fff; color:var(--accent-deep); border:1px solid var(--line); }
body .nav-tab { background:transparent; color:var(--muted); }
body .nav-tab:is(.is-active,:hover) { background:var(--ui-selected); color:var(--accent-deep); box-shadow:none; }
body .nav-tab.is-active { font-weight:700; }
body :is(.mobile-bottom-nav,.mobile-save-bar,.mobile-editor-header) { background:#fff; border-color:var(--line); }
body .mobile-bottom-nav button { color:var(--muted); background:transparent; }
body .mobile-bottom-nav button.is-active { background:var(--ui-selected); color:var(--accent); }
body .account-menu { border-color:var(--line); background:#fff; box-shadow:0 8px 28px #254b3020; }
body .account-menu button { background:#fff; color:var(--ink); }
body .account-menu button:hover { background:var(--ui-hover); }
body :is(.dashboard-action-card.purchase-action,.dashboard-action-card.material-action,.hub-entry-card,.purchase-entry-card) { background:#f3f8f4; color:var(--ink); border:1px solid var(--line); box-shadow:none; }
body :is(.dashboard-action-card,.hub-entry-card,.purchase-entry-card) :is(strong,small,p,.dashboard-action-arrow,.hub-entry-arrow) { color:var(--ink); }
body :is(.dashboard-action-icon,.hub-entry-icon,.purchase-entry-icon),body .purchase-entry-card:nth-child(2) .purchase-entry-icon { background:var(--ui-selected); color:var(--accent); }
body .hub-entry-icon.is-wood { background:var(--ui-selected); color:var(--accent); }
body :is(.material-stat,.order-stat,.pc-stat,.assembly-stat,.metric,.flow-summary-item) { background:#f5f9f5; border-color:var(--line); box-shadow:none; color:var(--ink); }
body :is(.material-stat,.order-stat,.pc-stat,.assembly-stat,.metric) :is(strong,b) { color:var(--accent-deep); }
body .pc-stat:hover { background:var(--ui-selected); border-color:var(--ui-selected-border); }
body :is(th,th:first-child) { background:#f1f6f2; color:var(--muted); }
body .thumb.placeholder { background:#f0f6f1; color:var(--muted); }
body :is(.sample-detail-total,.sample-cost-total,.sample-live-total) { background:#edf5ee; color:var(--ink); border:1px solid var(--line); }
body :is(.sample-detail-total,.sample-cost-total,.sample-live-total) strong { color:var(--accent-deep); }
body .empty:not(.status-pill) { background:#f7faf7; color:var(--muted); border-color:var(--line); border-radius:8px; }
body :is(.date-field,.file-field,.cost-field,.small-link,.badge,.status-pill,.pc-badge) { border-radius:6px; }
body .view > .panel + .panel { margin-top:16px; }
body:has(.modal:not([hidden]),dialog[open]) #accountMenuButton { visibility:hidden; }
body .login-screen { background:linear-gradient(145deg,#f7faf7,#e8f2eb); }

/* Action hierarchy: default compact action, primary save/create, secondary, danger. */
body :is(.small-btn,.mini-file,.ghost-btn,.primary-action,.mobile-create-button,.image-download-button),
body form button { background:var(--accent-soft); color:var(--accent-deep); border:1px solid var(--line); box-shadow:none; }
body :is(button.primary,.primary-action,.mobile-create-button,button[type=submit],.purchase-submit-bar button,.mobile-save-bar button:not(.secondary),.image-download-button) { background:var(--accent); color:#fff; border-color:var(--accent); box-shadow:none; }
body :is(button.secondary,.small-btn.secondary,.ghost-btn,.small-link,.panel-link,button.login-link) { background:#fff; color:var(--accent-deep); border-color:var(--line); box-shadow:none; }
body :is(.panel-link,.text-link,.view-back-btn) { background:transparent; color:var(--accent-deep); }
body :is(button.danger-btn,.category-chip button,[data-delete-saved-report],[data-remove-daily-report-toy]) { background:#fff3f1; color:var(--danger); border-color:#ebcbc6; }
body :is(.small-btn,.primary-action,.ghost-btn,form button):hover:not(:disabled) { background:var(--ui-hover); color:var(--accent-deep); border-color:var(--ui-selected-border); }
body :is(button.primary,.primary-action,button[type=submit],.mobile-create-button):hover:not(:disabled) { background:#21673c; color:white; }
body :is(button.danger-btn,[data-delete-saved-report]):hover:not(:disabled) { background:#fbe8e5; color:#92342f; border-color:#d9aaa3; }

/* All status filter groups share identical default, selected and hover states. */
body :is(.chip-row,.pc-filter-chips,.order-status-chips,#statsRangeChips) { gap:8px; padding-block:2px 4px; }
body :is(.chip-row,.pc-filter-chips,.order-status-chips,#statsRangeChips) > button {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  min-height:var(--ui-control-height) !important; height:var(--ui-control-height) !important;
  padding:7px 12px !important; border-radius:var(--ui-control-radius) !important;
  font-size:var(--ui-control-font) !important; line-height:20px !important; font-weight:500;
  background:#fff !important; color:#526b5b !important; border:1px solid var(--line) !important;
  box-shadow:none !important; white-space:nowrap;
}
body :is(.chip-row,.pc-filter-chips,.order-status-chips,#statsRangeChips) > button.is-active {
  background:var(--ui-selected) !important; color:var(--accent-deep) !important;
  border-color:var(--ui-selected-border) !important; font-weight:700;
}
@media(hover:hover) {
  body :is(.chip-row,.pc-filter-chips,.order-status-chips,#statsRangeChips) > button:hover:not(.is-active) { background:var(--ui-hover) !important; border-color:var(--ui-selected-border) !important; }
}

/* Search and filter controls, including dynamically built picker menus. */
body :is(.filter-bar,.product-toolbar,.sample-picker-filters,.purchase-picker-filters,.picker-search) :is(input:not([type=checkbox]):not([type=radio]),select,button),
body .compact-filter-menu > summary {
  min-height:var(--ui-control-height) !important; height:var(--ui-control-height) !important;
  padding:7px 10px !important; border-radius:var(--ui-control-radius) !important;
  font-size:var(--ui-control-font) !important; line-height:20px !important;
  background:#fff !important; color:#526b5b !important; border:1px solid var(--line) !important;
  font-weight:500; box-shadow:none !important; white-space:nowrap; box-sizing:border-box;
}
body :is(.filter-bar,.product-toolbar,.sample-picker-filters,.purchase-picker-filters,.picker-search) input[type=search],
body .compact-search-bar > input { background:#f6f9f6 !important; color:var(--ink) !important; }
body .compact-filter-menu > summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; }
body .compact-filter-menu > summary::-webkit-details-marker { display:none; }
body .compact-filter-menu > summary::before { content:""; width:14px; height:14px; flex-shrink:0; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 4h18l-7 8v7l-4 2v-9z'/%3E%3C/svg%3E") center/contain no-repeat; }
body .compact-filter-menu[open] > summary { background:var(--ui-selected) !important; border-color:var(--ui-selected-border) !important; color:var(--accent-deep) !important; }
body .compact-filter-options { z-index:40; width:min(260px,calc(100vw - 48px)); background:#fff; border:1px solid var(--line); box-shadow:0 6px 20px #254b3018; border-radius:8px; }
body .compact-filter-options :is(input,select,button) { max-width:100%; }
body .compact-filter-options button { background:var(--accent-soft) !important; color:var(--accent-deep) !important; }
body #openBomCreate,body #openKitCreate { background:var(--accent) !important; color:#fff !important; border-color:var(--accent) !important; font-weight:600; }
body :is(.filter-bar,.product-toolbar,.sample-picker-filters,.purchase-picker-filters,.picker-search) :is(input,select):focus-visible { outline:2px solid #287746 !important; outline-offset:1px; }

/* Tabs are navigation, with a single green underline across every module. */
body :is(.mode-tabs,.production-tabs,.mobile-subnav,.purchase-material-mode) { background:transparent !important; border:0; border-bottom:1px solid var(--line); box-shadow:none; border-radius:0 !important; gap:16px; }
body :is(.mode-tabs,.production-tabs,.mobile-subnav,.purchase-material-mode) > button {
  color:var(--muted) !important; background:transparent !important;
  min-height:42px !important; padding:9px 5px !important; font-size:14px !important; line-height:20px;
  border:0; border-bottom:3px solid transparent; border-radius:0 !important; box-shadow:none;
}
body :is(.mode-tabs,.production-tabs,.mobile-subnav,.purchase-material-mode) > button.is-active { color:var(--accent-deep) !important; border-bottom-color:var(--accent); font-weight:700; }

/* Keep elderly workers' report controls comfortably sized. */
body #dailyReportForm > button[type=submit],body #leaveForm > button[type=submit] { background:var(--accent); color:#fff; }
body #dailyReportForm #addDailyReportToy { background:var(--ui-selected); color:var(--accent-deep); border-color:var(--ui-selected-border); }
body #dailyReportToyRows .daily-report-toy-row { background:#f7faf7; border-color:#cbded0; border-left-color:var(--accent); }
body #dailyReportToyRows .daily-report-toy-choice { background:#fff; color:var(--ink); }
body #dailyReportToyPicker .daily-toy-groups button { background:#f1f7f2; border-color:#cbded0; color:var(--accent-deep); }
body #dailyReportToyPicker .daily-toy-picker-list button { background:#fff; color:var(--ink); }
body .workspace-picker .is-selected,body .workspace-picker .range-confirm { background:var(--accent); color:#fff; }
body .workspace-picker .in-range { background:var(--ui-selected); color:var(--accent-deep); }
body .calendar-grid button:disabled { background:#e0e5e1; color:#69766d; }

/* Edge-to-edge module backdrops belong to the page, not an inset title card. */
body .order-progress { margin:12px 0; padding:12px; background:#f5f9f6; border:1px solid var(--line); border-radius:6px; }
body .order-progress > div:first-child,body .order-progress-items > div { display:flex; justify-content:space-between; gap:12px; align-items:center; }
body .order-progress progress { display:block; width:100%; height:8px; margin:9px 0; accent-color:var(--accent); }
body .order-progress-items > div { padding:7px 0; border-top:1px solid var(--line); font-size:13px; }
body .order-progress-items small { display:block; color:var(--muted); margin-top:3px; }
body .order-assignment-row { display:grid; grid-template-columns:minmax(100px,1fr) minmax(130px,1fr) auto; gap:10px; padding:12px 0; border-bottom:1px solid var(--line); align-items:center; }
body .order-assignment-row label { min-width:0; font-size:12px; }
body .order-assignment-row select { width:100%; min-height:36px; padding:6px; font-size:14px; }
body .order-assignment-row .order-range-button { grid-column:1 / -1; justify-self:start; }
body .order-assignment-row > small { grid-column:1 / -1; color:var(--muted); }
body .planned-stock { color:var(--accent-deep); font-size:16px; }
body .planned-stock.is-short { color:var(--danger); }
@media(max-width:767px) {
  body .order-assignment-row { grid-template-columns:minmax(0,1fr) minmax(100px,1fr); }
  body .order-assignment-row > strong { grid-column:1 / -1; }
  body .material-row-side { min-width:104px; }
  body .material-row { grid-template-columns:42px minmax(0,1fr) 104px; }
}
:root { --bg:#f4f8fa; --shadow:0 4px 18px rgba(49,84,103,.045); }
body .workspace {
  position:relative; isolation:isolate;
  --module-art:url("art-warehouse.svg"); --module-tint:#e7ecd3; --module-wash:#e0f1f5;
}
body .workspace[data-module=inventory] { --module-art:url("art-warehouse.svg"); --module-tint:#cdece3; --module-wash:#e5f5f9; }
body .workspace[data-module=home] { --module-art:none; }
body #dashboard .dashboard-welcome-copy { max-width:100%; }
body #dashboard :is(.timeline-item,.flow-summary-item) { background:#fff; border:1px solid #e2e5e8; border-radius:8px; box-shadow:none; }
body .workspace[data-module=orders] { --module-art:url("art-orders.svg"); --module-tint:#cce5f7; --module-wash:#eef2fc; }
body .workspace[data-module=production] { --module-art:url("art-production.svg"); --module-tint:#e2d9f5; --module-wash:#f4effa; }
body .workspace[data-module=procurement] { --module-art:url("art-purchase.svg?v=59"); --module-tint:#f6dfc1; --module-wash:#fff4e9; }
body .workspace[data-module=products] { --module-art:url("art-products.svg"); --module-tint:#f0d8e5; --module-wash:#f8eff7; }
body .workspace[data-module=sampling] { --module-art:url("art-material.svg"); --module-tint:#e6eabc; --module-wash:#f5f6e6; }
body .workspace::before {
  content:""; position:absolute; inset:0 0 auto; height:370px; z-index:-1; pointer-events:none;
  background-image:var(--module-art),radial-gradient(ellipse at 100% 0,var(--module-tint),transparent 72%),linear-gradient(to bottom,var(--module-wash),var(--bg));
  background-size:225px 173px,100% 100%,100% 100%;
  background-position:right 16px top 145px,center,center; background-repeat:no-repeat;
}
body .topbar { background:transparent; border-color:transparent; }
body .dashboard-welcome,body .purchase-hub-hero,body .module-page-hero {
  position:relative; min-height:123px; padding:15px 24px;
  margin-bottom:14px; border:0; border-radius:0; box-sizing:border-box;
  background:transparent; box-shadow:none;
}
body .dashboard-welcome::after,body .purchase-hub-hero::after { content:none; }
body .dashboard-welcome-copy,body .purchase-hub-copy { max-width:calc(100% - 200px); }
body .module-page-hero h2 { margin:0; font-size:30px; }
body .module-page-hero p { margin-top:8px; }
body .dashboard-welcome-copy p,body .purchase-hub-copy p { line-height:1.7; color:#607780; }
body .dashboard-action-card.purchase-action,
body .dashboard-action-card.material-action { background:#fff; border-color:var(--line); }
body .dashboard-action-card { position:relative; isolation:isolate; }
body .dashboard-action-card::before { content:none; }
body .dashboard-action-card .dashboard-action-copy small { color:#63717a; }
body .dashboard-action-card .dashboard-action-icon { width:78px; height:78px; border-radius:0; background:url("art-purchase.svg?v=59") center/contain no-repeat; }
body .dashboard-action-card.material-action .dashboard-action-icon { background-image:url("art-material.svg"); }
body .dashboard-action-icon > svg { visibility:hidden; }
body .dashboard-action-card.material-action .dashboard-action-arrow { color:var(--accent-deep); }
body .hub-entry-card:first-child,body .purchase-entry-card:first-child,
body .hub-entry-card:nth-child(2),body .purchase-entry-card:nth-child(2) { background:#fff; border-color:var(--line); }
body .hub-entry-card:first-child .hub-entry-icon,body .purchase-entry-card:first-child .purchase-entry-icon { background:#dfedf9; color:#337eae; }
body .hub-entry-card:nth-child(2) .hub-entry-icon,body .purchase-entry-card:nth-child(2) .purchase-entry-icon { background:#e9e0f5; color:#8160a7; }

/* Four restrained colors help identify metrics without coloring the whole page. */
body :is(.metric-grid > .metric,.material-stat,.pc-stat,.order-stat,.assembly-stat) { --metric-tint:#eff9f3; --metric-end:#e8f5ed; --metric-ink:#28764f; background:linear-gradient(145deg,var(--metric-tint),var(--metric-end)); border-color:#e2eaf0; }
body :is(.metric-grid > .metric,.material-stat,.pc-stat,.order-stat,.assembly-stat):nth-child(2) { --metric-tint:#f0f8ff; --metric-end:#e6f1fb; --metric-ink:#337ba7; }
body :is(.metric-grid > .metric,.material-stat,.pc-stat,.order-stat,.assembly-stat):nth-child(3) { --metric-tint:#fff9ed; --metric-end:#fff1e1; --metric-ink:#a36620; }
body :is(.metric-grid > .metric,.material-stat,.pc-stat,.order-stat,.assembly-stat):nth-child(4) { --metric-tint:#f9f3ff; --metric-end:#eee7f9; --metric-ink:#7b54a4; }
body #dashboard .metric:nth-child(3) { --metric-tint:#f9f3ff; --metric-end:#eee7f9; --metric-ink:#7b54a4; }
body #dashboard .metric:nth-child(4) { --metric-tint:#fff9ed; --metric-end:#fff1e1; --metric-ink:#a36620; }
/* Let the page artwork carry the color; cards remain quiet, readable surfaces. */
body #dashboard .metric,body #purchaseCenter .pc-stat { background:#fff; border-color:var(--line); }
body :is(.metric-grid > .metric,.material-stat,.pc-stat,.assembly-stat) :is(strong,b),body #dashboard .metric-copy strong span { color:var(--metric-ink); }
body #dashboard .metric-icon { display:grid; place-items:center; margin:0; width:38px; height:38px; color:var(--metric-ink); background:#ffffff99; box-shadow:0 2px 6px #33557708; border-radius:10px; }
body .material-stat-icon { display:grid; place-items:center; width:30px; height:30px; margin:0 auto 6px; border-radius:8px; background:#ffffff99; color:var(--metric-ink); }
body .material-stat-icon svg { width:20px; height:20px; }
body .dashboard-alert-content { grid-template-columns:minmax(0,1fr); }
body #inventoryCostMetric { position:relative; isolation:isolate; min-height:180px; padding:20px; background:linear-gradient(125deg,#f3faf6,#eff7fc 55%,#fcf5e9); border:1px solid #e0ece6; border-radius:10px; overflow:hidden; }
body #inventoryCostMetric::after { content:""; position:absolute; z-index:-1; width:160px; height:142px; right:-10px; bottom:0; background:url("art-coins.svg") center/contain no-repeat; pointer-events:none; }
body #inventoryCostMetric :is(span,strong,small) { position:relative; max-width:calc(100% - 90px); overflow-wrap:anywhere; }
body #inventoryCostMetric strong { color:#27724d; font-size:32px; }
@media(min-width:768px) and (max-width:1180px) {
  /* Match the two-column tablet shell; legacy rules put content under the sidebar. */
  body .workspace { grid-column:2; }
}
@media(max-width:767px) {
  body .workspace { padding-top:0 !important; }
  body .workspace::before { height:233px; background-size:135px 114px,100% 100%,100% 100%; background-position:right 20px top 24px,center,center; }
  body .dashboard-welcome,body .purchase-hub-hero,body .module-page-hero { padding:22px 14px 9px; min-height:131px; margin-bottom:9px; }
  body .dashboard-welcome-copy,body .purchase-hub-copy { max-width:calc(100% - 130px); }
  body .dashboard-welcome-copy h2 { font-size:24px; line-height:1.4; }
  body .purchase-hub-copy h2 { font-size:26px; }
  body .dashboard-welcome-copy p,body .purchase-hub-copy p { font-size:13px; }
  body .dashboard-action-card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; min-height:195px; padding:12px 14px 42px; }
  body .dashboard-action-card .dashboard-action-icon { width:58px; height:58px; }
  body .dashboard-action-copy strong { font-size:16px; line-height:1.4; }
  body .dashboard-action-copy small { font-size:12px; line-height:1.6; }
  body #dashboard .metric-grid { gap:6px !important; padding:0; border:0; background:transparent; }
  body #dashboard .metric { border:1px solid #e2eaf0; border-radius:8px; gap:8px; }
  body #dashboard .metric-icon { margin:auto; }
  body #inventoryCostMetric { min-height:166px; }
  body #inventoryCostMetric::after { width:150px; height:134px; }
}
@media(max-width:360px) {
  body .dashboard-welcome-copy,body .purchase-hub-copy { max-width:calc(100% - 95px); }
  body .dashboard-welcome-copy h2 { font-size:22px; }
  body .workspace::before { background-size:108px 98px,100% 100%,100% 100%; background-position:right 20px top 36px,center,center; }
}
body #scheduleAssignmentModal { width:min(720px,calc(100vw - 24px)); max-width:none; max-height:calc(100dvh - 32px); margin:auto; padding:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; color:var(--ink); }
#scheduleAssignmentModal::backdrop { background:rgba(24,48,39,.36); }
body:has(#scheduleAssignmentModal[open]) { overflow:hidden; }
#scheduleAssignmentModal[hidden] { display: none; }
.schedule-assignment-card { display:flex; flex-direction:column; max-height:calc(100dvh - 34px); padding:0; }
body #scheduleAssignmentModal .panel-head { display:flex; flex-flow:row nowrap; align-items:flex-start; gap:12px; margin:0; padding:16px; flex-shrink:0; border-bottom:1px solid var(--line); }
body #scheduleAssignmentModal .panel-head > div { flex:1; min-width:0; }
body #scheduleAssignmentModal h2 { font-size:19px; line-height:1.4; margin:0 0 4px; }
body #scheduleAssignmentModal .panel-note { font-size:13px; line-height:1.5; margin:0; overflow-wrap:anywhere; }
.schedule-assignment-rows { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:14px; overflow:auto; min-height:0; overscroll-behavior:contain; }
body .schedule-assignment-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:12px; background:#fafcfb; border:1px solid var(--line); border-radius:8px; min-width:0; align-content:start; }
.schedule-assignment-row:has([data-assignment-check]:checked) { background:#f0f8f3; border-color:#87b395; }
body .schedule-assignment-row label { min-width:0; margin:0; padding:0; background:none; border:0; border-radius:0; }
body .schedule-assignment-row .assignment-person { display:flex; align-items:center; gap:8px; grid-column:1/-1; min-height:36px; }
body .assignment-person strong { font-size:15px; overflow-wrap:anywhere; }
body .assignment-person > span { margin-left:auto; color:var(--muted); white-space:nowrap; font-size:12px; }
body #scheduleAssignmentModal input[type=checkbox] { appearance:auto; width:20px; height:20px; min-width:20px; min-height:20px; margin:0; padding:0; flex:0 0 20px; box-shadow:none; }
body .schedule-assignment-row :is(.assignment-field,.assignment-dates) { display:grid; gap:5px; min-width:0; font-size:12px; color:var(--muted); }
body .schedule-assignment-row .assignment-dates { grid-column:1/-1; }
body #scheduleAssignmentModal :is(input[type=number],select,button) { box-sizing:border-box; min-width:0; min-height:38px; height:38px; padding:7px 10px; font-size:14px; line-height:22px; border-radius:6px; box-shadow:none; }
body #scheduleAssignmentModal :is(input[type=number],select,.assignment-date-button) { width:100%; }
body #scheduleAssignmentModal .assignment-date-button { text-align:left; font-size:12px; white-space:nowrap; }
body #scheduleAssignmentModal #closeScheduleAssignment { flex:0 0 auto; width:auto; }
body #scheduleAssignmentModal .wood-form-actions { display:flex; justify-content:flex-end; padding:12px 16px; margin:0; border-top:1px solid var(--line); background:#fff; flex-shrink:0; }
body #scheduleAssignmentModal #confirmScheduleAssignment { width:140px; flex:none; }
.schedule-assignment-row.has-leave-conflict { border-color: #e4a3a3; background: #fff5f5; }
.transaction-order-cards { display: grid; gap: 10px; }
body .transaction-order-card { width:100%; min-width:0; height:auto; display:grid; grid-template-columns:minmax(0,1fr); gap:10px; text-align:left; padding:14px; border:1px solid var(--line); border-radius:8px; background:#fff; color:inherit; cursor:pointer; white-space:normal; }
.transaction-order-card:hover, .transaction-order-card.is-selected { border-color: #39a76a; background: #f0fbf3; }
.transaction-order-card.is-blocked, .transaction-order-card:disabled { cursor: not-allowed; opacity: .52; background: #f3f4f3; border-color: #d7ddd8; }
.transaction-order-card.is-blocked:hover { border-color: #d7ddd8; background: #f3f4f3; }
.transaction-order-card span { display: grid; gap: 4px; min-width: 0; }
.transaction-order-card strong { font-size:15px; line-height:1.5; overflow-wrap:anywhere; }
.transaction-order-card small { color:#68776e; white-space:normal; overflow-wrap:anywhere; font-size:13px; line-height:1.65; }
.transaction-order-card b { justify-self:start; font-size:12px; line-height:1.5; padding:3px 7px; border-radius:4px; background:#edf5ee; white-space:normal; color:#247b4e; }
.picker-link-button { width: 100%; text-align: left; padding: 11px 14px; border: 1px solid var(--line, #dce8df); border-radius: 10px; background: #fff; color: #315b43; }
.transaction-order-confirm-bar { display:grid; gap:8px; }
.transaction-order-confirm-bar > span { font-size:12px; line-height:18px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.transaction-order-confirm-bar > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; min-width:0; }
.transaction-order-confirm-bar[hidden] { display: none; }
body :is(#bomAddMaterial,#transactionOrderPicker) { padding-bottom:calc(var(--picker-nav-height,0px) + 120px); }
body :is(#bomAddMaterial.is-active .picker-page-footer,#transactionOrderPicker.is-active .transaction-order-confirm-bar) { position:fixed; left:var(--picker-dock-center,50%); bottom:calc(var(--picker-nav-height,0px) + 10px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); width:var(--picker-dock-width,calc(100vw - 24px)); max-width:760px; box-sizing:border-box; margin:0; padding:10px 12px; z-index:85; border:1px solid #cfe2d4; border-radius:8px; background:#fff; box-shadow:0 -3px 18px #254b3018; }
body :is(#bomAddSubmit,#transactionOrderConfirm,#transactionOrderClear) { min-height:40px; height:40px; min-width:0; padding:8px 10px; font-size:13px; line-height:22px; border-radius:6px; white-space:nowrap; }
body #bomAddCount { font-size:12px; line-height:18px; }
body #bomAddSubmit { flex:0 0 auto; }
@media(max-width:560px) { .schedule-assignment-rows { grid-template-columns:minmax(0,1fr); padding:10px; gap:10px; } }

/* Order priority shares the compact form and badge scale on every screen. */
body .order-planning-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0 8px; }
body .order-planning-fields label { display:grid; gap:6px; min-width:0; margin:0; padding:0; background:none; border:0; font-size:13px; }
body .order-planning-fields label small { color:var(--muted); font-size:11px; font-weight:400; }
body .order-planning-fields :is(input,select) { box-sizing:border-box; width:100%; min-width:0; height:42px; min-height:42px; padding:8px 10px; font-size:13px; border-radius:6px; }
body .order-priority-help { font-size:12px; line-height:1.6; color:var(--muted); margin:8px 0 18px; }
body .order-priority-meta { display:flex; flex-wrap:wrap; align-items:center; gap:7px 12px; font-size:12px; color:var(--muted); }
body .order-priority-badge { display:inline-flex; flex:none; align-items:center; padding:3px 7px; border-radius:4px; font-size:12px; font-weight:600; line-height:18px; white-space:nowrap; background:#eef4f0; color:#40634c; }
body .order-priority-badge.priority-0 { background:#fff0ed; color:#ae4534; }
body .order-priority-badge.priority-1 { background:#fff5e5; color:#8b611c; }
body #scheduleAssignmentQueue { max-height:140px; overflow:auto; flex-shrink:0; padding:10px 16px; border-bottom:1px solid var(--line); background:#fafcfb; font-size:12px; }
#scheduleAssignmentQueue p { margin:0 0 8px; color:var(--muted); font-size:12px; }
#scheduleAssignmentQueue ol { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
#scheduleAssignmentQueue li { display:flex; align-items:flex-start; gap:8px; }
#scheduleAssignmentQueue li > span:last-child { min-width:0; overflow-wrap:anywhere; line-height:1.6; }
#scheduleAssignmentQueue small { display:block; color:var(--muted); font-size:11px; }
@media(max-width:360px) { body .order-planning-fields { grid-template-columns:minmax(0,1fr); } }
