:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --line-soft: #edf2f7;
  --primary: #1d4ed8;
  --primary-dark: #153e75;
  --success: #047857;
  --warning: #b45309;
  --danger: #be123c;
  --shadow: 0 14px 40px rgba(15, 23, 42, .08);
  --shadow-sm: 0 5px 18px rgba(15, 23, 42, .06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
  outline: none;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

tr:hover td {
  background: #f8fafc;
}

.collective-description {
  margin-top: 6px;
  white-space: pre-wrap;
  line-height: 1.45;
  color: #0f172a;
  font-size: 12px;
}

.boot,
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 0%, #1e3a8a 0, #0f172a 48%, #020617 100%);
  color: #fff;
  padding: 20px;
}

.boot {
  gap: 14px;
  grid-template-columns: auto auto;
}

.boot h1,
.boot p {
  margin: 0;
}

.boot p {
  color: #cbd5e1;
}

.boot-mark,
.brand-mark {
  height: 56px;
  width: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .25);
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(2, 6, 23, .32);
}

.login-card .brand-mark {
  margin: 0 auto 18px;
  background: var(--primary-dark);
  color: #fff;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 25px;
}

.login-card label,
.form-grid span {
  display: block;
  margin: 14px 0 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.muted,
.hint {
  color: var(--muted);
  line-height: 1.55;
}

.hint {
  text-align: center;
  font-size: 12px;
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0b1220 0%, #111827 58%, #0f172a 100%);
  color: #cbd5e1;
  padding: 14px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 10px;
}

.side-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  overflow: hidden;
  border-radius: 12px;
  font-weight: 900;
}

.side-logo.logo-image {
  padding: 4px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}

.side-logo.logo-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.side-logo.logo-fallback {
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  letter-spacing: .02em;
}

.side-brand strong,
.side-brand span {
  display: block;
}

.side-brand span {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

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

.sidebar button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  padding: 10px;
  text-align: left;
  font-weight: 700;
}

.sidebar button:hover,
.sidebar button.active {
  color: #fff;
  background: rgba(59, 130, 246, .16);
  border-color: rgba(147, 197, 253, .16);
}

.nav-icon {
  width: 22px;
  text-align: center;
}

.logout {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  font-size: 25px;
}

.topbar p {
  color: var(--muted);
  margin-top: 2px;
}

.notice {
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 0 16px;
}

.tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 14px;
  font-weight: 800;
}

.tabs button.selected {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}

.content {
  display: grid;
  gap: 16px;
}

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

.kpi,
.panel,
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.table-card {
  overflow-x: auto;
  max-width: 100%;
}

.table-card td:first-child,
.table-card th:first-child,
.table-card td:nth-child(4),
.table-card th:nth-child(4) {
  min-width: 0;
}

.table-card strong,
.collective-description {
  overflow-wrap: anywhere;
}

.management-report-table {
  min-width: 4600px;
  table-layout: auto;
}

.management-report-table th,
.management-report-table td,
.item-profit-table th,
.item-profit-table td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  vertical-align: middle;
}

.management-report-table th,
.item-profit-table th {
  text-align: center;
}

.management-report-table td:last-child {
  min-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.item-profit-table {
  min-width: 1650px;
}

.item-profit-table td:first-child {
  min-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.kpi {
  padding: 18px;
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 25px;
}

.panel {
  padding: 18px;
}

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

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.shop-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.shop-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.shop-card h3,
.shop-card p {
  margin: 0;
}

.shop-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.operation-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.operation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
}

.operation-head h3,
.operation-head p {
  margin: 0;
}

.operation-head h3 {
  font-size: 15px;
}

.operation-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.operation-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.operation-metrics div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.operation-metrics strong,
.operation-metrics span {
  display: block;
}

.operation-metrics span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.operation-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

.operation-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

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

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

.shop-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.shop-metrics div {
  border-radius: 9px;
  background: #f8fafc;
  padding: 10px;
}

.shop-metrics strong,
.shop-metrics span {
  display: block;
}

.shop-metrics strong {
  font-size: 20px;
}

.shop-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.compact-field {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.compact-field input {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.shop-orders {
  display: grid;
  gap: 7px;
}

.shop-orders > div {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 7px;
  font-size: 12px;
}

.shop-orders span,
.shop-orders small {
  color: var(--muted);
}

.record-list button {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
}

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

.activity > div {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.activity strong,
.activity span,
.activity p {
  display: block;
  margin: 0;
}

.activity span,
.activity p {
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.actions input {
  max-width: 360px;
}

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(150px, 190px));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

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

.filter-panel strong {
  font-size: 16px;
}

.filter-panel > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.filter-panel label span {
  display: block;
  margin: 0 0 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.toggle-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #f8fafc;
}

.toggle-filter input {
  width: auto;
}

.toggle-filter span {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.primary,
.ghost,
.tiny {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

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

.primary:hover {
  background: var(--primary-dark);
}

.ghost {
  background: #fff;
  color: #334155;
  border-color: var(--line);
}

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

.wide {
  width: 100%;
}

.line-editor {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.line-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.line-editor-head span {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.line-editor-scroll {
  overflow-x: auto;
  max-height: min(52vh, 540px);
}

.line-editor-table {
  min-width: 1180px;
  width: 100%;
  border-collapse: collapse;
}

.line-editor-table th,
.line-editor-table td {
  border: 1px solid var(--line);
  padding: 7px;
  vertical-align: middle;
}

.line-editor-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-align: left;
}

.line-editor-table input,
.line-editor-table select {
  width: 100%;
  min-width: 115px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.document-lines-table {
  min-width: 1320px;
  table-layout: fixed;
}

.document-lines-table th:nth-child(1),
.document-lines-table td:nth-child(1) {
  width: 58px;
}

.document-lines-table th:nth-child(2),
.document-lines-table td:nth-child(2) {
  width: 190px;
}

.document-lines-table th:nth-child(3),
.document-lines-table td:nth-child(3) {
  width: 180px;
}

.document-lines-table th:nth-child(4),
.document-lines-table td:nth-child(4) {
  width: 440px;
}

.document-lines-table th:nth-child(5),
.document-lines-table td:nth-child(5),
.document-lines-table th:nth-child(6),
.document-lines-table td:nth-child(6),
.document-lines-table th:nth-child(7),
.document-lines-table td:nth-child(7) {
  width: 150px;
}

.document-lines-table th:nth-child(8),
.document-lines-table td:nth-child(8) {
  width: 130px;
}

.bom-components-table {
  min-width: 2460px;
  table-layout: fixed;
}

.bom-components-table th:nth-child(1),
.bom-components-table td:nth-child(1) {
  width: 58px;
}

.bom-components-table th:nth-child(2),
.bom-components-table td:nth-child(2) {
  width: 190px;
}

.bom-components-table th:nth-child(3),
.bom-components-table td:nth-child(3) {
  width: 250px;
}

.bom-components-table th:nth-child(4),
.bom-components-table td:nth-child(4) {
  width: 260px;
}

.bom-components-table th:nth-child(5),
.bom-components-table td:nth-child(5) {
  width: 580px;
}

.bom-components-table th:nth-child(6),
.bom-components-table td:nth-child(6) {
  width: 150px;
}

.bom-components-table th:nth-child(7),
.bom-components-table td:nth-child(7) {
  width: 160px;
}

.bom-components-table th:nth-child(8),
.bom-components-table td:nth-child(8) {
  width: 160px;
}

.bom-components-table th:nth-child(9),
.bom-components-table td:nth-child(9) {
  width: 230px;
}

.bom-components-table th:nth-child(10),
.bom-components-table td:nth-child(10) {
  width: 150px;
}

.bom-components-table th:nth-child(11),
.bom-components-table td:nth-child(11) {
  width: 310px;
}

.bom-components-table th:nth-child(12),
.bom-components-table td:nth-child(12) {
  width: 150px;
}

.bom-components-table th:nth-child(13),
.bom-components-table td:nth-child(13) {
  width: 130px;
}

.purchase-lines-table {
  min-width: 1420px;
  table-layout: fixed;
}

.purchase-lines-table th:nth-child(1),
.purchase-lines-table td:nth-child(1) {
  width: 260px;
}

.purchase-lines-table th:nth-child(2),
.purchase-lines-table td:nth-child(2) {
  width: 460px;
}

.purchase-lines-table th:nth-child(3),
.purchase-lines-table td:nth-child(3),
.purchase-lines-table th:nth-child(4),
.purchase-lines-table td:nth-child(4),
.purchase-lines-table th:nth-child(5),
.purchase-lines-table td:nth-child(5),
.purchase-lines-table th:nth-child(6),
.purchase-lines-table td:nth-child(6) {
  width: 155px;
}

.purchase-lines-table th:nth-child(n+7),
.purchase-lines-table td:nth-child(n+7) {
  width: 170px;
}

.cost-source-cell .pill {
  white-space: normal;
  line-height: 1.25;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.mini-check input {
  width: auto;
  min-width: 0;
}

.mini-check span {
  margin: 0;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.line-params-row td {
  background: #f8fafc;
}

.line-params {
  display: grid;
  gap: 10px;
}

.line-params strong {
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

.line-param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.line-param-grid label {
  margin: 0;
}

.tiny {
  padding: 6px 9px;
  margin-left: 6px;
  font-size: 12px;
  background: #f8fafc;
  border-color: var(--line);
}

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

.table-card {
  overflow: auto;
}

.table-title {
  margin: 0;
  padding: 14px 14px 0;
  font-size: 17px;
}

.variance-row td {
  background: #fff7ed !important;
}

.variance-row strong {
  color: var(--danger);
}

.material-summary {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.logo-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  margin: 12px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.company-logo-preview,
.logo-placeholder {
  width: 120px;
  height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.company-logo-preview {
  object-fit: contain;
  padding: 8px;
}

.logo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

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

.template-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.template-card h3 {
  margin: 0 0 8px;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
}

.pill.confirmed,
.pill.completed,
.pill.posted,
.pill.active {
  background: #ecfdf5;
  color: var(--success);
}

.pill.cancelled,
.pill.failed {
  background: #fff1f2;
  color: var(--danger);
}

.pill.in-progress,
.pill.planned,
.pill.draft {
  background: #eff6ff;
  color: var(--primary);
}

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

.modal {
  width: min(1120px, calc(100vw - 36px));
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, .35);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  margin: 0;
}

.modal-head {
  cursor: grab;
  user-select: none;
}

.modal-head:active,
.modal.dragging .modal-head {
  cursor: grabbing;
}

.modal-drag-handle {
  flex: 1;
  min-width: 0;
}

.modal-drag-hint,
.modal-drag-handle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

.icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 22px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  padding: 18px;
}

.form-grid .check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}

.form-grid .check input {
  width: auto;
}

.form-grid .check span {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

.empty,
.error-page {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #f8fafc;
}

.report-list {
  margin: 10px 0 0;
  padding-left: 18px;
  max-height: 260px;
  overflow: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.searchable-select {
  position: relative;
  width: 100%;
  min-width: 120px;
}

.searchable-select-input {
  width: 100%;
  min-width: 0;
  cursor: text;
  padding-right: 30px;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    #fff;
}

.searchable-select.is-open .searchable-select-input {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.searchable-select.is-disabled {
  opacity: .72;
}

.searchable-select-native {
  position: absolute !important;
  pointer-events: none !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  left: 0 !important;
  top: 0 !important;
}

.searchable-select-menu {
  position: fixed;
  z-index: 99999;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
  padding: 6px;
  word-break: normal;
  overflow-wrap: anywhere;
}

.searchable-select-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  margin: 0;
  padding: 9px 10px;
  text-align: left;
}

.searchable-select-option:hover,
.searchable-select-option.is-highlighted {
  background: #eef4ff;
}

.searchable-select-option.is-selected {
  background: #dbeafe;
  color: #123b7a;
  font-weight: 800;
}

.searchable-select-main,
.searchable-select-subtext {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.searchable-select-subtext {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

.searchable-select-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 9px 10px;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .kpi-grid,
  .panel.two,
  .shop-grid,
  .operation-grid,
  .summary-grid,
  .filter-panel,
  .logo-row,
  .template-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions input {
    max-width: none;
  }
}

/* Product catalogue filters and readable technical columns. */
.product-catalogue .catalogue-filters { display: grid; grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.product-catalogue .catalogue-filter { display: grid; gap: 6px; min-width: 0; }
.product-catalogue .catalogue-filter span { font-weight: 700; font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.product-catalogue .catalogue-table { overflow-x: auto; }
.product-catalogue .catalogue-table table { min-width: 980px; }
.product-catalogue .catalogue-spec { min-width: 220px; max-width: 420px; white-space: normal; line-height: 1.3; }
@media (max-width: 900px) { .product-catalogue .catalogue-filters { grid-template-columns: 1fr 1fr; } .product-catalogue .catalogue-search { grid-column: 1 / -1; } }
@media (max-width: 600px) { .product-catalogue .catalogue-filters { grid-template-columns: 1fr; } }


/* ERP-wide stability for wide data-entry tables and modals. */
.nav-icon:empty { display: none; }
.table-card, .table-scroll, .tabs, .modal .table-wrap, .modal .table-card { overflow-x: auto; overflow-y: visible; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; scrollbar-width: auto; }
.table-card table { min-width: max-content; }
.modal { overscroll-behavior: contain; }
.modal input, .modal textarea, .modal select, .searchable-select-input { scroll-margin: 96px; }

/* Sidebar vertical movement: keeps all modules and Sign out reachable. */
.sidebar { overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.sidebar nav { flex: 0 0 auto; }
.logout { flex: 0 0 auto; }


/* Floating horizontal scrollbar for long ERP tables and tab strips. */
.erp-horizontal-scroll-proxy { position: fixed; bottom: 10px; height: 24px; overflow-x: auto; overflow-y: hidden; z-index: 5000; display: none; background: rgba(255,255,255,.98); border: 1px solid #64748b; border-radius: 6px; box-shadow: 0 4px 14px rgba(15,23,42,.18); overscroll-behavior: contain; touch-action: pan-x; cursor: grab; scrollbar-width: auto; }
.erp-horizontal-scroll-proxy:active { cursor: grabbing; }
.erp-horizontal-scroll-content { height: 1px; }


/* Clear two-row Internal Manufacturing Order production entry. */
.imo-production-line { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 12px 0; background: #fff; }
.imo-line-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.imo-line-grid { display: grid; gap: 10px; margin-bottom: 10px; }
.imo-line-grid.primary { grid-template-columns: minmax(190px, 1.5fr) minmax(180px, 1.5fr) minmax(130px, 1fr) minmax(110px, .65fr) minmax(110px, .65fr) minmax(130px, .8fr); }
.imo-line-grid.secondary { grid-template-columns: minmax(170px, 1fr) minmax(200px, 1.4fr) minmax(200px, 1.4fr) minmax(105px, .6fr) minmax(105px, .6fr) minmax(180px, 1fr); }
.imo-line-grid label { min-width: 0; }
.imo-line-grid textarea { min-height: 76px; resize: vertical; }
.imo-line-grid input[disabled] { color: var(--ink); background: #f8fafc; }
.imo-description summary { cursor: pointer; color: var(--primary); font-weight: 700; }
.imo-description pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; color: var(--muted); }
.material-monitor-card { min-width: min(100%, 560px); }
.compact-table { min-width: 680px; font-size: 12px; }
.warning-text { color: #b45309; font-weight: 700; margin: 8px 0 0; }
@media (max-width: 1100px) { .imo-line-grid.primary, .imo-line-grid.secondary { grid-template-columns: repeat(2, minmax(220px, 1fr)); } }
@media (max-width: 640px) { .imo-line-grid.primary, .imo-line-grid.secondary { grid-template-columns: 1fr; } }


/* Internal M.O. product line header: readable, high-contrast, and not a button style. */
.imo-line-grid.imo-line-main { background: #eaf2ff; border: 1px solid #2563eb; border-radius: 8px; padding: 12px; }
.imo-line-grid.imo-line-main label > span { color: #173a71; font-weight: 800; }
.imo-line-grid.imo-line-main input, .imo-line-grid.imo-line-main select { background: #fff; }


/* Selected source serials remain visible and can be removed with one click. */
.serial-chip-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.serial-chip { background: #eaf2ff; border: 1px solid #2563eb; color: #173a71; border-radius: 999px; padding: 3px 7px; font-size: 12px; }


/* Horizontal scrolling reliability fix. */
.table-card, .table-scroll, .table-wrap, .responsive-table, .data-table-wrapper, .tabs {
  scrollbar-width: auto;
  scrollbar-color: #64748b #e2e8f0;
}
.erp-horizontal-scroll-proxy {
  height: 30px;
  bottom: 6px;
  z-index: 12000;
  scrollbar-color: #475569 #e2e8f0;
  -webkit-overflow-scrolling: touch;
}
.erp-horizontal-scroll-proxy::-webkit-scrollbar { height: 16px; }
.erp-horizontal-scroll-proxy::-webkit-scrollbar-thumb { background: #64748b; border-radius: 8px; border: 3px solid #fff; }
.erp-horizontal-scroll-proxy::-webkit-scrollbar-track { background: #e2e8f0; border-radius: 8px; }


/* FICO-SERIAL-TRACEABILITY-TESTING-MO-V1 */
.serial-missing-row td { background: #fff0f1 !important; color: #b00020; font-weight: 700; }
.serial-traceability-panel .table-scroll { max-height: 420px; overflow: auto; border: 1px solid #d8e1ee; border-radius: 8px; }
.testing-task-note { margin: 0 0 14px; padding: 10px 12px; border-left: 4px solid #2451d8; background: #f1f5ff; color: #1e3f85; }
.testing-task-note strong { margin-right: 4px; }

/* Executive Quality KPI cards: clear label, value and supporting detail. */
.quality-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quality-summary-card {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 7px;
  min-height: 126px;
  padding: 18px;
  border: 1px solid #d9e3f0;
  border-left: 4px solid #2456d8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(15, 35, 65, 0.06);
}

.quality-summary-label {
  color: #40536f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.quality-summary-value {
  color: #0f213f;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
}

.quality-summary-note {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .quality-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .quality-summary-grid { grid-template-columns: 1fr; }
}

/* FICO universal compact list actions and space-efficient record tables. */
.compact-data-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  font-size: 13px;
}

.compact-data-table th,
.compact-data-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.record-list-table .record-title-cell {
  min-width: 150px;
  max-width: 280px;
  white-space: normal;
}

.record-list-table .record-updated-cell {
  width: 145px;
  min-width: 130px;
  white-space: nowrap;
  color: var(--muted);
}

.record-list-table .record-summary-cell {
  min-width: 240px;
  max-width: 560px;
  white-space: normal;
  line-height: 1.35;
}

.compact-data-table .code-cell,
.compact-data-table .unit-cell,
.compact-data-table .status-cell {
  white-space: nowrap;
}

.compact-data-table .name-cell {
  min-width: 150px;
  max-width: 340px;
  white-space: normal;
}

.compact-data-table .actions-column,
.compact-data-table .actions-cell {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  white-space: nowrap;
}

.row-action-select {
  width: 124px;
  min-width: 124px;
  height: 32px;
  padding: 5px 28px 5px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  background-color: #fff;
}

.product-list-table th:nth-child(1),
.product-list-table td:nth-child(1) { width: 135px; min-width: 115px; }
.product-list-table th:nth-child(2),
.product-list-table td:nth-child(2) { min-width: 180px; max-width: 340px; }
.product-list-table th:nth-child(3),
.product-list-table td:nth-child(3),
.product-list-table th:nth-child(4),
.product-list-table td:nth-child(4) { min-width: 125px; max-width: 220px; }
.product-list-table th:nth-child(6),
.product-list-table td:nth-child(6) { width: 80px; min-width: 70px; }
.product-list-table th:nth-child(7),
.product-list-table td:nth-child(7) { min-width: 105px; max-width: 180px; }

.user-list-table th,
.user-list-table td { white-space: nowrap; }
.user-list-table .name-cell { white-space: normal; }

@media (max-width: 900px) {
  .compact-data-table { min-width: 780px; }
  .record-list-table .record-summary-cell { min-width: 220px; max-width: 420px; }
}

/* FICO approved document-template editor enhancements v2 */
.line-dispatch-row > td {
  background: #f8fafc;
  border-top: 0;
  padding: 8px 10px 12px;
}
.line-dispatch-fields {
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 8px;
}
.dc-line-grid {
  grid-template-columns: minmax(180px, .65fr) minmax(340px, 2fr);
  align-items: start;
}
.dc-serial-field textarea {
  min-height: 74px;
  resize: vertical;
  white-space: pre-wrap;
}
@media (max-width: 900px) {
  .dc-line-grid { grid-template-columns: 1fr; }
}


/* FICO ERP Save/Action Reliability v3 */
.row-action-button {
  width: 124px;
  min-width: 124px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid #94a3b8;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.row-action-button:hover,
.row-action-button[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.row-action-caret { color: #475569; font-size: 11px; }
.row-action-popover {
  position: fixed;
  z-index: 100000;
  max-height: min(360px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #94a3b8;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .24);
}
.row-action-item {
  width: 100%;
  display: block;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.row-action-item:hover,
.row-action-item:focus { outline: none; background: #e0ecff; }
.row-action-item.danger { color: #b91c1c; }
.row-action-item.danger:hover,
.row-action-item.danger:focus { background: #fee2e2; }
.modal-actions button:disabled { opacity: .65; cursor: wait; }


/* Cross-module tab reliability v1 */
.sidebar nav button:disabled, .tabs button:disabled {
  opacity: .65;
  cursor: wait;
}


/* FICO ERP universal code/name searchable item selectors v3 */
.searchable-datalist {
  position: relative;
  width: 100%;
  min-width: 120px;
}

.searchable-datalist-input {
  width: 100%;
  min-width: 0;
  cursor: text;
  padding-right: 30px !important;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    #fff !important;
}

.searchable-datalist.is-open .searchable-datalist-input {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12) !important;
}

.searchable-datalist-menu .searchable-select-option {
  min-height: 38px;
}

.searchable-select-input::placeholder,
.searchable-datalist-input::placeholder {
  color: #64748b;
  opacity: 1;
}

/* Purchase calculation integrity hotfix v1 */
.purchase-live-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}
.purchase-live-totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #fff;
}
.purchase-live-totals .grand {
  border: 1px solid #93c5fd;
  background: #eff6ff;
}
.purchase-live-totals span { color: #475569; font-weight: 700; }
.purchase-live-totals strong { color: #0f172a; }
@media (max-width: 900px) {
  .purchase-live-totals { grid-template-columns: 1fr; }
}

/* FICO Integrated Accounts, Costing & Petty Cash — 20260725 v3 Final */
.integrated-accounting-banner {
  border-left: 5px solid var(--primary, #244f73);
}
.journal-balance {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:10px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #cbd5e1;
  background:#f8fafc;
}
.journal-balance.balanced { border-color:#86b99a; background:#f1f8f3; }
.journal-balance.unbalanced { border-color:#d6a4a4; background:#fff5f5; }


/* FICO Global UI + Accounts Hierarchy v2 */
.modal {
  min-width: min(520px, calc(100vw - 24px));
  min-height: min(340px, calc(100vh - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: auto;
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 1px 0 var(--line-soft);
}
.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 40;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 -1px 0 var(--line-soft);
}
.modal.resizing,
.modal.resizing * { user-select: none; }
.modal-reset-geometry { margin-left: auto; font-size: 18px; }
.modal-resize-handle { position: absolute; z-index: 55; touch-action: none; }
.modal-resize-handle.resize-n { left: 12px; right: 12px; top: -4px; height: 9px; cursor: ns-resize; }
.modal-resize-handle.resize-s { left: 12px; right: 12px; bottom: -4px; height: 9px; cursor: ns-resize; }
.modal-resize-handle.resize-e { top: 12px; bottom: 12px; right: -4px; width: 9px; cursor: ew-resize; }
.modal-resize-handle.resize-w { top: 12px; bottom: 12px; left: -4px; width: 9px; cursor: ew-resize; }
.modal-resize-handle.resize-ne,
.modal-resize-handle.resize-nw,
.modal-resize-handle.resize-se,
.modal-resize-handle.resize-sw { width: 16px; height: 16px; }
.modal-resize-handle.resize-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.modal-resize-handle.resize-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.modal-resize-handle.resize-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.modal-resize-handle.resize-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }

.user-resizable-table .user-resizable-header { position: relative; }
.table-column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 5;
}
.table-column-resizer::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 3px;
  width: 1px;
  background: transparent;
}
.user-resizable-header:hover .table-column-resizer::after,
.resizing-table-column .table-column-resizer::after { background: #60a5fa; }
body.resizing-table-column { cursor: col-resize !important; user-select: none !important; }
.record-summary-cell:empty::after { content: "No additional details"; color: var(--muted); font-style: italic; }


/* FICO Global UI + Accounts Hierarchy v2 */
.account-master-card .pill { background:#e0f2fe; color:#075985; }
.record-summary-cell { line-height:1.45; }


/* FICO ERP Editing + Full Window Movement v4 */
.modal {
  height: min(78vh, 720px);
  min-height: min(380px, calc(100vh - 120px));
  max-height: calc(100vh - 96px);
  overflow: auto;
}
.editor-save-verification {
  margin: 12px 18px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #86b99a;
  background: #f1f8f3;
  color: #14532d;
  flex: 0 0 auto;
}
.editor-save-verification.is-error {
  border-color: #ef9a9a;
  background: #fff5f5;
  color: #991b1b;
}
.editor-save-verification strong,
.editor-save-verification > div { display: block; margin-bottom: 5px; }
.editor-save-verification-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin-top: 8px;
}
.editor-save-verification-grid > div {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.editor-save-verification-grid span { color: #64748b; font-weight: 700; }
.editor-save-verification-grid b { overflow-wrap: anywhere; }
@media (max-height: 700px) {
  .modal {
    height: calc(100vh - 88px);
    min-height: 300px;
    max-height: calc(100vh - 72px);
  }
}
@media (max-width: 760px) {
  .editor-save-verification-grid { grid-template-columns: 1fr; }
}

/* FICO_V6_BOM_PO_ACCOUNTS_QUOTATION_DATE */
.date-format-hint{display:block;margin-top:4px;color:#64748b;font-size:11px}.purchase-live-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}.purchase-live-totals>div{border:1px solid #dbe3ef;border-radius:10px;padding:10px;background:#f8fafc;display:flex;justify-content:space-between}.purchase-live-totals .grand{background:#eef4ff;border-color:#9db7ea}

/* FICO_V7_SALES_PURCHASE_IB_OB_AUTO_TAX */


/* FICO_V9_COMBINED_ENTRY_PRINT_UI */
.modal.v9-maximised{border-radius:8px!important;}
.modal-maximise-geometry{font-size:18px!important;font-weight:800;}
.modal .line-editor-scroll.v9-freeze-header,
.modal .line-editor-scroll{overflow:auto;max-height:min(56vh,620px);position:relative;}
.modal .line-editor-table thead th{
  position:sticky;top:0;z-index:18;background:#f8fafc;box-shadow:0 1px 0 #cbd5e1;
}
.modal .v9-compact-line-editor .line-editor-table th,
.modal .v9-compact-line-editor .line-editor-table td,
.modal .purchase-lines-table th,
.modal .purchase-lines-table td,
.modal .bom-components-table th,
.modal .bom-components-table td,
.modal .line-editor-table th,
.modal .line-editor-table td{font-size:9pt;padding:4px 5px;line-height:1.15;}
.modal .line-editor-table input,
.modal .line-editor-table select,
.modal .line-editor-table textarea{font-size:9pt;padding:5px 6px;min-height:30px;min-width:88px;}
.modal .document-lines-table{min-width:1120px;}
.modal .document-lines-table th:nth-child(1),.modal .document-lines-table td:nth-child(1){width:44px;}
.modal .document-lines-table th:nth-child(2),.modal .document-lines-table td:nth-child(2){width:190px;}
.modal .document-lines-table th:nth-child(3),.modal .document-lines-table td:nth-child(3){width:190px;}
.modal .document-lines-table th:nth-child(4),.modal .document-lines-table td:nth-child(4){width:360px;}
.modal .document-lines-table th:nth-child(5),.modal .document-lines-table td:nth-child(5){width:110px;}
.modal .document-lines-table th:nth-child(6),.modal .document-lines-table td:nth-child(6){width:120px;}
.modal .document-lines-table th:nth-child(7),.modal .document-lines-table td:nth-child(7){width:105px;}
.modal .document-lines-table th:nth-child(8),.modal .document-lines-table td:nth-child(8){width:105px;}
.modal .line-param-grid{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:7px 10px;}
.modal .line-param-grid label span{font-size:9pt;}
.v9-commercial-live-totals,.purchase-live-totals{display:grid;grid-template-columns:repeat(3,minmax(170px,1fr));gap:8px;margin-top:10px;}
.v9-commercial-live-totals>div,.purchase-live-totals>div{display:flex;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:7px;background:#f8fafc;font-size:9pt;}
.v9-commercial-live-totals .grand,.purchase-live-totals .grand{font-weight:800;background:#eef2ff;border-color:#a5b4fc;}
.v9-signature-mask{position:absolute;background:#fff;z-index:3;}
.v9-two-signatures{z-index:4!important;}
@media(max-width:900px){.v9-commercial-live-totals,.purchase-live-totals{grid-template-columns:1fr;}}

/* FICO_V10_INVENTORY_IMO_ACCOUNTS_EXTENSION */
.modal .v10-sticky-section-head{position:sticky;top:0;z-index:22;background:#fff;border-bottom:1px solid #cbd5e1;padding-top:6px;padding-bottom:6px;}
.modal .v10-compact-internal-mo{font-size:9pt;}
.modal .v10-compact-internal-mo .imo-production-line{font-size:9pt;padding:8px;}
.modal .v10-compact-internal-mo input,
.modal .v10-compact-internal-mo select,
.modal .v10-compact-internal-mo textarea{font-size:9pt;padding:5px 6px;min-height:30px;}
.modal .v10-compact-internal-mo .imo-line-grid{gap:7px 9px;}
.modal .v10-journal-table{min-width:980px;}
.modal .v10-journal-table th,
.modal .v10-journal-table td{font-size:9pt;padding:4px 5px;}
.modal .v10-journal-table input,
.modal .v10-journal-table select{font-size:9pt;padding:5px 6px;min-height:30px;}
.modal .v10-freeze-header thead th,
.modal .table-scroll table thead th,
.modal .table-wrap table thead th{position:sticky;top:0;z-index:18;background:#f8fafc;box-shadow:0 1px 0 #cbd5e1;}
.modal .v10-master-linked-field small{display:block;margin-top:4px;}
.modal .v10-master-linked-field input{font-size:9pt;}


/* FICO_V10_2_FROZEN_HEADERS_CODE_ONLY */
.modal .v10-2-freeze-scroller{
  overflow:auto!important;
  position:relative!important;
  max-height:min(56vh,620px)!important;
  isolation:isolate;
  overscroll-behavior:contain;
}
.modal .v10-2-frozen-head{
  position:sticky;
  top:0;
  z-index:90;
  background:#f8fafc;
  box-shadow:0 2px 0 #cbd5e1;
}
.modal .v10-2-frozen-table{
  border-collapse:separate!important;
  border-spacing:0!important;
  table-layout:fixed!important;
  margin:0!important;
  background:#f8fafc;
}
.modal .v10-2-frozen-table thead th{
  position:static!important;
  top:auto!important;
  background:#f8fafc!important;
  font-size:9pt!important;
  padding:4px 5px!important;
  line-height:1.15!important;
  white-space:normal;
}
.modal thead.v10-2-source-head-hidden{display:none!important;}
.modal .v10-2-code-field{min-width:0;}
.modal .v10-2-code-field input{width:100%;font-size:9pt;padding:5px 6px;min-height:30px;}

/* FICO_V10_3_EXACT_SALES_ORDER_WORK_ORDER - exact latest submitted Sales Order / Work Order template; 10pt centred print values; delivery data only after delivery. */

/* FICO V11.4 PRQ automatic history line grid */
.purchase-lines-table{min-width:max-content}
.purchase-lines-table th,.purchase-lines-table td{white-space:nowrap}
.purchase-lines-table input.v11-4-auto-history-field{background:#f4f7fb;color:#24354d;min-width:96px}


/* FICO_QC_WORKSPACE_V12 */
.qc-v12-selector-grid{display:grid;grid-template-columns:minmax(220px,0.8fr) minmax(360px,1.6fr) auto;gap:12px;align-items:end;margin-top:14px}
.qc-v12-selector-grid label,.qc-v12-grid label{display:flex;flex-direction:column;gap:5px;min-width:0}
.qc-v12-selector-grid label>span,.qc-v12-grid label>span{font-size:9pt;font-weight:700;color:#334155}
.qc-v12-open-button{min-height:42px;white-space:nowrap}
.qc-v12-backdrop{z-index:1000}
.qc-v12-modal{width:min(1480px,97vw)!important;max-width:none!important;height:min(94vh,980px)!important;max-height:94vh!important;display:flex;flex-direction:column}
.qc-v12-modal-body{padding:12px 16px;overflow:auto;flex:1;overscroll-behavior:contain}
.qc-v12-section{border:1px solid #d6dee9;border-radius:9px;padding:11px;margin-bottom:10px;background:#fff}
.qc-v12-section h3{margin:0 0 8px;font-size:11pt;color:#172033}
.qc-v12-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:8px 10px}
.qc-v12-grid input,.qc-v12-grid select,.qc-v12-grid textarea{width:100%;font-size:9pt;padding:6px 7px;min-height:32px}
.qc-v12-span-2{grid-column:span 2}
.qc-v12-table-scroll{overflow:auto;max-height:380px;border:1px solid #d6dee9;border-radius:7px}
.qc-v12-parameter-table{min-width:1180px;margin:0;border-collapse:separate;border-spacing:0}
.qc-v12-parameter-table thead th{position:sticky;top:0;z-index:3;background:#eef3f8}
.qc-v12-parameter-table th,.qc-v12-parameter-table td{font-size:8.5pt;padding:4px}
.qc-v12-parameter-table input,.qc-v12-parameter-table select{font-size:8.5pt;padding:4px 5px;min-height:28px;width:100%}
.qc-v12-parameter-table th:nth-child(1){width:38px}.qc-v12-parameter-table th:nth-child(2){width:270px}.qc-v12-parameter-table th:nth-child(3){width:85px}.qc-v12-parameter-table th:nth-child(4){width:210px}.qc-v12-parameter-table th:nth-child(5){width:210px}.qc-v12-parameter-table th:nth-child(6){width:120px}.qc-v12-parameter-table th:nth-child(7){width:230px}.qc-v12-parameter-table th:nth-child(8){width:75px}
.qc-v12-stage-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:8px}.qc-v12-stage-list>div{display:flex;justify-content:space-between;gap:8px;padding:8px;border:1px solid #d6dee9;border-radius:7px;background:#f8fafc}
@media(max-width:1000px){.qc-v12-selector-grid{grid-template-columns:1fr}.qc-v12-grid{grid-template-columns:repeat(2,minmax(160px,1fr))}.qc-v12-span-2{grid-column:span 2}}
@media(max-width:620px){.qc-v12-grid{grid-template-columns:1fr}.qc-v12-span-2{grid-column:span 1}.qc-v12-modal{width:99vw!important;height:97vh!important;max-height:97vh!important}}


/* FICO_V13_IMO_STORE_FOC_REALLOCATION_INTERNAL_PRINTS */
.v13-imo-lines .line-editor-head{align-items:flex-start;gap:16px}
.v13-imo-lines .line-editor-head>div{display:grid;gap:3px}
.v13-imo-line{border:1px solid var(--border,#cbd5e1);border-radius:10px;padding:10px;margin:10px 0;background:var(--panel,#fff)}
.v13-main-grid{grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:8px}
.v13-main-grid label{min-width:0}
.v13-main-grid textarea{min-height:64px}
.v13-store-summary{display:flex;flex-wrap:wrap;gap:16px;padding:10px;border:1px dashed var(--border,#94a3b8);border-radius:8px;background:var(--soft,#f8fafc)}
.v13-store-summary strong{margin-right:auto}
.v13-special-rights{border-left:4px solid var(--primary,#1d4ed8)}
.v13-user-modal{width:min(1180px,96vw);max-height:94vh}
.v13-special-rights .rights-grid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
@media(max-width:800px){.v13-main-grid{grid-template-columns:1fr}.v13-store-summary{display:grid;grid-template-columns:1fr 1fr}.v13-store-summary strong{grid-column:1/-1}}

/* Admin Control Center: whole-page horizontal scrolling with fixed ERP proxy. */
.admin-control-horizontal-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
}

/* FICO ERP v71 — stable desktop modal maximize behaviour */
.modal.v9-maximised .modal-resize-handle {
  display: none !important;
}

.modal.v9-maximised .modal-drag-handle,
.modal.v9-maximised .modal-head {
  cursor: default !important;
}
