/* Shared operational UI; print templates retain their established layout. */
:root {
  --ink: #26313b;
  --muted: #5e6974;
  --tertiary: #73808a;
  --line: #dfe5e8;
  --line-light: #edf0f2;
  --canvas: #ffffff;
  --surface: #ffffff;
  --sidebar: #f7f9f9;
  --hover: #f4f7f7;
  --brand: #087f78;
  --brand-hover: #06675f;
  --brand-soft: #e9f7f4;
  --warning: #93600d;
  --warning-soft: #fff5e4;
  --danger: #ba3434;
  --danger-soft: #fff0ef;
  --success: #26744b;
  --success-soft: #edf7f0;
}
@media screen {
  body .nav-list .nav-section-title {
    margin:12px 0 4px; padding:6px 10px; border-radius:4px;
    background:#e9edef; color:var(--muted); font-size:12px; font-weight:600;
  }
  body .nav-list .nav-section-title:first-child { margin-top:0; }
  body .nav-list .nav-item { position:relative; padding-left:24px; }
  body .nav-list .nav-item.active::before {
    content:""; position:absolute; left:9px; top:50%; transform:translateY(-50%);
    width:3px; height:16px; border-radius:2px; background:var(--brand);
  }
  body .button.primary, body .button.filter-query, body .prod-machine.active {
    background: var(--brand); border-color: var(--brand); color: #fff;
  }
  body .button.primary:hover, body .button.filter-query:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
  body .topbar-primary { background:var(--brand); color:#fff; border-color:var(--brand); }
  body .topbar-primary:hover { background:var(--brand-hover); }
  body .user-avatar { background:var(--brand-soft); color:var(--brand); }
  body .link-button { color: var(--brand); }
  body .link-button:hover { color: var(--brand-hover); }
  body .action-attention, body .link-button[data-action="price"], body .sales-order-table .link-button[data-action="price"] {
    display: inline-flex; justify-content: center; align-items: center;
    margin: 0; padding: 5px 9px; border: 1px solid transparent; border-radius: 5px;
    background: var(--brand-soft); color: var(--brand); font-weight: 500; line-height: 20px; white-space: nowrap;
  }
  body .action-attention:hover, body .link-button[data-action="price"]:hover, body .sales-order-table .link-button[data-action="price"]:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-hover); }
  body [data-action="price"], body .sales-order-table .link-button[data-action="price"] {
    background:var(--warning-soft); color:var(--warning); border:1px solid #f0cf97;
  }
  body [data-action="price"]:is(:hover,:focus-visible), body .sales-order-table .link-button[data-action="price"]:is(:hover,:focus-visible) {
    background:#ffebc7; color:#784a08; border-color:#dba34a;
  }
  body .link-button:is([data-action^="delete"], [data-action^="remove"], [data-real-remove], [data-return-remove], [data-receipt-remove], [data-remove-line], [data-remove-draft-line]) { color: var(--muted); }
  body .link-button:is([data-action^="delete"], [data-action^="remove"], [data-real-remove], [data-return-remove], [data-receipt-remove], [data-remove-line], [data-remove-draft-line]):is(:hover,:focus-visible) { color: var(--danger); }
  body .button.danger { color: var(--danger); background: var(--danger-soft); border-color: #efc6c3; }
  body :is(input,select,textarea) { accent-color: var(--brand); }
  body :is(button,input,select,textarea,a):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  body table:not(.a4-sheet table):not(.reconciliation-sheet table) :is(th,td) {
    text-align: center !important; vertical-align: middle !important;
  }
  body table:not(.a4-sheet table):not(.reconciliation-sheet table) :is(th,td) :is(button,input,select,.line-amount,.number,.sales-line-value,.prod-sub,.product-name-button) { text-align: center; }
  body td :is(.actions,.prod-actions,.ui-row-actions) { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
  body .ui-row-actions { min-width: 172px; gap:10px; }
  body .sales-order-table { table-layout:fixed; min-width:1280px; }
  body .sales-order-table th:nth-child(1) { width:14%; }
  body .sales-order-table th:nth-child(2) { width:17%; }
  body .sales-order-table th:nth-child(3) { width:9%; }
  body .sales-order-table th:nth-child(4) { width:19%; min-width:0; }
  body .sales-order-table th:nth-child(5) { width:9%; }
  body .sales-order-table th:nth-child(6) { width:9%; }
  body .sales-order-table th:nth-child(7) { width:7%; }
  body .sales-order-table th:nth-child(8) { width:16%; }
  body .sales-order-table td { padding:12px 10px; overflow-wrap:anywhere; }
  body .sales-order-table td:first-child { white-space:normal; }
  body .sales-order-table td:first-child button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
  body .sales-order-table td:nth-child(3),body .prod-table td:nth-child(2) { white-space:nowrap; }
  body .sales-order-table td:nth-child(5)>.sales-line-value,
  body .sales-order-table td:nth-child(6)>.sales-line-value { display:flex; align-items:center; justify-content:center; padding:0; min-height:42px; }
  body .sales-order-table td:nth-child(6)>.sales-line-value:only-child { min-height:0; }
  body .sales-order-table td:nth-child(6)>.sales-line-value+.sales-line-value { margin-top:10px; }
  body .badge { justify-content:center; vertical-align:middle; }
  body .prod-dialog { color:var(--ink); }
  body :is(.prod-sub,.prod-empty,.planner-empty,.planner-time-unknown) { color:var(--tertiary); }
  body :is(.prod-form-section,.prod-common-filters,.prod-stat,.prod-stage,.planner-editor,.prod-dialog) { border-color:var(--line); }
  body :is(.prod-note,.prod-selected,.prod-calculation-panel) { background:var(--brand-soft); color:var(--ink); }
  body .prod-stage { background:var(--hover); }
  body :is(.planner-badge.active,.planner-time-bar.active) { color:var(--brand); background:var(--brand-soft); }
  body :is(.planner-badge.done,.planner-time-bar.done) { color:var(--success); background:var(--success-soft); }
  body :is(.planner-badge.paused,.planner-time-bar.paused,.prod-badge.warn) { color:var(--warning); background:var(--warning-soft); }
  body :is(.planner-badge.late,.planner-time-bar.late) { color:var(--danger); background:var(--danger-soft); }
  body .planner-selected .planner-time-label { background:var(--brand-soft); }
  body .planner-time-label, body .planner-machine-label, body .planner-time-head>* { text-align:center; }
  body .planner-due { align-self:center; justify-self:center; }
}
