﻿:root {
  --prestec-orange: #f35b27;
  --prestec-orange-dark: #c63a15;
  --prestec-gold: #c89b3c;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --line: #d7dde3;
  --panel: #ffffff;
  --page: #f7f5f2;
  --soft-panel: #fbfaf8;
  --shadow: 0 10px 28px rgba(26, 26, 26, .07);
  --success: #0f766e;
  --warning: #b45309;
  --danger: #b42318;
  --heading-font: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
  --body-font: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
  --mono-font: Consolas, "Courier New", monospace;
}

.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 13px;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(243, 91, 39, .35);
  outline-offset: 2px;
  border-color: var(--prestec-orange);
}

h1,
h2,
h3,
.button,
.nav a,
.workspace-tabs a,
.stat-value,
.stat-label,
th,
.badge {
  font-family: var(--heading-font);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  background:
    linear-gradient(90deg, #fff 0%, #fff 31%, var(--page) 31%, var(--page) 100%);
}

.login-panel {
  padding: clamp(24px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  background: transparent;
}

.login-card {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-brand img {
  width: 190px;
  height: auto;
}

.login-heading {
  margin: 22px 0;
}

.login-heading span,
.login-visual-content span {
  display: block;
  color: var(--prestec-orange);
  font-family: var(--heading-font);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  color: var(--ink);
  font-family: var(--heading-font);
}

.login-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.otp-notice {
  border: 1px solid rgba(243, 91, 39, .24);
  border-radius: 8px;
  background: #fff8f4;
  color: var(--ink);
  display: grid;
  gap: 4px;
  line-height: 1.45;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.otp-notice span {
  color: var(--prestec-orange-dark);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-weight: 700;
  font-size: 11px;
  text-transform: none;
  color: var(--muted);
}

.field input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.inline-add-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-add-control input {
  flex: 1;
}

.inline-add-control .button {
  white-space: nowrap;
}

.inventory-item-modal-card {
  max-width: 1120px;
}

.inventory-item-modal-card .customer-modal-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.inventory-item-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.inventory-item-modal-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.inventory-item-modal-grid section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink);
}

.inventory-item-modal-grid .field {
  margin-bottom: 10px;
}

.inventory-item-modal-grid input:disabled,
.inventory-item-modal-grid select:disabled,
.inventory-item-modal-grid textarea:disabled,
.inventory-item-modal-grid input[readonly] {
  background: #f3f5f7;
  color: #667085;
  cursor: not-allowed;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.phase1j-help {
  display: inline-grid;
  margin-left: 6px;
  position: static;
  vertical-align: middle;
}

.phase1j-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phase1j-title h2,
.phase1j-title h3 {
  margin: 0;
}

.phase1j-help summary {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: var(--prestec-orange-dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  line-height: 1;
  list-style: none;
  width: 22px;
}

.phase1j-help summary::-webkit-details-marker {
  display: none;
}

.phase1j-help > div {
  background: #fffaf0;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 400;
  gap: 6px;
  line-height: 1.4;
  margin-top: 6px;
  max-width: min(720px, 100%);
  padding: 10px 12px;
  position: static;
  width: max-content;
}

.phase1j-help[open] {
  flex-basis: 100%;
}

.phase1j-help > div p {
  margin: 0;
}

.phase1j-help > div strong {
  color: var(--ink);
  font-size: 12px;
}

.inventory-item-modal-card > .actions {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 900px) {
  .inventory-item-modal-grid {
    grid-template-columns: 1fr;
  }
}

.button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: var(--prestec-orange);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.button:hover {
  background: var(--prestec-orange-dark);
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.secondary:hover {
  background: #f7f5f2;
  border-color: #d2d2d2;
  color: var(--prestec-orange-dark);
}

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

.button.danger-button:hover {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}

.button:disabled {
  opacity: .6;
  cursor: wait;
}

.login-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 7vw, 80px);
  background: var(--ink);
  color: #fff;
}

.login-visual-content {
  max-width: 640px;
}

.login-visual h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.02;
  color: #fff;
  font-family: var(--heading-font);
}

.login-visual p {
  color: #e8e8e8;
  font-size: 17px;
  line-height: 1.55;
  max-width: 560px;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 246px 1fr;
  overflow: hidden;
}

.content-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

.app-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  justify-content: space-between;
  min-height: 52px;
  padding: 8px 12px 8px 16px;
}

.app-topbar > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.app-topbar strong {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
}

.app-topbar span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar {
  background: var(--ink);
  border-right: 1px solid var(--ink);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  background: #fff;
  border-radius: 4px;
  padding: 10px;
}

.brand img {
  width: 132px;
  height: auto;
}

.user-card {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card span {
  color: #d8d8d8;
  margin-top: 3px;
  font-size: 12px;
}

.notification-box {
  position: relative;
  width: auto;
  z-index: 80;
}

.notification-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  height: 36px;
  justify-content: center;
  min-width: 44px;
  padding: 0 10px;
  position: relative;
}

.notification-button strong {
  align-items: center;
  background: var(--prestec-orange);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  position: absolute;
  right: -5px;
  top: -6px;
}

.notification-popover {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: none;
  left: auto;
  max-height: 280px;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  min-width: 340px;
  top: 42px;
  z-index: 20;
}

.notification-popover.open {
  display: grid;
  gap: 6px;
}

.notification-filters {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 4px 4px 8px;
}

.notification-status-tabs {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 2px;
}

.notification-status-tabs button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 28px;
}

.notification-status-tabs button.active {
  background: #fff;
  color: var(--prestec-orange-dark);
  box-shadow: 0 1px 3px rgba(26, 26, 26, .08);
}

.notification-filters select,
.notification-filters input {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 30px;
  padding: 0 8px;
  width: 100%;
}

.notification-list {
  display: grid;
  gap: 6px;
}

.notification-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 8px;
  text-align: left;
}

.notification-item.unread {
  border-color: var(--prestec-orange);
  background: #fff8f4;
}

.notification-item strong {
  font-size: 12px;
}

.notification-item span,
.notification-item em,
.compact-empty {
  font-size: 11px;
}

.notification-item em {
  color: var(--prestec-orange-dark);
  font-style: normal;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav a {
  color: #f7f5f2;
  text-decoration: none;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 3px solid transparent;
}

.nav a.active,
.nav a:hover {
  background: rgba(243, 91, 39, .14);
  border-left-color: var(--prestec-orange);
  color: #fff;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group summary {
  align-items: center;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: #f7f5f2;
  cursor: pointer;
  display: flex;
  font-family: var(--heading-font);
  font-weight: 700;
  justify-content: space-between;
  list-style: none;
  padding: 9px 10px;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  color: #d8d8d8;
  content: 'â–¾';
  font-size: 10px;
}

.nav-group:not([open]) summary::after {
  content: 'â–¸';
}

.nav-group summary.active,
.nav-group summary:hover {
  background: rgba(243, 91, 39, .14);
  border-left-color: var(--prestec-orange);
  color: #fff;
}

.subnav {
  display: grid;
  gap: 3px;
  padding-left: 16px;
}

.subnav a {
  font-size: 12px;
  padding: 7px 9px;
}

.content {
  min-width: 0;
  padding: 10px;
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.content.admin-scroll-view {
  overflow-x: hidden;
  overflow-y: auto;
}

.content:has(> .workspace) {
  overflow-x: hidden;
  overflow-y: auto;
}

.content:has(> .purchase-management-body) {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.content:has(> .purchase-management-body) > .purchase-management-topbar,
.content:has(> .purchase-management-body) > .workspace-tabs {
  flex-shrink: 0;
}

/* Do not set fixed height/overflow hidden on purchase tab panels; long operational tabs must remain vertically scrollable. */
.content:has(> .purchase-management-body) > .purchase-management-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 36px;
}

.content:has(.purchase-embedded-suppliers) {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.content:has(.purchase-embedded-suppliers) > .purchase-management-topbar,
.content:has(.purchase-embedded-suppliers) > .workspace-tabs {
  flex-shrink: 0;
}

.content:has(.purchase-embedded-suppliers) > .purchase-management-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.purchase-embedded-suppliers {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.purchase-embedded-suppliers .supplier-module {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.purchase-embedded-suppliers #supplierContent {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.admin-scroll-view .grid {
  padding-bottom: 28px;
}

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 32px;
}

.admin-header {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.admin-header h1 {
  margin: 0 0 4px;
}

.admin-header p,
.admin-card-heading p,
.admin-modal-header p {
  color: var(--muted);
  margin: 0;
}

.admin-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.admin-summary-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
  padding: 12px 14px;
}

.admin-summary-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.admin-summary-grid strong {
  color: var(--ink);
  font-size: 22px;
}

.admin-tabs {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px;
}

.admin-tabs button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  padding: 9px 12px;
  white-space: nowrap;
}

.admin-tabs button.active {
  background: var(--prestec-orange);
  color: #fff;
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-tab-panel[hidden] {
  display: none;
}

.admin-card-heading,
.admin-section-heading,
.admin-modal-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.admin-card-heading {
  margin-bottom: 12px;
}

.admin-card-heading h2,
.admin-modal-header h2 {
  margin: 0 0 4px;
}

.admin-users-wrap {
  overflow-x: auto;
}

.admin-users-table.compact {
  min-width: 1120px;
  table-layout: auto;
}

.admin-users-table.compact th,
.admin-users-table.compact td {
  vertical-align: middle;
}

.admin-users-table.compact td:last-child,
.admin-users-table.compact th:last-child {
  min-width: 210px;
  width: 210px;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-master-toolbar {
  align-items: end;
  display: flex;
  gap: 12px;
  margin: 0 0 12px;
  max-width: 360px;
}

.admin-master-toolbar .field,
.admin-master-toolbar select {
  width: 100%;
}

.admin-master-table {
  min-width: 820px;
}

.admin-inline-check {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  font-weight: 600;
}

.admin-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.admin-badge.active,
.admin-badge.concurrent {
  background: #d1fae5;
  color: #065f46;
}

.admin-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.admin-badge.primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-badge.temporary {
  background: #fef9c3;
  color: #713f12;
}

.admin-badge.delegated {
  background: #ede9fe;
  color: #5b21b6;
}

.admin-badge.neutral {
  background: #eef2f7;
  color: #475467;
  margin: 3px;
}

.admin-empty-state {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  margin: 0;
  padding: 18px;
}

.admin-modal-overlay {
  align-items: flex-start;
  background: rgba(16, 24, 40, .45);
  display: none;
  inset: 0;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
  position: fixed;
  z-index: 1200;
}

.admin-modal-overlay.visible {
  display: flex;
}

.admin-modal-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(16, 24, 40, .24);
  margin: auto;
  max-width: 780px;
  width: min(100%, 780px);
}

.admin-modal-card.wide {
  max-width: 980px;
  width: min(100%, 980px);
}

.admin-modal-card.narrow {
  max-width: 520px;
}

.admin-modal-header {
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.admin-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px;
}

.admin-modal-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-modal-section h3 {
  font-size: 14px;
  margin: 0 0 12px;
}

.admin-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-grid.single {
  grid-template-columns: 1fr;
}

.admin-form-grid .actions {
  align-items: end;
  display: flex;
}

.admin-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-permission-groups {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-permission-groups fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  padding: 12px;
}

.admin-permission-groups legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}

.admin-collapsible-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-permission-note {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}

.sortable-table th[role="button"].sorted {
  background: #fff7ed;
  color: var(--prestec-orange);
}

.sort-icon {
  color: currentColor;
  font-size: 10px;
  margin-left: 4px;
}

@media (max-width: 900px) {
  .admin-header {
    flex-direction: column;
  }

  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form-grid,
  .admin-permission-groups {
    grid-template-columns: 1fr;
  }

  .admin-modal-card,
  .admin-modal-card.wide {
    width: min(100%, 720px);
  }
}

.admin-users-wrap {
  overflow-x: auto;
}

.admin-users-table:not(.compact) {
  min-width: 1460px;
  table-layout: auto;
}

.admin-users-table:not(.compact) th,
.admin-users-table:not(.compact) td {
  vertical-align: top;
}

.admin-users-table:not(.compact) th:nth-child(10),
.admin-users-table:not(.compact) td:nth-child(10) {
  min-width: 360px;
  width: 360px;
}

.admin-users-table:not(.compact) th:last-child,
.admin-users-table:not(.compact) td:last-child {
  min-width: 76px;
  width: 76px;
}

.workspace {
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto;
  min-height: 100%;
}

.workspace-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #eef1f4;
  overflow: hidden;
  flex: 0 0 auto;
}

.workspace-tabs a,
.workspace-tabs button {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  font-weight: 700;
  text-align: center;
  min-width: 112px;
  min-height: 38px;
  max-height: 42px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  white-space: nowrap;
}

.workspace-tabs a.active,
.workspace-tabs a:hover,
.workspace-tabs button.active,
.workspace-tabs button:hover {
  color: var(--prestec-orange);
  background: #fff;
  border-bottom-color: var(--prestec-orange);
}

#inventoryWorkspaceView {
  min-height: auto;
  overflow: visible;
}

.workspace:has(> #inventoryWorkspaceView) {
  align-content: start;
  grid-template-rows: auto auto;
}

.workspace:has(> #inventoryWorkspaceView) > .workspace-tabs {
  align-self: start;
  flex: 0 0 auto;
  min-height: 40px;
  max-height: 44px;
}

.workspace:has(> #inventoryWorkspaceView) > .workspace-tabs a,
.workspace:has(> #inventoryWorkspaceView) > .workspace-tabs button {
  align-items: center;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  color: var(--prestec-orange);
  font-family: var(--heading-font);
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.stats {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--prestec-orange);
}

.warehouse-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.warehouse-kpi {
  min-height: 86px;
}

.warehouse-kpi.primary {
  border-left: 4px solid var(--prestec-orange);
}

.warehouse-kpi.alert .stat-value {
  color: #d97706;
}

.warehouse-dashboard-panels {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.2fr);
  gap: 12px;
}

.compact-work-list {
  display: grid;
  gap: 8px;
}

.compact-work-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 3px solid var(--prestec-orange);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  text-decoration: none;
}

.compact-work-item:hover {
  background: #fff7f2;
  border-color: var(--prestec-orange);
}

.compact-work-item span,
.compact-work-item small {
  color: var(--muted);
}

.compact-summary-table {
  width: 100%;
  font-size: 12px;
}

.compact-summary-table th,
.compact-summary-table td {
  padding: 8px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  align-items: center;
}

.toolbar h2 {
  margin: 0;
  font-size: 15px;
}

.card h2,
.side-panel h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--heading-font);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.filter-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.filter-grid label {
  display: grid;
  gap: 5px;
}

.filter-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-grid input,
.filter-grid select,
td input,
td select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.actions.compact {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-form .field {
  margin-bottom: 0;
}

select,
textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  min-height: 82px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - 142px);
  overflow: hidden;
}

.document-main {
  display: grid;
  grid-template-rows: minmax(140px, .36fr) minmax(0, .64fr);
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.document-side {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.document-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.document-form .field {
  gap: 4px;
  margin-bottom: 0;
}

.form-mini-note,
.field-helper {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 4px 0 0;
}

.label-with-help {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.info-tooltip {
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  cursor: help;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 18px;
}

.info-tooltip::after {
  background: #111827;
  border-radius: 6px;
  bottom: calc(100% + 8px);
  color: #fff;
  content: attr(data-tooltip);
  display: none;
  font-size: 12px;
  font-weight: 500;
  left: 50%;
  line-height: 1.35;
  max-width: 260px;
  min-width: 180px;
  padding: 8px 10px;
  position: absolute;
  transform: translateX(-50%);
  white-space: normal;
  z-index: 30;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after {
  display: block;
}

.document-form .field input,
.document-form .field select {
  height: 34px;
  padding: 0 10px;
}

.document-form .field textarea {
  min-height: 56px;
  padding: 8px 10px;
}

.document-table {
  table-layout: fixed;
  font-size: 12px;
}

.document-table th,
.document-table td {
  padding: 5px 6px;
  white-space: normal;
  vertical-align: middle;
}

.document-table input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
}

.document-table textarea {
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 48px;
  padding: 6px 8px;
  resize: vertical;
  width: 100%;
}

#handoverSelected,
#stockInItems,
#requestSelected {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.section-heading-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.purchase-orders-page {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.purchase-management-topbar {
  align-items: flex-start;
}

.purchase-management-topbar .actions {
  justify-content: flex-end;
  max-width: 820px;
}

.purchase-module-tabs {
  overflow-x: auto;
  white-space: nowrap;
}

.purchase-module-tabs button {
  min-width: max-content;
}

.purchase-management-body {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.purchase-tab-panel {
  align-content: start;
}

.purchase-section {
  min-height: 0;
  overflow: visible;
}

.segmented-control {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented-control button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 12px;
}

.segmented-control button.active {
  background: var(--prestec-orange);
  border-color: var(--prestec-orange);
  color: #fff;
}

/* Operational data tables are sortable by default; keep headers visible and actions state-driven. */
.sortable-table th[role="button"] {
  cursor: pointer;
  user-select: none;
}

.sortable-table th[role="button"]:hover {
  background: #fff8f4;
}

.sortable-th-label {
  display: inline;
}

.sort-indicator {
  color: var(--muted);
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  margin-left: 5px;
}

.sortable-table th.sorted-asc,
.sortable-table th.sorted-desc {
  background: #fff3ed;
  color: var(--prestec-orange-dark);
}

.sortable-table th.sorted-asc .sort-indicator,
.sortable-table th.sorted-desc .sort-indicator {
  color: var(--prestec-orange-dark);
}

/* Official print templates render in a separate print document/iframe to avoid blank previews from app layout state. */
.print-frame {
  border: 0;
  height: 0;
  opacity: 0;
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
}

.purchase-overview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.purchase-overview-board {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr);
}

.purchase-dashboard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  padding: 14px;
}

.purchase-dashboard-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-top: 12px;
}

.purchase-dashboard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  min-height: 92px;
  padding: 11px 12px;
  text-align: left;
}

.purchase-dashboard-card:hover {
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.purchase-dashboard-card.active { border-left-color: #2563eb; }
.purchase-dashboard-card.warning { border-left-color: #f59e0b; }
.purchase-dashboard-card.danger { border-left-color: #dc2626; }
.purchase-dashboard-card.done { border-left-color: #22c55e; }

.purchase-dashboard-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-dashboard-card strong {
  color: #111827;
  display: block;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 8px;
}

.purchase-dashboard-card small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 5px;
}

.purchase-dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .55fr);
  margin-top: 12px;
}

.purchase-dashboard-tasks,
.purchase-dashboard-activity {
  min-width: 0;
}

.purchase-dashboard-activity h2 {
  font-size: 16px;
  margin: 0;
}

.purchase-dashboard-activity p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 12px;
}

.dashboard-activity-list {
  display: grid;
  gap: 8px;
}

.dashboard-activity-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.dashboard-activity-row span,
.dashboard-activity-row em,
.dashboard-activity-row small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.dashboard-activity-row strong {
  color: #111827;
  font-size: 13px;
}

.purchase-overview-main,
.purchase-overview-side,
.purchase-action-center {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  min-width: 0;
  padding: 14px;
}

.purchase-overview-head,
.purchase-action-center-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.purchase-overview-head h2,
.purchase-overview-side h2,
.purchase-action-center-head h2 {
  font-size: 16px;
  margin: 0;
}

.purchase-overview-head p,
.purchase-action-center-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.purchase-action-center-head strong {
  color: var(--prestec-orange);
  font-size: 24px;
  line-height: 1;
}

.purchase-overview-priority {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin-top: 12px;
}

.purchase-overview-metric {
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  min-height: 86px;
  padding: 11px 12px;
}

.purchase-overview-metric.active {
  border-left-color: #2563eb;
}

.purchase-overview-metric.warning {
  border-left-color: #f59e0b;
}

.purchase-overview-metric.done {
  border-left-color: #22c55e;
}

.purchase-overview-metric.value {
  border-left-color: var(--prestec-orange);
}

.purchase-overview-metric span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-overview-metric strong {
  color: #111827;
  display: block;
  font-size: 24px;
  line-height: 1.15;
  margin-top: 8px;
}

.purchase-overview-metric small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 5px;
}

.purchase-pipeline {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-top: 12px;
}

.purchase-pipeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.purchase-pipeline-item > div:first-child {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.purchase-pipeline-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-pipeline-item strong {
  color: #111827;
  font-size: 18px;
}

.purchase-pipeline-track {
  background: #eef2f7;
  border-radius: 999px;
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
}

.purchase-pipeline-track i {
  background: #64748b;
  display: block;
  height: 100%;
}

.purchase-pipeline-item.warning .purchase-pipeline-track i {
  background: #f59e0b;
}

.purchase-pipeline-item.active .purchase-pipeline-track i {
  background: #2563eb;
}

.purchase-pipeline-item.done .purchase-pipeline-track i {
  background: #22c55e;
}

.purchase-efficiency-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.overview-action-table {
  margin-top: 12px;
  max-height: calc(100vh - 500px);
  min-height: 220px;
}

.purchase-overview-grid > div {
  display: grid;
  gap: 8px;
}

.purchase-overview-grid h2,
.purchase-section-card h2 {
  font-size: 15px;
  margin: 0;
}

.purchase-section-card {
  display: grid;
  gap: 12px;
}

.compact-section-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.compact-section-header p,
.purchase-overview-grid p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.purchase-order-filter {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px);
}

.purchase-order-filter.professional-filter {
  grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(150px, 1fr)) repeat(2, minmax(130px, .75fr));
}

.purchase-kpi-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}

.purchase-overview-grid .purchase-kpi-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.purchase-kpi {
  box-shadow: none;
  min-height: 72px;
  padding: 10px;
}

.purchase-kpi span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.purchase-kpi strong {
  color: var(--prestec-orange);
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin-top: 6px;
}

.purchase-kpi small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.purchase-kpi .stat-value {
  font-size: 22px;
  margin-top: 6px;
}

.purchase-quick-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purchase-quick-filters .active {
  background: var(--prestec-orange);
  border-color: var(--prestec-orange);
  color: #fff;
}

.purchase-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100vh - 370px);
  min-height: 260px;
  overflow: auto;
}

.purchase-management-table {
  min-width: 1120px;
}

.purchase-scroll-area {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100vh - 360px);
  min-height: 260px;
  overflow: auto;
}

.purchase-scroll-area .purchase-management-table {
  min-width: 1280px;
}

.purchase-report-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.purchase-report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 12px;
}

.purchase-report-card span {
  color: var(--prestec-orange);
  font-size: 18px;
  font-weight: 900;
}

.purchase-report-page {
  display: grid;
  gap: 16px;
}

.purchase-report-filter-bar {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  padding: 12px;
}

.purchase-report-filter-bar label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
}

.purchase-report-filter-bar input,
.purchase-report-filter-bar select {
  min-width: 0;
}

.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.purchase-report-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.purchase-report-summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.purchase-report-summary-card.done { border-left-color: #22c55e; }
.purchase-report-summary-card.warning { border-left-color: #f59e0b; }
.purchase-report-summary-card.danger { border-left-color: #dc2626; }

.purchase-report-summary-card span,
.purchase-report-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-report-summary-card strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.purchase-report-tabs {
  justify-content: flex-start;
}

.purchase-report-grid-two {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-report-panel {
  display: grid;
  gap: 12px;
  overflow: visible;
}

.purchase-report-bars {
  display: grid;
  gap: 10px;
}

.purchase-report-bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(110px, 0.9fr) minmax(140px, 2fr) minmax(120px, 1fr) minmax(60px, auto);
}

.purchase-report-bar-row > span {
  font-weight: 800;
}

.purchase-report-bar-row > div {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.purchase-report-bar-row i {
  background: linear-gradient(90deg, var(--prestec-orange), #2563eb);
  display: block;
  height: 100%;
}

.purchase-report-bar-row strong {
  text-align: right;
}

.purchase-report-bar-row small {
  color: var(--muted);
  font-weight: 800;
}

.purchase-management-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.purchase-management-table tbody tr {
  cursor: pointer;
}

.purchase-management-table tbody tr:hover {
  background: #fff7ed;
}

.purchase-management-table td {
  vertical-align: top;
}

.purchase-management-table .subline {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.purchase-overdue-row {
  background: #fff7ed;
}

.purchase-mobile-cards {
  display: none;
}

.table-link {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.table-link:hover {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.object-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  line-height: 1.35;
  padding: 0;
  text-align: left;
}

.object-link:hover,
.object-link:focus-visible {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.linked-object-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.empty-cell {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.purchase-order-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.purchase-order-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--prestec-orange);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 10px 12px;
  text-align: left;
}

.purchase-order-card:hover {
  border-color: var(--prestec-orange);
  box-shadow: 0 4px 14px rgba(247, 81, 30, .12);
}

.purchase-order-code {
  color: var(--prestec-orange);
  font-size: 12px;
  font-weight: 900;
}

.purchase-order-card strong {
  color: var(--ink);
  font-size: 14px;
}

.purchase-order-card span,
.purchase-order-card small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  justify-self: start;
  padding: 3px 9px;
}

.workflow-status.done {
  background: #ecfdf3;
  border-color: #86efac;
  color: #15803d;
}

.workflow-status.waiting {
  background: #fff8db;
  border-color: #facc15;
  color: #92400e;
}

.workflow-status.rejected {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.workflow-status.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

button.workflow-status,
.quote-count-button {
  cursor: pointer;
  font: inherit;
}

.quote-count-button:hover {
  box-shadow: 0 0 0 2px rgba(255, 85, 36, 0.14);
}

.danger-empty {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.purchase-workflow-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.purchase-drawer-tabs {
  margin-bottom: 10px;
}

.purchase-detail-drawer {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
}

.purchase-detail-layout {
  margin-bottom: 0;
}

.purchase-history-list {
  display: grid;
  gap: 8px;
}

.purchase-history-list article {
  border: 1px solid var(--line);
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.purchase-history-list article.done {
  border-left-color: #22c55e;
}

.purchase-history-list article.active {
  background: #fff8db;
  border-left-color: var(--prestec-orange);
}

.purchase-history-list span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-action-box {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.purchase-action-box textarea {
  min-height: 76px;
}

.quotation-links {
  display: grid;
  gap: 5px;
  margin: 8px 0;
}

.dynamic-link-list {
  display: grid;
  gap: 6px;
}

.dynamic-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.modal.open {
  display: flex;
}

.modal-panel {
  width: min(920px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

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

.modal-header small {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0;
}

.modal-header h2 {
  margin: 4px 0 0;
}

.po-modal-panel .document-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.po-modal-panel {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.po-form-scroll {
  overflow: auto;
  padding-right: 4px;
}

.po-form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fff;
}

.po-form-section h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.po-modal-panel .po-form-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

#purchaseQuoteModal.open {
  z-index: 96;
}

.quote-detail-modal-panel {
  align-items: stretch;
  padding: 18px;
  background: #f8fafc;
  width: min(1200px, 96vw);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.quote-detail-modal-panel > * {
  flex: 0 0 auto;
  min-width: 0;
}

.quotation-modal-section {
  clear: both;
  position: relative;
  z-index: 0;
}

.quote-detail-modal-panel .quotation-modal-section + .quotation-modal-section,
.quote-detail-modal-panel .quote-detail-table-wrap + .quote-detail-total-box,
.quote-detail-modal-panel .quote-detail-total-box + .quote-detail-note,
.quote-detail-modal-panel .quote-detail-note + .quote-comparison-panel {
  margin-top: 0;
}

.quote-detail-header {
  align-items: center;
  padding: 0 0 14px;
  margin: 0;
  flex-wrap: wrap;
}

.quote-modal-heading {
  min-width: 0;
}

.quote-detail-header h2 {
  font-size: 24px;
  line-height: 1.15;
}

.quote-detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.quote-header-side {
  align-items: flex-end;
  display: grid;
  gap: 10px;
}

.quote-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.quote-selected-card,
.control-summary-card,
.quote-comparison-card,
.quote-selection-card,
.approval-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 14px;
  overflow: visible;
}

.quote-selected-card {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.quote-selected-main {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.quote-selected-main span,
.quote-selected-grid span,
.quote-selected-total span,
.control-summary-grid span,
.approval-meta-grid span,
.approval-reason-box > span,
.quote-reason-readout span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-selected-main h3 {
  font-size: 20px;
  margin: 3px 0;
}

.quote-selected-main p {
  color: var(--muted);
  margin: 0;
}

.quote-selected-total {
  min-width: 190px;
  text-align: right;
}

.quote-selected-total strong {
  color: var(--brand);
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

.quote-selected-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote-selected-grid,
.control-summary-grid,
.approval-meta-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quote-selected-grid div,
.control-summary-grid div,
.approval-meta-grid div,
.quote-reason-readout div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px;
}

.quote-detail-summary {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.quote-detail-status,
.quote-detail-meta-grid,
.quote-detail-table-wrap,
.quote-detail-total-box,
.quote-detail-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.quote-detail-status {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
}

.quote-detail-status strong {
  font-size: 22px;
  color: var(--text);
}

.quote-detail-status small,
.quote-detail-meta-grid span,
.quote-detail-total-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 0;
  overflow: hidden;
}

.quote-detail-meta-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quote-detail-meta-grid strong,
.quote-detail-meta-grid .object-link {
  font-weight: 800;
}

.quote-detail-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px;
}

.quote-detail-table-wrap table {
  margin: 0;
  min-width: 980px;
}

.quote-detail-total-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px;
}

.quote-detail-total-box div {
  min-width: 150px;
  display: grid;
  gap: 4px;
}

.quote-detail-total-box div:last-child strong {
  color: var(--brand);
  font-size: 18px;
}

.quote-detail-note {
  padding: 12px;
  color: var(--text);
}

.risk-badge,
.warning-badge {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  margin: 2px 3px 2px 0;
  padding: 5px 8px;
  white-space: nowrap;
}

.risk-badge.warning,
.warning-badge.waiting {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.risk-badge.danger,
.warning-badge.rejected {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.warning-badge.done,
.warning-badge.ok {
  background: #ecfdf5;
  border-color: #99f6e4;
  color: #0f766e;
}

.table-subline {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px;
  max-width: 220px;
}

.text-rejected {
  color: var(--danger);
  font-weight: 800;
}

.text-done {
  color: var(--success);
  font-weight: 800;
}

.purchase-request-quote-card {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.purchase-request-quote-card .form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.purchase-request-quote-card label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.purchase-request-quote-card input,
.purchase-request-quote-card select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.purchase-request-quote-card textarea {
  min-height: 78px;
}

.purchase-request-quote-card .compact-card {
  margin: 10px 0 12px;
}

.purchase-request-quote-card .table-wrap {
  overflow: auto;
}

.purchase-request-quote-card .compact-table {
  min-width: 1120px;
}

.purchase-request-quote-card .compact-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
  padding: 0;
}

.purchase-request-quote-card .compact-table th,
.purchase-request-quote-card .compact-table td {
  vertical-align: middle;
}

.purchase-request-quote-card .compact-table input:not([type="checkbox"]) {
  height: 32px;
}

.quote-total-panel {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.quote-total-panel div {
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
  padding: 8px 10px;
}

.quote-total-panel span,
.quote-total-panel strong {
  display: block;
}

.quote-total-panel span {
  color: var(--muted);
  font-size: 11px;
}

.quote-total-panel strong {
  margin-top: 2px;
  font-size: 14px;
}

.quote-total-panel .grand-total {
  border-color: rgba(243, 91, 39, .38);
  background: #fff7f2;
}

.quote-total-panel .grand-total strong {
  color: var(--prestec-orange-dark);
}

.purchase-request-quote-card .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.section-title-row h3 {
  border-bottom: 0;
  margin-bottom: 0;
}

.po-items-wrap {
  max-height: 260px;
  overflow: auto;
}

.po-items-table {
  min-width: 1040px;
}

.po-items-table th:nth-child(1) {
  width: 46px;
}

.po-items-table th:nth-child(5),
.po-items-table th:nth-child(6),
.po-items-table th:nth-child(10) {
  width: 76px;
}

.po-items-table th:nth-child(7),
.po-items-table th:nth-child(8) {
  width: 120px;
}

.po-total-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.po-total-grid div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--soft);
}

.po-total-grid span,
.po-total-grid strong {
  display: block;
}

.po-total-grid span {
  color: var(--muted);
  font-size: 11px;
}

.po-total-grid strong {
  margin-top: 3px;
  font-size: 15px;
}

.po-words-field {
  margin-top: 8px;
}

.po-form-section > textarea,
.po-words-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.po-sticky-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  justify-content: flex-end;
}

.po-print-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.po-print-info-section {
  border: 1px solid #111827;
  margin-top: 8px;
}

.po-print-info-section h2 {
  margin: 0;
  padding: 5px 7px;
  font-size: 11px;
  background: #f7f5f2;
  border-bottom: 1px solid #111827;
  text-transform: uppercase;
}

.po-print-info-section .print-meta {
  margin: 0;
  padding: 6px 7px;
}

.po-print-table th:nth-child(1) {
  width: 32px;
}

.po-print-table th:nth-child(4),
.po-print-table th:nth-child(5) {
  width: 48px;
}

.po-print-table th:nth-child(6),
.po-print-table th:nth-child(7) {
  width: 78px;
}

.po-print-table th:nth-child(2) {
  width: 25%;
}

.po-print-table th:nth-child(3) {
  width: 22%;
}

.print-en,
.po-print-summary em,
.print-signatures span {
  font-size: 1em;
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
}

.po-print-summary {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.po-print-summary div {
  border: 1px solid #111827;
  padding: 6px;
}

.po-print-summary span,
.po-print-summary strong {
  display: block;
}

@media (max-width: 900px) {
  .po-modal-panel .po-form-grid,
  .po-total-grid,
  .quote-detail-summary,
  .quote-detail-meta-grid,
  .quote-selected-grid,
  .control-summary-grid,
  .approval-meta-grid {
    grid-template-columns: 1fr;
  }

  .quote-detail-header,
  .quote-selected-main,
  .approval-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-header-side,
  .quote-selected-total {
    align-items: flex-start;
    text-align: left;
  }

  .quote-header-badges {
    justify-content: flex-start;
  }

  .quote-detail-total-box {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.supplier-module {
  display: grid;
  gap: 10px;
}

.supplier-main-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  overflow-x: auto;
}

.supplier-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
}

.supplier-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-height: 74px;
}

.supplier-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.supplier-metric strong {
  color: var(--brand);
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.supplier-metric.good strong {
  color: #15803d;
}

.supplier-metric.info strong {
  color: #1d4ed8;
}

.supplier-metric.warning strong {
  color: #b45309;
}

.supplier-metric.danger strong {
  color: #b91c1c;
}

.supplier-overview-grid,
.supplier-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.supplier-command-center {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .55fr);
}

.supplier-command-main,
.supplier-decision-panel,
.supplier-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  min-width: 0;
  padding: 14px;
}

.supplier-command-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.supplier-command-head h2,
.supplier-decision-panel h2,
.supplier-panel h2 {
  font-size: 16px;
  margin: 0;
}

.supplier-command-head p,
.supplier-panel p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.supplier-command-actions,
.supplier-lens-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplier-command-actions {
  justify-content: flex-end;
}

.supplier-command-metrics {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  margin-top: 12px;
}

.supplier-lens-bar {
  align-items: center;
  margin-top: 12px;
}

.supplier-decision-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.supplier-decision-list article {
  border: 1px solid var(--line);
  border-left: 4px solid var(--prestec-orange);
  border-radius: 8px;
  padding: 10px 12px;
}

.supplier-decision-list strong {
  color: #111827;
  display: block;
  font-size: 24px;
  line-height: 1;
}

.supplier-decision-list span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
}

.supplier-dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .55fr);
  margin-top: 12px;
}

.supplier-dashboard-grid .supplier-panel.wide {
  grid-column: 1 / -1;
}

.supplier-panel .compact-data-table {
  margin-top: 10px;
}

.supplier-alert-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.supplier-alert-list > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.supplier-alert-list strong {
  color: #111827;
  font-size: 12px;
}

.supplier-alert-list span,
.supplier-capability-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.supplier-alert-list small {
  justify-self: start;
}

.supplier-capability-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-top: 10px;
}

.supplier-capability-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 92px;
  padding: 11px 12px;
}

.supplier-capability-grid strong {
  color: #111827;
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.supplier-subview-toolbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 12px 14px;
}

.supplier-subview-toolbar h2 {
  font-size: 16px;
  margin: 0;
}

.supplier-subview-toolbar p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.supplier-filter-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.supplier-quote-workspace {
  padding: 10px;
}

.quote-heading {
  margin-bottom: 10px;
}

.quote-filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.quote-filter-panel input,
.quote-filter-panel select {
  min-width: 0;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.quick-filter {
  border: 1px solid #cfd8e3;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.quick-filter.active {
  border-color: #ff4f24;
  color: #ff4f24;
  background: #fff4ef;
}

.supplier-quote-table-wrap {
  max-height: calc(100vh - 345px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  width: 100%;
}

.supplier-quote-table {
  font-size: 12px;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.supplier-quote-table th,
.supplier-quote-table td {
  padding: 7px 6px;
  white-space: normal;
  word-break: break-word;
}

.supplier-quote-table th:nth-child(1) { width: 7%; }
.supplier-quote-table th:nth-child(2) { width: 8%; }
.supplier-quote-table th:nth-child(3) { width: 8%; }
.supplier-quote-table th:nth-child(4) { width: 4%; }
.supplier-quote-table th:nth-child(5) { width: 6%; }
.supplier-quote-table th:nth-child(6) { width: 4%; }
.supplier-quote-table th:nth-child(7) { width: 7%; }
.supplier-quote-table th:nth-child(8) { width: 6%; }
.supplier-quote-table th:nth-child(9) { width: 7%; }
.supplier-quote-table th:nth-child(10) { width: 6%; }
.supplier-quote-table th:nth-child(11) { width: 5%; }
.supplier-quote-table th:nth-child(12) { width: 7%; }
.supplier-quote-table th:nth-child(13) { width: 6%; }
.supplier-quote-table th:nth-child(14) { width: 19%; }
}

.supplier-quote-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e9eef3;
}

.supplier-quote-table tbody tr:hover {
  background: #fff7f3;
}

.quote-rfq-link {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.quote-rfq-link:hover,
.quote-rfq-link:focus-visible {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.supplier-quote-table td small {
  display: block;
  color: #667085;
  margin-top: 3px;
  font-weight: 500;
}

.supplier-quote-table .row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.supplier-quote-table .row-actions .button {
  font-size: 11px;
  min-width: 0;
  padding: 4px 5px;
  width: 100%;
}

.active-mini-button {
  background: #fff4ef;
  border-color: var(--prestec-orange);
  color: var(--prestec-orange);
}

.comparison-summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.warning-row {
  background: #fffaf0;
}

.best-cell,
.best-inline {
  color: #047857;
  font-weight: 800;
}

.supplier-quote-detail-panel {
  max-height: 92vh;
  overflow: auto;
  width: min(1080px, 96vw);
}

.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-list div {
  border-left: 3px solid #ff4f24;
  padding: 6px 8px;
  background: #f8fafc;
}

.timeline-list span {
  display: block;
  color: #667085;
  margin-top: 2px;
}

.status-pill.info {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.supplier-list-card .table-wrap {
  max-height: calc(100vh - 360px);
  min-height: 260px;
  overflow: auto;
}

.supplier-list-card .supplier-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.supplier-table th:nth-child(1) {
  width: 90px;
}

.supplier-table th:nth-child(2) {
  width: 240px;
}

.supplier-table th:nth-child(4) {
  width: 220px;
}

.supplier-table th:nth-child(6),
.supplier-table th:nth-child(10) {
  width: 120px;
}

.supplier-name-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  padding: 0;
  text-align: left;
}

.supplier-name-link:hover,
.supplier-name-link:focus-visible {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.compact-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compact-data-table th,
.compact-data-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.compact-data-table th {
  background: #eef2f7;
  font-weight: 800;
}

.supplier-rating {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  min-width: 32px;
  justify-content: center;
  padding: 2px 8px;
  font-weight: 800;
}

.supplier-rating.rating-a {
  color: #047857;
  background: #ecfdf5;
  border-color: #86efac;
}

.supplier-rating.rating-b {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.supplier-rating.rating-c,
.supplier-rating.rating-d,
.supplier-rating.rating-e {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.supplier-rating.rating-d,
.supplier-rating.rating-e {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.supplier-rating.rating-pending {
  color: #475569;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.supplier-evaluation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.supplier-evaluation-single {
  grid-template-columns: minmax(0, 1fr);
}

.supplier-evaluation-card {
  display: grid;
  gap: 6px;
}

.score-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  padding: 5px 0;
}

.score-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.total-score-row {
  border-bottom: 0;
  color: var(--prestec-orange);
  font-size: 14px;
}

.score-editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.score-editor-panel h3 {
  font-size: 14px;
  margin: 0;
}

.score-breakdown-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.score-breakdown-card h3 {
  font-size: 14px;
  margin: 0;
}

.supplier-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.supplier-detail-modal[hidden] {
  display: none;
}

.supplier-detail-panel {
  width: min(1120px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.supplier-detail-tabs {
  margin-bottom: 10px;
}

.supplier-detail-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.supplier-edit-form {
  display: grid;
  gap: 10px;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.supplier-edit-form label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.supplier-edit-form input,
.supplier-edit-form select,
.supplier-edit-form textarea {
  font: inherit;
}

.supplier-edit-form textarea {
  resize: vertical;
}

.full-textarea {
  min-height: 180px;
  width: 100%;
}

/* --- Cải tiến 3: Badge "Cần đánh giá" trong danh sách NCC --- */
.eval-needed-badge {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  color: #b45309;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 5px;
  vertical-align: middle;
  white-space: nowrap;
}

/* --- Cải tiến 4: Quick-action từ Cảnh báo --- */
.alert-quick-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.alert-quick-actions a.button {
  text-decoration: none;
}

/* --- Cải tiến 1: Bản đồ nguồn cung --- */
.supply-map-panel {
  overflow: visible;
}

.supply-map-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-top: 12px;
}

.supply-map-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  position: relative;
}

.supply-map-card.one-source {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
}

.supply-map-header {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.supply-map-header strong {
  color: #111827;
  font-size: 12px;
  line-height: 1.3;
}

.one-source-tag {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  white-space: nowrap;
}

.supply-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.supply-map-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.supply-chip {
  align-items: flex-start;
  appearance: none;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.supply-chip:hover {
  background: #fff7ed;
  border-color: var(--brand);
}

.supply-chip-name {
  color: #111827;
  font-size: 12px;
  font-weight: 600;
}

.supply-chip-risk {
  font-size: 10px;
}

.supply-map-risk-bar {
  border-radius: 0 0 4px 4px;
  bottom: 0;
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.supply-map-risk-bar.risk-thap { background: #86efac; }
.supply-map-risk-bar.risk-trung-binh { background: #fbbf24; }
.supply-map-risk-bar.risk-cao { background: #f87171; }

/* --- Cải tiến 2: Biểu đồ biến động giá --- */
.price-history-card {
  grid-column: 1 / -1;
}

.price-history-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 10px;
}

.price-trend-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.price-trend-item > strong {
  color: #111827;
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
}

.price-bars {
  display: grid;
  gap: 7px;
}

.price-bar-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(80px, 1.4fr) 1fr minmax(70px, auto);
}

.price-bar-label {
  color: #374151;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-bar-row.best .price-bar-label {
  color: #15803d;
  font-weight: 700;
}

.price-bar-track {
  background: #f3f4f6;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.price-bar-fill {
  background: #f4511e;
  border-radius: 4px;
  height: 100%;
}

.price-bar-row.best .price-bar-fill {
  background: #15803d;
}

.price-bar-value {
  color: #6b7280;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.price-spread {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 8px;
}

.price-spread strong {
  color: #b45309;
}

/* ── Supplier single-view no-scroll layout ──────────────────────────────── */

.supplier-single-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: visible;
}

.supplier-kpi-strip {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.supplier-kpi-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.supplier-kpi-pill {
  appearance: none;
  background: #fff;
  color: var(--text);
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font: inherit;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.supplier-kpi-pill strong {
  color: var(--brand);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.supplier-kpi-pill span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

button.supplier-kpi-pill {
  cursor: pointer;
}

button.supplier-kpi-pill:hover {
  border-color: #94a3b8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.supplier-kpi-pill.kpi-good { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.supplier-kpi-pill.kpi-good strong { color: #15803d; }
.supplier-kpi-pill.kpi-info { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.supplier-kpi-pill.kpi-info strong { color: #1d4ed8; }
.supplier-kpi-pill.kpi-warning { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.supplier-kpi-pill.kpi-warning strong { color: #b45309; }
.supplier-kpi-pill.kpi-danger { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.supplier-kpi-pill.kpi-danger strong { color: #b91c1c; }

.supplier-lens-compact {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.supplier-lens-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-right: 2px;
}

.supplier-overview-panels {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: auto;
  overflow: visible;
}

.supplier-overview-panels.supplier-overview-wide {
  grid-template-columns: minmax(0, 1fr);
}

.supplier-panel-scrollable {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.supplier-panel-scrollable .panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  justify-content: space-between;
  padding: 9px 12px;
}

.supplier-panel-scrollable .panel-head h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.panel-scroll-content {
  min-height: 0;
  overflow: visible;
  padding: 10px 12px 12px;
}

.supplier-dashboard-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.supplier-dashboard-table-wrap .compact-data-table {
  margin: 0;
}

.supplier-dashboard-empty {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  min-height: 72px;
  padding: 14px;
}

.supplier-view-switcher .button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.supplier-recommendation-card {
  display: grid;
  gap: 12px;
}

.recommendation-table th,
.recommendation-table td {
  min-width: 110px;
}

.recommendation-table th:nth-child(2),
.recommendation-table td:nth-child(2),
.recommendation-table th:nth-child(4),
.recommendation-table td:nth-child(4),
.recommendation-table th:nth-child(11),
.recommendation-table td:nth-child(11) {
  min-width: 180px;
}

.recommendation-breakdown {
  margin-top: 4px;
}

.recommendation-breakdown summary {
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.recommendation-breakdown div {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.recommendation-choice-panel {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  min-width: 320px;
  padding: 10px;
}

.supplier-rfq-info {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin: 8px 0 10px;
  padding: 10px 12px;
}

.supplier-rfq-info.empty {
  color: var(--muted);
}

.supplier-control-warning {
  background: #fffbeb;
  border-color: #f59e0b;
}

.supplier-control-restricted,
.supplier-control-blocked {
  background: #fef2f2;
  border-color: #ef4444;
}

.supplier-rfq-badges,
.supplier-rfq-warnings {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.supplier-control-fields {
  background: #fff7ed;
  border: 1px solid #fb923c;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px 12px;
}

.supplier-control-fields.hidden {
  display: none;
}

.supplier-control-fields label {
  display: grid;
  gap: 4px;
}

.supplier-control-help {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.quote-comparison-panel {
  display: grid;
  gap: 18px;
  margin-top: 0;
  min-height: 0;
}

.quote-comparison-panel .section-title-row {
  align-items: flex-start;
  border-bottom: 0;
  margin-bottom: 12px;
  min-width: 0;
  padding-bottom: 0;
}

.quote-comparison-panel .section-title-row h2,
.approval-card .section-title-row h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.quote-comparison-panel .section-title-row p,
.approval-card .section-title-row p {
  color: var(--muted);
  margin: 0;
}

.control-summary-card {
  border-left: 4px solid var(--success);
}

.control-summary-card.supplier-control-warning {
  border-left-color: var(--warning);
}

.control-summary-card.supplier-control-restricted,
.control-summary-card.supplier-control-blocked {
  border-left-color: var(--danger);
}

.control-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 10px;
}

.control-reason-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.control-reason-list li {
  line-height: 1.45;
}

.quote-comparison-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0;
  width: 100%;
}

.quote-comparison-table {
  min-width: 1080px;
  margin: 0;
}

.quote-comparison-table th,
.quote-comparison-table td {
  vertical-align: top;
}

.quote-comparison-panel .selected-row {
  background: #f0fdfa;
  box-shadow: inset 3px 0 0 var(--success);
}

.quote-comparison-panel .lowest-price-row:not(.selected-row) {
  background: #f8fafc;
  box-shadow: inset 3px 0 0 #94a3b8;
}

.quote-selection-reason-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 0;
}

.quote-selection-reason-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quote-selection-reason-grid textarea,
.quote-selection-reason-grid select,
.approval-note-field textarea {
  width: 100%;
}

.quote-reason-readout {
  align-content: start;
  display: grid;
  gap: 8px;
}

.approval-card {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.approval-reason-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.approval-note-field {
  display: grid;
  gap: 5px;
  font-weight: 800;
}

.approval-note-field textarea[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.approval-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding-top: 10px;
}

.quote-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.payables-panel {
  display: grid;
  gap: 14px;
  overflow: visible;
  padding-bottom: 28px;
}

.payables-view-tabs {
  justify-content: flex-start;
}

.payables-view-panel {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.payment-requests-panel {
  display: grid;
  gap: 12px;
  overflow: visible;
}

.payable-summary-grid,
.payable-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.payable-summary-grid div,
.payable-detail-grid div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.payable-summary-grid div.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.payable-summary-grid span,
.payable-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payable-summary-grid strong,
.payable-detail-grid strong {
  font-size: 16px;
}

.payable-filter-bar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(130px, 1fr)) auto;
}

.payable-filter-bar input,
.payable-filter-bar select {
  min-width: 0;
}

.payable-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.payables-panel .table-wrap,
.payment-requests-panel .table-wrap,
.table-scroll-x {
  max-height: none;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.payable-table-wrap table {
  min-width: 1120px;
}

.payable-overdue-row {
  background: #fff7ed;
}

.payable-modal-panel {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  width: min(1080px, calc(100vw - 36px));
}

.payable-modal-panel .form-grid label {
  display: grid;
  gap: 4px;
}

@media (max-width: 1100px) {
  .payable-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.supplier-recommendation-list {
  display: grid;
  gap: 8px;
}

.supplier-recommendation-option {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.alert-item {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
}

.alert-item:last-child { border-bottom: none; }

.alert-item strong { font-size: 12px; }
.alert-item span { color: var(--muted); font-size: 12px; }

.risk-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  justify-content: space-between;
  padding: 5px 0;
}

.risk-item:last-child { border-bottom: none; }
.risk-item span:first-child { font-size: 12px; }

.panel-subsection-head {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin: 8px 0 4px;
  padding-top: 8px;
  text-transform: uppercase;
}

.panel-subsection-head:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.decision-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}

.decision-stat {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  text-align: center;
}

.decision-stat strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.decision-stat span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-top: 3px;
}

.capability-item {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 0;
}

.capability-item:last-child { border-bottom: none; }
.capability-item strong { font-size: 12px; }
.capability-item span { color: var(--muted); font-size: 11px; }

.supplier-empty-hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 12px;
  text-align: center;
}

.empty-hero-icon { font-size: 36px; line-height: 1; }

.supplier-empty-hero p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.supplier-subtab-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 0 8px;
}

@media (max-width: 1180px) {
  .quote-filter-panel {
    grid-template-columns: 1fr;
  }

  .supplier-metrics,
  .supplier-overview-panels,
  .supplier-overview-grid,
  .supplier-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supplier-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .supplier-metrics,
  .supplier-overview-panels,
  .supplier-overview-grid,
  .supplier-report-grid,
  .supplier-evaluation-grid,
  .supplier-filter-grid,
  .quote-filter-panel {
    grid-template-columns: 1fr;
  }
}

.request-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.request-picker .field {
  position: relative;
}

.request-picker-hint {
  color: #64748b;
  font-size: 13px;
  margin: -4px 0 10px;
}

.request-inventory-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 10px;
  padding: 9px 11px;
}

.request-item-source-badge {
  white-space: nowrap;
}

.request-item-trace-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
  white-space: nowrap;
}

.inventory-item-request-panel {
  margin: 12px 0;
}

.inventory-item-request-panel .section-heading-row p {
  color: #64748b;
  margin: 4px 0 0;
}

.inventory-item-request-table td {
  vertical-align: top;
}

.inventory-item-request-table th:nth-child(2),
.inventory-item-request-table td:nth-child(2) {
  min-width: 220px;
}

.inventory-item-request-table th:nth-child(4),
.inventory-item-request-table td:nth-child(4) {
  min-width: 180px;
  max-width: 260px;
}

.inventory-request-subline,
.inventory-review-summary {
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.inventory-status-note {
  color: #64748b;
  display: block;
  line-height: 1.35;
  margin-top: 5px;
}

.inventory-review-summary {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.inventory-review-summary div + div {
  margin-top: 4px;
}

.inventory-review-modal-card {
  width: min(620px, calc(100vw - 32px));
}

.inventory-duplicate-check {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  margin: 12px 0;
  padding: 12px;
}

.inventory-duplicate-check h3 {
  color: #78350f;
  font-size: 15px;
  margin: 0 0 8px;
}

.inventory-duplicate-state,
.inventory-duplicate-keyword {
  color: #64748b;
  font-size: 13px;
}

.inventory-duplicate-warning {
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.inventory-duplicate-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.inventory-duplicate-item {
  background: #fff;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.inventory-duplicate-item > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-duplicate-item small {
  color: #64748b;
}

.inventory-duplicate-item .mini-button {
  justify-self: start;
}

.inventory-reorder-panel {
  margin: 12px 0;
}

.inventory-reorder-panel .section-heading-row p {
  color: #64748b;
  margin: 4px 0 0;
}

.inventory-reorder-summary {
  margin: 12px 0;
}

.inventory-reorder-info-strip {
  background: #f8fafc;
  border: 1px solid var(--prestec-ui-border, #d7dde3);
  border-left: 3px solid var(--prestec-ui-info, #1d4ed8);
  border-radius: 6px;
  color: var(--prestec-ui-text-secondary, #475569);
  font-size: 12px;
  line-height: 1.35;
  margin: 6px 0 8px;
  padding: 7px 10px;
}

.inventory-reorder-summary-pilot {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin: 6px 0 8px;
}

.inventory-reorder-summary-card {
  background: #fff;
  border: 1px solid var(--prestec-ui-border, #d7dde3);
  border-radius: 6px;
  min-height: 50px;
  padding: 7px 9px;
}

.inventory-reorder-summary-card span {
  color: var(--prestec-ui-text-secondary, #475569);
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
}

.inventory-reorder-summary-card strong {
  color: var(--prestec-ui-text, #1a1a1a);
  display: block;
  font-size: 19px;
  line-height: 1.1;
  margin-top: 3px;
}

.inventory-reorder-summary-card--danger {
  border-top: 2px solid #dc2626;
}

.inventory-reorder-summary-card--warning {
  border-top: 2px solid #f59e0b;
}

.inventory-reorder-summary-card--info {
  border-top: 2px solid #2563eb;
}

.inventory-reorder-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(160px, .8fr) auto;
  margin: 10px 0 12px;
}

.inventory-reorder-filter-pilot {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin: 8px 0;
}

.inventory-reorder-filter-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1.35fr) minmax(170px, 1fr) minmax(150px, .8fr) minmax(170px, .9fr);
}

.inventory-reorder-filter-pilot input,
.inventory-reorder-filter-pilot select {
  border-color: var(--prestec-ui-border, #d7dde3);
  height: 32px;
  padding: 0 8px;
}

.inventory-reorder-filter-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}

.inventory-reorder-filter-actions .button {
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.inventory-reorder-alert-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-width: 100%;
  width: min(100%, calc(100vw - 320px));
}

.inventory-reorder-alert-head,
.inventory-reorder-alert-row {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: 118px minmax(270px, 1fr) 180px 190px 150px;
  width: 100%;
}

.inventory-reorder-alert-head {
  color: var(--prestec-ui-text-secondary, #475569);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0;
  padding: 0 10px;
  text-transform: uppercase;
}

.inventory-reorder-alert-row {
  background: #fff;
  border: 1px solid var(--prestec-ui-border, #d7dde3);
  border-radius: 6px;
  padding: 9px 10px;
}

.inventory-reorder-alert-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.inventory-reorder-alert-status {
  display: grid;
  gap: 4px;
  justify-items: start;
  align-content: start;
}

.inventory-reorder-priority-cell {
  min-width: 0;
}

.inventory-reorder-alert-item,
.inventory-reorder-alert-stock,
.inventory-reorder-alert-buying,
.inventory-reorder-action-cell {
  border-left: 1px solid #eef2f7;
  min-width: 0;
  padding-left: 10px;
}

.inventory-reorder-alert-item {
  display: grid;
  gap: 2px;
  align-content: start;
}

.inventory-reorder-alert-stock,
.inventory-reorder-alert-buying {
  display: grid;
  gap: 5px;
  align-content: start;
}

.inventory-reorder-cell-label {
  color: var(--prestec-ui-text-secondary, #475569);
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.inventory-reorder-number {
  color: var(--prestec-ui-text, #1a1a1a);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
  text-align: right;
}

.inventory-reorder-number--stock {
  color: var(--prestec-ui-danger, #b91c1c);
  font-size: 18px;
}

.inventory-reorder-stock-main,
.inventory-reorder-buying-row {
  align-items: baseline;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

.inventory-reorder-net-cell strong {
  color: var(--prestec-ui-danger, #b91c1c);
  font-size: 16px;
  text-align: right;
}

.inventory-reorder-alert-buying .inventory-reorder-number {
  justify-self: end;
}

.inventory-reorder-buying-row--muted {
  color: var(--prestec-ui-text-secondary, #475569);
  font-size: 11px;
}

.inventory-reorder-buying-row--muted strong {
  color: var(--prestec-ui-text, #1a1a1a);
  font-weight: 800;
}

.inventory-reorder-threshold-grid {
  display: grid;
  gap: 3px 8px;
  grid-template-columns: repeat(2, minmax(70px, 1fr));
  line-height: 1.2;
}

.inventory-reorder-threshold-grid span {
  align-items: baseline;
  color: var(--prestec-ui-text-secondary, #475569);
  display: grid;
  font-size: 11px;
  gap: 4px;
  grid-template-columns: 1fr auto;
  white-space: nowrap;
}

.inventory-reorder-threshold-grid em {
  font-style: normal;
}

.inventory-reorder-threshold-grid strong {
  color: var(--prestec-ui-text, #1a1a1a);
  font-weight: 800;
}

.inventory-reorder-action-stack {
  align-items: stretch;
  display: grid;
  gap: 5px;
  justify-content: stretch;
  min-width: 0;
  width: 100%;
}

.inventory-reorder-action-stack .button {
  height: 28px;
  justify-content: center;
  padding: 0 8px;
  white-space: nowrap;
  width: 100%;
}

.inventory-reorder-action--primary {
  background: var(--prestec-ui-accent, #f35b27);
  border-color: var(--prestec-ui-accent, #f35b27);
  color: #fff;
}

.inventory-reorder-action--manual {
  border-color: #fed7aa;
  color: var(--prestec-ui-warning, #b45309);
  font-size: 11px;
}

.inventory-reorder-action--primary-config {
  background: var(--prestec-ui-accent, #f35b27);
  border-color: var(--prestec-ui-accent, #f35b27);
  color: #fff;
}

.inventory-reorder-action--muted {
  opacity: .72;
}

.inventory-reorder-table-wrap-v3 {
  margin-top: 8px;
  max-width: 100%;
  overflow-x: auto;
  width: min(100%, calc(100vw - 320px));
}

.inventory-reorder-table-v3 {
  min-width: 1020px;
  table-layout: fixed;
  width: 100%;
}

.inventory-reorder-table-v3 th,
.inventory-reorder-table-v3 td {
  vertical-align: middle;
}

.inventory-reorder-table-v3 th {
  white-space: nowrap;
}

.inventory-reorder-table-v3 td {
  padding-bottom: 7px;
  padding-top: 7px;
}

.inventory-reorder-alert-col {
  width: 112px;
}

.inventory-reorder-item-col {
  width: 26%;
}

.inventory-reorder-stock-col {
  width: 76px;
}

.inventory-reorder-open-col {
  width: 92px;
}

.inventory-reorder-net-col {
  width: 114px;
}

.inventory-reorder-threshold-col {
  width: 154px;
}

.inventory-reorder-action-col {
  width: 206px;
}

.inventory-reorder-table-v3 .inventory-reorder-action-col,
.inventory-reorder-table-v3 .inventory-reorder-action-cell {
  right: 0;
}

.inventory-reorder-table-v3 td.inventory-reorder-alert-status {
  display: table-cell;
}

.inventory-reorder-table-v3 .inventory-reorder-alert-status .prestec-badge {
  display: table;
  margin-bottom: 4px;
}

.inventory-reorder-table-v3 .inventory-reorder-alert-status .prestec-badge:last-child {
  margin-bottom: 0;
}

.inventory-reorder-table-v3 td.inventory-reorder-alert-item {
  border-left: 0;
  display: table-cell;
  padding-left: 0;
}

.inventory-reorder-table-v3 .inventory-reorder-alert-item strong {
  color: var(--prestec-ui-accent-dark, #c63a15);
  font-size: 12.5px;
}

.inventory-reorder-table-v3 .inventory-reorder-alert-item span {
  color: var(--prestec-ui-text, #1a1a1a);
  font-weight: 700;
}

.inventory-reorder-table-v3 td.inventory-reorder-stock-cell,
.inventory-reorder-table-v3 td.inventory-reorder-open-cell,
.inventory-reorder-table-v3 td.inventory-reorder-net-cell {
  text-align: right;
}

.inventory-reorder-table-v3 .inventory-reorder-number--stock {
  font-size: 15px;
}

.inventory-reorder-table-v3 .inventory-reorder-net-cell strong {
  font-size: 15px;
}

.inventory-reorder-open-cell .workflow-status,
.inventory-reorder-net-cell .workflow-status {
  margin-top: 3px;
}

.inventory-reorder-threshold-cell {
  color: var(--prestec-ui-text-secondary, #475569);
}

.inventory-reorder-table-v3 .inventory-reorder-threshold-grid {
  grid-template-columns: repeat(2, minmax(68px, 1fr));
}

.inventory-reorder-system-suggest {
  display: block;
  margin-top: 3px;
}

.inventory-reorder-table-v3 td.inventory-reorder-action-cell {
  background: #fff;
  display: table-cell;
  min-width: 0;
  padding-left: 8px;
  text-align: right;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  width: 100%;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .button {
  border-radius: 6px;
  font-weight: 700;
  height: 31px;
  line-height: 1;
  min-width: 76px;
  padding: 0 10px;
  width: auto;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .button.secondary:not(.inventory-reorder-action--primary):not(.inventory-reorder-action--primary-config):not(.inventory-reorder-action--manual) {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
  min-width: 74px;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .button.inventory-reorder-action--primary {
  background: var(--prestec-ui-accent, #f35b27);
  border-color: var(--prestec-ui-accent, #f35b27);
  box-shadow: 0 1px 2px rgba(180, 83, 9, .18);
  color: #fff;
  min-width: 112px;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .button.inventory-reorder-action--primary:hover {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .button.inventory-reorder-action--primary-config {
  background: var(--prestec-ui-accent, #f35b27);
  border-color: var(--prestec-ui-accent, #f35b27);
  box-shadow: 0 1px 2px rgba(180, 83, 9, .14);
  color: #fff;
  min-width: 78px;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .button.inventory-reorder-action--manual {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
  font-size: 11px;
  font-weight: 700;
  min-width: 108px;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .prestec-badge {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 700;
  min-height: 31px;
  padding: 0 10px;
  white-space: nowrap;
}

.inventory-reorder-table-v3 .inventory-reorder-action-stack .prestec-badge--completed {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
}

@media (max-width: 900px) {
  .inventory-reorder-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) {
  .inventory-reorder-summary-pilot {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .inventory-reorder-filter-pilot {
    grid-template-columns: 1fr;
  }

  .inventory-reorder-filter-actions {
    justify-content: flex-start;
  }

  .inventory-reorder-alert-head,
  .inventory-reorder-alert-row {
    grid-template-columns: 108px minmax(235px, 1fr) 166px 174px 144px;
  }
}

.request-project-field {
  position: relative;
}

.request-project-field[hidden] {
  display: none !important;
}

.project-customer-field {
  position: relative;
}

.project-machine-field {
  position: relative;
}

.suggestion-field {
  position: relative;
}

.suggestion-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: grid;
  left: 0;
  max-height: 220px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 15;
}

.suggestion-list:empty {
  display: none;
}

.suggestion-list button {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  text-align: left;
}

.suggestion-list button:hover {
  background: #fff8f4;
}

.suggestion-list strong {
  color: var(--prestec-orange);
  font-size: 12px;
}

.suggestion-list span {
  color: var(--muted);
  font-size: 12px;
}

.suggestion-list .request-item-suggestion {
  align-items: flex-start;
}

.suggestion-list small {
  color: #64748b;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.machine-picker-selected {
  align-content: flex-start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-height: 42px;
  padding: 6px;
}

.machine-picker-chip {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  max-width: 100%;
  padding: 5px 7px 5px 10px;
}

.machine-picker-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-picker-chip button {
  align-items: center;
  background: #fff3ee;
  border: 1px solid #ffd5c6;
  border-radius: 999px;
  color: var(--prestec-orange);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  line-height: 1;
  width: 20px;
}

.machine-picker-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 4px;
}

.request-custom-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1fr) 80px 90px minmax(160px, 1fr) auto;
}

.request-custom-grid input {
  min-width: 0;
}

.request-thumb {
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: zoom-in;
  height: 36px;
  object-fit: cover;
  width: 48px;
}

.image-modal {
  align-items: center;
  background: rgba(0, 0, 0, .72);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: fixed;
  z-index: 120;
}

.image-modal.open {
  display: flex;
}

.image-modal img {
  background: #fff;
  border-radius: 6px;
  max-height: 88vh;
  max-width: 88vw;
  object-fit: contain;
}

.image-modal button {
  background: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 24px;
  height: 36px;
  position: absolute;
  right: 24px;
  top: 20px;
  width: 36px;
}

.document-side .table-wrap {
  max-height: calc(100vh - 220px);
}

.card {
  min-height: 0;
}

.document-main > .card {
  overflow-x: hidden;
  overflow-y: auto;
}

.request-layout .document-main {
  grid-template-rows: auto minmax(0, 1fr);
}

.request-layout .request-info-card {
  overflow: visible;
}

.document-main > .card:nth-child(2) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.document-main > .card:nth-child(2) .actions {
  flex: 0 0 auto;
}

.document-main > .card.document-items-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.handover-layout {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  height: auto;
  overflow: visible;
}

.handover-layout .document-main {
  grid-template-rows: auto auto;
  overflow: visible;
}

.handover-layout.is-create-closed .document-main {
  display: none;
}

.handover-layout.is-create-closed .document-side {
  grid-column: 1;
}

.handover-layout.is-create-open {
  display: block;
}

.handover-layout.is-create-open::before {
  background: rgba(15, 23, 42, .42);
  content: "";
  inset: 0;
  position: fixed;
  z-index: 120;
}

.handover-layout.is-create-open .document-main {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  inset: 24px;
  margin: 0 auto;
  max-width: 1180px;
  overflow: hidden;
  padding: 16px 18px 0;
  position: fixed;
  width: min(1180px, calc(100vw - 48px));
  z-index: 121;
}

.handover-layout.is-create-open .document-side {
  display: none;
}

.handover-create-modal-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.handover-create-modal-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.handover-layout .document-main > .card:first-child {
  overflow: visible;
}

.handover-layout .document-main > .card.document-items-card {
  min-height: 0;
  overflow: visible;
}

.handover-layout #handoverSelected {
  max-height: none;
}

.handover-layout .document-side {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: visible;
}

.handover-layout .document-side > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.handover-layout .document-side .table-wrap {
  flex: 1 1 auto;
  max-height: 360px;
  min-height: 220px;
  overflow: auto;
}

.handover-layout #handoverHistoryList {
  max-height: clamp(260px, 42vh, 520px);
  min-height: 0;
}

.handover-layout #handoverHistoryList .history-list {
  align-content: start;
}

.handover-workspace-notice {
  background: #ecfdf3;
  border: 1px solid #9ae6b4;
  border-radius: 6px;
  color: #166534;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.handover-item-search {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
}

.handover-item-search label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.handover-item-search label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.handover-item-search input {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 36px;
  padding: 0 10px;
  width: 100%;
}

.handover-item-search-results {
  display: grid;
  gap: 6px;
}

.handover-item-search-row {
  align-items: center;
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 10px;
  text-align: left;
}

.handover-item-search-row:hover:not(:disabled),
.handover-item-search-row:focus-visible {
  border-color: var(--prestec-orange);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, .14);
  outline: none;
}

.handover-item-search-row:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.handover-item-search-row strong,
.handover-item-search-row small {
  display: block;
}

.handover-create-actions {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 16px rgba(15, 23, 42, .06);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 8px -14px 0;
  padding: 10px 14px 0;
}

.handover-action-note {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 2px;
  line-height: 1.35;
  margin-right: auto;
  max-width: 360px;
}

.handover-action-note strong {
  color: var(--text);
  font-size: 13px;
}

.side-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  align-self: start;
}

.selected-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.selected-item {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.selected-item strong {
  font-size: 13px;
}

.selected-item input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
}

.history-list {
  display: grid;
  gap: 6px;
  padding: 6px;
}

.history-filter {
  border: 1px solid var(--line);
  border-radius: 5px;
  height: 34px;
  margin: 6px 6px 4px;
  padding: 0 10px;
  width: calc(100% - 12px);
}

.history-date-filter {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
  margin: 0 6px 6px;
}

.history-date-filter input {
  border: 1px solid var(--line);
  border-radius: 5px;
  height: 32px;
  min-width: 0;
  padding: 0 8px;
}

.request-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-grid div,
.detail-note,
.approval-line {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 34px 9px 10px;
}

.detail-grid span,
.detail-note span,
.approval-line span,
.approval-line small {
  color: var(--muted);
  display: block;
  font-size: 11px;
}

.detail-grid strong,
.approval-line strong {
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.approval-line em {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  margin-top: 7px;
  padding: 2px 8px;
}

.detail-note {
  margin-top: 8px;
}

.detail-note p {
  margin: 5px 0 0;
}

.approval-stack {
  display: grid;
  gap: 14px;
}

.approval-line {
  position: relative;
}

.approval-stack.flow-stack .approval-line::after {
  bottom: -18px;
  color: #9aa8b3;
  content: "↓";
  font-size: 22px;
  font-weight: 900;
  left: 50%;
  line-height: 1;
  position: absolute;
  transform: translateX(-50%);
  z-index: 1;
}

.approval-stack.flow-stack .approval-line:last-child::after {
  display: none;
}

.approval-line.approved {
  background: #f0fdf4;
  border-color: #86efac;
}

.approval-line.approved em,
.approval-stack.flow-stack .approval-line.approved::after {
  color: #15803d;
}

.approval-line.waiting {
  background: #fffbeb;
  border-color: #facc15;
}

.approval-line.waiting em,
.approval-stack.flow-stack .approval-line.waiting::after {
  color: #a16207;
}

.approval-line.rejected {
  background: #fef2f2;
  border-color: #fca5a5;
}

.approval-line.rejected em,
.approval-stack.flow-stack .approval-line.rejected::after {
  color: #b91c1c;
}

.approval-line.upcoming {
  background: #f8fafc;
  border-color: #d7dee6;
}

.approval-line.upcoming em {
  color: #64748b;
}
.approval-reason {
  color: #b91c1c;
  font-weight: 700;
  margin-top: 6px;
}

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

.approval-select {
  min-height: 30px;
  min-width: 132px;
  padding: 4px 8px;
}

.request-workflow-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--prestec-orange);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
  margin: 10px 0 12px;
  padding: 12px;
}

.request-workflow-panel h3 {
  font-size: 14px;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.request-workflow-panel p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 10px;
}

.workflow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-step {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d7dee6;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
}

.workflow-step small {
  align-items: center;
  background: #e2e8f0;
  border-radius: 999px;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.workflow-step.done {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

.workflow-step.active {
  background: #fffbeb;
  border-color: #facc15;
  color: #92400e;
}

.workflow-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
}

.workflow-handoff-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.request-handover-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
  margin: 0 0 12px;
  padding: 12px;
}

.request-handover-preview__header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.request-handover-preview__header h3 {
  font-size: 14px;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.request-handover-preview__header p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.request-handover-preview__status {
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
}

.request-handover-preview__status.ready {
  background: #eff6ff;
  color: #1d4ed8;
}

.request-handover-preview__status.done {
  background: #f0fdf4;
  color: #15803d;
}

.request-handover-preview__status.blocked {
  background: #fef2f2;
  color: #b91c1c;
}

.request-handover-preview__table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}

.request-handover-preview__items {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 720px;
  width: 100%;
}

.request-handover-preview__items th,
.request-handover-preview__items td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.request-handover-preview__items th {
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
}

.request-handover-preview__items strong,
.request-handover-preview__items span,
.request-handover-preview__items small {
  display: block;
}

.request-handover-preview__items small {
  color: var(--muted);
  margin-top: 2px;
}

.request-handover-preview__items .number {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.request-handover-preview__error,
.request-handover-preview__blockers {
  color: #b91c1c;
  font-weight: 800;
}

.request-handover-preview__existing,
.request-handover-preview__blockers,
.request-handover-preview__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.workflow-assignee-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 32px;
  min-width: 220px;
  padding: 0 10px;
}

.workflow-assignee-picker {
  display: grid;
  gap: 8px;
  min-width: min(420px, 100%);
  position: relative;
}

.workflow-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-user-hint {
  color: var(--muted);
  font-size: 12px;
}

.workflow-user-option {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
}

.workflow-user-option.selected {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.workflow-user-option span {
  display: grid;
  gap: 1px;
}

.workflow-user-option strong {
  font-size: 12px;
}

.workflow-user-option small {
  color: var(--muted);
  font-size: 10px;
}

.workflow-user-suggestions {
  left: 0;
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 8;
}

.approval-undo {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--prestec-orange);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  margin-left: 6px;
  padding: 0;
  vertical-align: middle;
  width: 22px;
}

.approval-undo:hover {
  border-color: var(--prestec-orange);
  background: #fff8f4;
}

.mini-button {
  min-height: 28px;
  padding: 5px 10px;
}

.inventory-merge-row-button {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
  min-width: 50px;
}

.inventory-merge-row-button.is-enabled {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, .24);
}

.inventory-merge-row-button.is-enabled:hover,
.inventory-merge-row-button.is-enabled:focus-visible {
  border-color: #1e40af;
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.inventory-merge-row-button:disabled,
.inventory-merge-row-button.is-disabled {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

.editing-row {
  background: #fff8f4;
}

.history-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 6px;
  align-items: stretch;
}

.history-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}

.history-row-actions .button {
  min-height: 30px;
  padding: 5px 10px;
}

.history-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 8px;
  text-align: left;
  font: inherit;
}

.history-item:hover,
.history-item:focus-visible {
  border-color: var(--prestec-orange);
  background: #fff8f4;
}

.history-main,
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-main strong {
  color: var(--prestec-orange);
  font-size: 12px;
}

.history-main span,
.history-line,
.history-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.history-line {
  overflow-wrap: anywhere;
  white-space: normal;
}

.history-meta .badge {
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
}

.mini-badge.muted-badge {
  background: #eef2f7;
  color: #475569;
}

.mini-badge.warning-badge {
  background: #fff7ed;
  color: #c2410c;
}

.permission-toggles {
  display: grid;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.permission-toggles label {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 16px minmax(0, 1fr);
  line-height: 1.25;
  white-space: normal;
}

.permission-toggles span {
  display: block;
  overflow-wrap: normal;
  word-break: normal;
}

.permission-toggles input {
  height: 14px;
  width: 14px;
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(16, 24, 40, .32);
  z-index: 10;
}

.drawer.open {
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(720px, 100vw);
  height: 100%;
  overflow: auto;
  background: #fff;
  padding: 24px;
  box-shadow: -8px 0 24px rgba(16, 24, 40, .18);
}

.wide-drawer {
  width: min(1040px, 100vw);
}

.search {
  min-width: 280px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
}

.inventory-table-wrap {
  max-height: calc(100vh - 222px);
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 7px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.inventory-table {
  table-layout: fixed;
  font-size: 11px;
}

.inventory-table th,
.inventory-table td {
  padding: 5px 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 10px;
  background: #eef1f4;
  color: var(--ink);
}

.sort-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-transform: none;
}

.sort-button:hover {
  color: var(--prestec-orange);
}

.new-item-row td {
  background: #fff8f4;
  border-bottom: 2px solid var(--prestec-orange);
}

.new-item-row .save-new-item {
  width: 100%;
  height: 28px;
  padding: 0 6px;
}

.icon-toolbar-button {
  min-width: 40px;
  width: auto;
  padding: 0 11px;
}

.icon-actions {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  gap: 4px;
  align-items: center;
}

.admin-row-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--prestec-orange);
  color: var(--prestec-orange);
  background: #fff7f2;
}

.icon-button.danger-button {
  color: var(--danger);
}

.icon-button.approve-button {
  color: var(--success);
}

.selection-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 3px;
}

.mini-button {
  min-width: 0;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  padding: 0 3px;
}

.mini-button:hover {
  border-color: var(--prestec-orange);
  color: var(--prestec-orange);
}

.muted-cell {
  color: var(--muted);
  font-style: italic;
}

.inventory-table .filter-row th {
  top: 28px;
  padding: 3px 4px;
  background: #f8fafc;
}

.inventory-table .filter-row input,
.inventory-table .filter-row select,
.inventory-table .cell-edit {
  width: 100%;
  min-width: 0;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  background: #fff;
  font-size: 10.5px;
}

.inventory-table .quantity-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.inventory-table .quantity-filter input,
.inventory-table .quantity-filter select {
  height: 22px;
}

.inventory-table .empty-table-row td {
  height: 58px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
  background: #fff;
}

.inventory-table .cell-edit {
  height: auto;
  min-height: 24px;
}

.inventory-table .cell-edit.number {
  text-align: right;
}

.inventory-table .col-block,
.inventory-table .col-_selected,
.inventory-table .col-_actions,
.inventory-table .col-groupCode,
.inventory-table .col-nameCode,
.inventory-table .col-codeSeq,
.inventory-table .col-unit,
.inventory-table .col-rack,
.inventory-table .col-actualQty,
.inventory-table .col-unitPrice,
.inventory-table .col-totalValue {
  width: 4.8%;
}

.inventory-table .col-_selected {
  width: 3%;
}

.inventory-table .col-_actions {
  width: 5%;
}

.inventory-table .col-stdCode,
.inventory-table .col-manufacturer,
.inventory-table .col-unitManager,
.inventory-table .col-managerUser,
.inventory-table .col-status {
  width: 6%;
}

.inventory-table .col-mainName {
  width: 10%;
}

.inventory-table .col-spec,
.inventory-table .col-note {
  width: 7%;
}

.inventory-topbar {
  margin-bottom: 12px;
}

.inventory-status {
  color: var(--muted);
  font-weight: 700;
}

.inventory-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.inventory-summary-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 70px;
  padding: 10px 12px;
  box-shadow: 0 4px 16px rgba(26, 26, 26, .04);
}

.inventory-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inventory-summary-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.inventory-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.inventory-view-tab {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

.inventory-view-tab.active {
  border-color: var(--prestec-orange);
  background: #fff7f2;
  color: var(--prestec-orange);
}

.inventory-view-panel[hidden] {
  display: none;
}

.inventory-filter-card {
  margin-bottom: 10px;
  padding: 10px;
}

.inventory-filter-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(110px, 1fr));
  gap: 8px;
  align-items: end;
}

.inventory-filter-grid label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.inventory-filter-grid input,
.inventory-filter-grid select {
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.inventory-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-list-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.inventory-list-table {
  min-width: 1040px;
}

.inventory-list-table th,
.inventory-list-table td {
  padding: 6px 7px;
  font-size: 11.5px;
  line-height: 1.25;
}

.inventory-list-table .inventory-column-filter-row th {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  padding: 4px 6px;
  vertical-align: top;
}

.inventory-column-filter-control {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  height: 26px;
  line-height: 1.2;
  min-width: 0;
  padding: 0 7px;
  width: 100%;
}

.inventory-column-filter-stack {
  display: grid;
  gap: 3px;
}

.inventory-column-filter-actions {
  align-items: flex-end;
  display: grid;
  gap: 3px;
  justify-items: end;
}

.inventory-column-filter-actions span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.inventory-column-filter-actions .mini-button {
  height: 24px;
  padding: 0 7px;
}

.inventory-list-table .col-_selected {
  width: 42px;
}

.inventory-list-table .col-stdCode {
  width: 142px;
}

.inventory-list-table .col-mainName {
  width: 165px;
}

.inventory-list-table .col-spec {
  width: 185px;
}

.inventory-list-table .col-unit,
.inventory-list-table .col-actualQty,
.inventory-list-table .col-status {
  width: 90px;
}

.inventory-list-table .col-rack {
  width: 130px;
}

.inventory-list-table .col-unitManager {
  width: 155px;
}

.inventory-list-table .col-_actions {
  width: 145px;
}

.inventory-code-structure {
  color: var(--muted);
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 2px;
}

.inventory-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inventory-row-actions .mini-button {
  height: 24px;
  padding: 0 7px;
}

.inventory-item-modal-card {
  max-width: 980px;
}

.inventory-item-modal-grid {
  display: grid;
  gap: 14px;
  max-height: min(72vh, 720px);
  overflow-y: auto;
  padding-right: 4px;
}

.inventory-item-modal-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.inventory-item-modal-grid h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.projects-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.project-topbar {
  margin-bottom: 0;
}

.project-top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.project-main,
.project-side {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.project-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.project-filter-card {
  padding: 10px;
}

.project-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, 1fr)) 130px 130px;
  gap: 8px;
}

.customer-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px);
  gap: 8px;
}

.project-filter-row input,
.project-filter-row select,
.customer-filter-row input,
.customer-filter-row select {
  height: 34px;
  min-width: 0;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.project-stats .card {
  padding: 10px;
}

.project-stats .stat-value {
  font-size: 24px;
}

.project-table-wrap {
  min-height: 0;
}

.project-table {
  font-size: 12px;
  table-layout: fixed;
  width: 100%;
}

.project-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.project-table th:nth-child(1),
.project-table td:nth-child(1) {
  width: 82px;
}

.project-table th:nth-child(2),
.project-table td:nth-child(2) {
  width: 24%;
}

.project-table th:nth-child(3),
.project-table td:nth-child(3) {
  width: 68px;
}

.project-table th:nth-child(4),
.project-table td:nth-child(4) {
  width: 13%;
}

.project-table th:nth-child(5),
.project-table td:nth-child(5) {
  width: 15%;
}

.project-table th:nth-child(6),
.project-table td:nth-child(6) {
  width: 95px;
}

.project-table th:nth-child(7),
.project-table td:nth-child(7) {
  width: 126px;
}

.project-table th:nth-child(8),
.project-table td:nth-child(8) {
  width: 118px;
}

.project-table th:nth-child(9),
.project-table td:nth-child(9) {
  width: 11%;
}

.project-table th:nth-child(10),
.project-table td:nth-child(10) {
  width: 8%;
}

.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
  width: 54px;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 22%;
}

.customer-table th:nth-child(5),
.customer-table td:nth-child(5),
.customer-table th:nth-child(6),
.customer-table td:nth-child(6),
.customer-table th:nth-child(7),
.customer-table td:nth-child(7) {
  width: 12%;
}

.project-table tbody tr {
  cursor: pointer;
}

.project-table tbody tr:hover td,
.project-table tbody tr.selected td {
  background: #fff8f4;
}

.project-list-table tbody tr {
  cursor: default;
}

.project-list-table tbody tr:hover td {
  background: inherit;
}

.project-list-table tbody tr.selected td {
  background: #fff8f4;
}

.project-name-cell {
  font-weight: 700;
}

.project-description-cell {
  color: var(--muted);
  line-height: 1.35;
}

.project-customer-cell {
  cursor: pointer;
}

.project-open-cell {
  cursor: pointer;
}

.project-open-cell:hover,
.project-customer-cell:hover {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.project-machine-cell {
  line-height: 1.35;
}

.project-machine-link {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: block;
  font: inherit;
  line-height: inherit;
  margin: 0 0 3px;
  padding: 0;
  text-align: left;
  white-space: normal;
  width: 100%;
  word-break: normal;
}

.project-machine-link:hover {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.project-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  max-width: 100%;
  padding: 3px 8px;
  white-space: normal;
}

.project-status.processing {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.project-status.paused {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.project-status.waiting {
  background: #fefce8;
  border-color: #fde68a;
  color: #a16207;
}

.project-status.done {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: var(--success);
}

.project-status.cancelled {
  background: #fff1f2;
  border-color: #fecdd3;
  color: var(--danger);
}

.project-side {
  display: block;
  overflow-y: auto;
}

.project-detail-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.project-detail-head h2 {
  border: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
  margin: 4px 0 0;
  padding: 0;
  text-transform: none;
}

.project-code {
  color: var(--prestec-orange);
  font-weight: 900;
}

.project-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.project-meta div {
  border-bottom: 1px solid #edf0f2;
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
}

.project-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.project-description p {
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.project-profile-page {
  display: grid;
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.project-profile-hero {
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 0;
  overflow: auto;
}

.project-profile-info {
  align-content: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 0;
}

.project-profile-info .customer-profile-info-item.wide {
  grid-column: span 1;
}

.project-profile-tabs {
  overflow-x: auto;
}

.project-profile-tabs button {
  min-width: 144px;
  padding: 8px 12px;
}

.project-tab-panel {
  display: none;
  min-height: 0;
  overflow: auto;
}

.project-tab-panel.active {
  display: block;
}

.project-tab-panel > .customer-profile-panel {
  min-height: 100%;
}

.project-inline-link {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.project-inline-link:hover {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.project-detail-empty {
  color: var(--muted);
  display: grid;
  gap: 6px;
  padding: 24px 10px;
  text-align: center;
}

.project-form textarea,
.project-form input {
  font: inherit;
}

.technical-forms-page {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.technical-forms-frame {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 100%;
  width: 100%;
}

th {
  background: #eef1f4;
  font-size: 12px;
  text-transform: none;
  color: var(--ink);
}

td.wrap {
  white-space: normal;
  min-width: 220px;
  overflow-wrap: anywhere;
}

td input,
td textarea,
.document-table input,
.document-table textarea {
  white-space: normal;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f7f5f2;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.badge.sent,
.badge.processing,
.badge.pending_department_approval,
.badge.pending_director_approval,
.badge.pending_warehouse_approval {
  background: #fff7ed;
  color: var(--warning);
}

.badge.awaiting_reception {
  background: #f1f5f9;
  color: #475569;
}

.badge.done {
  background: #ecfdf3;
  color: var(--success);
}

.badge.completed {
  background: #ecfdf3;
  color: var(--success);
}

.empty {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.error {
  color: var(--danger);
  margin-top: 10px;
}

@media (max-width: 860px) {
  .login-page,
  .app-shell {
    grid-template-columns: 1fr;
  }

  body {
    overflow: auto;
  }

  .login-page {
    min-height: 100vh;
    background: var(--page);
  }

  .login-panel {
    min-height: 100vh;
  }

  .login-card {
    max-width: none;
  }

  .login-visual {
    display: none;
  }

  .app-shell,
  .content {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: static;
    min-height: auto;
    overflow: visible;
  }

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

  .topbar,
  .toolbar {
    flex-direction: column;
    padding-right: 12px;
  }

  .split,
  .document-layout,
  .form-grid,
  .filter-grid,
  .project-grid,
  .project-filter-row,
  .customer-filter-row,
  .project-stats {
    grid-template-columns: 1fr;
  }

  .purchase-kpi-grid,
  .purchase-order-filter.professional-filter {
    grid-template-columns: 1fr;
  }

  .purchase-table-wrap {
    display: none;
  }

  .purchase-mobile-cards {
    display: grid;
    gap: 8px;
  }

  .workspace,
  #inventoryWorkspaceView,
  .projects-page,
  .technical-forms-page,
  .project-grid,
  .project-main {
    height: auto;
    overflow: visible;
  }

  .project-table-wrap {
    max-height: 68vh;
  }

  .document-layout,
  .document-main {
    height: auto;
    overflow: visible;
  }

  .document-main {
    grid-template-rows: auto auto;
  }

  .document-form {
    grid-template-columns: 1fr;
  }

  .request-custom-grid {
    grid-template-columns: 1fr;
  }

  .request-detail-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .inventory-table-wrap {
    max-height: 72vh;
  }

  .inventory-table {
    font-size: 10px;
  }

  .project-table {
    font-size: 10.5px;
  }

  .inventory-table th,
  .inventory-table td,
  .project-table th,
  .project-table td {
    padding: 5px 3px;
  }

  .search {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }

  .document-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .project-filter-row {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .document-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .inventory-table {
    font-size: 10px;
  }
}

.print-area {
  display: none;
}

.print-sheet {
  color: #111827;
  background: #fff;
  font-size: 11px;
}

.print-sheet.a4 {
  min-height: 277mm;
}

.print-doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 3px solid var(--prestec-orange);
  padding-bottom: 10px;
}

.print-brand {
  color: var(--prestec-orange);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.print-logo {
  display: block;
  width: 132px;
  height: auto;
}

.print-company {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.print-doc-code {
  min-width: 150px;
  border: 1px solid #111827;
  font-weight: 700;
  text-align: center;
}

.print-doc-code div {
  padding: 5px 8px;
}

.print-doc-code div + div {
  border-top: 1px solid #111827;
}

.print-title {
  margin: 16px 0 12px;
  font-size: 18px;
  color: var(--prestec-orange);
  text-align: center;
  text-transform: uppercase;
}

.print-draft-mark {
  border: 2px solid var(--danger);
  color: var(--danger);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 auto 12px;
  max-width: 320px;
  padding: 8px 10px;
  text-align: center;
}

.print-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #111827;
}

.print-header strong,
.print-header span {
  display: block;
}

.print-header strong {
  font-size: 16px;
}

.print-header span {
  margin-top: 4px;
  font-weight: 700;
}

.print-code {
  font-weight: 700;
  white-space: nowrap;
}

.print-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 12px 0;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.print-table th,
.print-table td {
  border: 1px solid #111827;
  padding: 5px 6px;
  white-space: normal;
}

.print-table th {
  background: #f7f5f2;
  color: #111827;
  text-transform: none;
}

.print-note {
  margin-top: 10px;
  line-height: 1.45;
}

.print-signatures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  margin-top: 28px;
  text-align: center;
}

.print-signatures span {
  display: block;
  margin-top: 6px;
  color: #4b5563;
}

.customer-profile-page {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 0 0 18px;
}

.customer-profile-toolbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 148px 10px 12px;
}

.customer-profile-toolbar > div:first-child {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.customer-profile-toolbar h1 {
  border-left: 3px solid var(--prestec-orange);
  color: var(--ink);
  font-size: 20px;
  margin: 0;
  padding-left: 10px;
}

.customer-profile-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  overflow: hidden;
}

.customer-profile-summary {
  background: linear-gradient(135deg, #fff7ed, #fff);
  border-right: 1px solid var(--line);
}

.customer-profile-summary-head {
  background: var(--prestec-orange);
  color: #fff;
  font-weight: 800;
  padding: 12px 16px;
}

.customer-profile-summary-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.customer-profile-summary-body strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.customer-profile-summary-body span {
  color: var(--muted);
  font-size: 12px;
}

.customer-profile-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 18px;
}

.customer-profile-info-item {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 0;
}

.customer-profile-info-item:nth-child(odd) {
  padding-right: 14px;
}

.customer-profile-info-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-profile-info-item strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.customer-profile-info-item.wide {
  grid-column: 1 / -1;
}

.customer-profile-info-item.accent span {
  color: var(--prestec-orange);
}

.customer-profile-tabs {
  border-bottom: 2px solid #1d4ed8;
  display: flex;
}

.customer-profile-tabs button {
  background: linear-gradient(#f5f7fb, #e8edf5);
  border: 1px solid #cbd5e1;
  border-bottom: 0;
  color: var(--ink);
  cursor: default;
  font-weight: 800;
  min-width: 150px;
  padding: 10px 18px;
  text-transform: none;
}

.customer-profile-tabs button.active {
  background: #1d4ed8;
  color: #fff;
  position: relative;
}

.customer-profile-tabs button.active::after {
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #1d4ed8;
  bottom: -8px;
  content: "";
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.customer-profile-content {
  display: none;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.customer-profile-content.active {
  display: grid;
}

.customer-profile-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.customer-profile-panel-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.customer-profile-panel-head h2 {
  color: var(--ink);
  font-size: 16px;
  margin: 0;
}

.customer-profile-panel-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0 0;
}

.customer-profile-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.customer-machine-table th,
.customer-machine-table td {
  white-space: normal;
}

.customer-machine-table th:nth-child(1),
.customer-machine-table td:nth-child(1) {
  width: 44px;
}

.customer-machine-table th:nth-child(2),
.customer-machine-table td:nth-child(2) {
  width: 24%;
}

.customer-machine-table th:nth-child(3),
.customer-machine-table td:nth-child(3) {
  width: 12%;
}

.customer-machine-table th:nth-child(4),
.customer-machine-table td:nth-child(4) {
  width: 13%;
}

.customer-machine-table th:nth-child(5),
.customer-machine-table td:nth-child(5) {
  width: 14%;
}

.customer-machine-table th:nth-child(6),
.customer-machine-table td:nth-child(6) {
  width: 100px;
}

.customer-machine-table th:nth-child(7),
.customer-machine-table td:nth-child(7) {
  width: 90px;
}

.customer-machine-table th:nth-child(8),
.customer-machine-table td:nth-child(8) {
  width: 17%;
}

.customer-machine-table th:nth-child(9),
.customer-machine-table td:nth-child(9) {
  width: 78px;
}

.customer-machine-table tbody tr[data-open-machine] {
  cursor: pointer;
}

.customer-machine-table tbody tr[data-open-machine]:hover {
  background: #fff8f4;
}

.customer-activity-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.customer-activity-item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--prestec-orange);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.customer-activity-item:hover {
  background: #fff8f4;
  border-color: #fb923c;
  transform: translateY(-1px);
}

.customer-activity-item span {
  color: var(--prestec-orange);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-activity-item strong {
  color: var(--ink);
  font-size: 13px;
}

.customer-activity-item small,
.customer-activity-item p,
.customer-profile-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
}

.customer-machine-form {
  background: #fff8f4;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 10px;
}

.customer-profile-placeholder-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-profile-placeholder-grid article,
.customer-document-drop {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.customer-profile-placeholder-grid span,
.customer-document-drop span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-profile-placeholder-grid strong,
.customer-document-drop strong {
  color: var(--ink);
  font-size: 14px;
}

.customer-profile-placeholder-grid p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.customer-document-drop {
  align-items: center;
  background: #f8fafc;
  justify-items: center;
  margin-bottom: 12px;
  min-height: 130px;
  text-align: center;
}

.customer-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, .42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 120;
}

.customer-modal-backdrop[hidden] {
  display: none;
}

.customer-modal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 16px;
  width: min(760px, calc(100vw - 32px));
}

.customer-modal-card.large-modal-card {
  width: min(1080px, calc(100vw - 32px));
}

.inventory-merge-modal-card {
  width: min(920px, calc(100vw - 32px));
}

.inventory-merge-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

.inventory-merge-summary > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  min-width: 0;
  padding: 8px 10px;
}

.inventory-merge-summary span {
  color: #64748b;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 3px;
}

.inventory-merge-summary strong {
  color: #0f172a;
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-merge-list {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  max-height: 280px;
  overflow: auto;
}

.inventory-merge-list table {
  border-collapse: collapse;
  width: 100%;
}

.inventory-merge-list th,
.inventory-merge-list td {
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  padding: 7px 9px;
  text-align: left;
  vertical-align: middle;
}

.inventory-merge-list th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  position: sticky;
  text-transform: uppercase;
  top: 0;
}

.inventory-merge-list tr.is-target td {
  background: #eff6ff;
}

.inventory-merge-target-badge {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  color: #1d4ed8;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
}

.inventory-merge-note {
  margin-top: 10px;
}

.inventory-merge-note textarea {
  min-height: 64px;
}

.inventory-merge-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
  padding: 8px 10px;
}

.request-purchase-item-list {
  max-height: 320px;
  overflow: auto;
}

.table-actions.compact-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.customer-modal-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.customer-modal-head span {
  color: var(--prestec-orange);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-modal-head h2 {
  color: var(--ink);
  font-size: 18px;
  margin: 3px 0 0;
}

.customer-modal-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-modal-grid .wide {
  grid-column: 1 / -1;
}

.field.inline-check {
  align-items: center;
  flex-direction: row;
  gap: 8px;
  min-height: 40px;
}

.field.inline-check input {
  width: auto;
}

.handover-returnable-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr);
  margin-bottom: 10px;
}

.handover-returnable-filters .history-filter {
  margin: 0;
  width: 100%;
}

.handover-compact-card-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.handover-compact-card-head h2 {
  margin-bottom: 2px;
}

.handover-compact-card-head small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.handover-returnable-card.is-collapsed .handover-returnable-body {
  display: none;
}

.handover-returnable-card .compact-toggle {
  flex: 0 0 auto;
  padding: 6px 10px;
}

.qty-stack {
  display: grid;
  gap: 2px;
  min-width: 110px;
}

.qty-stack span {
  font-size: 12px;
  line-height: 1.35;
}

.machine-report-modal {
  width: min(860px, calc(100vw - 32px));
}

.technical-report-choice-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.technical-report-choice {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--prestec-orange);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
}

.technical-report-choice:hover {
  border-color: var(--prestec-orange);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.technical-report-choice strong {
  color: var(--ink);
  font-size: 14px;
}

.technical-report-choice span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .technical-report-choice-list {
    grid-template-columns: 1fr;
  }
}

.project-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, .42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 130;
}

.project-modal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 16px;
  width: min(1120px, calc(100vw - 44px));
}

.project-modal-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.project-detail-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  justify-content: end;
  min-width: 192px;
}

.project-action-button {
  align-items: center;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  min-width: 92px;
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
}

.project-modal-head span {
  color: var(--prestec-orange);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-modal-head h2 {
  color: var(--ink);
  font-size: 20px;
  margin: 3px 0 0;
}

.project-modal-card .project-form .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-modal-card .project-form .field.wide {
  grid-column: 1 / -1;
}

.machine-detail-page {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.machine-detail-toolbar {
  min-height: 44px;
  padding: 6px 148px 6px 8px;
}

.machine-detail-toolbar h1 {
  font-size: 18px;
}

.machine-detail-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 220px;
  padding: 10px;
  min-height: 0;
  overflow: hidden;
}

.machine-detail-main {
  min-width: 0;
}

.machine-title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.machine-title-line h2 {
  color: var(--ink);
  font-size: 18px;
  margin: 0;
}

.machine-detail-main > p {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0 7px;
  padding-bottom: 6px;
}

.machine-customer-link {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
}

.machine-customer-link:hover {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.machine-info-grid {
  display: grid;
  gap: 4px 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.machine-detail-page .customer-profile-info-item {
  gap: 2px;
  padding: 5px 0;
}

.machine-detail-page .customer-profile-info-item span {
  font-size: 11px;
}

.machine-detail-page .customer-profile-info-item strong {
  font-size: 12px;
}

.machine-visual-card {
  align-self: start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.machine-visual-frame {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-height: 0;
  overflow: hidden;
}

.machine-visual-frame img {
  display: block;
  height: 280px;
  object-fit: contain;
  width: 100%;
}

.machine-visual-placeholder {
  align-items: center;
  height: 280px;
  min-height: 120px;
  background:
    linear-gradient(135deg, rgba(255, 85, 32, .13), rgba(29, 78, 216, .08)),
    #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.machine-image-button {
  cursor: pointer;
  justify-content: center;
  text-align: center;
}

.machine-image-actions {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr 1fr;
}

.machine-image-actions > :only-child {
  grid-column: 1 / -1;
}

.machine-image-button input {
  display: none;
}

.machine-visual-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  text-align: center;
}

.machine-visual-placeholder strong {
  color: var(--prestec-orange);
  font-size: 22px;
  font-style: italic;
}

.machine-tabs {
  overflow-x: auto;
}

.machine-tabs button {
  min-width: 136px;
  padding: 8px 12px;
}

.machine-detail-content {
  display: grid;
  gap: 8px;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 0;
}

.machine-tab-panel {
  display: none;
  min-height: 0;
}

.machine-tab-panel.active {
  display: block;
}

.machine-mini-panel,
.machine-detail-panel {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.machine-panel-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-bottom: 6px;
}

.machine-mini-panel h3,
.machine-detail-panel h3 {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  margin: 0;
  padding-bottom: 6px;
}

.machine-panel-head h3 {
  border-bottom: 0;
  padding-bottom: 0;
}

.machine-panel-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 2px 0 0;
}

.machine-list-tools {
  margin-bottom: 6px;
}

.panel-filter-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-filter-tools .search {
  max-width: 360px;
  min-width: 220px;
}

.panel-filter-tools select {
  max-width: 220px;
}

.machine-list-tools .search {
  max-width: 360px;
}

.machine-activity-item {
  align-items: stretch;
  cursor: default;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 92px;
  min-height: 118px;
}

.machine-activity-item.filtered-out {
  display: none !important;
}

[data-panel-item].filtered-out {
  display: none !important;
}

.recent-activity-board {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-column {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 260px;
  overflow: hidden;
}

.recent-column h3 {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  margin: 0;
  padding: 9px 10px;
}

.recent-column-list {
  display: grid;
  gap: 2px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}

.recent-activity-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--prestec-orange);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr) 170px;
  padding: 9px 10px;
  text-align: left;
}

.recent-activity-row.compact {
  border-left-width: 2px;
  gap: 8px;
  grid-template-columns: 10px minmax(0, 1fr);
  padding: 7px 8px;
}

.recent-activity-row:hover {
  background: #fff8f4;
  border-color: #ffd5c6;
}

.recent-activity-dot {
  background: var(--prestec-orange);
  border-radius: 999px;
  height: 8px;
  width: 8px;
}

.recent-activity-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recent-activity-main strong {
  color: var(--prestec-orange);
  font-size: 11px;
  text-transform: uppercase;
}

.recent-activity-main > span {
  color: var(--ink);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-activity-main small {
  color: var(--muted);
  line-height: 1.35;
}

.recent-activity-side {
  align-items: flex-end;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.recent-activity-side time {
  color: var(--muted);
  font-size: 12px;
}

.recent-empty {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  padding: 10px;
}

.machine-activity-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-activity-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.machine-activity-main {
  min-width: 0;
}

.machine-activity-main > span {
  color: var(--prestec-orange);
  display: block;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.machine-activity-title {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: block;
  font: inherit;
  font-weight: 900;
  line-height: 1.25;
  padding: 0;
  text-align: left;
}

.machine-activity-title:hover {
  color: var(--prestec-orange);
  text-decoration: underline;
}

.machine-activity-actions {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-rows: 1fr 1fr;
  margin-top: 0;
}

.machine-activity-actions .project-status,
.machine-activity-actions .button {
  align-items: center;
  display: inline-flex;
  height: 100%;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.machine-activity-actions .button:hover {
  border-color: var(--prestec-orange);
  color: var(--prestec-orange);
}

.report-activity-grid .machine-activity-item {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.42fr);
  min-height: 104px;
}

.report-activity-grid .machine-activity-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
}

.report-activity-grid .machine-activity-actions .project-status {
  grid-column: 1 / -1;
  min-height: 32px;
}

.report-activity-grid .machine-activity-actions .button {
  min-height: 32px;
  padding: 6px 8px;
}

.machine-empty-panel {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 132px;
  padding: 16px;
  text-align: center;
}

.machine-empty-panel strong {
  color: var(--ink);
  font-size: 15px;
}

.machine-empty-panel span {
  max-width: 560px;
}

.machine-note-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 6px;
  padding: 8px;
}

.machine-note-box strong {
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.machine-note-box p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .customer-profile-hero,
  .customer-profile-content,
  .machine-detail-hero,
  .machine-detail-content {
    grid-template-columns: 1fr;
  }

  .customer-profile-summary {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .purchase-management-topbar .actions {
    justify-content: flex-start;
    max-width: none;
  }

  .purchase-order-filter.professional-filter,
  .purchase-order-filter {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-overview-grid .purchase-kpi-grid,
  .purchase-overview-board,
  .purchase-overview-priority,
  .purchase-dashboard-card-grid,
  .purchase-dashboard-grid,
  .purchase-report-filter-bar,
  .purchase-report-grid-two,
  .purchase-pipeline,
  .supplier-command-center,
  .supplier-command-metrics,
  .supplier-dashboard-grid,
  .supplier-capability-grid,
  .purchase-report-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .purchase-overview-board {
    grid-template-columns: 1fr;
  }

  .purchase-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .purchase-report-bar-row {
    grid-template-columns: minmax(100px, 0.8fr) minmax(120px, 1.6fr) minmax(110px, 1fr) auto;
  }
}

@media (max-width: 720px) {
  .customer-profile-toolbar,
  .customer-profile-toolbar > div:first-child,
  .customer-profile-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-profile-info {
    grid-template-columns: 1fr;
  }

  .customer-profile-tabs {
    overflow-x: auto;
  }

  .customer-profile-toolbar {
    padding-right: 12px;
  }

  .customer-modal-grid,
  .project-modal-card .project-form .form-grid,
  .machine-info-grid,
  .machine-activity-grid,
  .recent-activity-board,
  .recent-activity-row {
    grid-template-columns: 1fr;
  }

  .machine-detail-toolbar {
    padding-right: 12px;
  }

  .purchase-order-filter.professional-filter,
  .purchase-order-filter,
  .purchase-overview-grid .purchase-kpi-grid,
  .purchase-overview-board,
  .purchase-overview-priority,
  .purchase-dashboard-card-grid,
  .purchase-dashboard-grid,
  .purchase-report-filter-bar,
  .purchase-report-grid-two,
  .purchase-report-bar-row,
  .purchase-pipeline,
  .supplier-command-center,
  .supplier-command-metrics,
  .supplier-dashboard-grid,
  .supplier-capability-grid,
  .purchase-report-grid {
    grid-template-columns: 1fr;
  }

  .supplier-command-head {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-management-topbar .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-report-bar-row strong {
    text-align: left;
  }

  .customer-profile-placeholder-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .print-area,
  .print-area * {
    visibility: visible;
  }

  .print-area {
    display: block;
    position: absolute;
    inset: 0;
    padding: 0;
  }

  body.printing-request-quote .print-area,
  body.printing-request-quote .print-area * {
    visibility: hidden;
  }

  body.printing-request-quote #requestQuotePrintSource,
  body.printing-request-quote #requestQuotePrintSource * {
    visibility: visible;
  }

  body.printing-request-quote #requestQuotePrintSource {
    display: block;
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .print-sheet {
    width: 100%;
  }

  .print-sheet.a4 {
    min-height: auto;
  }

  .no-print {
    display: none !important;
  }
}

/* Supplier Performance Report */
.supplier-performance-report {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rpt-summary-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1100px) {
  .rpt-summary-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .rpt-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rpt-kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rpt-kpi-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.rpt-kpi-card strong {
  color: var(--brand);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.rpt-kpi-warn {
  border-color: #fca5a5;
  background: #fff5f5;
}

.rpt-kpi-warn strong {
  color: #b91c1c;
}

.rpt-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.rpt-filter-input {
  flex: 1;
  min-width: 140px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
}

.rpt-filter-select {
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
}

.rpt-filter-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.rpt-filter-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.rpt-table-wrap {
  overflow-x: auto;
}

.rpt-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}

.rpt-table th,
.rpt-table td {
  padding: 6px 8px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  white-space: normal;
}

.rpt-table thead th {
  background: #eef1f4;
  font-size: 11px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.rpt-table .rpt-col-num {
  text-align: right;
  white-space: nowrap;
}

.rpt-table .rpt-col-name { min-width: 140px; }
.rpt-table .rpt-col-group { min-width: 100px; }
.rpt-table .rpt-col-flags { min-width: 120px; }
.rpt-table .rpt-col-action { min-width: 160px; font-size: 11px; }

.rpt-row-warn {
  background: #fffbeb;
}

.rpt-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
}

.rpt-link-btn:hover {
  color: var(--brand-dark, #1d4ed8);
}

.rpt-supplier-code {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.rpt-score-val {
  color: var(--muted);
  font-size: 10px;
  margin-left: 4px;
}

.rpt-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.rpt-badge-green  { background: #dcfce7; color: #15803d; }
.rpt-badge-teal   { background: #ccfbf1; color: #0f766e; }
.rpt-badge-yellow { background: #fef9c3; color: #854d0e; }
.rpt-badge-orange { background: #ffedd5; color: #c2410c; }
.rpt-badge-red    { background: #fee2e2; color: #b91c1c; }
.rpt-badge-darkred { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }
.rpt-badge-gray   { background: #f1f5f9; color: #475569; }

.rpt-flag-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  margin: 1px 1px 1px 0;
  white-space: nowrap;
}

.rpt-muted {
  color: var(--muted);
  font-size: 11px;
}

.rpt-cell-warn {
  color: #b91c1c;
  font-weight: 600;
}

.rpt-cell-ok {
  color: #15803d;
}

/* ============================================================
   Supplier Profile Modal — sp-* classes
   ============================================================ */

/* Panel sizing */
.supplier-detail-panel {
  width: min(1160px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.supplier-detail-content {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Profile header */
.sp-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, #f8fafc, #fff);
  border-radius: 7px 7px 0 0;
  margin: -16px -16px 10px;
  flex-shrink: 0;
}

.sp-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.sp-profile-name {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.2;
  color: var(--ink);
}

.sp-profile-info {
  min-width: 0;
}

.sp-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.sp-meta-code {
  font-family: monospace;
  background: #f1f5f9;
  border-radius: 3px;
  padding: 1px 5px;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.sp-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sp-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* Alert banner under header */
.sp-profile-alert {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  color: #9f1239;
  font-size: 12px;
  padding: 7px 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

/* Tab bar scrollable */
.sp-tab-bar {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.sp-tab-bar::-webkit-scrollbar { display: none; }

/* Section cards within tab content */
.sp-section-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.sp-section-card:last-child { margin-bottom: 0; }

.sp-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* 2-col form grid */
.sp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* 3-col variant */
.sp-form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px) {
  .sp-form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .sp-form-grid,
  .sp-form-grid-3 { grid-template-columns: 1fr; }
}

.sp-form-grid label,
.sp-form-grid-3 label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.sp-form-grid input,
.sp-form-grid select,
.sp-form-grid textarea,
.sp-form-grid-3 input,
.sp-form-grid-3 select,
.sp-form-grid-3 textarea {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 8px;
  height: 33px;
  background: #fff;
}

.sp-form-grid textarea,
.sp-form-grid-3 textarea {
  height: auto;
}

/* Checkbox grid — 2×2, each item a card-row */
.sp-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 560px) {
  .sp-checkbox-grid { grid-template-columns: 1fr; }
}

.sp-checkbox-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: background .12s, border-color .12s;
}

.sp-checkbox-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.sp-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand);
}

.sp-checkbox-item span {
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

/* Compact textarea */
.sp-textarea-sm {
  min-height: 76px !important;
  max-height: 160px;
  resize: vertical;
  height: auto !important;
}

/* Sticky save row */
.sp-sticky-save {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

/* Detail grid improvements */
.sp-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sp-detail-wide {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .sp-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Badges */
.sp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.sp-badge-active     { background: #dcfce7; color: #15803d; }
.sp-badge-blacklist  { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }
.sp-badge-restricted { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.sp-badge-neutral    { background: #f1f5f9; color: #475569; }
.sp-badge-score      { background: #eff6ff; color: #1d4ed8; }
.sp-badge-nr         { background: #f8fafc; color: #94a3b8; }

.sp-badge-rating-a   { background: #dcfce7; color: #15803d; }
.sp-badge-rating-b   { background: #d1fae5; color: #065f46; }
.sp-badge-rating-c   { background: #fef9c3; color: #854d0e; }
.sp-badge-rating-d   { background: #fee2e2; color: #b91c1c; }
.sp-badge-rating-x   { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }

.sp-badge-risk-high  { background: #fee2e2; color: #b91c1c; }
.sp-badge-risk-med   { background: #fef3c7; color: #92400e; }
.sp-badge-risk-low   { background: #dcfce7; color: #15803d; }

/* ─── Badge variants ─────────────────────────────────────────────────────── */
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; border-radius: 4px; padding: 2px 8px; font-size: .78rem; font-weight: 600; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: 4px; padding: 2px 8px; font-size: .78rem; font-weight: 600; }
.badge-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; border-radius: 4px; padding: 2px 8px; font-size: .78rem; font-weight: 600; }

/* ─── PO Issue card ──────────────────────────────────────────────────────── */
.po-issue-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}
.po-issue-card--issued  { border-color: #86efac; background: #f0fdf4; }
.po-issue-card--blocked { border-color: #fcd34d; background: #fffbeb; }

.po-issue-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.po-issue-card-header h2 { margin: 0; font-size: 1rem; flex: 1; }

.po-issue-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 14px;
  font-size: .87rem;
}
.po-issue-details div { display: flex; flex-direction: column; gap: 2px; }
.po-issue-details div.wide { grid-column: 1 / -1; }
.po-issue-details span { color: var(--muted); font-size: .78rem; }

.po-issue-blockers {
  margin: 0 0 14px;
  padding: 0 0 0 20px;
  font-size: .87rem;
  color: #92400e;
}
.po-issue-blockers li { margin-bottom: 4px; }

.po-issue-ready { margin: 0 0 14px; font-size: .87rem; color: #15803d; }

.po-issue-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.po-issue-note-input {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--body-font);
  font-size: .87rem;
  resize: vertical;
}

.po-issue-stamp {
  display: inline-block;
  border: 3px solid #15803d;
  color: #15803d;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 4px 12px;
  border-radius: 4px;
  opacity: .7;
  transform: rotate(-3deg);
  margin-bottom: 14px;
}

/* ─── Official PO print ──────────────────────────────────────────────────── */
.po-official-stamp {
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #15803d;
  border: 2px solid #15803d;
  display: inline-block;
  padding: 4px 16px;
  border-radius: 4px;
  margin-bottom: 10px;
  opacity: .75;
  transform: rotate(-2deg);
}

.po-print-total { font-weight: 700; }
.po-print-total.grand { font-size: 1.05em; color: var(--prestec-orange-dark); }

/* ─── Print media ────────────────────────────────────────────────────────── */
@media print {
  body > *:not(#poPrintArea) { display: none !important; }
  #poPrintArea { display: block !important; }
  .po-print-sheet { page-break-inside: avoid; }
  .po-official-print .po-official-stamp { opacity: 1; }
  .print-signatures { page-break-inside: avoid; }
}

/* ─── Assignment modal (Giai đoạn E) ─────────────────────────────────────── */
.assignment-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.assignment-modal-overlay.visible { display: flex; }

.assignment-modal {
  background: var(--card-bg, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 100%;
  max-width: 780px;
  margin: auto;
}

.assignment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.assignment-modal-header h2 { margin: 0; font-size: 1.1rem; }

.assignment-modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.assignment-modal-body h3 {
  margin: .5rem 0 0;
  font-size: .95rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.assignment-primary-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--surface, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  flex-wrap: wrap;
}
.assignment-primary-info { flex: 1; }
.assignment-level-tag {
  display: inline-block;
  font-size: .78rem;
  background: var(--bg-muted, #e5e7eb);
  color: var(--text-secondary, #6b7280);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: .4rem;
}
.assignment-primary-title {
  display: block;
  width: 100%;
  font-size: .85rem;
  color: var(--text-secondary, #6b7280);
  margin-top: .25rem;
}

.assignment-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.assignment-badge.primary   { background: #dbeafe; color: #1d4ed8; }
.assignment-badge.concurrent { background: #d1fae5; color: #065f46; }
.assignment-badge.temporary  { background: #fef9c3; color: #713f12; }
.assignment-badge.delegated  { background: #ede9fe; color: #5b21b6; }
.assignment-badge.inactive   { background: #f3f4f6; color: #9ca3af; }

.assignment-table { width: 100%; font-size: .9rem; }
.assignment-table th { white-space: nowrap; }

.assignment-form { margin-top: .25rem; }

.button.small { padding: 3px 10px; font-size: .8rem; }

.status-badge { display: inline-block; font-size: .75rem; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.status-badge.active   { background: #d1fae5; color: #065f46; }
.status-badge.inactive { background: #f3f4f6; color: #9ca3af; }

/* ─── Audit log UI ────────────────────────────────────────────────────────── */
.audit-filter-form { margin-bottom: 1rem; }

.audit-log-table { width: 100%; font-size: .875rem; }
.audit-log-table th { white-space: nowrap; }
.audit-time { white-space: nowrap; font-size: .8rem; color: var(--text-secondary, #6b7280); }
.audit-note { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--text-secondary, #6b7280); }
.audit-action-tag {
  display: inline-block;
  font-size: .75rem;
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-secondary, #374151);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}
.audit-total-hint { font-size: .8rem; color: var(--text-secondary, #9ca3af); margin-top: .5rem; }
.audit-loading { padding: .75rem 0; color: var(--text-secondary, #9ca3af); font-size: .9rem; }

.audit-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1100;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.audit-detail-overlay.visible { display: flex; }

.audit-detail-modal {
  background: var(--card-bg, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  width: 100%;
  max-width: 640px;
  margin: auto;
}

.audit-detail-body {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.audit-detail-body h3 { margin: .25rem 0 0; font-size: .9rem; font-weight: 600; color: var(--text-secondary, #6b7280); }

.audit-detail-meta {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .875rem;
  padding: .75rem;
  background: var(--surface, #f9fafb);
  border-radius: 6px;
  border: 1px solid var(--border, #e5e7eb);
}
.audit-meta-label { font-weight: 600; color: var(--text-secondary, #6b7280); margin-right: .35rem; }

.audit-json-block {
  background: var(--surface, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: .75rem 1rem;
  font-size: .78rem;
  font-family: monospace;
  overflow-x: auto;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre;
  margin: 0;
}
.receipt-item-link-summary {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.receipt-item-link-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 8px 10px;
}

.receipt-item-link-row span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* =========================================================
   PRESTEC UI STANDARD - UI-1B BASE CLASSES
   ========================================================= */

:root {
  --prestec-ui-page: var(--page, #f7f5f2);
  --prestec-ui-panel: var(--panel, #ffffff);
  --prestec-ui-soft-panel: var(--soft-panel, #fbfaf8);
  --prestec-ui-text: var(--ink, #1a1a1a);
  --prestec-ui-text-secondary: #475569;
  --prestec-ui-border: var(--line, #d7dde3);
  --prestec-ui-accent: var(--prestec-orange, #f35b27);
  --prestec-ui-accent-dark: var(--prestec-orange-dark, #c63a15);
  --prestec-ui-success: #15803d;
  --prestec-ui-warning: #b45309;
  --prestec-ui-danger: #b91c1c;
  --prestec-ui-info: #1d4ed8;
  --prestec-ui-radius-sm: 5px;
  --prestec-ui-radius-md: 6px;
  --prestec-ui-radius-lg: 8px;
  --prestec-ui-shadow-sm: 0 4px 16px rgba(26, 26, 26, .05);
  --prestec-ui-shadow-md: var(--shadow, 0 10px 28px rgba(26, 26, 26, .07));
  --prestec-ui-space-1: 4px;
  --prestec-ui-space-2: 6px;
  --prestec-ui-space-3: 8px;
  --prestec-ui-space-4: 10px;
  --prestec-ui-space-5: 12px;
  --prestec-ui-space-6: 16px;
  --prestec-ui-space-7: 20px;
  --prestec-ui-font-table: 12px;
  --prestec-ui-font-form: 13px;
  --prestec-ui-font-label: 11px;
}

.prestec-btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--prestec-ui-radius-md);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  gap: var(--prestec-ui-space-2);
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0 var(--prestec-ui-space-5);
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
  white-space: nowrap;
}

.prestec-btn:disabled,
.prestec-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
}

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

.prestec-btn--primary:hover:not(:disabled) {
  background: var(--prestec-ui-accent-dark);
}

.prestec-btn--secondary {
  background: #fff;
  border-color: var(--prestec-ui-border);
  color: var(--prestec-ui-text);
}

.prestec-btn--secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.prestec-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--prestec-ui-text-secondary);
}

.prestec-btn--ghost:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--prestec-ui-text);
}

.prestec-btn--link {
  background: transparent;
  border-color: transparent;
  color: var(--prestec-ui-info);
  height: auto;
  justify-content: flex-start;
  padding: 0;
  text-align: left;
}

.prestec-btn--link:hover:not(:disabled) {
  color: #1e40af;
  text-decoration: underline;
}

.prestec-btn--icon {
  height: 30px;
  padding: 0;
  width: 30px;
}

.prestec-btn--danger {
  background: #fff;
  border-color: #fca5a5;
  color: var(--prestec-ui-danger);
}

.prestec-btn--danger:hover:not(:disabled) {
  background: var(--prestec-ui-danger);
  border-color: var(--prestec-ui-danger);
  color: #fff;
}

.prestec-btn--loading,
.prestec-btn[aria-busy="true"] {
  cursor: wait;
  opacity: .72;
}

.prestec-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 4px;
  line-height: 1.2;
  min-height: 20px;
  padding: 2px 7px;
  text-transform: none;
  white-space: nowrap;
}

.prestec-badge--draft {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.prestec-badge--pending {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.prestec-badge--processing {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.prestec-badge--approved {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.prestec-badge--issued {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #0f766e;
}

.prestec-badge--completed {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.prestec-badge--cancelled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}

.prestec-badge--rejected {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.prestec-badge--overdue {
  background: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.prestec-badge--warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b45309;
}

.prestec-badge--risk {
  background: #fff1f2;
  border-color: #fb7185;
  color: #9f1239;
}

.prestec-badge--inactive {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}

.prestec-badge.prestec-badge--condition-new {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.prestec-badge.prestec-badge--condition-good {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.prestec-badge.prestec-badge--condition-used {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

.prestec-badge.prestec-badge--condition-damaged {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

.prestec-badge.prestec-badge--condition-repair {
  background: #ffedd5;
  border-color: #fb923c;
  color: #c2410c;
}

.prestec-badge.prestec-badge--condition-lost {
  background: #f3e8ff;
  border-color: #c084fc;
  color: #7e22ce;
}

.prestec-badge.prestec-badge--condition-disposed {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #374151;
}

.prestec-badge.prestec-badge--condition-unknown {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

.prestec-table-wrap {
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  overflow: auto;
}

.prestec-table {
  border-collapse: collapse;
  color: var(--prestec-ui-text);
  font-size: var(--prestec-ui-font-table);
  min-width: 920px;
  table-layout: auto;
  width: 100%;
}

.prestec-table th,
.prestec-table td {
  border-bottom: 1px solid var(--prestec-ui-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.prestec-table th {
  background: #eef1f4;
  color: var(--prestec-ui-text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.prestec-table tbody tr:hover td {
  background: #fff7ed;
}

.prestec-table--dense th,
.prestec-table--dense td {
  padding: 6px 8px;
}

.prestec-table--sticky-header thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.prestec-table--sticky-actions .prestec-table__actions {
  background: inherit;
  box-shadow: -8px 0 12px rgba(15, 23, 42, .04);
  position: sticky;
  right: 0;
  z-index: 1;
}

.prestec-table--sticky-actions thead .prestec-table__actions {
  z-index: 3;
}

.prestec-table__code {
  font-family: var(--mono-font, Consolas, "Courier New", monospace);
  font-weight: 800;
  white-space: nowrap;
}

.prestec-table__status,
.prestec-table__date {
  white-space: nowrap;
}

.prestec-table__person {
  min-width: 140px;
}

.prestec-table__number {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.prestec-table__actions {
  min-width: 120px;
  text-align: right;
  white-space: nowrap;
}

.prestec-table__subline {
  color: var(--prestec-ui-text-secondary);
  display: block;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 2px;
}

.prestec-filter-bar {
  align-items: end;
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--prestec-ui-space-3);
  padding: var(--prestec-ui-space-5);
}

.prestec-filter-bar--compact {
  padding: var(--prestec-ui-space-3);
}

.prestec-filter-bar input,
.prestec-filter-bar select {
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-sm);
  font: inherit;
  font-size: 13px;
  height: 32px;
  padding: 0 8px;
}

.prestec-filter-bar__search {
  flex: 1 1 220px;
  min-width: 180px;
}

.prestec-filter-bar__quick {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--prestec-ui-space-2);
}

.prestec-filter-bar__advanced {
  align-items: center;
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: var(--prestec-ui-space-3);
}

.prestec-drawer {
  background: rgba(15, 23, 42, .42);
  display: none;
  inset: 0;
  justify-content: flex-end;
  position: fixed;
  z-index: 1000;
}

.prestec-drawer.open,
.prestec-drawer[open] {
  display: flex;
}

.prestec-drawer__panel {
  background: var(--prestec-ui-page);
  box-shadow: -18px 0 40px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1120px;
  min-width: min(100vw, 760px);
  width: min(92vw, 1120px);
}

.prestec-drawer__header,
.prestec-drawer__footer {
  align-items: center;
  background: var(--prestec-ui-panel);
  border-bottom: 1px solid var(--prestec-ui-border);
  display: flex;
  gap: var(--prestec-ui-space-5);
  justify-content: space-between;
  padding: var(--prestec-ui-space-5) var(--prestec-ui-space-6);
}

.prestec-drawer__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--prestec-ui-space-5);
}

.prestec-drawer__tabs {
  background: #eef1f4;
  border-bottom: 1px solid var(--prestec-ui-border);
  display: flex;
  overflow-x: auto;
}

.prestec-drawer__footer {
  border-bottom: 0;
  border-top: 1px solid var(--prestec-ui-border);
  justify-content: flex-end;
}

.prestec-modal {
  align-items: flex-start;
  background: rgba(15, 23, 42, .46);
  display: none;
  inset: 0;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
  position: fixed;
  z-index: 1100;
}

.prestec-modal.open,
.prestec-modal[open] {
  display: flex;
}

.prestec-modal__panel {
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .24);
  margin: auto;
  max-width: 720px;
  width: min(100%, 720px);
}

.prestec-modal__header,
.prestec-modal__footer {
  align-items: flex-start;
  border-bottom: 1px solid var(--prestec-ui-border);
  display: flex;
  gap: var(--prestec-ui-space-5);
  justify-content: space-between;
  padding: var(--prestec-ui-space-6);
}

.prestec-modal__body {
  display: grid;
  gap: var(--prestec-ui-space-5);
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: var(--prestec-ui-space-6);
}

.prestec-modal__footer {
  align-items: center;
  border-bottom: 0;
  border-top: 1px solid var(--prestec-ui-border);
  justify-content: flex-end;
}

.prestec-modal--danger .prestec-modal__panel {
  border-color: #fca5a5;
}

.prestec-workflow-header {
  align-items: center;
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-left: 4px solid var(--prestec-ui-accent);
  border-radius: var(--prestec-ui-radius-lg);
  display: grid;
  gap: var(--prestec-ui-space-3);
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(120px, auto));
  padding: var(--prestec-ui-space-5);
}

.prestec-workflow-header__step,
.prestec-workflow-header__next,
.prestec-workflow-header__owner,
.prestec-workflow-header__due {
  display: grid;
  gap: 2px;
}

.prestec-workflow-header span {
  color: var(--prestec-ui-text-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.prestec-workflow-header strong {
  color: var(--prestec-ui-text);
  font-size: 13px;
}

.prestec-workflow-banner {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: var(--prestec-ui-radius-md);
  color: #1d4ed8;
  line-height: 1.45;
  padding: var(--prestec-ui-space-4) var(--prestec-ui-space-5);
}

.prestec-workflow-banner--risk {
  background: #fff1f2;
  border-color: #fb7185;
  color: #9f1239;
}

.prestec-workflow-banner--warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b45309;
}

.prestec-form {
  display: grid;
  gap: var(--prestec-ui-space-5);
}

.prestec-form__section {
  background: var(--prestec-ui-panel);
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  padding: var(--prestec-ui-space-6);
}

.prestec-form__grid {
  display: grid;
  gap: var(--prestec-ui-space-5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prestec-field {
  display: grid;
  gap: var(--prestec-ui-space-2);
}

.prestec-field label,
.prestec-field > span:first-child {
  color: var(--prestec-ui-text-secondary);
  font-size: var(--prestec-ui-font-label);
  font-weight: 800;
}

.prestec-field input,
.prestec-field select,
.prestec-field textarea {
  border: 1px solid var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-sm);
  font: inherit;
  font-size: var(--prestec-ui-font-form);
  min-height: 32px;
  padding: 6px 8px;
}

.prestec-field--required label::after,
.prestec-field--required > span:first-child::after {
  color: var(--prestec-ui-danger);
  content: " *";
}

.prestec-field--readonly input,
.prestec-field--readonly select,
.prestec-field--readonly textarea,
.prestec-field input[readonly],
.prestec-field textarea[readonly] {
  background: #f8fafc;
  color: var(--prestec-ui-text-secondary);
}

.prestec-field__hint {
  color: var(--prestec-ui-text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.prestec-field__error {
  color: var(--prestec-ui-danger);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.prestec-form__footer {
  align-items: center;
  background: var(--prestec-ui-panel);
  border-top: 1px solid var(--prestec-ui-border);
  bottom: 0;
  display: flex;
  gap: var(--prestec-ui-space-3);
  justify-content: flex-end;
  padding: var(--prestec-ui-space-5);
  position: sticky;
  z-index: 5;
}

.prestec-empty,
.prestec-loading,
.prestec-error {
  border: 1px dashed var(--prestec-ui-border);
  border-radius: var(--prestec-ui-radius-lg);
  line-height: 1.45;
  padding: var(--prestec-ui-space-6);
}

.prestec-empty {
  background: #fff;
  color: var(--prestec-ui-text-secondary);
}

.prestec-loading {
  background: #f8fafc;
  color: var(--prestec-ui-text-secondary);
}

.prestec-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: var(--prestec-ui-danger);
}

@media (max-width: 900px) {
  .prestec-workflow-header,
  .prestec-form__grid {
    grid-template-columns: 1fr;
  }

  .prestec-drawer__panel {
    min-width: 0;
    width: 100vw;
  }
}

/* =========================================================
   PRESTEC UI STANDARD - UI-1C INVENTORY LIST PILOT
   ========================================================= */

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot).prestec-filter-bar {
  display: block;
  margin-bottom: 8px;
  padding: 8px 10px;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-grid {
  align-items: end;
  display: grid;
  gap: 6px 8px;
  grid-template-columns: minmax(230px, 1.6fr) minmax(82px, .55fr) minmax(140px, .9fr) minmax(120px, .8fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(130px, .8fr);
}

.inventory-items-filter-pilot .inventory-items-filter-grid {
  grid-template-columns: minmax(118px, .7fr) minmax(250px, 1.6fr) minmax(82px, .55fr) minmax(140px, .9fr) minmax(120px, .8fr) minmax(270px, 1.25fr);
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field span {
  color: var(--prestec-ui-text-secondary, #475569);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) input,
:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) select {
  border-color: var(--prestec-ui-border, #d7dde3);
  height: 30px;
  padding: 0 8px;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--status {
  grid-column: 1;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--selected {
  grid-column: 2;
}

.inventory-items-filter-pilot .inventory-items-filter-field--selected {
  grid-column: 1;
}

.inventory-items-filter-pilot .inventory-items-filter-field--search {
  grid-column: 2;
}

.inventory-items-filter-pilot .inventory-items-filter-field--block {
  grid-column: 3;
}

.inventory-items-filter-pilot .inventory-items-filter-field--group {
  grid-column: 4;
}

.inventory-items-filter-pilot .inventory-items-filter-field--name-code {
  grid-column: 5;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-actions {
  align-items: end;
  align-self: end;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  grid-column: 3 / -1;
  justify-content: flex-end;
}

.inventory-items-filter-pilot .inventory-items-filter-actions {
  grid-column: 6;
}

:is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-actions .button {
  height: 30px;
  padding: 0 9px;
  white-space: nowrap;
}

.inventory-all-filter-pilot .inventory-readonly-hint {
  color: var(--prestec-ui-text-secondary, #475569);
  font-size: 11px;
  line-height: 1.35;
  margin: 6px 0 0;
}

@media (max-width: 1180px) {
  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-grid {
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(110px, 1fr));
  }

  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--unit-manager,
  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--owner-department,
  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--holder-user,
  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--status,
  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-field--selected {
    grid-column: auto;
  }

  :is(.inventory-items-filter-pilot, .inventory-all-filter-pilot) .inventory-items-filter-actions {
    grid-column: 2 / -1;
  }
}

.inventory-row-actions--pilot {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-end;
}

.prestec-table.inventory-list-table .col-_actions {
  width: 176px;
}

.prestec-table.inventory-list-table.inventory-all-table-pilot .col-_actions {
  width: 92px;
}

.prestec-table.inventory-list-table.inventory-all-table-pilot .col-ownerDepartment,
.prestec-table.inventory-list-table.inventory-all-table-pilot .col-managerUser {
  width: 148px;
}

.prestec-table.inventory-list-table.prestec-table--dense th,
.prestec-table.inventory-list-table.prestec-table--dense td {
  padding: 4px 6px;
}

.prestec-table.inventory-list-table td.prestec-table__number,
.prestec-table.inventory-list-table th.prestec-table__number {
  text-align: right;
}

.prestec-table.inventory-list-table td.prestec-table__actions,
.prestec-table.inventory-list-table th.prestec-table__actions {
  text-align: right;
}

.prestec-table.inventory-list-table .prestec-table__subline {
  line-height: 1.2;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-row-secondary-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 3px;
  opacity: .72;
}

.inventory-row-secondary-actions .button {
  font-size: 10.5px;
  height: 22px;
  line-height: 1;
  padding: 0 5px;
}

.inventory-row-actions--pilot > .button {
  height: 24px;
  padding: 0 7px;
}

.inventory-row-secondary-actions .danger-button {
  border-color: #fca5a5;
  color: var(--prestec-ui-danger, #b91c1c);
}

.inventory-row-actions--pilot:hover .inventory-row-secondary-actions,
.inventory-row-actions--pilot:focus-within .inventory-row-secondary-actions {
  opacity: 1;
}

/* Item edit modal refinement: scoped late to override older inventory modal rules. */
.inventory-item-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-height: min(92vh, 900px);
  max-width: 1040px;
  width: min(1040px, calc(100vw - 32px));
}

.inventory-item-modal-head {
  align-items: flex-start;
}

.inventory-item-modal-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.inventory-item-modal-grid {
  align-content: start;
  display: grid;
  gap: 12px;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 6px 2px 0;
}

.inventory-item-modal-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.inventory-item-modal-section h3 {
  border-bottom: 1px solid #eef2f7;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 10px;
  padding-bottom: 7px;
}

.receiving-draft-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(92vh, 920px);
  overflow: hidden;
  padding: 16px 18px 0;
  width: min(1180px, calc(100vw - 32px));
}

.receiving-draft-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 14px 0;
}

.receiving-draft-form {
  display: grid;
  gap: 12px;
}

.receiving-draft-section {
  min-width: 0;
}

.receiving-legacy-fallback {
  background: #f8fafc;
  border-style: dashed;
}

.receiving-legacy-fallback summary {
  color: #475569;
  cursor: pointer;
  font-weight: 700;
}

.receiving-legacy-fallback[open] {
  background: #fff;
}

.receiving-draft-header-grid {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.receiving-field-help {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
}

.receiving-po-reference-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 10px;
  padding: 8px 10px;
}

.receiving-filter-panel {
  margin-bottom: 12px;
}

.receiving-filter-grid {
  grid-template-columns: minmax(240px, 1.6fr) minmax(160px, 0.9fr) minmax(160px, 0.9fr) repeat(2, minmax(145px, 0.8fr));
}

.receiving-list-section,
.receiving-detail-section,
.receiving-detail-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.receiving-detail-modal,
.receiving-preview-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(92vh, 920px);
  overflow: hidden;
  padding: 16px 18px 0;
  width: min(1120px, calc(100vw - 32px));
}

.receiving-preview-modal {
  width: min(1180px, calc(100vw - 32px));
}

.receiving-modal-header {
  flex-shrink: 0;
}

.receiving-modal-header p {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
}

.receiving-modal-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 14px 0;
}

.receiving-modal-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  margin: 0 -18px;
  padding: 12px 18px;
}

.receiving-status-stack {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}

.receiving-detail-overview {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.receiving-detail-overview > div:first-child {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receiving-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.receiving-cost-note .empty {
  margin: 0;
}

.receiving-preview-body {
  grid-template-columns: 1fr;
}

.receiving-preview-summary-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.receiving-preview-summary-grid > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
}

.receiving-preview-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receiving-preview-issues--blocked {
  border-color: #fecaca;
  background: #fff7f7;
}

.receiving-preview-issues--warning,
.receiving-preview-readiness--blocked {
  border-color: #fed7aa;
  background: #fffaf0;
}

.receiving-preview-readiness--ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.receiving-preview-table-wrap {
  overflow-x: auto;
}

.receiving-preview-table {
  min-width: 980px;
}

.receiving-preview-table th,
.receiving-preview-table td {
  white-space: nowrap;
}

.receiving-preview-table th:nth-child(3),
.receiving-preview-table td:nth-child(3),
.receiving-preview-table th:nth-child(8),
.receiving-preview-table td:nth-child(8) {
  min-width: 220px;
  white-space: normal;
}

.cost-baseline-preview-grid {
  grid-template-columns: minmax(300px, .9fr) minmax(340px, 1.1fr);
  width: 100%;
}

.cost-baseline-preview-grid .inventory-item-modal-section h3,
.cost-baseline-preview-grid .customer-modal-head h2 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cost-baseline-key-section .prestec-table th {
  width: 118px;
}

.cost-baseline-preview-grid .prestec-table {
  table-layout: auto;
  width: 100%;
}

.cost-baseline-preview-grid .prestec-table th,
.cost-baseline-preview-grid .prestec-table td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.cost-baseline-status-cell {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  white-space: normal;
}

.cost-baseline-status-cell .prestec-badge {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 980px) {
  .cost-baseline-preview-grid {
    grid-template-columns: 1fr;
  }
}

.receiving-draft-line-section {
  display: grid;
  gap: 12px;
}

.receiving-line-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.receiving-item-picker {
  background: #f8fafc;
}

.receiving-item-combobox {
  display: grid;
  gap: 6px;
}

.receiving-item-combobox label {
  display: grid;
  gap: 5px;
}

.receiving-item-combobox span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receiving-item-combobox input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 36px;
  padding: 0 10px;
  width: 100%;
}

.receiving-item-picker-results {
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  max-height: 260px;
  overflow: auto;
}

.receiving-selected-item-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.receiving-item-picker-results th,
.receiving-item-picker-results td {
  white-space: nowrap;
}

.receiving-multiline-skeleton {
  display: grid;
  gap: 10px;
}

.receiving-multiline-skeleton-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.receiving-multiline-skeleton-head h3 {
  margin-bottom: 4px;
}

.receiving-multiline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.receiving-multiline-skeleton-wrap {
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  max-height: 340px;
  overflow: auto;
}

.receiving-multiline-skeleton-table {
  min-width: 1320px;
}

.receiving-multiline-skeleton-table th,
.receiving-multiline-skeleton-table td {
  vertical-align: top;
  white-space: nowrap;
}

.receiving-multiline-skeleton-table input,
.receiving-multiline-skeleton-table select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 32px;
  min-width: 120px;
  padding: 0 8px;
}

.receiving-multiline-skeleton-table input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.receiving-multiline-item-placeholder,
.receiving-multiline-item-picker {
  display: grid;
  gap: 4px;
  min-width: 240px;
}

.receiving-multiline-item-placeholder span {
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.receiving-multiline-row-item {
  display: grid;
  gap: 6px;
  min-width: 250px;
}

.receiving-multiline-row-summary {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.receiving-multiline-row-summary strong,
.receiving-multiline-row-summary span {
  white-space: normal;
}

.receiving-multiline-item-picker input {
  width: 100%;
}

.receiving-multiline-picker-hint,
.receiving-multiline-picker-error,
.receiving-multiline-picker-empty {
  font-size: 12px;
  white-space: normal;
}

.receiving-multiline-picker-error {
  color: #991b1b;
}

.receiving-multiline-picker-empty {
  color: var(--muted);
}

.receiving-multiline-search-suggestions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.receiving-multiline-search-suggestions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receiving-multiline-selected-item {
  align-items: flex-start;
  display: grid;
  gap: 5px;
  white-space: normal;
}

.receiving-multiline-selected-item span {
  white-space: normal;
}

.receiving-multiline-picker-results {
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  max-height: 220px;
  overflow: auto;
}

.receiving-multiline-picker-results th,
.receiving-multiline-picker-results td {
  white-space: nowrap;
}

.receiving-line-warning-cell {
  min-width: 220px;
  white-space: normal;
}

.receiving-multiline-row-invalid > td {
  background: #fff7ed;
}

.receiving-multiline-skeleton-table .receiving-field-invalid,
.receiving-multiline-skeleton-table input.receiving-field-invalid,
.receiving-multiline-skeleton-table select.receiving-field-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.receiving-multiline-row-errors td {
  background: #fff7ed;
  border-top: 0;
  white-space: normal;
}

.receiving-row-error-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.receiving-row-error-badge {
  white-space: normal;
}

.receiving-multiline-picker-panel-row td {
  background: #f8fafc;
  border-top: 0;
}

.receiving-multiline-picker-panel {
  display: grid;
  gap: 6px;
  min-width: 680px;
}

.receiving-multiline-panel-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 1200;
}

.receiving-multiline-panel {
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(86vh, 720px);
  overflow: hidden;
  width: min(920px, calc(100vw - 32px));
}

.receiving-multiline-panel-head,
.receiving-multiline-panel-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.receiving-multiline-panel-head {
  border-bottom: 1px solid #e2e8f0;
}

.receiving-multiline-panel-head h3 {
  margin: 0 0 3px;
}

.receiving-multiline-panel-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
}

.receiving-multiline-panel-search {
  display: grid;
  gap: 5px;
}

.receiving-multiline-panel-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receiving-multiline-panel-search input {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 36px;
  padding: 0 10px;
  width: 100%;
}

.receiving-multiline-panel-results {
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  max-height: 360px;
  overflow: auto;
}

.receiving-multiline-panel-results th,
.receiving-multiline-panel-results td {
  white-space: nowrap;
}

.receiving-multiline-panel-actions {
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
}

.receiving-multiline-validation {
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  bottom: 8px;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, .08);
  display: grid;
  gap: 8px;
  padding: 10px;
  position: sticky;
  z-index: 3;
}

.receiving-multiline-validation > .button {
  justify-self: end;
  min-height: 40px;
}

.receiving-multiline-validation > button.secondary[disabled] {
  display: none;
}

.receiving-multiline-validation-result ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.receiving-draft-actions {
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 20px rgba(15, 23, 42, .08);
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0 -18px;
  padding: 12px 18px;
  position: sticky;
  bottom: 0;
  z-index: 4;
}

.receiving-draft-actions .button,
.issue-draft-actions .button,
.handover-create-actions .button {
  min-height: 40px;
}

@media (max-width: 900px) {
  .receiving-draft-modal-card {
    max-height: calc(100vh - 20px);
    padding: 12px 12px 0;
    width: calc(100vw - 16px);
  }

  .receiving-detail-modal,
  .receiving-preview-modal {
    max-height: calc(100vh - 20px);
    padding: 12px 12px 0;
    width: calc(100vw - 16px);
  }

  .receiving-draft-header-grid,
  .receiving-line-grid,
  .receiving-filter-grid,
  .receiving-item-picker .filter-grid {
    grid-template-columns: 1fr;
  }

  .receiving-multiline-skeleton-head {
    align-items: stretch;
    flex-direction: column;
  }

  .receiving-multiline-actions {
    justify-content: flex-start;
  }

  .receiving-multiline-panel {
    max-height: calc(100vh - 24px);
    width: calc(100vw - 16px);
  }

  .receiving-draft-actions {
    margin: 0 -12px;
    padding: 10px 12px;
  }

  .receiving-modal-footer {
    margin: 0 -12px;
    padding: 10px 12px;
  }

  .receiving-preview-summary-grid {
    grid-template-columns: 1fr;
  }

  .receiving-detail-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .receiving-detail-actions {
    justify-content: flex-start;
  }
}

.inventory-item-form-grid {
  display: grid;
  gap: 10px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-item-form-grid .wide {
  grid-column: 1 / -1;
}

.inventory-item-form-grid .field {
  margin: 0;
  min-width: 0;
}

.inventory-effective-threshold-panel {
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.inventory-effective-threshold-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.inventory-effective-threshold-head strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
}

.inventory-effective-threshold-head small,
.inventory-effective-threshold-loading,
.inventory-effective-threshold-empty {
  color: var(--muted);
  font-size: 12px;
}

.inventory-effective-threshold-head-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.inventory-effective-threshold-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.inventory-effective-threshold-grid span {
  background: #fff;
  border: 1px solid #e5edf6;
  border-radius: 6px;
  padding: 8px;
}

.inventory-effective-threshold-grid em {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-style: normal;
}

.inventory-effective-threshold-grid strong {
  color: var(--ink);
  display: block;
  font-size: 14px;
  margin-top: 3px;
}

.inventory-effective-threshold-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.inventory-effective-threshold-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.inventory-effective-threshold-form label {
  margin: 0;
}

.inventory-effective-threshold-form label span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.inventory-effective-threshold-form input,
.inventory-effective-threshold-form select,
.inventory-effective-threshold-form textarea {
  width: 100%;
}

.inventory-effective-threshold-form .wide {
  grid-column: 1 / -1;
}

.inventory-unit-control,
.inventory-location-control {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.inventory-unit-add-button,
.inventory-location-add-button {
  height: 32px;
  min-width: 58px;
  padding: 0 10px;
  white-space: nowrap;
}

.inventory-unit-add-panel,
.inventory-location-add-panel {
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 8px;
  padding: 8px;
}

.inventory-unit-add-panel[hidden],
.inventory-location-add-panel[hidden] {
  display: none;
}

.inventory-unit-add-actions,
.inventory-location-add-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.inventory-unit-add-actions .button,
.inventory-location-add-actions .button {
  height: 32px;
  padding: 0 10px;
}

.inventory-returnable-field {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
}

.inventory-returnable-field input {
  margin: 0;
  width: auto;
}

.inventory-item-modal-actions {
  background: #fff;
  border-top: 1px solid var(--line);
  margin: 10px -2px 0;
  padding-top: 10px;
  position: sticky;
  bottom: 0;
}

@media (max-width: 760px) {
  .inventory-item-form-grid {
    grid-template-columns: 1fr;
  }

  .inventory-unit-control,
  .inventory-unit-add-panel,
  .inventory-location-control,
  .inventory-location-add-panel {
    grid-template-columns: 1fr;
  }
}
/* Phase 1E-Code-05.4: inventory item threshold management */
.threshold-filter-card,
.threshold-table-card {
  margin-bottom: 12px;
}

.threshold-summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.threshold-summary-pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.threshold-summary-pill span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.threshold-summary-pill strong {
  color: var(--ink);
  display: block;
  font-size: 18px;
  line-height: 1;
  margin-top: 4px;
}

.threshold-summary-pill.active,
.threshold-quick-view-bar .button.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.threshold-quick-view-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.threshold-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.threshold-filter-grid label,
.threshold-form .field {
  display: grid;
  gap: 5px;
}

.threshold-filter-grid span,
.threshold-form .field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.threshold-filter-grid input,
.threshold-filter-grid select,
.threshold-form input,
.threshold-form select,
.threshold-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 32px;
  padding: 6px 8px;
  width: 100%;
}

.threshold-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.threshold-table-wrap {
  max-height: calc(100vh - 310px);
  overflow: auto;
}

.threshold-summary-table {
  min-width: 1380px;
  table-layout: fixed;
}

.threshold-summary-table .threshold-col-code {
  width: 170px;
}

.threshold-summary-table .threshold-col-name {
  width: 260px;
}

.threshold-summary-table .threshold-col-unit {
  width: 70px;
}

.threshold-summary-table .threshold-col-holder {
  width: 180px;
}

.threshold-summary-table .threshold-col-number {
  width: 92px;
}

.threshold-summary-table .threshold-col-reorder {
  width: 116px;
}

.threshold-summary-table .threshold-col-source {
  width: 120px;
}

.threshold-summary-table .threshold-col-status {
  width: 125px;
}

.threshold-summary-table .threshold-col-actions {
  width: 190px;
}

.threshold-table th,
.threshold-table td {
  line-height: 1.28;
  padding: 7px 8px;
  vertical-align: top;
}

.threshold-table th {
  white-space: nowrap;
}

.threshold-table td {
  overflow-wrap: anywhere;
}

.threshold-table td.wrap {
  white-space: normal;
}

.threshold-table .threshold-code-cell,
.threshold-table .threshold-holder-cell {
  white-space: normal;
}

.threshold-table .threshold-code-cell strong {
  display: block;
  line-height: 1.3;
}

.threshold-table .threshold-name-cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.threshold-table .threshold-unit-cell {
  overflow-wrap: normal;
  text-align: center;
  white-space: nowrap;
}

.threshold-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
}

.threshold-table .threshold-actions-cell {
  white-space: normal;
}

.threshold-table .threshold-actions-cell.compact-actions {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.threshold-table .threshold-actions-cell .button,
.threshold-table .threshold-actions-cell .muted-note {
  justify-content: center;
  line-height: 1.25;
  min-height: 28px;
  white-space: normal;
}

.threshold-modal-card {
  max-width: 820px;
}

.threshold-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
}

.threshold-form-grid .wide {
  grid-column: 1 / -1;
}

.threshold-form input[readonly],
.threshold-form select:disabled {
  background: #f3f5f7;
  color: var(--muted);
}

.threshold-modal-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  padding-top: 12px;
}

@media (max-width: 1100px) {
  .threshold-filter-grid,
  .threshold-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .threshold-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.inventory-outflow-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inventory-outflow-tabs {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
}

.inventory-outflow-tabs button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 46px;
  padding: 8px 12px;
  text-align: center;
}

.inventory-outflow-tabs button strong {
  color: var(--ink);
  font-size: .9rem;
}

.inventory-outflow-tabs button span {
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.25;
}

.inventory-outflow-tabs button.active {
  background: #fff;
  border-color: var(--prestec-orange);
  box-shadow: 0 1px 5px rgba(26, 26, 26, .08);
  color: var(--prestec-orange-dark);
}

.issue-export-readonly {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.issue-export-topbar p {
  max-width: 820px;
}

.issue-export-filter-card,
.issue-export-list-card {
  margin: 0;
}

.issue-export-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.issue-export-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue-export-filters label span {
  color: var(--muted);
  font-size: .78rem;
}

.issue-export-filters input,
.issue-export-filters select {
  width: 100%;
}

.issue-export-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.issue-export-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.issue-export-summary div {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.issue-export-summary span {
  color: var(--muted);
  font-size: .78rem;
}

.issue-export-summary strong {
  font-size: 1rem;
}

.issue-export-table th,
.issue-export-table td,
.issue-export-lines-table th,
.issue-export-lines-table td {
  vertical-align: top;
}

.issue-export-table .link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--prestec-orange-dark);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.issue-export-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.issue-export-detail-modal {
  max-width: min(1120px, calc(100vw - 32px));
}

.issue-export-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.issue-export-modal-header span {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.issue-export-modal-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.issue-export-detail-actions {
  gap: 8px;
}

.issue-export-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.issue-export-detail-meta th {
  width: 14%;
}

.issue-export-detail-meta td {
  width: 36%;
}

.issue-export-create-denied {
  align-self: center;
  max-width: 220px;
}

.issue-draft-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 48px);
  max-width: min(1180px, calc(100vw - 32px));
  overflow: hidden;
  width: min(1180px, calc(100vw - 32px));
}

.issue-draft-modal .issue-export-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.issue-draft-modal .issue-export-modal-header h2,
.receiving-draft-modal-card h2,
.handover-create-modal-head h2,
.document-items-card h2 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.issue-cancel-draft-modal {
  max-width: min(640px, calc(100vw - 32px));
}

.issue-post-preview-modal {
  max-width: min(1180px, calc(100vw - 32px));
}

.issue-cancel-draft-modal .issue-export-modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.issue-cancel-draft-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue-cancel-draft-modal label span {
  color: var(--muted);
  font-size: .78rem;
}

.issue-draft-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-draft-info-section {
  background: #fbfaf8;
}

.issue-draft-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.issue-draft-section-head h3 {
  margin: 0;
}

.issue-draft-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(180px, .75fr) minmax(220px, 1fr);
  gap: 12px;
}

.issue-draft-form-grid label,
.issue-draft-line-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue-draft-form-grid label span,
.issue-draft-line-grid label span {
  color: var(--muted);
  font-size: .78rem;
}

.issue-draft-form-grid .wide {
  grid-column: 1 / -1;
}

.issue-draft-lines {
  display: grid;
  gap: 0;
}

.issue-draft-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.issue-draft-table-head,
.issue-draft-table-row {
  display: grid;
  grid-template-columns:
    48px
    minmax(220px, 1.35fr)
    minmax(105px, .7fr)
    minmax(170px, 1.1fr)
    66px
    minmax(92px, .65fr)
    minmax(105px, .7fr)
    minmax(130px, .9fr)
    82px;
}

.issue-draft-table-head {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.issue-draft-table-head span,
.issue-draft-cell {
  border-right: 1px solid var(--line);
  min-width: 0;
  padding: 10px;
}

.issue-draft-table-head span:last-child,
.issue-draft-cell:last-child {
  border-right: 0;
}

.issue-draft-table-row + .issue-draft-table-row {
  border-top: 1px solid var(--line);
}

.issue-draft-cell {
  display: grid;
  gap: 5px;
}

.issue-draft-cell--index,
.issue-draft-cell--actions,
.issue-draft-cell--number {
  align-content: start;
}

.issue-draft-cell--index,
.issue-draft-cell--number {
  text-align: right;
}

.issue-draft-cell--actions {
  justify-items: end;
}

.issue-draft-cell--name small {
  color: var(--muted);
  display: block;
  font-size: .78rem;
  line-height: 1.35;
}

.issue-draft-cell label,
.issue-draft-item-search {
  display: grid;
  gap: 6px;
}

.issue-draft-cell input {
  min-width: 0;
  width: 100%;
}

.issue-draft-mobile-label {
  color: var(--muted);
  display: none;
  font-size: .74rem;
  font-weight: 800;
}

.issue-draft-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.issue-draft-line-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(140px, .7fr) minmax(180px, 1fr);
  gap: 12px;
}

.issue-draft-selected-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1.8fr;
  gap: 12px;
}

.issue-draft-selected-item > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.issue-draft-selected-item span,
.issue-draft-selected-item small {
  color: var(--muted);
}

.issue-draft-selected-item dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.issue-draft-selected-item dt {
  color: var(--muted);
  font-size: .75rem;
}

.issue-draft-selected-item dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.issue-draft-picker-state {
  color: var(--muted);
  font-size: .86rem;
}

.issue-draft-picker-state.error {
  color: var(--danger);
}

.issue-draft-picker-results {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.issue-draft-picker-result {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(180px, 1.2fr) minmax(240px, 1.8fr);
  gap: 10px;
  cursor: pointer;
}

.issue-draft-picker-result:last-child {
  border-bottom: 0;
}

.issue-draft-picker-result:hover:not(:disabled) {
  background: #fff7ed;
}

.issue-draft-picker-result:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.issue-draft-picker-result small,
.issue-draft-picker-result em {
  color: var(--muted);
  font-size: .78rem;
}

.issue-draft-alert {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.issue-draft-alert strong {
  display: block;
  margin-bottom: 6px;
}

.issue-draft-alert ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.issue-draft-alert--error {
  border-color: #fecaca;
  background: #fef2f2;
}

.issue-draft-alert--success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.issue-draft-backend-list li + li {
  margin-top: 4px;
}

.issue-draft-backend-list span {
  display: block;
  color: var(--muted);
}

.issue-draft-validation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.issue-draft-validation-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 9px;
  font-size: .82rem;
}

.issue-preview-readiness {
  border-left: 4px solid var(--line);
}

.issue-preview-readiness--pass {
  border-left-color: var(--success);
}

.issue-preview-readiness--fail {
  border-left-color: var(--danger);
}

.issue-preview-readiness h3 {
  margin: 0 0 10px;
}

.issue-preview-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.issue-preview-summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.issue-preview-summary-grid span {
  color: var(--muted);
  display: block;
  font-size: .78rem;
  margin-bottom: 4px;
}

.issue-preview-summary-grid strong {
  color: var(--ink);
  display: block;
  font-size: 1rem;
}

.issue-preview-message-list {
  margin: 0;
  padding-left: 18px;
}

.issue-preview-message-list li + li {
  margin-top: 6px;
}

.issue-preview-message-list span {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.issue-preview-lines-table {
  min-width: 1080px;
}

.issue-preview-lines-table th,
.issue-preview-lines-table td {
  vertical-align: top;
}

.issue-preview-cost-hidden {
  margin-bottom: 0;
}

.issue-post-confirm-section {
  display: grid;
  gap: 12px;
}

.issue-post-confirm-section h3 {
  margin: 0;
}

.issue-post-confirm-section label {
  display: grid;
  gap: 6px;
}

.issue-post-confirm-section label span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.issue-post-confirm-section input {
  max-width: 320px;
}

.issue-post-confirm-actions {
  justify-content: flex-end;
}

.issue-draft-actions {
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 20px rgba(15, 23, 42, .08);
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0 -16px -16px;
  padding: 12px 16px 16px;
  position: sticky;
  bottom: 0;
  z-index: 4;
}

@media (max-width: 1120px) {
  .issue-export-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .issue-export-filter-actions {
    grid-column: 1 / -1;
  }

  .issue-draft-form-grid,
  .issue-draft-line-grid,
  .issue-draft-table-head,
  .issue-draft-table-row,
  .issue-draft-selected-item,
  .issue-draft-picker-result {
    grid-template-columns: 1fr;
  }

  .issue-draft-table-head {
    display: none;
  }

  .issue-draft-table-row {
    padding: 8px;
  }

  .issue-draft-cell {
    border-right: 0;
    padding: 8px;
  }

  .issue-draft-cell--index,
  .issue-draft-cell--number {
    text-align: left;
  }

  .issue-draft-cell--actions {
    justify-items: start;
  }

  .issue-draft-mobile-label {
    display: block;
  }

  .issue-draft-selected-item dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .issue-preview-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .inventory-outflow-tabs,
  .issue-export-summary,
  .issue-export-filters,
  .issue-draft-form-grid,
  .issue-draft-selected-item dl {
    grid-template-columns: 1fr;
  }

  .handover-layout .document-side,
  .handover-returnable-filters,
  .handover-item-search-row {
    grid-template-columns: 1fr;
  }

  .handover-layout.is-create-open .document-main {
    inset: 10px;
    padding: 12px 12px 0;
    width: calc(100vw - 20px);
  }

  .handover-create-modal-head {
    flex-direction: column;
  }

  .handover-action-note {
    flex: 1 0 100%;
    max-width: none;
  }
}
