:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --line: #d9e0e8;
  --text: #202733;
  --muted: #697386;
  --blue: #1768ac;
  --blue-dark: #124a7c;
  --green: #0f766e;
  --amber: #a16207;
  --red: #b42318;
  --soft: #eef4fa;
}

.sales-order-receipt-form [readonly] {
  background: #f3f6fa;
  color: #42526a;
}

.sales-order-receipt-form small {
  display: block;
  margin-top: 0.3rem;
}

.sales-receipt-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4rem;
  margin-top: 3rem;
}

.sales-receipt-signatures div {
  border-top: 1px solid #526174;
  padding-top: 0.45rem;
  text-align: center;
}

/* DIS-BOM-ALTA-COPIA-UX-C3: alta de versiones BOM sobre disenos existentes. */
.bom-create-copy-panel {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.bom-create-copy-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, .65fr);
  gap: 16px;
  align-items: start;
}

.bom-create-copy-grid .span-2 {
  grid-column: 1 / -1;
}

.bom-create-field,
.bom-create-source {
  min-width: 0;
}

.bom-create-source {
  display: grid;
  gap: 12px;
}

.bom-create-load-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #eef6ff;
  color: #174b7a;
}

.bom-create-load-state.error {
  background: #fff1f2;
  color: #a61b29;
}

.bom-create-load-state button {
  flex: 0 0 auto;
}

.bom-create-picker {
  position: relative;
  margin-top: 6px;
}

.bom-create-picker-menu {
  z-index: 30;
  width: min(700px, calc(100vw - 72px));
  max-height: 360px;
  overflow: auto;
}

.bom-create-picker-option {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 0;
  border-bottom: 1px solid var(--line, #dfe5ec);
  background: transparent;
  color: inherit;
}

.bom-create-picker-option:hover,
.bom-create-picker-option:focus-visible {
  background: var(--surface-soft, #f4f7fa);
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
}

.bom-create-picker-option span,
.bom-create-picker-option small {
  color: var(--muted, #64748b);
}

.bom-create-context {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line, #dfe5ec);
  border-radius: 10px;
  background: var(--surface-soft, #f7f9fb);
}

.bom-create-method {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 12px 14px;
  border: 1px solid var(--line, #dfe5ec);
  border-radius: 10px;
}

.bom-create-method legend {
  padding: 0 6px;
  font-weight: 700;
}

.bom-create-method label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.bom-create-method small {
  flex-basis: 100%;
}

.bom-create-preview {
  padding: 12px;
  border: 1px solid var(--line, #dfe5ec);
  border-radius: 10px;
  background: var(--surface, #fff);
}

.bom-create-preview-summary {
  display: grid;
  gap: 10px;
}

.bom-create-preview-summary > div:first-child {
  display: grid;
  gap: 3px;
}

.bom-create-preview-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
}

.bom-create-preview-counts span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-soft, #f4f7fa);
  color: var(--muted, #64748b);
}

.bom-create-preview-counts strong {
  color: var(--text, #202733);
  font-size: 1rem;
}

.bom-create-warning,
.bom-create-error,
.bom-create-loading {
  margin: 6px 0;
  padding: 9px 11px;
  border-radius: 8px;
}

.bom-create-warning {
  background: #fff7db;
  color: #7a4b00;
}

.bom-create-error,
.bom-create-status.error {
  color: #a61b29;
}

.bom-create-error {
  background: #fff1f2;
}

.bom-create-loading {
  background: #eef6ff;
  color: #174b7a;
}

.bom-create-status {
  min-height: 1.4em;
  margin: 12px 0 0;
}

@media (max-width: 900px) {
  .bom-create-copy-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bom-create-copy-grid .span-2 {
    grid-column: 1 / -1;
  }

  .bom-create-preview-counts {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}

@media (max-width: 600px) {
  .bom-create-copy-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .bom-create-copy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bom-create-copy-grid .span-2 {
    grid-column: auto;
  }

  .bom-create-picker-menu {
    position: fixed;
    inset: 72px 8px auto 8px;
    width: auto;
    max-height: calc(100vh - 96px);
  }

  .bom-create-method {
    display: grid;
  }

  .bom-create-load-state {
    align-items: stretch;
    flex-direction: column;
  }
}

/* DIS-BOM-RMOP-CONTRACT-C2: alcance exclusivo del contrato nativo. */
[data-bom-native-contract] {
  min-width: 0;
  max-width: 100%;
}

[data-bom-native-contract] .table-wrap {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

[data-bom-native-contract] table {
  width: 100%;
  min-width: 880px;
}

[data-bom-native-contract] code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

[data-bom-native-contract] details > summary {
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 1100px) {
  [data-bom-native-contract] table {
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  [data-bom-native-contract] .toolbar,
  [data-bom-native-contract] .inline-form {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  [data-bom-native-contract] .toolbar > *,
  [data-bom-native-contract] .inline-form > * {
    min-width: 0;
    width: 100%;
  }
}

.material-conversions-table td {
  vertical-align: top;
}

.material-conversion-actions {
  display: grid;
  gap: 0.5rem;
  min-width: 13rem;
}

.material-conversion-actions details,
.material-conversion-add {
  border: 1px solid var(--border, #d7dce3);
  border-radius: 0.55rem;
  padding: 0.5rem;
  background: var(--surface, #fff);
}

.material-conversion-actions summary,
.material-conversion-add summary {
  cursor: pointer;
  font-weight: 650;
}

.material-conversion-add {
  margin-top: 1rem;
}

.material-conversion-form {
  margin-top: 0.75rem;
}

.material-conversion-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.material-conversion-form-grid label,
.material-conversion-inline-action {
  min-width: 0;
}

.material-conversion-preview {
  display: block;
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  border-left: 0.25rem solid #2878c7;
  background: #eef6ff;
  color: #173a5e;
}

.material-conversion-preview.is-error {
  border-left-color: #b42318;
  background: #fff1f0;
  color: #7a271a;
}

.material-conversion-inline-action {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.material-conversion-inline-action input[name="reason"] {
  min-width: 11rem;
  flex: 1 1 11rem;
}

.material-conversion-approval-modal {
  width: min(1260px, calc(100vw - 36px));
}

.material-conversion-approval-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fbff;
}

.material-conversion-approval-summary strong {
  color: var(--blue-dark);
  font-size: 18px;
}

.material-conversion-approval-summary .muted {
  margin-left: auto;
}

.material-conversion-approval-table {
  min-width: 980px;
}

.material-conversion-approval-table th:first-child {
  width: 110px;
}

.material-conversion-approval-table th:last-child {
  width: 155px;
}

.material-conversion-queue-actions {
  display: grid;
  gap: 6px;
}

.material-conversion-queue-actions form,
.material-conversion-queue-actions a {
  margin: 0;
}

@media (max-width: 760px) {
  .material-conversion-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-conversion-actions {
    min-width: 10rem;
  }

  .material-conversion-approval-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .material-conversion-approval-summary .muted {
    margin-left: 0;
  }
}

.exchange-rate-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.exchange-rate-summary-grid .metric-card {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.exchange-rate-summary-grid .metric-card strong {
  font-size: 1.35rem;
}

.tc-rate-page-head {
  align-items: center;
}

.tc-rate-page-head h2,
.tc-rate-records h3,
.tc-rate-modal-head h3 {
  margin-bottom: .25rem;
}

.tc-rate-daily-card {
  align-content: start;
  min-height: 190px;
}

.tc-rate-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.tc-rate-card-head > div {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.tc-rate-card-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin: .4rem 0;
}

.tc-rate-card-facts div {
  min-width: 0;
}

.tc-rate-card-facts dt {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tc-rate-card-facts dd {
  margin: .2rem 0 0;
  overflow-wrap: anywhere;
}

.tc-rate-daily-card > button {
  align-self: end;
  justify-self: start;
  margin-top: auto;
}

.tc-rate-missing {
  margin: .5rem 0;
  color: var(--muted);
}

.tc-rate-help,
.tc-rate-filter-box {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tc-rate-help summary,
.tc-rate-filter-box summary {
  padding: .75rem 1rem;
  color: var(--blue-dark);
  cursor: pointer;
  font-weight: 700;
}

.tc-rate-help p {
  margin: 0;
  padding: 0 1rem 1rem;
  line-height: 1.55;
}

.tc-rate-concluded-body {
  padding: 0 1rem 1rem;
}

.tc-rate-concluded-body > p {
  padding: 0;
}

.tc-rate-concluded-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.tc-rate-historical-card {
  min-height: 0;
}

.tc-rate-records {
  margin-top: 1rem;
}

.tc-rate-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: .8rem;
  padding: 0 1rem 1rem;
}

.tc-rate-filters label {
  min-width: 0;
}

.tc-rate-filters .table-actions {
  align-self: end;
}

.tc-rate-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1rem;
}

.modal.tc-rate-modal {
  z-index: 70;
}

.tc-rate-modal .modal-backdrop {
  z-index: 70;
}

.tc-rate-modal .tc-rate-modal-panel {
  z-index: 71;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 48px));
  padding: 0;
  overflow: hidden;
}

.tc-rate-modal-head {
  flex: 0 0 auto;
  margin: 0;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.tc-rate-modal-body {
  min-height: 0;
  padding: 1rem 1.1rem 1.1rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.tc-rate-current {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  border: 1px solid #b8cee2;
  border-radius: 7px;
  background: #eff6ff;
  color: var(--blue-dark);
}

.tc-rate-modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin: 0;
}

.tc-rate-modal-form .wide,
.tc-rate-modal-actions {
  grid-column: 1 / -1;
}

.tc-rate-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: .25rem;
}

.exchange-rate-workspace .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

#tc-feedback {
  scroll-margin-top: 5rem;
  outline: none;
}

#tc-feedback:empty {
  display: none;
}

#tc-feedback:not(:empty) {
  display: grid;
  gap: .75rem;
  margin: 1rem 0;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: var(--panel);
}

#tc-feedback.tc-feedback-success {
  border-color: #5aa89e;
  background: #ecfdf5;
  color: #115e59;
}

#tc-feedback.tc-feedback-noop {
  border-color: #70a8d8;
  background: #eff6ff;
  color: var(--blue-dark);
}

#tc-feedback.tc-feedback-validation {
  border-color: #d6a84d;
  background: #fffbeb;
  color: #854d0e;
}

#tc-feedback.tc-feedback-conflict,
#tc-feedback.tc-feedback-error {
  border-color: #d96b63;
  background: #fef2f2;
  color: #991b1b;
}

#tc-feedback:focus-visible {
  box-shadow: 0 0 0 3px rgba(23, 104, 172, .28);
}

.tc-feedback-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem 1rem;
  margin: 0;
}

.tc-feedback-details div {
  min-width: 0;
}

.tc-feedback-details dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tc-feedback-details dd {
  margin: .2rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

@media (max-width: 800px) {
  .exchange-rate-summary-grid,
  .tc-rate-concluded-grid {
    grid-template-columns: 1fr;
  }

  .exchange-rate-workspace .exchange-rate-form,
  .exchange-rate-workspace .material-searchbar,
  .tc-rate-filters,
  .tc-rate-modal-form {
    grid-template-columns: 1fr;
  }

  .tc-feedback-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-rate-card-facts {
    grid-template-columns: 1fr;
  }

  .tc-rate-modal .tc-rate-modal-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px auto;
  }

  .tc-rate-modal-form .wide,
  .tc-rate-modal-actions {
    grid-column: auto;
  }

  .tc-rate-modal-actions {
    justify-content: stretch;
  }

  .tc-rate-modal-actions > * {
    flex: 1 1 10rem;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 24%, rgba(32, 128, 168, 0.36), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(192, 136, 66, 0.28), transparent 26%),
    linear-gradient(120deg, rgba(8, 19, 30, 0.62), rgba(24, 67, 82, 0.36)),
    var(--login-bg-image, none),
    linear-gradient(135deg, #e7eef2 0%, #f7fafb 45%, #dfe8ec 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.login-body::before {
  content: "";
  position: fixed;
  inset: -40px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.16), transparent 34%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px);
  filter: blur(14px);
  transform: rotate(-2deg) scale(1.04);
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(390px, 0.85fr);
  width: min(960px, calc(100vw - 56px));
  min-height: 460px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 32px 86px rgba(8, 20, 31, 0.38);
  backdrop-filter: blur(3px);
}

.login-brand-panel {
  position: relative;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(14, 30, 45, 0.08), rgba(13, 29, 43, 0.54)),
    linear-gradient(90deg, rgba(18, 104, 124, 0.26), rgba(255, 255, 255, 0.04));
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  transform: skewX(-5deg);
  pointer-events: none;
}

.login-brand-panel h2 {
  position: relative;
  color: #fff;
  font-size: 34px;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}

.login-brand-panel p {
  position: relative;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.45;
}

.login-logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 190px;
  height: 112px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: none;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.36));
}

.login-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-system-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.login-system-meta span {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.login-panel {
  display: grid;
  align-content: center;
  border: 0;
  border-radius: 0;
  padding: 50px 46px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.97));
  box-shadow: none;
}

.login-panel h1 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.12;
}

.login-note {
  color: var(--muted);
  line-height: 1.45;
  max-width: 330px;
}

.login-form {
  display: grid;
  gap: 13px;
  margin: 22px 0 16px;
}

.login-form label {
  color: #526073;
  font-weight: 700;
}

.login-form input {
  min-height: 42px;
  border-color: #b8c7d5;
  background: #fff;
}

.login-form button {
  min-height: 42px;
}

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

.settings-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfe;
}

.settings-section h3 {
  margin: 0 0 12px;
  color: var(--blue-dark);
}

.settings-section-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.settings-section-note code {
  color: var(--blue-dark);
  font-weight: 800;
}

.settings-form-grid {
  margin-top: 0;
}

.settings-sales-preferences-head {
  grid-column: 1 / -1;
}

.settings-sales-preferences-head h4,
.settings-sales-preferences-head p {
  margin: 0;
}

.settings-sales-preferences-head h4 {
  color: var(--blue-dark);
}

.settings-commercial-field {
  display: grid;
  gap: 5px;
}

.settings-commercial-field label {
  display: block;
}

.settings-commercial-field small {
  line-height: 1.35;
}

.settings-currency-status:not(:empty) {
  margin-top: 7px;
  color: #8a5a00;
  font-weight: 700;
}

.print-settings-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
}

.print-settings-fields {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.print-settings-editor .settings-form-grid {
  grid-template-columns: repeat(3, minmax(145px, 1fr));
}

.print-live-preview {
  position: sticky;
  top: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfe;
}

.print-live-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.print-live-preview-head h3 {
  margin: 0;
  color: var(--blue-dark);
}

.print-live-preview-head span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e8f2ff;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.print-preview-stage {
  display: grid;
  place-items: center;
  min-height: 520px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  background: #d7dce3;
}

.print-preview-sheet {
  position: relative;
  width: 320px;
  aspect-ratio: 210 / 297;
  padding: 15px 0 78px;
  background: #fff;
  color: #777;
  font-family: Arial, sans-serif;
  font-size: 6px;
  box-shadow: 0 12px 26px rgba(23, 32, 44, 0.26);
}

.print-preview-page-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
}

.print-preview-letterhead,
.print-preview-client-row,
.print-preview-table,
.print-preview-validity {
  position: relative;
  z-index: 1;
}

.print-preview-sheet.paper-Letter {
  aspect-ratio: 216 / 279;
}

.print-preview-sheet.paper-medio_oficio_2 {
  aspect-ratio: 165 / 216;
}

.print-preview-sheet.landscape {
  width: 340px;
  aspect-ratio: 297 / 210;
}

.print-preview-sheet.landscape.paper-Letter {
  aspect-ratio: 279 / 216;
}

.print-preview-sheet.landscape.paper-medio_oficio_2 {
  aspect-ratio: 216 / 165;
}

.print-preview-letterhead,
.print-preview-client-row,
.print-preview-table,
.print-preview-validity {
  width: 90%;
  margin-right: auto;
  margin-left: auto;
}

.print-preview-letterhead {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 56px;
  align-items: start;
  position: relative;
}

.print-preview-header-image-wrap {
  display: none;
  width: 100%;
  max-height: 50px;
  overflow: hidden;
}

.print-preview-header-image-wrap.has-image {
  display: block;
}

.print-preview-header-image-wrap img {
  width: 100%;
  max-height: 50px;
  object-fit: contain;
}

.print-preview-brand {
  display: grid;
  gap: 2px;
  justify-self: start;
  color: #004b93;
  font-weight: 800;
}

.print-preview-brand.logo-center {
  justify-self: center;
  text-align: center;
}

.print-preview-brand.logo-right {
  justify-self: end;
  text-align: right;
}

.print-preview-brand img {
  width: 74px;
  max-height: 32px;
  object-fit: contain;
  object-position: left center;
}

.print-preview-brand strong {
  display: none;
}

.print-preview-brand.no-logo img {
  display: none;
}

.print-preview-brand.no-logo strong {
  display: none;
}

.print-preview-title {
  display: grid;
  gap: 3px;
  justify-items: center;
  align-self: center;
  justify-self: center;
  text-align: center;
}

.print-preview-letterhead > div:empty {
  display: none;
}

.print-preview-title strong {
  color: #00519a;
  font-size: 10px;
  font-weight: 800;
}

.print-preview-title span {
  color: #ef4444;
  font-size: 8px;
  font-weight: 800;
}

.print-preview-client-row {
  display: grid;
  grid-template-columns: 27% 38% 35%;
  gap: 5px;
  margin-bottom: 7px;
  color: #1b5f9d;
  line-height: 1.25;
}

.print-preview-client-row span {
  color: #697386;
}

.print-preview-table {
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: 5.4px;
}

.print-preview-table th,
.print-preview-table td {
  padding: 3px;
  border: 1px solid #d9d9d9;
  vertical-align: top;
}

.print-preview-table th {
  color: #1b5f9d;
  font-weight: 800;
}

.print-preview-table tbody tr:nth-child(even),
.print-preview-table tfoot tr {
  background: #f2f2f2;
}

.print-preview-table td:nth-child(n+2),
.print-preview-table th:nth-child(n+2),
.print-preview-table tfoot th,
.print-preview-table tfoot td {
  text-align: right;
}

.print-preview-table td:first-child,
.print-preview-table th:first-child {
  text-align: left;
}

.print-preview-table b,
.print-preview-table strong {
  color: #003f7a;
}

.print-preview-side-note {
  position: absolute;
  top: 120px;
  right: 7px;
  width: 12px;
  height: 190px;
  overflow: hidden;
  color: #1b8bd2;
  font-size: 3.8px;
  line-height: 1.15;
  text-align: left;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.print-preview-table span {
  color: #697386;
}

.print-preview-purchase-letterhead {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 4px;
  min-height: 92px;
  padding-bottom: 0;
  border-bottom: 0;
}

.print-preview-purchase-letterhead .print-preview-header-image-wrap {
  grid-column: 1 / -1;
}

.print-preview-purchase-letterhead .print-preview-title {
  min-width: 0;
}

.print-preview-purchase-issued {
  display: flex;
  justify-content: center;
  gap: 3px 12px;
  color: #64748b;
  font-size: 4.6px;
}

.print-preview-purchase-issued b {
  color: #1f5f96;
  text-transform: uppercase;
}

.print-preview-purchase-card {
  position: relative;
  z-index: 1;
  width: 90%;
  margin: 7px auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.print-preview-purchase-card > header {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  padding-bottom: 2px;
  border-bottom: 0;
}

.print-preview-purchase-card > header div,
.print-preview-purchase-card > header strong {
  display: grid;
  gap: 2px;
}

.print-preview-purchase-card > header strong {
  color: #163a59;
  font-size: 7px;
}

.print-preview-purchase-card > header > b {
  align-self: center;
  padding: 2px 4px;
  border-radius: 8px;
  background: #fff4dd;
  color: #915a00;
}

.print-preview-purchase-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 8px;
  margin: 6px 0;
}

.print-preview-purchase-card dl div,
.print-preview-purchase-card dt,
.print-preview-purchase-card dd {
  min-width: 0;
  margin: 0;
}

.print-preview-purchase-card dt {
  color: #64748b;
  font-size: 4.2px;
  font-weight: 800;
  text-transform: uppercase;
}

.print-preview-purchase-card dd {
  margin-top: 1px;
  color: #172033;
  font-size: 5px;
}

.print-preview-purchase-table {
  width: 100%;
  margin: 0;
}

.print-preview-purchase-table th:nth-child(1) { width: 39%; }
.print-preview-purchase-table th:nth-child(2) { width: 17%; }
.print-preview-purchase-table th:nth-child(n+3) { width: 14.66%; }

.print-preview-validity {
  margin-top: 8px;
  font-size: 5.5px;
}

.print-preview-footer {
  position: absolute;
  right: 0;
  bottom: 13px;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: end;
  width: 90%;
  min-height: 48px;
  margin: 0 auto;
  padding-top: 3px;
  border-top: 1px solid #dedede;
  color: #0873c9;
}

.print-preview-sheet.has-page-background .print-preview-footer {
  border-top: 0;
}

.print-preview-footer > img {
  display: none;
  grid-column: 1;
  width: 100%;
  max-height: 56px;
  object-fit: contain;
  object-position: left bottom;
}

.print-preview-footer.has-image > img {
  display: block;
}

.print-preview-years strong {
  display: block;
  color: #9ca3af;
  font-size: 9px;
  line-height: 0.92;
}

.print-preview-years small {
  display: block;
  margin-top: 1px;
  color: #a8adb6;
  font-size: 3.8px;
  line-height: 1.1;
}

.print-preview-years {
  grid-column: 1;
  justify-self: start;
}

.print-preview-contact small {
  display: block;
  color: #94a3b8;
  font-size: var(--preview-footer-text-size, 4.8px);
}

.print-preview-contact {
  grid-column: 2;
  display: grid;
  gap: 1px;
  justify-self: center;
  justify-items: center;
  text-align: center;
}

.print-preview-contact span {
  font-size: var(--preview-footer-text-size, 5.5px);
}

.print-preview-social {
  grid-column: 3;
  justify-self: center;
  text-align: center;
  color: #0873c9;
  font-size: var(--preview-footer-text-size, 5.5px);
  font-weight: 800;
}

.print-preview-qr {
  grid-column: 2;
  justify-self: end;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, #111 50%, transparent 0) 0 0 / 6px 6px,
    linear-gradient(#111 50%, transparent 0) 0 0 / 6px 6px,
    #fff;
  border: 1px solid #111;
  color: #111;
  font-size: 6px;
  font-weight: 800;
}

.print-preview-footer.qr-left .print-preview-qr {
  grid-column: 1;
  justify-self: start;
}

.print-preview-footer.qr-left {
  grid-template-columns: auto minmax(0, 1fr);
}

.print-preview-footer.qr-left > img {
  grid-column: 2;
  object-position: right bottom;
}

.print-preview-footer.qr-left .print-preview-years {
  grid-column: 2;
  justify-self: center;
}

.print-preview-footer.qr-left .print-preview-contact {
  grid-column: 3;
}

.print-preview-footer.qr-left .print-preview-social {
  grid-column: 4;
  justify-self: end;
}

.print-preview-footer.qr-center .print-preview-qr {
  grid-column: 2;
  justify-self: center;
}

.print-preview-footer.qr-center {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.print-preview-footer.qr-center > img {
  grid-column: 1;
}

.print-preview-footer.qr-center .print-preview-contact {
  grid-column: 2;
}

.print-preview-footer.qr-center .print-preview-social {
  grid-column: 4;
  justify-self: end;
}

.print-preview-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.print-preview-qr:not(.has-image) img {
  display: none;
}

.print-preview-qr.has-image span {
  display: none;
}

.branding-upload-section {
  margin-bottom: 14px;
}

.branding-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.print-upload-grid {
  margin-top: 12px;
}

.branding-upload-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.branding-preview {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed #b8c6d4;
  border-radius: 8px;
  background: #f3f6f8;
  overflow: hidden;
}

.branding-preview img {
  width: 100%;
  height: 110px;
  object-fit: contain;
}

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

.branding-upload-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.branding-upload-card code {
  color: var(--blue-dark);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.login-error {
  border: 1px solid #fecdd3;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff1f2;
  color: var(--red);
  font-weight: 700;
}

.login-notice {
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 9px 10px;
  background: #ecfdf3;
  color: var(--green);
  font-weight: 700;
}

.login-help-link {
  justify-self: center;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.login-help-link:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: #243241;
  color: white;
  padding: 22px 16px;
  overflow: auto;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 26px;
}

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

.sidebar a {
  color: #d7e4ef;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
}

.sidebar a.active,
.sidebar a:hover {
  background: #31475d;
  color: #fff;
}

.nav-label {
  margin: 12px 0 2px;
  color: #91a5b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.main {
  margin-left: 238px;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0;
  color: #17202c;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
}

.userbox,
.panel,
.metrics article,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.userbox {
  padding: 10px 14px;
  color: var(--muted);
  text-align: right;
}

.userbox span {
  color: var(--green);
}

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

.userbox form {
  margin-top: 8px;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.link-button:hover {
  background: transparent;
  color: var(--blue-dark);
  text-decoration: underline;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
  overflow: auto;
}

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

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.metrics article {
  padding: 16px;
}

.metrics strong {
  display: block;
  color: var(--blue);
  font-size: 28px;
}

.metrics span {
  color: var(--muted);
}

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

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.amber,
.pill.amber {
  background: #fff7ed;
  color: var(--amber);
}

.badge.red {
  background: #fff1f2;
  color: var(--red);
}

.badge.green,
.pill.green {
  background: #ecfdf3;
  color: var(--green);
}

.pill.red {
  background: #fff1f2;
  color: var(--red);
}

.pill.private {
  background: #f5f3ff;
  color: #6d28d9;
}

.alert {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
}

.alert.sobre-stock {
  background: #d96b21;
  color: #fff;
}

.alert.alto {
  background: #9ed7ff;
  color: #08466f;
}

.alert.ok {
  background: #23b26b;
  color: #fff;
}

.alert.bajo {
  background: #ffe38a;
  color: #6b4b00;
}

.alert.critico {
  background: #ff1f1f;
  color: #fff;
}

.alert.muerto,
.alert.sin-rotacion {
  background: #111827;
  color: #fff;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

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

.workflow div {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  padding: 12px;
  min-height: 86px;
  background: #fbfcfe;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.module-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
  text-decoration: none;
}

.module-card:hover {
  background: #eef6fd;
  border-color: #9cc7ed;
}

.module-card strong {
  color: var(--blue-dark);
  font-size: 16px;
}

.module-card p,
.placeholder-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.placeholder-panel {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.card {
  padding: 14px;
}

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

.card p {
  color: var(--muted);
}

dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 10px;
  margin: 12px 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.note {
  min-height: 38px;
}

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

button,
.primary {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  border-radius: 6px;
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 700;
}

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

.secondary {
  border-color: #c8d1dc;
  background: #fff;
  color: var(--text);
}

.secondary:hover {
  background: #f3f6f8;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 5px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
}

.check input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d1dc;
  border-radius: 6px;
  padding: 9px;
  color: var(--text);
  font-family: inherit;
}

.wide {
  grid-column: span 2;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  min-width: 1460px;
}

.materials-compact-table {
  min-width: 1080px;
}

.materials-compact-table th:nth-child(1),
.materials-compact-table td:nth-child(1) {
  min-width: 280px;
}

.materials-compact-table th:nth-child(2),
.materials-compact-table td:nth-child(2) {
  min-width: 190px;
}

.materials-compact-table th:nth-child(3),
.materials-compact-table td:nth-child(3),
.materials-compact-table th:nth-child(4),
.materials-compact-table td:nth-child(4) {
  min-width: 180px;
}

.materials-compact-table th:nth-child(5),
.materials-compact-table td:nth-child(5),
.materials-compact-table th:nth-child(6),
.materials-compact-table td:nth-child(6) {
  min-width: 150px;
}

.material-purchase-summary-table {
  min-width: 980px;
}

.material-purchase-summary-table th:nth-child(1),
.material-purchase-summary-table td:nth-child(1) {
  min-width: 280px;
}

.material-purchase-summary-table th:nth-child(2),
.material-purchase-summary-table td:nth-child(2) {
  min-width: 220px;
}

.material-purchase-summary-table th:nth-child(3),
.material-purchase-summary-table td:nth-child(3) {
  min-width: 250px;
}

.material-purchase-summary-table th:nth-child(4),
.material-purchase-summary-table td:nth-child(4) {
  min-width: 180px;
}

.material-purchase-consumption {
  font-size: 0.86rem;
  line-height: 1.45;
}

.material-purchase-consumption-item {
  display: inline-block;
  margin-right: 0.45rem;
  white-space: nowrap;
}

.material-purchase-consumption-item small {
  color: var(--muted);
}

.material-purchase-suggestion {
  font-size: .82rem;
}

.material-purchase-suggestion strong,
.material-purchase-suggestion small {
  display: block;
}

.material-purchase-suggestion small {
  margin-top: .18rem;
  color: var(--muted);
  line-height: 1.25;
}

.material-purchase-suggestion-note {
  margin-bottom: .75rem;
}

.material-purchase-destination-help {
  margin: 0;
}

.materials-master-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.materials-master-table .material-selection-column {
  min-width: 0;
  width: 3%;
  text-align: center;
  vertical-align: middle;
}

.material-bulk-modal-panel {
  width: min(1180px, calc(100vw - 36px));
}

.material-bulk-selection-summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 10px 0 4px;
}

.material-bulk-selection-summary strong {
  font-size: 18px;
}

.material-bulk-selected-list {
  max-height: 96px;
  overflow: auto;
  margin: 4px 0 14px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
}

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

.material-bulk-field {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.material-bulk-apply {
  padding-top: 7px;
  font-size: 12px;
}

.material-bulk-value {
  display: grid;
  gap: 4px;
}

.material-bulk-value > span {
  font-weight: 600;
}

.material-bulk-value select[multiple] {
  min-height: 92px;
}

.material-bulk-warning {
  margin: 14px 0 0;
}

@media (max-width: 800px) {
  .material-bulk-fields {
    grid-template-columns: 1fr;
  }
}

.materials-master-table th,
.materials-master-table td {
  vertical-align: top;
}

.materials-master-table th:nth-child(1),
.materials-master-table td:nth-child(1) {
  min-width: 0;
  width: 3%;
}

.materials-master-table th:nth-child(2),
.materials-master-table td:nth-child(2) {
  min-width: 0;
  width: 7%;
}

.materials-master-table th:nth-child(3),
.materials-master-table td:nth-child(3) {
  min-width: 0;
  width: 22%;
}

.materials-master-table th:nth-child(4),
.materials-master-table td:nth-child(4) {
  min-width: 0;
  width: 12%;
}

.materials-master-table th:nth-child(5),
.materials-master-table td:nth-child(5),
.materials-master-table th:nth-child(6),
.materials-master-table td:nth-child(6),
.materials-master-table th:nth-child(7),
.materials-master-table td:nth-child(7) {
  min-width: 0;
  width: 7%;
}

.materials-master-table th:nth-child(8),
.materials-master-table td:nth-child(8) {
  min-width: 0;
  width: 14%;
}

.materials-master-table th,
.materials-master-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.materials-master-table th:nth-child(5),
.materials-master-table td:nth-child(5) {
  width: 7%;
}

.materials-master-table th:nth-child(6),
.materials-master-table td:nth-child(6) {
  width: 7%;
}

.materials-master-table th:nth-child(7),
.materials-master-table td:nth-child(7) {
  width: 10%;
}

.materials-master-table .material-name-column {
  width: 22%;
}

.materials-master-table .material-stock-control-column {
  width: 12%;
}

.materials-master-table .material-stock-summary-column {
  width: 14%;
}

.material-stock-summary {
  display: grid;
  gap: 4px;
}

.material-stock-summary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.material-stock-summary-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.material-stock-summary-item strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.material-stock-summary-item:hover,
.material-stock-summary-item:focus-visible {
  border-color: #bfdbfe;
  background: #eff6ff;
  outline: none;
}

.material-stock-summary-item.is-available strong {
  color: #166534;
}

.material-stock-summary-item.is-reserved strong {
  color: #9a6700;
}

.material-stock-summary-item.is-total {
  border-top-color: var(--line);
}

.materials-master-table .material-consumption-column {
  width: 10%;
}

.materials-master-table th:last-child,
.materials-master-table td:last-child {
  width: 8%;
}

.materials-master-table .material-stack {
  display: grid;
  gap: 0.2rem;
}

.materials-master-table .material-consumption-column {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
}

.materials-master-table .material-consumption-column span {
  white-space: nowrap;
}

.material-list-bom-delivery {
  display: grid;
  gap: 5px;
}

.material-list-bom-delivery > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.materials-master-table th:nth-child(9),
.materials-master-table td:nth-child(9),
.materials-master-table th:nth-child(10),
.materials-master-table td:nth-child(10),
.materials-master-table th:nth-child(11),
.materials-master-table td:nth-child(11),
.materials-master-table th:nth-child(12),
.materials-master-table td:nth-child(12),
.materials-master-table th:nth-child(13),
.materials-master-table td:nth-child(13),
.materials-master-table th:nth-child(14),
.materials-master-table td:nth-child(14) {
  min-width: 115px;
}

.material-detail-modal .materials-compact-table {
  min-width: 760px;
}

.material-detail-modal .materials-compact-table th:nth-child(1),
.material-detail-modal .materials-compact-table td:nth-child(1) {
  min-width: 190px;
}

.material-detail-modal .materials-compact-table th:nth-child(2),
.material-detail-modal .materials-compact-table td:nth-child(2),
.material-detail-modal .materials-compact-table th:nth-child(3),
.material-detail-modal .materials-compact-table td:nth-child(3),
.material-detail-modal .materials-compact-table th:nth-child(4),
.material-detail-modal .materials-compact-table td:nth-child(4) {
  min-width: 150px;
}

.row-link {
  color: var(--blue-dark);
  text-decoration: none;
}

.row-link:hover {
  text-decoration: underline;
}

.stock-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
}

.button-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  border-radius: 6px;
  padding: 8px 11px;
  text-decoration: none;
  font-weight: 700;
}

.button-link.secondary {
  border-color: #c8d1dc;
  background: #fff;
  color: var(--text);
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 0;
}

.material-actions {
  align-items: center;
}

.material-actions form {
  margin: 0;
}

.material-actions button,
.material-actions .button-link {
  min-height: 36px;
}

.material-new-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.info-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 8px 0;
}

.info-strip span {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfe;
  line-height: 1.2;
}

.material-new-header h2 {
  margin: 0;
}

.material-new-header-mode {
  margin: 4px 0 0;
}

.material-new-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfe;
}

.material-new-card h3 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 16px;
}

.material-receipt-detail-card {
  min-width: 0;
  padding: 14px;
}

.material-receipt-detail-card .section-head {
  margin-bottom: 10px;
}

.material-receipt-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 9px;
  margin: 0;
}

.material-receipt-summary > div {
  min-width: 0;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
}

.material-receipt-summary dt,
.material-receipt-summary dd {
  display: block;
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.material-receipt-summary dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.material-receipt-summary dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.material-receipt-lines-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.material-receipt-lines-table {
  width: 100%;
  min-width: 940px;
  margin-top: 0;
  table-layout: fixed;
}

.material-receipt-lines-table th,
.material-receipt-lines-table td {
  min-width: 0;
  padding: 8px 7px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.material-receipt-lines-table.has-costs th:nth-child(1),
.material-receipt-lines-table.has-costs td:nth-child(1) { width: 16%; }
.material-receipt-lines-table.has-costs th:nth-child(2),
.material-receipt-lines-table.has-costs td:nth-child(2) { width: 10%; }
.material-receipt-lines-table.has-costs th:nth-child(3),
.material-receipt-lines-table.has-costs td:nth-child(3) { width: 12%; }
.material-receipt-lines-table.has-costs th:nth-child(4),
.material-receipt-lines-table.has-costs td:nth-child(4) { width: 11%; }
.material-receipt-lines-table.has-costs th:nth-child(5),
.material-receipt-lines-table.has-costs td:nth-child(5) { width: 11%; }
.material-receipt-lines-table.has-costs th:nth-child(6),
.material-receipt-lines-table.has-costs td:nth-child(6) { width: 10%; }
.material-receipt-lines-table.has-costs th:nth-child(7),
.material-receipt-lines-table.has-costs td:nth-child(7) { width: 11%; }
.material-receipt-lines-table.has-costs th:nth-child(8),
.material-receipt-lines-table.has-costs td:nth-child(8) { width: 10%; }
.material-receipt-lines-table.has-costs th:nth-child(9),
.material-receipt-lines-table.has-costs td:nth-child(9) { width: 9%; }

.material-receipt-lines-table.without-costs th:nth-child(1),
.material-receipt-lines-table.without-costs td:nth-child(1) { width: 26%; }
.material-receipt-lines-table.without-costs th:nth-child(2),
.material-receipt-lines-table.without-costs td:nth-child(2),
.material-receipt-lines-table.without-costs th:nth-child(3),
.material-receipt-lines-table.without-costs td:nth-child(3) { width: 16%; }
.material-receipt-lines-table.without-costs th:nth-child(4),
.material-receipt-lines-table.without-costs td:nth-child(4) { width: 15%; }
.material-receipt-lines-table.without-costs th:nth-child(5),
.material-receipt-lines-table.without-costs td:nth-child(5),
.material-receipt-lines-table.without-costs th:nth-child(6),
.material-receipt-lines-table.without-costs td:nth-child(6) { width: 13.5%; }

.material-receipt-quantity {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px 5px;
}

.material-receipt-confirm-lines {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.material-receipt-confirm-line {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.material-receipt-confirm-line h4 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  overflow-wrap: anywhere;
}

.material-receipt-confirm-line .material-detail-definition-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.material-receipt-detail-actions {
  width: 100%;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.material-receipt-create-card {
  min-width: 0;
  background: #fff;
}

.material-receipt-create-card > .section-head {
  margin-bottom: 8px;
}

.material-receipt-create-card > .muted {
  margin: 0 0 12px;
}

.material-receipt-create-kind {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfe;
}

.material-receipt-create-kind + .material-receipt-create-kind {
  margin-top: 12px;
}

.material-receipt-create-kind > summary {
  cursor: pointer;
  padding: 11px 12px;
  color: var(--blue-dark);
  font-weight: 800;
}

.material-receipt-create-kind[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #eef6fd;
}

.material-receipt-create-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
  padding: 12px;
}

.material-receipt-create-form > label,
.material-receipt-line-grid > label {
  min-width: 0;
}

.material-receipt-create-form input,
.material-receipt-create-form select,
.material-receipt-create-form textarea {
  min-width: 0;
  max-width: 100%;
}

.material-receipt-create-form input,
.material-receipt-create-form select {
  min-height: 36px;
  height: 36px;
}

.material-receipt-create-form textarea {
  min-height: 64px;
  resize: vertical;
}

.material-receipt-form-error[hidden] {
  display: none;
}

.material-receipt-create-form [aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 2px rgb(180 35 24 / 14%);
}

.material-receipt-create-form > .full-row {
  grid-column: 1 / -1;
  min-width: 0;
}

.material-receipt-lines-section {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.material-receipt-lines-section > .section-head {
  align-items: center;
  margin-bottom: 10px;
}

.material-receipt-lines-section h4 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 14px;
}

.material-receipt-line-card {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 10px;
  background: #fff;
}

.material-receipt-line-card + .material-receipt-line-card {
  margin-top: 10px;
}

.material-receipt-line-card legend {
  max-width: calc(100% - 16px);
  padding: 0 6px;
  color: var(--blue-dark);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.material-receipt-line-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  margin-top: 4px;
}

.material-receipt-material-field {
  grid-column: span 2;
}

.material-receipt-field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
}

.material-receipt-picker {
  position: relative;
  min-width: 0;
  margin-top: 5px;
}

.material-receipt-picker-menu {
  min-width: min(680px, calc(100vw - 72px));
}

.material-receipt-picker-options button {
  display: grid;
  gap: 3px;
}

.material-receipt-picker-options button span {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.82;
}

.material-receipt-picker-actions {
  display: flex;
  justify-content: flex-end;
  padding: 4px;
  border-top: 1px solid var(--line);
}

.material-receipt-picker-actions button {
  min-height: 30px;
  font-size: 11px;
}

.material-receipt-stock-preview {
  align-self: end;
  min-width: 0;
  padding: 9px 10px;
  border: 1px dashed #b8c7d5;
  border-radius: 6px;
  background: #f8fbfe;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.material-receipt-currency {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfe;
}

.material-receipt-currency label,
.material-receipt-currency input,
.material-receipt-currency select {
  min-width: 0;
  max-width: 100%;
}

.material-receipt-rate-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #17633a;
  font-weight: 700;
}

.material-receipt-rate-status.is-error {
  color: #b42318;
}

.exchange-rate-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.exchange-rate-form .table-actions {
  grid-column: 1 / -1;
}

.exchange-rate-table {
  min-width: 920px;
}

.material-receipt-line-actions {
  align-self: end;
  min-width: 0;
}

/* MAT-COM-UX-C1: editor comercial compacto, sin campos economicos confiados al cliente. */
.commercial-receipt-lines-section {
  max-width: 100%;
  overflow: visible;
}

.commercial-receipt-lines-section .material-receipt-line-grid {
  grid-template-columns:
    minmax(280px, 2.6fr)
    minmax(145px, 1.15fr)
    minmax(115px, 0.8fr)
    minmax(140px, 1fr)
    minmax(150px, 1.05fr)
    minmax(76px, auto);
  align-items: start;
  gap: 8px;
}

.commercial-receipt-lines-section .material-receipt-material-field {
  grid-column: auto;
}

.commercial-receipt-unit-field {
  min-width: 0;
}

.commercial-receipt-unit-field label,
.commercial-receipt-unit-field select {
  min-width: 0;
  max-width: 100%;
}

.commercial-receipt-unit-field small {
  display: block;
  min-height: 2.5em;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.commercial-quick-conversion-toggle {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
}

.commercial-quick-conversion {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #c8d9e8;
  border-radius: 6px;
  background: #f5f9fc;
}

.commercial-quick-conversion[hidden] {
  display: none !important;
}

.commercial-quick-conversion > p,
.commercial-quick-conversion > .full-row {
  grid-column: 1 / -1;
}

.commercial-quick-conversion > p {
  margin: 0;
}

.commercial-quick-conversion label small {
  display: block;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .commercial-quick-conversion {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .commercial-quick-conversion {
    grid-template-columns: 1fr;
  }
}

.commercial-receipt-money-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  margin-top: 5px;
  border: 1px solid #c8d2dc;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.commercial-receipt-money-field input {
  width: 100%;
  border: 0;
  border-radius: 0;
}

.commercial-receipt-money-field > span:last-child {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-left: 1px solid #d7e0e8;
  background: #eef4f8;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
}

.commercial-receipt-calculated-field {
  min-height: 36px;
  background: #f4f7fa;
}

.commercial-receipt-calculated-field output {
  min-width: 0;
  padding: 8px 9px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.commercial-receipt-lines-section .material-receipt-line-actions {
  display: flex;
  align-self: end;
  justify-content: flex-end;
  padding-bottom: 1px;
}

.commercial-receipt-remove-confirm {
  position: absolute;
  z-index: 6;
  right: 10px;
  bottom: 10px;
  width: min(360px, calc(100% - 20px));
  padding: 10px;
  border: 1px solid #c9483f;
  border-radius: 7px;
  background: #fff8f7;
  box-shadow: 0 8px 22px rgb(49 22 20 / 18%);
}

.commercial-receipt-remove-confirm[hidden] {
  display: none;
}

.commercial-receipt-remove-confirm p {
  margin: 0 0 8px;
  font-weight: 700;
}

.commercial-receipt-line-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.commercial-receipt-line-error[hidden] {
  display: none;
}

.commercial-receipt-lines-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.commercial-receipt-document-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #a9bfce;
  border-radius: 7px;
  background: #f2f8fc;
}

.commercial-receipt-document-summary h5 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}

.commercial-receipt-document-summary dl {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0;
}

.commercial-receipt-document-summary dl > div {
  display: flex;
  gap: 8px;
}

.commercial-receipt-document-summary dt {
  color: var(--muted);
}

.commercial-receipt-document-summary dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.commercial-receipt-review-table th:first-child,
.commercial-receipt-review-table td:first-child {
  width: 38%;
}

.commercial-receipt-review-table tfoot th,
.commercial-receipt-review-table tfoot td {
  border-top: 2px solid var(--blue-dark);
  font-weight: 800;
}

/* ABA-LDC-UX: jerarquia compacta para revisar y completar una lista de compra. */
.commercial-receipt-detail-card {
  padding: 12px 14px;
  background: #fff;
}

.commercial-receipt-detail-card > .section-head {
  align-items: center;
  margin: 0;
}

.commercial-receipt-detail-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.commercial-receipt-detail-actions {
  align-items: center;
}

.commercial-receipt-detail-definition {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.commercial-receipt-detail-definition > div {
  padding: 7px 9px;
  background: #fbfdff;
}

.commercial-receipt-lines-overview {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.commercial-receipt-lines-overview > .section-head {
  align-items: center;
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.commercial-receipt-lines-overview .table-wrap {
  border: 0;
  border-radius: 0;
}

.commercial-purchase-modal-panel {
  width: min(1480px, calc(100vw - 36px));
  padding: 10px;
  overscroll-behavior: contain;
}

.commercial-purchase-modal-panel > .commercial-receipt-create-card {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.commercial-receipt-advanced {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.commercial-receipt-advanced > summary {
  padding: 9px 11px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.commercial-receipt-advanced > summary strong {
  margin-left: 5px;
}

.commercial-receipt-advanced[open] > summary {
  border-bottom: 1px solid var(--line);
}

.commercial-receipt-create-form .commercial-receipt-advanced .material-receipt-currency {
  padding: 8px 10px;
  border: 0;
  border-radius: 0 0 7px 7px;
  background: #f8fbfe;
}

.material-receipt-create-actions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ABA-COMPACT-C1: lista de compra densa para revisar varias lineas sin perder contexto. */
.commercial-receipt-create-card {
  padding: 12px;
}

.commercial-receipt-create-card > .section-head {
  margin-bottom: 4px;
}

.commercial-receipt-create-card > .muted {
  margin-bottom: 6px;
  font-size: 12px;
}

.commercial-receipt-create-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px 10px;
  padding: 8px 0 0;
}

.commercial-receipt-form-intro {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.6fr);
  align-items: center;
  gap: 8px 18px;
  padding: 9px 11px;
  border: 1px solid #d7e5f0;
  border-radius: 8px;
  background: #f7fbff;
}

.commercial-receipt-form-intro h4,
.commercial-receipt-form-intro p {
  margin: 0;
}

.commercial-receipt-form-intro h4 {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}

.commercial-receipt-form-intro p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.commercial-receipt-form-steps {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #34536d;
  font-size: 11px;
}

.commercial-receipt-form-steps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.commercial-receipt-form-steps span + span::before {
  content: "›";
  margin-right: 3px;
  color: #8ba1b4;
  font-size: 15px;
}

.commercial-receipt-form-steps strong {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #dcecf8;
  color: #075a95;
  font-size: 10px;
}

.commercial-receipt-create-form > label {
  font-size: 12px;
}

.commercial-receipt-create-form .commercial-receipt-header-type,
.commercial-receipt-create-form .commercial-receipt-header-document,
.commercial-receipt-create-form .commercial-receipt-header-date {
  grid-column: span 2;
}

.commercial-receipt-create-form .commercial-receipt-header-supplier,
.commercial-receipt-create-form .commercial-receipt-header-reference {
  grid-column: span 3;
}

.commercial-receipt-create-form input,
.commercial-receipt-create-form select {
  min-height: 32px;
  height: 32px;
}

.commercial-receipt-create-form .material-receipt-currency {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px 10px;
}

.commercial-receipt-create-form .material-receipt-currency label {
  font-size: 11px;
}

.commercial-receipt-create-form .material-receipt-rate-status {
  margin: -1px 0 0;
  font-size: 11px;
}

.commercial-receipt-create-form .commercial-receipt-notes textarea {
  min-height: 42px;
  height: 42px;
}

.commercial-receipt-create-form .material-receipt-lines-section {
  padding-top: 8px;
}

.commercial-receipt-create-form .material-receipt-lines-section > .section-head {
  margin-bottom: 5px;
}

.commercial-receipt-line-card {
  padding: 6px 8px;
  border-radius: 6px;
}

.commercial-receipt-line-card + .commercial-receipt-line-card {
  margin-top: 5px;
}

.commercial-receipt-line-card legend {
  font-size: 12px;
}

.commercial-receipt-lines-section .material-receipt-line-grid {
  grid-template-columns:
    minmax(320px, 3fr)
    minmax(175px, 1.35fr)
    minmax(105px, 0.75fr)
    minmax(135px, 0.95fr)
    minmax(155px, 1fr)
    60px;
  gap: 5px 7px;
  margin-top: 1px;
  align-items: start;
}

.commercial-receipt-line-card .material-receipt-field-label {
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 14px;
}

.commercial-receipt-line-card .material-receipt-picker {
  margin-top: 0;
}

.commercial-receipt-line-card .material-receipt-material-field,
.commercial-receipt-line-card .commercial-receipt-unit-field,
.commercial-receipt-line-card .commercial-receipt-quantity-field,
.commercial-receipt-line-card .commercial-receipt-total-field,
.commercial-receipt-line-card .commercial-receipt-unit-price-field {
  min-width: 0;
  align-self: start;
}

.commercial-receipt-line-card .commercial-receipt-unit-field > label,
.commercial-receipt-line-card .commercial-receipt-quantity-field,
.commercial-receipt-line-card .commercial-receipt-total-field,
.commercial-receipt-line-card .commercial-receipt-unit-price-field {
  gap: 4px;
  margin: 0;
  font-size: 11px;
  line-height: 14px;
}

.commercial-receipt-line-card .commercial-receipt-total-field,
.commercial-receipt-line-card .commercial-receipt-unit-price-field {
  white-space: normal;
}

.commercial-receipt-line-card .material-receipt-picker-actions {
  padding: 1px 0 0;
}

.commercial-receipt-line-card .material-receipt-picker-actions button,
.commercial-receipt-line-card .commercial-quick-conversion-toggle,
.commercial-receipt-line-card .material-receipt-line-actions > button {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 10px;
}

.commercial-receipt-line-card .commercial-quick-conversion-toggle {
  width: auto;
  margin-top: 3px;
}

.commercial-receipt-line-card .commercial-receipt-unit-field small {
  min-height: 0;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.15;
}

.commercial-receipt-line-card .commercial-receipt-money-field {
  margin-top: 0;
}

.commercial-receipt-line-card .commercial-receipt-calculated-field,
.commercial-receipt-line-card .commercial-receipt-money-field {
  min-height: 32px;
}

.commercial-receipt-line-card .commercial-receipt-money-field input {
  height: 30px;
}

.commercial-receipt-line-card .material-receipt-line-actions {
  align-self: start;
  margin-top: 18px;
  padding: 0;
}

.commercial-receipt-line-card .material-receipt-line-actions > button {
  width: 100%;
  min-height: 32px;
  padding-inline: 5px;
}

.commercial-receipt-line-card .material-receipt-line-grid > .muted.full-row {
  margin: 0;
  font-size: 10px;
  line-height: 1.15;
}

/* Franja informativa para solicitud, consumo, sugerencia, saldo y cantidad solicitada. */
.commercial-receipt-lines-head {
  display: grid;
  grid-template-columns:
    50px
    minmax(200px, 1.8fr)
    88px
    110px
    128px
    92px
    142px
    96px
    106px
    108px
    48px;
  gap: 6px;
  margin: 0 8px 3px;
  padding: 0 8px 4px;
  border-bottom: 1px solid #d9e4ee;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}

.commercial-receipt-lines-head.is-coordination-only,
.commercial-receipt-request-context.is-coordination-only {
  grid-template-columns:
    50px
    minmax(240px, 2fr)
    92px
    116px
    minmax(140px, 1fr)
    106px
    52px;
}

.commercial-receipt-lines-section[data-commercial-receipt-need-only] .commercial-receipt-line-card legend {
  display: none;
}

.commercial-receipt-request-context {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns:
    50px
    minmax(200px, 1.8fr)
    88px
    110px
    128px
    92px
    142px
    96px
    106px
    108px
    48px;
  gap: 5px 6px;
  align-items: start;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #d9e4ee;
  border-radius: 5px;
  background: #f7fafc;
  font-size: 11px;
  line-height: 1.2;
}

.commercial-receipt-request-number strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.commercial-receipt-request-context .commercial-receipt-unit-field,
.commercial-receipt-request-context .commercial-receipt-quantity-field,
.commercial-receipt-request-context .commercial-receipt-total-field,
.commercial-receipt-request-context .commercial-receipt-unit-price-field,
.commercial-receipt-request-context .material-receipt-line-actions {
  align-self: start;
  min-width: 0;
  margin: 0;
}

.commercial-receipt-request-context .material-receipt-line-actions {
  margin-top: 18px;
}

.commercial-receipt-request-context .commercial-receipt-money-field {
  white-space: nowrap;
}

.commercial-receipt-request-context > * {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.commercial-receipt-request-context dl {
  display: block;
}

.commercial-receipt-request-context strong,
.commercial-receipt-request-context small,
.commercial-receipt-request-context dt,
.commercial-receipt-request-context dd {
  display: block;
}

.commercial-receipt-request-context dt,
.commercial-receipt-request-context small {
  color: var(--muted);
}

.commercial-receipt-request-context .commercial-receipt-row-label {
  display: none;
}

.commercial-receipt-coordination-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.commercial-receipt-coordination-meta div {
  min-width: 180px;
}

.commercial-receipt-coordination-meta dt,
.commercial-receipt-coordination-note summary {
  color: var(--muted);
  font-size: 12px;
}

.commercial-receipt-coordination-meta dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.commercial-receipt-coordination-note {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.commercial-receipt-coordination-note summary {
  cursor: pointer;
  font-weight: 700;
}

.commercial-receipt-coordination-note label {
  display: block;
  margin-top: 8px;
}

.commercial-receipt-request-context dd {
  margin: 2px 0 0;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.commercial-receipt-request-consumption {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.commercial-receipt-request-consumption small {
  display: inline;
}

.commercial-receipt-locked-need {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 56px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.commercial-receipt-locked-need strong {
  color: var(--blue-dark);
}

.commercial-receipt-locked-need small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.commercial-receipt-empty-lines {
  margin: 0 0 6px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.commercial-receipt-free-needs {
  margin-bottom: 7px;
  padding: 9px;
  border: 1px solid #c8d9e8;
  border-radius: 7px;
  background: #f7fafc;
}

.commercial-receipt-free-needs > .section-head {
  margin-bottom: 6px;
}

.commercial-receipt-free-needs h5,
.commercial-receipt-free-needs p {
  margin: 0;
}

.commercial-receipt-free-needs > label {
  max-width: 620px;
  margin-bottom: 7px;
  font-size: 11px;
}

.commercial-receipt-free-needs-head,
.commercial-receipt-free-need-option {
  display: grid;
  grid-template-columns:
    minmax(260px, 2.2fr)
    minmax(130px, 0.9fr)
    minmax(190px, 1.35fr)
    minmax(150px, 1.05fr)
    minmax(115px, 0.8fr)
    64px;
  gap: 8px;
  align-items: center;
}

.commercial-receipt-free-needs-head {
  padding: 5px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

[data-commercial-receipt-free-needs-results] {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.commercial-receipt-free-need-option {
  width: 100%;
  min-height: 52px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  font-size: 11px;
  line-height: 1.2;
}

.commercial-receipt-free-need-option:last-child {
  border-bottom: 0;
}

.commercial-receipt-free-need-option:hover,
.commercial-receipt-free-need-option:focus-visible {
  background: #edf6ff;
}

.commercial-receipt-free-need-option > span,
.commercial-receipt-free-need-option strong,
.commercial-receipt-free-need-option small {
  min-width: 0;
}

.commercial-receipt-free-need-option strong,
.commercial-receipt-free-need-option small {
  display: block;
}

.commercial-receipt-free-need-option small {
  margin-top: 2px;
  color: var(--muted);
}

.commercial-receipt-free-need-action {
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.commercial-receipt-free-needs-empty {
  padding: 14px;
  text-align: center;
}

.commercial-receipt-create-form .commercial-receipt-lines-footer {
  margin-top: 5px;
}

.commercial-receipt-create-form .commercial-receipt-document-summary {
  margin-top: 7px;
  padding: 7px 10px;
}

.commercial-receipt-create-form .commercial-receipt-document-summary h5 {
  margin-bottom: 4px;
}

@media (max-width: 1180px) {
  .commercial-receipt-form-intro {
    grid-template-columns: 1fr;
  }

  .commercial-receipt-form-steps {
    justify-content: flex-start;
  }
  .commercial-receipt-lines-section .material-receipt-line-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .commercial-receipt-line-card .material-receipt-material-field {
    grid-column: span 7;
  }

  .commercial-receipt-line-card .commercial-receipt-unit-field {
    grid-column: span 5;
  }

  .commercial-receipt-line-card .commercial-receipt-quantity-field {
    grid-column: span 3;
  }

  .commercial-receipt-line-card .commercial-receipt-total-field,
  .commercial-receipt-line-card .commercial-receipt-unit-price-field {
    grid-column: span 4;
  }

  .commercial-receipt-line-card .material-receipt-line-actions {
    grid-column: span 1;
  }

  .commercial-receipt-request-context {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .commercial-receipt-lines-head {
    display: none;
  }

  .commercial-receipt-request-context .commercial-receipt-row-label {
    display: block;
  }

  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-unit-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-quantity-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-total-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-unit-price-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .material-receipt-line-actions {
    grid-column: auto;
  }

  .commercial-receipt-free-needs-head,
  .commercial-receipt-free-need-option {
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)) 90px 64px;
  }
}

@media (max-width: 720px) {
  .material-receipt-summary {
    grid-template-columns: 1fr;
  }

  .material-receipt-lines-wrap {
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .material-receipt-detail-actions button {
    width: 100%;
  }

  .material-receipt-create-card .section-head,
  .material-receipt-lines-section > .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .material-receipt-create-form,
  .material-receipt-line-grid,
  .material-receipt-currency,
  .exchange-rate-form {
    grid-template-columns: 1fr;
  }

  .commercial-receipt-lines-section .material-receipt-line-grid {
    grid-template-columns: 1fr;
  }

  .commercial-receipt-line-card .material-receipt-material-field,
  .commercial-receipt-line-card .commercial-receipt-unit-field,
  .commercial-receipt-line-card .commercial-receipt-quantity-field,
  .commercial-receipt-line-card .commercial-receipt-total-field,
  .commercial-receipt-line-card .commercial-receipt-unit-price-field,
  .commercial-receipt-line-card .material-receipt-line-actions {
    grid-column: 1 / -1;
  }

  .commercial-receipt-line-card .material-receipt-line-actions {
    margin-top: 0;
  }

  .commercial-receipt-request-context {
    grid-template-columns: 1fr;
  }

  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-unit-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-quantity-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-total-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .commercial-receipt-unit-price-field,
  .commercial-receipt-line-card .commercial-receipt-request-context .material-receipt-line-actions {
    grid-column: 1 / -1;
  }

  .commercial-receipt-free-needs-head {
    display: none;
  }

  .commercial-receipt-free-need-option {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .commercial-receipt-free-need-action {
    justify-self: start;
  }

  .commercial-receipt-create-form .material-receipt-currency {
    grid-template-columns: 1fr;
  }

  .commercial-receipt-create-form .commercial-receipt-header-type,
  .commercial-receipt-create-form .commercial-receipt-header-document,
  .commercial-receipt-create-form .commercial-receipt-header-supplier,
  .commercial-receipt-create-form .commercial-receipt-header-reference,
  .commercial-receipt-create-form .commercial-receipt-header-date {
    grid-column: 1 / -1;
  }

  .commercial-purchase-modal-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px auto;
    padding: 6px;
  }

  .material-receipt-material-field,
  .material-receipt-rate-status,
  .exchange-rate-form .table-actions {
    grid-column: auto;
  }

  .commercial-receipt-lines-section .material-receipt-line-actions {
    display: block;
  }

  .commercial-receipt-lines-section .material-receipt-line-actions > button,
  .commercial-receipt-lines-footer,
  .commercial-receipt-lines-footer button {
    width: 100%;
  }

  .commercial-receipt-remove-confirm {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .commercial-receipt-document-summary dl,
  .commercial-receipt-document-summary dl > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .commercial-receipt-review-table,
  .commercial-receipt-review-table tbody,
  .commercial-receipt-review-table tfoot,
  .commercial-receipt-review-table tr,
  .commercial-receipt-review-table th,
  .commercial-receipt-review-table td {
    display: block;
    width: 100% !important;
    min-width: 0;
  }

  .commercial-receipt-review-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .commercial-receipt-review-table tbody tr,
  .commercial-receipt-review-table tfoot tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .commercial-receipt-review-table td,
  .commercial-receipt-review-table tfoot th {
    padding: 6px 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .material-receipt-picker-menu {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .material-receipt-create-actions,
  .material-receipt-create-actions button,
  .material-receipt-create-actions .button-link,
  .material-receipt-lines-section [data-material-receipt-add-line] {
    width: 100%;
  }
}

/* RMM-ABAS-C1-UX1: vistas GET dedicadas para impresion controlada. */
.print-document-page {
  min-width: 0;
  margin: 0;
  background: #eef2f6;
  color: #172033;
  overflow-x: hidden;
}

.print-document-shell {
  width: min(1500px, calc(100% - 32px));
  min-width: 0;
  margin: 24px auto;
}

.print-document-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.print-document-header,
.print-document-card {
  min-width: 0;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #fff;
  overflow-x: auto;
}

.print-document-header h1,
.print-document-card h2,
.print-document-card p {
  margin-top: 0;
}

.print-document-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.print-document-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 16px 0;
}

.print-document-meta div {
  min-width: 0;
}

.print-document-meta dt {
  color: #5d6879;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.print-document-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.print-document-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.print-document-table th,
.print-document-table td {
  padding: 8px;
  border: 1px solid #d7dee8;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.print-document-table th {
  background: #f4f6f9;
  text-align: left;
}

.print-document-table .print-manual-entry-cell {
  min-width: 34mm;
  height: 12mm;
  background: #fff;
}

.print-document-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #5d6879;
  font-size: .75rem;
}

.print-page-number::after {
  content: "";
}

.commercial-purchase-print-page .print-document-shell {
  position: relative;
  width: min(1000px, calc(100% - 32px));
}

.commercial-print-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.commercial-print-heading > div {
  min-width: 0;
}

.commercial-print-logo {
  width: min(var(--commercial-print-logo-width, 48mm), 180px);
  max-height: 64px;
  object-fit: contain;
}

.commercial-print-header-image,
.commercial-print-footer-image {
  display: block;
  width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.commercial-print-header-image {
  margin-bottom: 12px;
}

.commercial-print-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff4dd;
  color: #915a00;
  font-size: .78rem;
  line-height: 1.15;
}

.commercial-print-date {
  color: #526173;
  font-size: .82rem;
  font-weight: 700;
}

.commercial-print-document-code {
  display: block;
  margin-top: 3px;
  color: #c13232;
  font-size: .78rem;
  font-weight: 800;
}

.commercial-print-footer-qr {
  width: 14mm;
  height: 14mm;
  object-fit: contain;
}

.commercial-print-page-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.commercial-purchase-print .print-document-header.is-single-document .print-document-meta {
  grid-template-columns: repeat(2, minmax(0, 220px));
}

.commercial-purchase-print .commercial-print-col-material {
  width: 38%;
}

.commercial-purchase-print .commercial-print-col-unit {
  width: 17%;
}

.commercial-purchase-print .commercial-print-col-requested,
.commercial-purchase-print .commercial-print-col-purchased,
.commercial-purchase-print .commercial-print-col-total {
  width: 15%;
}

@media (max-width: 760px) {
  .print-document-shell {
    width: min(100% - 16px, 1500px);
    margin: 8px auto;
  }

  .print-document-header,
  .print-document-card {
    padding: 12px;
  }

  .print-document-meta {
    grid-template-columns: 1fr;
  }

  .print-document-card-head,
  .print-document-toolbar {
    flex-wrap: wrap;
  }
}

@page {
  size: A4 landscape;
  margin: 12mm 10mm 15mm;
}

@page commercial-purchase {
  size: Letter portrait;
  margin: 9mm 10mm 11mm;
}

@media print {
  html,
  .print-document-page {
    width: 100%;
    min-width: 0;
    background: #fff;
    overflow: visible;
  }

  .print-document-shell {
    width: 100%;
    margin: 0;
  }

  .print-document-toolbar,
  .print-document-notice {
    display: none !important;
  }

  .print-document-header,
  .print-document-card {
    margin: 0 0 6mm;
    padding: 4mm;
    border-color: #777;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    break-inside: auto;
  }

  .print-document-header {
    break-after: avoid-page;
  }

  .print-document-card + .print-document-card {
    break-before: page;
  }

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

  .print-document-table {
    min-width: 0;
    font-size: 8.5pt;
  }

  .print-document-table thead {
    display: table-header-group;
  }

  .print-document-table tr {
    break-inside: avoid;
  }

  .print-document-footer {
    position: fixed;
    right: 0;
    bottom: -10mm;
    left: 0;
  }

  .print-page-number::after {
    content: "Pagina " counter(page);
  }

  .commercial-purchase-print-page {
    font-size: 9.5pt;
  }

  .commercial-purchase-print-page .print-document-shell {
    page: commercial-purchase;
  }

  .commercial-purchase-print-page .print-document-header {
    display: block;
    width: 168mm;
    max-width: calc(100% - 28mm);
    margin: 0 auto 3.5mm;
    padding: 0;
    border: 0;
  }

  .commercial-purchase-print-page .commercial-print-header-image {
    width: 100%;
  }

  .commercial-purchase-print-page .commercial-print-heading {
    position: relative;
    display: block;
    min-height: 38mm;
  }

  .commercial-purchase-print-page .commercial-print-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--commercial-print-logo-width, 48mm);
    max-width: 92mm;
    max-height: 23mm;
    object-position: left center;
  }

  .commercial-purchase-print-page .print-document-header.logo-center .commercial-print-logo {
    left: 50%;
    object-position: center center;
    transform: translateX(-50%);
  }

  .commercial-purchase-print-page .print-document-header.logo-right .commercial-print-logo {
    right: 0;
    left: auto;
    object-position: right center;
  }

  .commercial-purchase-print-page .commercial-print-heading > div {
    position: absolute;
    top: 24mm;
    right: 0;
    left: 0;
    text-align: center;
  }

  .commercial-purchase-print-page .print-document-header:not(.has-logo) .commercial-print-heading {
    min-height: 20mm;
  }

  .commercial-purchase-print-page .print-document-header:not(.has-logo) .commercial-print-heading > div {
    top: 3mm;
  }

  .commercial-purchase-print-page .commercial-print-header-image {
    max-height: 18mm;
    margin-bottom: 2mm;
  }

  .commercial-purchase-print-page .print-document-header .eyebrow {
    margin: 0 0 1mm;
    color: #1f4f78;
    font-size: 7pt;
  }

  .commercial-purchase-print-page .print-document-header.has-logo .eyebrow {
    display: none;
  }

  .commercial-purchase-print-page .print-document-header h1 {
    margin: 0;
    color: #00519a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  .commercial-purchase-print-page .commercial-print-document-code {
    margin-top: 1.5mm;
    color: #ef4444;
    font-size: 10.5px;
  }

  .commercial-purchase-print-page .print-document-header .print-document-meta {
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: 2mm 18mm;
    margin: 2mm auto 0;
    color: #697386;
  }

  .commercial-purchase-print-page .print-document-card {
    width: 168mm;
    max-width: calc(100% - 28mm);
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .commercial-purchase-print-page .print-document-card-head {
    align-items: center;
    gap: 4mm;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .commercial-purchase-print-page .print-document-card-head p {
    margin-bottom: .8mm;
  }

  .commercial-purchase-print-page .print-document-card h2 {
    margin-bottom: 0;
    color: #102f4a;
    font-size: 13pt;
  }

  .commercial-purchase-print-page .commercial-print-status {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #915a00;
    font-size: 7.5pt;
    font-weight: 700;
  }

  .commercial-purchase-print-page .print-document-card > .print-document-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2mm 7mm;
    margin: 3.5mm 0 3mm;
  }

  .commercial-purchase-print-page .print-document-meta dt {
    color: #64748b;
    font-size: 6.2pt;
  }

  .commercial-purchase-print-page .print-document-meta dd {
    margin-top: .5mm;
    color: #697386;
    font-size: 8pt;
    line-height: 1.18;
  }

  .commercial-purchase-print-page .print-document-table {
    border-collapse: collapse;
    color: #777;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 8.8px;
    line-height: 1.15;
  }

  .commercial-purchase-print-page .print-document-table th,
  .commercial-purchase-print-page .print-document-table td {
    padding: 4px 5px;
    border: .35pt solid #d9d9d9;
    line-height: 1.15;
  }

  .commercial-purchase-print-page .print-document-table th {
    background: #fff;
    color: #1b5f9d;
    font-size: 9.3px;
    font-weight: 800;
  }

  .commercial-purchase-print-page .print-document-table td {
    border-color: #d9d9d9;
  }

  .commercial-purchase-print-page .print-document-table td strong {
    color: #003f7a;
  }

  .commercial-purchase-print-page .print-document-table tbody tr:nth-child(even) td {
    background: #f2f2f2;
  }

  .commercial-purchase-print-page .print-document-table .print-manual-entry-cell {
    min-width: 0;
    height: 11mm;
  }

  .commercial-purchase-print-page .print-document-table tfoot th,
  .commercial-purchase-print-page .print-document-table tfoot td {
    border-top: 1.5px solid #64748b;
    background: #f7f7f7;
  }

  .commercial-purchase-print-page .print-document-card + .print-document-card {
    break-before: page;
  }

  .commercial-purchase-print-page .print-document-footer {
    align-items: center;
    position: static;
    margin-top: 3mm;
    padding-top: 0;
    border-top: 0;
    font-size: var(--commercial-print-footer-size, 8px);
    break-inside: avoid;
  }

  .commercial-purchase-print-page .commercial-print-footer-image {
    max-width: 55%;
    max-height: 12mm;
    object-position: left center;
  }

  .commercial-purchase-print-page .commercial-print-page-background {
    top: -9mm;
    right: -10mm;
    bottom: -11mm;
    left: -10mm;
    z-index: 0;
    width: auto;
    height: auto;
  }

  .commercial-purchase-print-page .commercial-purchase-print,
  .commercial-purchase-print-page .print-document-footer {
    position: relative;
    z-index: 1;
  }

  .commercial-purchase-print-page .print-page-number {
    display: none;
  }
}

.material-new-base-card {
  background: #fff;
}

.material-new-form {
  display: grid;
  gap: 12px;
}

.material-new-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.material-new-base-stack {
  display: grid;
  gap: 12px;
}

.material-new-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.material-new-base-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}

.material-new-base-fields {
  display: grid;
  gap: 12px;
}

.material-new-core-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  margin-top: 0;
}

.material-new-option-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.material-new-policy-note {
  padding: 9px 11px;
  border: 1px solid #d9e0e8;
  border-radius: 6px;
  background: #f8fbfe;
  color: var(--muted);
  line-height: 1.35;
}

.material-stock-unit-select option.is-transform-unit {
  background: #e8f5ff;
  color: #0f4f7a;
  font-weight: 700;
}

.material-stock-unit-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.material-stock-unit-hint span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0ea5e9;
  box-shadow: 0 0 0 2px #e8f5ff;
}

.material-new-image-box {
  display: grid;
  gap: 10px;
}

.material-new-reference-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px dashed #b7c5d5;
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
}

.material-new-reference-preview img {
  width: 100%;
  height: 100%;
  max-height: 230px;
  object-fit: contain;
}

.material-new-identity-grid {
  grid-template-columns: minmax(150px, 0.55fr) minmax(160px, 0.55fr) minmax(260px, 1.25fr) minmax(260px, 1fr);
}

.material-new-section-grid,
.material-new-bom-grid {
  grid-template-columns: 1fr;
}

.material-new-bom-grid {
  align-items: end;
}

.material-new-bom-grid p {
  margin: 0;
  line-height: 1.35;
}

.material-bom-flexibility {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.material-bom-flexibility .check {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.material-delivery-mode-table td:first-child,
.material-delivery-mode-table th:first-child {
  width: 92px;
  text-align: center;
}

.material-delivery-mode-table .check {
  justify-content: center;
  padding-top: 0;
}

.material-new-tabbed-form {
  gap: 0;
}

.material-new-tab-control,
.material-new-formula-toggle,
.material-new-transformation-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.material-new-subtabs {
  margin-bottom: 12px;
}

.material-new-subtabs label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--blue-dark);
  font-weight: 700;
  cursor: pointer;
}

.material-new-subtabs label.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#material-new-tab-datos:checked ~ .material-new-subtabs label[for="material-new-tab-datos"],
#material-new-tab-conversiones:checked ~ .material-new-subtabs label[for="material-new-tab-conversiones"],
#material-new-is-formula:checked ~ #material-new-tab-formula:checked ~ .material-new-subtabs label[for="material-new-tab-formula"],
#material-new-is-transformation:checked ~ #material-new-tab-formula:checked ~ .material-new-subtabs label[for="material-new-tab-formula"],
#material-new-tab-bom:checked ~ .material-new-subtabs label[for="material-new-tab-bom"],
#material-new-tab-entrega:checked ~ .material-new-subtabs label[for="material-new-tab-entrega"],
#material-new-tab-stock:checked ~ .material-new-subtabs label[for="material-new-tab-stock"] {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.material-new-formula-tab-label {
  opacity: 0.45;
  pointer-events: none;
}

#material-new-is-formula:checked ~ .material-new-subtabs .material-new-formula-tab-label,
#material-new-is-transformation:checked ~ .material-new-subtabs .material-new-formula-tab-label {
  opacity: 1;
  pointer-events: auto;
}

.material-new-tab-panel {
  display: none;
  gap: 12px;
}

#material-new-tab-datos:checked ~ .material-new-datos-panel,
#material-new-tab-conversiones:checked ~ .material-new-conversiones-panel,
#material-new-is-formula:checked ~ #material-new-tab-formula:checked ~ .material-new-formula-panel,
#material-new-is-transformation:checked ~ #material-new-tab-formula:checked ~ .material-new-formula-panel,
#material-new-tab-bom:checked ~ .material-new-bom-panel,
#material-new-tab-entrega:checked ~ .material-new-entrega-panel,
#material-new-tab-stock:checked ~ .material-new-stock-panel {
  display: grid;
}

.material-new-inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.material-new-inline-field button {
  min-height: 38px;
  white-space: nowrap;
}

.material-new-family-check,
.material-new-reservable-check,
.material-new-commercial-reservation-check,
.material-new-formula-label,
.material-new-transformation-label {
  align-self: end;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.material-new-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.material-new-checks .check {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.material-new-checks-minimal {
  grid-template-columns: minmax(220px, 360px);
}

.material-new-faux-check {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid #9fb0c2;
  border-radius: 4px;
  background: #fff;
}

#material-new-is-formula:checked ~ .material-new-datos-panel [data-material-formula-faux],
#material-new-is-transformation:checked ~ .material-new-datos-panel [data-material-transformation-faux] {
  border-color: var(--blue);
  background: var(--blue);
}

#material-new-is-formula:checked ~ .material-new-datos-panel [data-material-formula-faux]::after,
#material-new-is-transformation:checked ~ .material-new-datos-panel [data-material-transformation-faux]::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.material-new-actions {
  justify-content: flex-start;
}

.material-new-modal {
  width: min(1360px, calc(100vw - 36px));
}

.material-new-modal .material-new-layout {
  margin-top: 0;
}

.material-new-conversion-table {
  min-width: 760px;
}

.material-new-table-title {
  margin: 12px 0 4px;
  color: var(--blue-dark);
  font-size: 15px;
}

.material-new-conversion-table th,
.material-new-conversion-table td {
  min-width: 125px;
}

.material-new-conversion-table th:first-child,
.material-new-conversion-table td:first-child {
  min-width: 130px;
}

.material-new-conversion-table th:nth-child(2),
.material-new-conversion-table td:nth-child(2) {
  min-width: 220px;
}

.material-new-validation-result {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.material-new-validation-result ul {
  margin: 0;
  padding-left: 18px;
}

.material-new-validation-result.is-ok {
  border-color: #b7dfc3;
  background: #f0fbf3;
  color: #245c34;
}

.material-new-validation-result.is-error {
  border-color: #fecaca;
  background: #fff5f5;
  color: #9b1c1c;
}

.material-new-validation-result.is-warning {
  border-color: #f2d9a6;
  background: #fff7e6;
  color: #8a5a00;
}

.material-new-formula-table {
  min-width: 920px;
  table-layout: fixed;
}

.material-new-formula-mode {
  grid-template-columns: minmax(220px, 360px);
  margin-bottom: 10px;
}

.material-new-transformation-section {
  display: grid;
  gap: 10px;
}

.material-new-transform-format-table {
  min-width: 1120px;
}

.material-new-transform-format-table th,
.material-new-transform-format-table td {
  vertical-align: middle;
}

.material-new-transform-format-table th:first-child,
.material-new-transform-format-table td:first-child {
  width: 74px;
  text-align: center;
}

.material-new-transform-format-table td:nth-child(2) {
  min-width: 210px;
}

.material-new-transform-format-table td:nth-child(2) strong,
.material-new-transform-format-table td:nth-child(2) small {
  display: block;
}

.material-new-transform-format-table td:nth-child(2) small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.25;
}

.material-new-transform-format-table td:nth-child(4),
.material-new-transform-format-table td:nth-child(5),
.material-new-transform-format-table td:nth-child(6),
.material-new-transform-format-table td:nth-child(7) {
  font-weight: 700;
  color: #14364d;
}

.material-new-transform-format-table tr.is-disabled {
  opacity: 0.62;
}

.material-new-transform-empty[hidden] {
  display: none;
}

.material-new-row-check {
  justify-content: center;
  margin: 0;
}

.material-new-formula-table th:first-child,
.material-new-formula-table td:first-child {
  width: 42%;
  min-width: 360px;
  vertical-align: top;
}

.material-new-formula-table th:nth-child(2),
.material-new-formula-table td:nth-child(2),
.material-new-formula-table th:nth-child(3),
.material-new-formula-table td:nth-child(3) {
  width: 29%;
  vertical-align: top;
}

.material-component-picker .sales-quote-picker-menu {
  position: static;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-top: 6px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.material-component-picker .sales-quote-picker-menu input {
  width: calc(100% - 12px);
  min-height: 38px;
  margin: 6px;
}

.material-component-picker .sales-quote-picker-options {
  max-height: 260px;
}

.material-new-stock-status-table {
  min-width: 760px;
}

.material-new-stock-status-table th:first-child,
.material-new-stock-status-table td:first-child {
  min-width: 130px;
}

.material-new-cost-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.material-new-cost-status-card,
.material-new-cost-readiness {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-new-cost-status-card p,
.material-new-cost-readiness p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.material-new-cost-state {
  justify-self: start;
  width: auto;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.material-new-cost-state.is-pending {
  border-color: #f2d9a6;
  background: #fff7e6;
  color: #8a5a00;
}

.material-new-cost-readiness {
  margin-top: 10px;
  background: #f8fbfe;
}

.material-new-stock-status-table th:nth-child(2),
.material-new-stock-status-table td:nth-child(2),
.material-new-stock-status-table th:nth-child(3),
.material-new-stock-status-table td:nth-child(3) {
  min-width: 180px;
}

.material-new-range-cell {
  min-width: 360px;
}

.material-new-range-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.material-stock-policy-editor {
  display: grid;
  grid-template-columns: auto minmax(78px, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 150px;
}

.material-stock-policy-editor > span {
  white-space: nowrap;
}

.material-stock-policy-editor select,
.material-stock-policy-editor input {
  min-width: 0;
  width: 100%;
}

.material-new-stock-status-table td:first-child small {
  display: block;
  margin-top: 4px;
}

.material-stock-policy-table-wrap {
  margin-top: 10px;
}

.material-stock-policy-base-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #8ac7a0;
  border-left: 4px solid #078b2e;
  border-radius: 6px;
  background: #effaf2;
  color: #145c2b;
}

.material-stock-policy-row.is-ok td {
  font-weight: 600;
}

.material-stock-policy-row.is-ok .material-stock-policy-base-editor {
  padding: 5px;
  border: 2px solid #078b2e;
  border-radius: 6px;
  background: #f3fff5;
}

.material-stock-policy-row.is-ok .material-stock-policy-base-editor input {
  font-weight: 800;
  border-color: #078b2e;
}

.material-stock-policy-base-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #078b2e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.material-stock-policy-row.is-ok .muted {
  color: inherit;
  opacity: .85;
}

.supply-stock-policy-table th,
.supply-stock-policy-table td {
  vertical-align: top;
}

.supply-stock-policy-table td:first-child input,
.supply-stock-policy-table td:first-child select,
.supply-stock-policy-table td:nth-child(4) input {
  width: 100%;
}

.supply-stock-policy-table td:first-child small,
.supply-stock-policy-table td:last-child small,
.supply-stock-policy-table td:last-child .pill {
  display: block;
  margin-top: 5px;
}

.supply-stock-policy-limit {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(88px, auto) minmax(64px, 86px);
  gap: 5px;
  align-items: center;
  min-width: 300px;
}

.supply-stock-policy-limit select,
.supply-stock-policy-limit input {
  min-width: 0;
  width: 100%;
}

.material-searchbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(110px, 150px)) auto auto auto;
  align-items: end;
  gap: 10px;
  margin: 14px 0 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.material-searchbar[data-material-catalog-filters] > .search-field,
.material-searchbar[data-material-catalog-filters] > .compact-field,
.material-searchbar[data-bom-cost-filters] > .search-field,
.material-searchbar[data-bom-cost-filters] > .compact-field,
.material-searchbar[data-bom-technical-filters] > .search-field,
.material-searchbar[data-bom-technical-filters] > .compact-field {
  align-self: start;
}

.material-searchbar[data-material-catalog-filters] > button,
.material-searchbar[data-material-catalog-filters] > .button-link,
.material-searchbar[data-bom-cost-filters] > button,
.material-searchbar[data-bom-cost-filters] > .button-link,
.material-searchbar[data-bom-technical-filters] > button,
.material-searchbar[data-bom-technical-filters] > .button-link {
  align-self: start;
  margin-top: 22px;
}

.material-searchbar button,
.material-searchbar .button-link {
  min-height: 38px;
  justify-content: center;
}

.bom-technical-filterbar {
  grid-template-columns: minmax(280px, 1fr) minmax(110px, 150px) auto auto;
}

.bom-technical-advanced-filters {
  grid-template-columns: minmax(220px, 320px) auto;
}

.search-field {
  min-width: 240px;
}

.compact-field {
  min-width: 110px;
}

.advanced-filters {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.advanced-filters.open {
  display: grid;
}

.material-filter-apply {
  align-self: end;
  justify-self: start;
}

/* Abastecimiento: registro compacto y progresivo de solicitudes de compra. */
.supply-needs {
  min-width: 0;
}

.supply-needs-list-head,
.supply-needs-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.supply-needs-list-head {
  justify-content: space-between;
  margin: 8px 0;
}

.supply-needs-list-head > p {
  margin: 0;
}

.supply-needs-bulk-toolbar {
  justify-content: flex-end;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  font-size: .82rem;
}

.supply-needs-bulk-toolbar .button-link,
.supply-needs-bulk-toolbar button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: .8rem;
}

.supply-needs-bulk-action[aria-disabled="true"],
.supply-needs-bulk-action:disabled {
  pointer-events: none;
  opacity: .55;
}

.supply-needs-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.supply-needs-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: .78rem;
  line-height: 1.25;
}

.supply-needs-table th,
.supply-needs-table td {
  min-width: 0;
  padding: 8px 6px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.supply-needs-table thead th {
  vertical-align: bottom;
  line-height: 1.15;
}

.supply-needs-table tbody tr:hover {
  background: #f8fbfe;
}

.supply-needs-table > tbody > tr > td {
  display: table-cell;
}

.supply-needs-table th:nth-child(1) { width: 3%; }
.supply-needs-table th:nth-child(2) { width: 5%; }
.supply-needs-table th:nth-child(3) { width: 8%; }
.supply-needs-table th:nth-child(4) { width: 13%; }
.supply-needs-table th:nth-child(5) { width: 18%; }
.supply-needs-table th:nth-child(6) { width: 9%; }
.supply-needs-table th:nth-child(7) { width: 10%; }
.supply-needs-table th:nth-child(8) { width: 10%; }
.supply-needs-table th:nth-child(9),
.supply-needs-table th:nth-child(10),
.supply-needs-table th:nth-child(11) { width: 4%; }
.supply-needs-table th:nth-child(12) { width: 8%; }
.supply-needs-table th:nth-child(13) { width: 5%; }

.supply-need-select-cell {
  text-align: center;
}

.supply-need-id {
  color: var(--blue-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.supply-need-dates,
.supply-need-context,
.supply-need-units,
.supply-need-quantity,
.supply-need-suggestion,
.supply-need-situation {
  display: table-cell;
}

.supply-need-dates > *,
.supply-need-context > *,
.supply-need-units > *,
.supply-need-quantity > *,
.supply-need-situation > * {
  margin-top: 0;
  margin-bottom: 3px;
}

.supply-need-dates span,
.supply-need-context span,
.supply-need-context small,
.supply-need-units small,
.supply-need-quantity small,
.supply-need-suggestion small,
.supply-need-situation small {
  color: var(--muted);
  line-height: 1.25;
}

.supply-need-context strong,
.supply-need-context span,
.supply-need-context small,
.supply-need-dates strong,
.supply-need-dates span,
.supply-need-quantity strong,
.supply-need-quantity small,
.supply-need-suggestion strong,
.supply-need-suggestion small,
.supply-need-situation small {
  display: block;
}

.supply-need-material-button {
  display: grid;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.supply-need-material-button:hover,
.supply-need-material-button:focus-visible {
  color: var(--primary);
  background: transparent;
  box-shadow: none;
}

.supply-need-material-button > span {
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
}

.supply-need-material-button > strong {
  line-height: 1.22;
}

.supply-need-material-button > small {
  margin-top: 2px;
  color: var(--muted);
}

.supply-need-units > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}

.supply-need-conversion {
  padding-top: 3px;
  border-top: 1px dashed var(--line);
}

.supply-need-consumption {
  display: table-cell;
  font-variant-numeric: tabular-nums;
}

.supply-need-consumption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 6px;
}

.supply-need-consumption span {
  white-space: nowrap;
}

.supply-need-consumption small {
  color: var(--muted);
  font-weight: 700;
}

.supply-need-suggestion {
  font-variant-numeric: tabular-nums;
}

.supply-need-suggestion strong + strong {
  margin-top: 2px;
}

.supply-need-quantity {
  font-variant-numeric: tabular-nums;
}

.supply-need-situation-pill {
  width: fit-content;
  white-space: normal;
  line-height: 1.2;
}

.supply-need-situation-pill.is-success { background: #dcfce7; color: #166534; }
.supply-need-situation-pill.is-warning { background: #fef3c7; color: #92400e; }
.supply-need-situation-pill.is-danger { background: #fee2e2; color: #991b1b; }
.supply-need-situation-pill.is-info { background: #dbeafe; color: #1e40af; }
.supply-need-situation-pill.is-neutral { background: #eef2f7; color: #475569; }

.supply-need-actions-menu {
  position: relative;
}

.supply-need-actions-menu > summary {
  cursor: pointer;
  font-weight: 700;
}

.supply-need-actions-menu[open] {
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 44, .12);
}

.supply-need-actions-menu .actions,
.supply-need-actions-menu form {
  display: grid;
  gap: 6px;
}

.supply-material-preview-modal .modal-panel {
  width: min(520px, calc(100vw - 32px));
}

.supply-material-preview-body {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.supply-material-preview-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
  border-radius: 6px;
}

.supply-material-preview-body img[hidden],
.supply-material-preview-empty[hidden] {
  display: none;
}

.supply-material-preview-empty {
  color: var(--muted);
  text-align: center;
}

.supply-needs-link-receipt-modal .modal-panel {
  width: min(680px, calc(100vw - 32px));
}

.supply-needs-selection-form {
  display: grid;
  gap: 12px;
}

@media (max-width: 980px) {
  .supply-needs-table-wrap {
    overflow-x: visible;
  }

  .supply-needs-table,
  .supply-needs-table tbody,
  .supply-needs-table tr,
  .supply-needs-table td {
    display: block;
    width: 100%;
  }

  .supply-needs-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .supply-needs-table tbody {
    display: grid;
    gap: 10px;
  }

  .supply-needs-table tr {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .supply-needs-table td {
    display: block;
    padding: 6px;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .2);
  }

  .supply-needs-table > tbody > tr > td {
    display: block;
  }

  .supply-needs-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .supply-needs-table td:last-child {
    border-bottom: 0;
  }

  .supply-need-consumption-grid {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
  }

  .supply-need-actions-menu[open] {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .supply-needs-list-head,
  .supply-needs-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .supply-need-consumption-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sales-order-quickbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0 8px;
}

.sales-order-quickbar .search-field {
  min-width: 0;
}

.sales-order-quickbar button {
  min-height: 38px;
}

.compact-toggle-searchbar {
  grid-template-columns: 1fr;
  padding: 0;
  border: 0;
  background: transparent;
}

.custom-series-filter-section {
  margin: 0;
}

.custom-series-bom-filterbar.open {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.sales-order-filter-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.list-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.list-summary.bottom {
  justify-content: flex-end;
}

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

.pagination .button-link {
  padding: 6px 10px;
}

.button-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

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

th {
  color: var(--blue-dark);
  background: #f7fafc;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.sort-link {
  color: var(--blue-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
}

.sort-link:hover,
.sort-link.active {
  text-decoration: underline;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f8fbfe;
}

.production-sales-orders-table {
  min-width: 1800px;
}

.production-sales-orders-table th,
.production-sales-orders-table td {
  font-size: 12px;
}

.production-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 170px;
}

.production-control-placeholder {
  display: flex;
  margin: 10px 0 14px;
  text-transform: none;
  white-space: normal;
}

.designs-table {
  min-width: 1540px;
}

.designs-table th,
.designs-table td {
  text-align: center;
}

.designs-table th:nth-child(3),
.designs-table td:nth-child(3) {
  text-align: left;
  min-width: 280px;
}

.design-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 30px;
  border-radius: 3px;
  padding: 5px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.design-state.green {
  background: #27ae60;
}

.design-state.red {
  background: #e74c3c;
}

.design-state.amber {
  background: #e67e22;
}

.design-state.neutral {
  background: #34495e;
}

.design-state.violet {
  background: #8e44ad;
}

.sales-orders-table {
  min-width: 1880px;
  font-size: 12px;
}

.sales-orders-table th,
.sales-orders-table td {
  padding: 8px;
}

.sales-quotes-table {
  min-width: 1260px;
  font-size: 11px;
}

.sales-quotes-table th,
.sales-quotes-table td {
  padding: 6px 7px;
  vertical-align: top;
  line-height: 1.2;
}

.sales-quotes-table .button-link {
  padding: 5px 7px;
  font-size: 11px;
}

.sales-quote-observation {
  min-width: 130px;
  max-width: 190px;
  line-height: 1.35;
  color: #34495e;
}

.sales-quote-created {
  min-width: 110px;
}

.sales-quote-close-form {
  margin: 6px 0 0;
}

.sales-quote-close-button {
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #ef4444;
  border-radius: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.sales-quote-close-button:hover,
.sales-quote-close-button:focus {
  background: #dc2626;
  border-color: #dc2626;
}

.sales-orders-table th:nth-child(5),
.sales-orders-table td:nth-child(5),
.sales-orders-table th:nth-child(12),
.sales-orders-table td:nth-child(12) {
  min-width: 220px;
}

.sales-order-observation {
  max-width: 320px;
  line-height: 1.35;
}

.order-status.generated {
  background: #2563eb;
}

.order-status.reviewed {
  background: #e23a05;
}

.order-status.ready {
  background: #f2e600;
  color: #172335;
}

.order-status.production {
  background: #9b0606;
}

.order-status.closed {
  background: #22a65a;
}

.order-status.pending-closed {
  background: #7c3aed;
}

.order-status.cancelled {
  background: #111827;
}

.order-type {
  min-width: 94px;
}

.order-type.type-order {
  background: #9b0606;
}

.order-type.type-direct {
  background: #3b8b0b;
}

.order-type.type-order-sale {
  background: #bf3100;
}

.order-type.type-none {
  background: #0f2d46;
}

.order-type.type-assistance {
  background: #0f766e;
}

.order-type.type-utilities {
  background: #8e44ad;
}

.order-type.type-exchange,
.order-type.type-other {
  background: #6b7280;
}

.count-link,
.count-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid #92b7df;
  border-radius: 2px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.count-link:hover {
  background: #edf6ff;
  border-color: var(--blue);
}

.count-empty {
  border-color: transparent;
  color: var(--text);
  font-weight: 400;
}

.series-table {
  min-width: 880px;
}

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

.product-transfer-form {
  margin: 0;
}

.transfer-cart-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.transfer-cart-bar strong {
  color: var(--blue-dark);
  font-size: 18px;
}

.transfer-cart-bar form {
  margin: 0;
}

.product-list-table {
  min-width: 1420px;
  font-size: 12px;
}

.product-list-table th,
.product-list-table td {
  text-align: center;
  vertical-align: middle;
}

.product-list-table th:nth-child(4),
.product-list-table td:nth-child(4),
.product-list-table th:nth-child(5),
.product-list-table td:nth-child(5),
.product-list-table th:nth-child(6),
.product-list-table td:nth-child(6),
.product-list-table th:nth-child(12),
.product-list-table td:nth-child(12) {
  text-align: left;
}

.product-list-table .select-cell {
  width: 36px;
}

.product-list-table th:nth-child(4),
.product-list-table td:nth-child(4) {
  min-width: 330px;
}

.product-list-table th:nth-child(3),
.product-list-table td:nth-child(3),
.product-list-table th:nth-child(5),
.product-list-table td:nth-child(5),
.product-list-table th:nth-child(11),
.product-list-table td:nth-child(11) {
  width: 92px;
}

.product-state {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 64px;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 3px;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-state.available {
  background: #078337;
}

.product-state.process {
  background: #daaa32;
}

.product-state.order-process {
  background: #e67e22;
}

.product-state.order-available {
  background: #2e75b6;
}

.product-state.sold {
  background: #b42318;
}

.product-state.maintenance {
  background: #222a35;
}

.product-state.assistance {
  background: #6a0888;
}

.product-state.other {
  background: #334155;
}

.product-color-cell {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 76px;
  min-height: 34px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.design-preview-link {
  font-weight: 800;
}

.product-preview-modal {
  width: min(760px, calc(100vw - 48px));
}

.transfer-modal-panel {
  width: min(1180px, calc(100vw - 48px));
}

.transfer-products-table {
  min-width: 980px;
  margin-top: 12px;
}

.transfer-products-table form {
  margin: 0;
}

.product-preview-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

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

.preview-meta span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.preview-meta strong {
  color: var(--blue-dark);
}

.inactive-row {
  opacity: 0.68;
}

.security-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.security-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfe;
}

.security-summary h3 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}

.security-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.users-table {
  min-width: 820px;
}

.admin-users-searchbar {
  grid-template-columns: minmax(280px, 1fr) auto auto;
  margin: 0 0 12px;
}

.admin-users-searchbar .advanced-filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.user-material-locations-optional {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.user-material-locations-optional > summary {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 800;
}

.user-material-locations-optional > summary small {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 600;
}

.user-material-locations-optional > .user-material-locations {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.admin-roles-searchbar {
  grid-template-columns: minmax(280px, 1fr) auto auto;
  margin: 0 0 12px;
}

.admin-roles-searchbar .advanced-filters {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.roles-table {
  min-width: 940px;
}

.roles-table td:first-child {
  min-width: 300px;
}

.roles-table td:first-child .muted {
  display: inline-block;
  max-width: 560px;
}

.roles-table .actions {
  min-width: 190px;
  align-items: center;
}

.roles-table tr.selected-row {
  background: #edf6ff;
}

.role-link {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  color: var(--text);
  background: #fbfcfe;
  text-decoration: none;
}

.role-link.selected {
  background: #edf6ff;
  border-color: #9cc7ed;
  border-left-color: var(--blue-dark);
}

.role-link strong {
  color: var(--blue-dark);
}

.role-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.role-link span,
.role-link em,
.role-link small {
  color: var(--muted);
}

.role-link em,
.role-link small {
  font-style: normal;
  font-size: 12px;
}

.role-link small {
  color: var(--blue);
  font-weight: 700;
}

.menu-rule-panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.menu-rule-panel strong {
  color: var(--blue-dark);
}

.menu-rule-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.permissions-modal .modal-panel {
  width: min(1180px, calc(100vw - 48px));
}

.role-editor {
  min-width: 0;
}

.compact-form {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  margin-top: 0;
}

.permission-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0 8px;
}

.permission-search {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--blue-dark);
}

.permission-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.permission-filter-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.permission-filter-tabs button.active {
  border-color: var(--blue);
  background: #edf6ff;
  color: var(--blue-dark);
}

.permission-editor-hint {
  margin: 0 0 12px;
}

.permission-editor-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid #cfe3f4;
  border-radius: 8px;
  background: #f4f9fd;
  color: var(--muted);
  font-size: 12px;
}

.permission-editor-guide strong {
  color: var(--blue-dark);
}

.permission-area-stack {
  display: grid;
  gap: 12px;
}

.permission-area {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-area summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 800;
}

.permission-area summary small {
  color: var(--muted);
  font-weight: 700;
}

.permission-module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 12px 12px;
}

.permission-module-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fbfcfe;
}

.permission-module-card > summary {
  list-style: none;
}

.permission-module-card > summary::-webkit-details-marker {
  display: none;
}

.permission-module-card > summary {
  padding: 8px 10px;
}

.permission-module-card > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  color: var(--muted);
  transition: transform .15s ease;
}

.permission-module-card[open] > summary::before {
  transform: rotate(90deg);
}

.permission-module-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.permission-module-head span,
.permission-module-head small {
  display: inline;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-module-head > div:first-of-type {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-module-head strong {
  display: inline;
  margin: 0;
  color: var(--blue-dark);
  font-size: 16px;
}

.permission-module-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.permission-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0 12px 12px;
}

.permission-submodule-list {
  padding-top: 4px;
}

.permission-submodule {
  border-top: 1px solid #e7edf3;
}

.permission-submodule:first-child {
  border-top: 0;
}

.permission-submodule-head {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  justify-content: flex-start;
  padding: 6px 10px;
  color: var(--blue-dark);
}

.permission-submodule-head::-webkit-details-marker {
  display: none;
}

.permission-submodule-head::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  color: var(--muted);
  transition: transform .15s ease;
}

.permission-submodule[open] > .permission-submodule-head::before {
  transform: rotate(90deg);
}

.permission-submodule-head small {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}

.permission-option {
  display: grid;
  grid-template-columns: auto minmax(210px, 1.2fr) minmax(220px, 1fr) minmax(120px, .55fr);
  gap: 3px 8px;
  align-items: center;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.permission-option input {
  grid-row: auto;
  width: auto;
  margin: 0;
}

.permission-option span {
  font-weight: 700;
  line-height: 1.2;
}

.permission-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.permission-option .permission-usage {
  color: var(--blue-dark);
  font-size: 11px;
}

.permission-option .permission-code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

@media (max-width: 820px) {
  .permission-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .permission-option .permission-usage,
  .permission-option .permission-code {
    grid-column: 2;
  }
}

.permission-option.is-allowed {
  border-color: #93c5bd;
  background: #f3fbf8;
}

.permission-option.is-denied {
  opacity: 0.82;
}

.permission-empty {
  margin: 12px 0;
}

@media print {
  body.print-body {
    background: #fff;
  }

  body.print-body .print-page {
    box-shadow: none;
    margin: 0;
    width: auto;
    min-height: auto;
  }

  body.print-body .print-toolbar {
    display: none;
  }

  .sidebar,
  .topbar,
  .material-searchbar,
  .material-actions,
  .pagination,
  .list-summary.bottom,
  .modal {
    display: none !important;
  }

  .main {
    margin: 0;
    padding: 0;
  }

  .panel {
    border: 0;
    padding: 0;
    overflow: visible;
  }

  table {
    min-width: 0;
    font-size: 10px;
  }
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline div {
  border-left: 4px solid var(--green);
  padding: 8px 12px;
  background: #f8fbfa;
}

.timeline span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline p {
  margin: 5px 0 0;
}

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

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

.bom-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.bom-item {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--text);
  text-decoration: none;
}

.bom-item.selected {
  background: #edf6ff;
  border-color: #9cc7ed;
  border-left-color: var(--blue-dark);
}

.bom-item span,
.bom-item em {
  color: var(--muted);
}

.bom-item em {
  font-style: normal;
  font-size: 12px;
}

.bom-workspace {
  border-left: 4px solid var(--blue);
}

.bom-workspace .section-head {
  align-items: flex-start;
}

.bom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.bom-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.bom-nav a.active {
  border-color: var(--blue);
  background: #edf6ff;
  color: var(--blue-dark);
}

.bom-tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.bom-tool-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.bom-tool-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.bom-tool-strip a.active {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: #f1f8ff;
}

.bom-status-strip,
.row-badges,
.table-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bom-status-strip {
  margin-top: 12px;
}

.bom-status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}

.bom-status-strip strong {
  margin-right: 4px;
  color: var(--blue-dark);
}

.row-badges {
  margin-top: 6px;
}

.bom-catalog-table {
  overflow-x: auto;
}

.bom-catalog-table table {
  min-width: 1120px;
}

.bom-catalog-table th,
.bom-catalog-table td {
  vertical-align: top;
}

.bom-catalog-table .selected-row {
  background: #f1f8ff;
}

.bom-catalog-version-summary,
.bom-catalog-version-list {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.bom-catalog-version-link {
  display: grid;
  min-width: 112px;
  color: var(--blue-dark);
  line-height: 1.2;
  text-decoration: none;
}

.bom-catalog-version-link:hover strong {
  text-decoration: underline;
}

.bom-catalog-version-link small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.bom-catalog-version-link .bom-catalog-version-approvals {
  white-space: normal;
}

.bom-catalog-version-coverage {
  display: grid;
  gap: 6px;
}

.bom-catalog-coverage-item {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 135px;
}

.bom-catalog-coverage-item .badge {
  justify-self: start;
  white-space: nowrap;
}

.bom-catalog-preview-thumb {
  display: grid;
  place-items: center;
  width: 78px;
  min-width: 78px;
  aspect-ratio: 4 / 3;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--blue-dark);
  text-align: center;
  text-decoration: none;
  overflow: hidden;
}

.bom-catalog-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bom-catalog-preview-thumb span {
  font-weight: 900;
  font-size: 13px;
}

.bom-catalog-preview-thumb small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.bom-catalog-preview-thumb.file-preview {
  background: #fff8eb;
  border-color: #f3cf92;
}

.bom-catalog-preview-thumb.file-preview span {
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #fff;
  color: #9a5a00;
}

.bom-catalog-preview-thumb:hover {
  border-color: #1d70b8;
  background: #eef6ff;
}

.table-actions-inline {
  align-items: flex-start;
}

.table-actions-inline .button-link {
  min-height: 32px;
  padding: 6px 9px;
}

.bom-detail-panel,
.custom-series-detail-panel {
  display: grid;
  gap: 14px;
}

.bom-detail-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.bom-detail-metrics,
.custom-series-detail-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 0;
}

.bom-detail-metrics article,
.custom-series-detail-metrics article {
  min-width: 0;
}

.bom-detail-metrics strong,
.custom-series-detail-metrics strong {
  overflow-wrap: anywhere;
  font-size: 22px;
}

.bom-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.bom-detail-title {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.bom-detail-title h2 {
  margin: 0;
}

.bom-detail-title-badges,
.bom-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bom-detail-actions {
  justify-content: flex-end;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.bom-detail-actions .button-link,
.bom-detail-actions button {
  min-height: 34px;
}

.bom-detail-main-action {
  font-weight: 800;
}

.bom-detail-ficha {
  border: 0;
  padding: 0;
  background: #fff;
}

.bom-detail-ficha .sales-order-legacy-summary {
  padding-top: 4px;
}

.bom-detail-ficha-row strong {
  overflow-wrap: normal;
  word-break: normal;
}

.bom-detail-quote-actions {
  margin: 2px 0 0;
}

.bom-general-edit-form {
  display: grid;
  gap: 12px;
}

.bom-general-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bom-general-edit-grid label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-general-edit-grid .wide {
  grid-column: 1 / -1;
}

.bom-general-edit-grid .span-2 {
  grid-column: span 2;
}

.bom-general-edit-grid input,
.bom-general-edit-grid select,
.bom-general-edit-grid textarea {
  width: 100%;
  min-height: 34px;
  font-size: 12px;
}

.bom-general-edit-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.bom-general-edit-grid textarea {
  min-height: 74px;
  padding: 7px 8px;
  resize: vertical;
}

.bom-general-edit-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--muted);
}

.bom-general-picker .sales-quote-picker-button {
  min-height: 34px;
  background: #fff;
}

.bom-general-picker .sales-quote-picker-menu {
  min-width: 100%;
}

.bom-cost-dirty-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #f3cf92;
  border-radius: 6px;
  background: #fff8eb;
  color: #7a4b00;
  font-weight: 700;
}

.bom-cost-dirty-warning[hidden] {
  display: none;
}

.bom-history-view {
  display: grid;
  gap: 12px;
}

.bom-history-table {
  min-width: 980px;
}

.bom-detail-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.05fr) minmax(280px, 1.05fr);
  gap: 10px;
  align-items: start;
}

.bom-detail-summary-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.bom-detail-summary-card.is-primary {
  border-left: 3px solid var(--blue);
  background: #eef7ff;
}

.bom-detail-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bom-detail-summary-card strong {
  color: var(--blue-dark);
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.bom-detail-summary-card p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.bom-detail-summary-card small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bom-detail-kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
}

.bom-detail-field {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.bom-detail-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.bom-detail-field strong {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: normal;
  word-break: normal;
}

.bom-detail-grid,
.custom-series-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.custom-series-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.bom-detail-identity article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.bom-detail-identity span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bom-detail-identity strong {
  color: var(--blue-dark);
  overflow-wrap: anywhere;
}

.bom-detail-identity small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bom-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  margin: 14px 0 0;
  border-bottom: 0;
}

.bom-detail-tabs button {
  min-height: 40px;
  padding: 7px 13px;
  border: 0;
  border-radius: 0;
  background: #eef3f7;
  color: #34495e;
  box-shadow: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bom-detail-tabs button.active {
  border: 0;
  background: #fff;
  color: #1abc9c;
}

.bom-detail-tab-panel {
  display: grid;
  gap: 12px;
}

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

.bom-technical-review-tabs {
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.bom-technical-review-tabs button {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.bom-technical-review-tab-count {
  min-width: 21px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(52, 73, 94, 0.1);
  color: inherit;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.bom-technical-review-tabs button.active .bom-technical-review-tab-count {
  background: rgba(26, 188, 156, 0.14);
}

.bom-technical-review-tab-panel {
  padding-top: 12px;
}

.bom-technical-review-tab-panel > .subpanel {
  margin: 0;
}

.bom-technical-review-decision .form-grid {
  align-items: start;
}

.bom-edit-draft-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 130px minmax(220px, 1fr) minmax(130px, auto);
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #cfe0f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-edit-draft-panel label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-edit-draft-panel .wide {
  min-width: 0;
}

.bom-edit-draft-panel input,
.bom-edit-draft-panel select {
  width: 100%;
  min-height: 34px;
  font-size: 12px;
}

.bom-edit-draft-panel button {
  min-height: 34px;
  white-space: nowrap;
}

.bom-disabled-picker {
  display: block;
}

.bom-disabled-picker .sales-quote-picker-button {
  min-height: 34px;
  color: #596474;
}

.bom-disabled-picker .sales-quote-picker-button:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.bom-route-overview,
.bom-area-recipe,
.bom-legacy-reference,
.custom-series-related,
.custom-series-future-areas {
  display: grid;
  gap: 12px;
}

.custom-series-identity {
  margin-bottom: 2px;
}

.custom-series-empty-state {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 12px;
  border: 1px dashed #c8d7e7;
  border-radius: 6px;
  background: #fff;
}

.custom-series-empty-state strong {
  color: var(--blue-dark);
  font-size: 16px;
}

.custom-series-empty-state span {
  color: var(--muted);
}

.custom-series-material-groups {
  display: grid;
  gap: 12px;
}

.custom-series-delivery-matrix {
  margin-top: 12px;
}

.custom-series-delivery-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.custom-series-delivery-legend span {
  padding: 6px 9px;
  border: 1px solid #d4e2ee;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}

.custom-series-delivery-legend strong {
  color: var(--blue-dark);
}

.custom-series-delivery-table {
  min-width: 1180px;
}

.custom-series-delivery-table th,
.custom-series-delivery-table td {
  vertical-align: top;
}

.custom-series-delivery-table th:not(:first-child):not(:nth-child(2)),
.custom-series-delivery-table td:not(:first-child):not(:nth-child(2)) {
  min-width: 260px;
}

.custom-series-delivery-cell {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 1fr));
  gap: 6px;
}

.custom-series-delivery-cell label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-series-delivery-cell input {
  width: 100%;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid #cfe0f0;
  border-radius: 6px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 900;
  text-align: right;
}

.custom-series-delivery-cell input:disabled {
  opacity: 1;
}

.custom-series-delivery-state {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.custom-series-document-table,
.custom-series-validation-table,
.custom-series-approval-table,
.custom-series-related-table {
  min-width: 980px;
}

.custom-series-document-table th,
.custom-series-document-table td,
.custom-series-validation-table th,
.custom-series-validation-table td,
.custom-series-approval-table th,
.custom-series-approval-table td,
.custom-series-related-table th,
.custom-series-related-table td {
  vertical-align: top;
}

.custom-series-approval-table {
  min-width: 1640px;
}

.custom-series-approval-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.custom-series-approval-flow article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #cfe0f0;
  border-radius: 6px;
  background: #f7fbff;
}

.custom-series-approval-flow strong {
  color: var(--blue-dark);
}

.custom-series-approval-flow span {
  color: var(--muted);
  line-height: 1.35;
}

.custom-series-document-roadmap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.custom-series-document-roadmap article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.custom-series-document-roadmap strong {
  color: var(--blue-dark);
}

.custom-series-document-roadmap span {
  color: var(--muted);
  line-height: 1.35;
}

.custom-series-validation-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bom-route-board {
  display: grid;
  gap: 10px;
  overflow-x: auto;
}

.bom-route-area-table {
  min-width: 1380px;
}

.bom-route-area-table th,
.bom-route-area-table td {
  vertical-align: middle;
}

.bom-route-sort-head {
  width: 100%;
  min-height: 28px;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font: inherit;
  text-align: left;
}

.bom-route-sort-head::after {
  content: "";
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
}

.bom-route-sort-head.active[data-sort-dir="asc"]::after {
  content: "^";
}

.bom-route-sort-head.active[data-sort-dir="desc"]::after {
  content: "v";
}

.bom-route-editor-table tfoot th {
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.bom-route-order-cell {
  width: 152px;
}

.bom-route-order-tools {
  display: grid;
  grid-template-columns: 28px 28px 48px 28px;
  gap: 5px;
  align-items: center;
}

.bom-route-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  cursor: grab;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -1px;
  user-select: none;
}

.bom-route-drag-handle:active {
  cursor: grabbing;
}

.bom-route-order-tools input {
  min-height: 30px;
  padding: 4px;
  text-align: center;
}

.bom-route-order-tools button {
  min-height: 30px;
  padding: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.bom-route-icon-button {
  min-width: 28px;
  justify-content: center;
}

.bom-route-order-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bom-route-dragging {
  opacity: 0.5;
}

.bom-route-drag-over td {
  box-shadow: inset 0 2px 0 #1d70b8;
}

.bom-route-time-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-route-time-field input {
  width: 86px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: right;
}

.bom-route-small-number {
  width: 64px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: center;
}

.bom-route-area-select {
  width: 100%;
  min-height: 34px;
}

.bom-route-type-select {
  width: 132px;
  min-height: 32px;
  font-size: 12px;
}

.route-hint {
  display: block;
  max-width: 160px;
  margin-top: 4px;
  line-height: 1.25;
}

.bom-route-include-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.bom-route-include-toggle input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.bom-route-excluded td {
  background: #fbfcfe;
  color: #687386;
}

.bom-route-add-strip {
  padding-top: 2px;
}

.bom-route-draft-row td {
  background: #f8fbff;
}

.bom-route-remove-summary {
  display: grid;
  gap: 12px;
}

.bom-route-remove-impact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bom-route-impact-item {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 92px;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-route-impact-item.warning {
  border-color: #f3cf92;
  background: #fff8eb;
}

.bom-route-impact-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.bom-area-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.bom-area-card-route-alternativa {
  border-color: #fed7aa;
  background: #fffbf4;
  box-shadow: inset 4px 0 0 #f59e0b;
}

.bom-area-card-route-alternativa .bom-area-card-head,
.bom-area-card-route-alternativa .bom-area-material-table th {
  background: #fff7ed;
}

.bom-area-card-route-alternativa .bom-area-material-table td {
  background: #fffaf0;
}

.bom-area-card-route-referencia {
  border-color: #fecdd3;
  background: #fff7f8;
  box-shadow: inset 4px 0 0 #f43f5e;
}

.bom-area-card-route-referencia .bom-area-card-head,
.bom-area-card-route-referencia .bom-area-material-table th {
  background: #fff1f2;
}

.bom-area-card-route-referencia .bom-area-material-table td {
  background: #fff8f9;
}

.bom-area-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-radius: 6px;
  padding: 4px 6px;
}

.bom-area-card h4 {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 16px;
}

.bom-area-card-actions,
.bom-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.bom-inline-actions .secondary,
.bom-area-card-actions .secondary {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.bom-area-material-table {
  min-width: 1160px;
}

.bom-area-material-table th,
.bom-area-material-table td {
  vertical-align: top;
}

.bom-area-material-editor-table {
  margin-top: 4px;
}

.bom-route-kind {
  border: 1px solid transparent;
}

.bom-route-kind-principal {
  border-color: #bbf7d0;
}

.bom-route-kind-alternativa {
  border-color: #fed7aa;
}

.bom-route-kind-referencia {
  border-color: #fecdd3;
}

.bom-material-tolerance-field {
  display: grid;
  gap: 4px;
  width: 112px;
}

.bom-material-tolerance-field input {
  width: 92px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-weight: 700;
}

.bom-material-tolerance-field input:not(:disabled) {
  background: #fff;
}

.bom-material-tolerance-field input.over-limit {
  border-color: var(--red);
  color: var(--red);
}

.bom-material-max-value {
  display: inline-flex;
  min-width: 72px;
  min-height: 30px;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.bom-material-area-list {
  display: grid;
  gap: 12px;
}

.bom-material-add-strip {
  padding-top: 2px;
}

.bom-native-area-card {
  gap: 8px;
}

.bom-native-area-card .bom-area-material-table {
  min-width: 900px;
}

.bom-native-material-summary-table .bom-native-line-action {
  width: 1%;
  white-space: nowrap;
}

.bom-native-line-action .secondary {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.bom-native-line-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bom-native-line-actions form {
  margin: 0;
}

.bom-native-line-actions .danger {
  border-color: #fecaca;
  color: #b42318;
}

.bom-native-line-material-field {
  display: grid;
  gap: 6px;
}

.bom-native-line-editor-panel {
  z-index: 61;
  width: min(980px, calc(100vw - 36px));
}

.bom-native-line-editor-panel .section-head {
  margin-bottom: 12px;
}

.bom-native-line-editor-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.bom-native-area-add {
  padding-top: 2px;
}

.bom-native-area-add > summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 6px 12px;
  white-space: nowrap;
}

.bom-native-area-add > summary::-webkit-details-marker {
  display: none;
}

.bom-native-area-add[open] > summary {
  margin-bottom: 10px;
}

.bom-native-area-add-form,
.bom-native-line-editor .form-grid {
  border: 1px solid #d9e6f2;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.bom-native-area-add-form {
  display: grid;
  gap: 8px;
}

.bom-native-material-entry-table {
  min-width: 940px;
}

.bom-native-material-entry-table th:nth-child(1),
.bom-native-material-entry-table td:nth-child(1) {
  width: 31%;
}

.bom-native-material-entry-table th:nth-child(2),
.bom-native-material-entry-table td:nth-child(2) {
  width: 14%;
}

.bom-native-material-entry-table th:nth-child(3),
.bom-native-material-entry-table td:nth-child(3) {
  width: 21%;
}

.bom-native-material-entry-table th:nth-child(4),
.bom-native-material-entry-table td:nth-child(4) {
  width: 14%;
}

.bom-native-material-entry-table th:nth-child(5),
.bom-native-material-entry-table td:nth-child(5),
.bom-native-material-entry-table th:nth-child(6),
.bom-native-material-entry-table td:nth-child(6) {
  width: 10%;
}

.bom-native-compact-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.bom-native-compact-field input,
.bom-native-compact-field select {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
}

.bom-native-compact-field small,
.bom-native-material-result-count {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
}

.bom-native-material-picker {
  min-width: 250px;
}

.bom-native-material-picker .sales-quote-picker-button {
  background: #fff;
}

.bom-native-material-picker .sales-quote-picker-menu {
  min-width: min(680px, calc(100vw - 64px));
}

.bom-material-picker {
  min-width: 280px;
}

.bom-material-existing-picker {
  min-width: min(360px, 100%);
}

.bom-material-existing-picker .sales-quote-picker-button:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.bom-material-editing td {
  background: #fff8eb;
}

.bom-material-editing .sales-quote-picker-button {
  border-color: #f5a623;
  background: #fff;
}

.bom-material-picker .sales-quote-picker-menu {
  min-width: min(680px, calc(100vw - 64px));
}

.bom-material-qty-input {
  width: 92px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: right;
}

.bom-material-unit-input {
  width: 88px;
  min-height: 30px;
  padding: 4px 6px;
  background: #f8fafc;
}

.bom-material-note-input {
  width: 100%;
  min-width: 120px;
  min-height: 30px;
  padding: 4px 6px;
}

.bom-material-draft-row td {
  background: #f8fbff;
}

.bom-material-alternative-row td {
  background: #fff8eb;
  border-top: 2px solid #fed7aa;
}

.bom-material-alternative-row td:first-child {
  position: relative;
  padding-left: 32px;
  box-shadow: inset 4px 0 0 #f59e0b;
}

.bom-material-alternative-row td:first-child::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  border-left: 2px solid #f59e0b;
}

.bom-material-alternative-row td:first-child::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 28px;
  width: 14px;
  border-top: 2px solid #f59e0b;
}

.bom-material-alternatives-summary-row td {
  background: #fffbeb;
  border-top: 0;
}

.bom-material-alternatives-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bom-alternative-chip {
  min-height: 28px;
  padding: 4px 8px;
}

.bom-material-type-badge {
  min-width: 88px;
  justify-content: center;
}

.bom-material-flat-wrap {
  overflow-x: auto;
}

.bom-material-flat-table {
  min-width: 1320px;
}

.bom-material-flat-table th,
.bom-material-flat-table td {
  vertical-align: top;
}

.material-rmop-matrix-table {
  min-width: 1580px;
  table-layout: fixed;
}

.material-rmop-matrix-table th,
.material-rmop-matrix-table td {
  vertical-align: top;
}

.material-rmop-block-start td {
  border-top: 2px solid #cbd5e1;
}

.material-rmop-subrow td,
.material-rmop-status-row td {
  background: #fbfdff;
}

.material-rmop-alternative-row td {
  background: #fff8eb;
}

.material-rmop-matrix-table tr.is-selected-for-delivery td {
  background: #eff6ff;
}

.rmop-concept-col {
  width: 88px;
}

.rmop-concept-cell {
  min-width: 88px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.rmop-issue-cell {
  background: #f8fafc;
}

.rmop-option-cell {
  background: #f8fbff;
  min-width: 92px;
  max-width: 110px;
}

.material-rmop-matrix-table .select-col input {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.rmop-material-cell-main {
  display: grid;
  gap: 2px;
}

.rmop-material-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
}

.rmop-material-tolerance {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
}

.rmop-option-selector {
  display: grid;
  gap: 4px;
  align-items: start;
}

.rmop-option-choice {
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
  font-size: 10px;
}

.rmop-option-choice.active {
  border-color: #0ea5e9;
  background: #e0f2fe;
}

.rmop-option-box {
  width: 13px;
  height: 13px;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  background: #fff;
  display: inline-grid;
  place-items: center;
}

.rmop-option-choice.active .rmop-option-box {
  border-color: #0284c7;
  background: #0284c7;
}

.rmop-option-choice.active .rmop-option-box::after {
  content: "";
  width: 6px;
  height: 3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.rmop-option-selected {
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
}

.rmop-reservation-hint {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
  text-align: left;
}

.rmop-alt-material-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
}

.rmop-alt-material-list > div {
  padding-left: 8px;
  border-left: 2px solid #f59e0b;
}

.rmop-alternative-modal {
  width: min(840px, calc(100vw - 48px));
}

.rmop-assignment-modal {
  width: min(980px, calc(100vw - 48px));
}

.rmop-assignment-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.rmop-assignment-summary article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #f8fbfe;
}

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

.rmop-assignment-summary strong {
  display: block;
  color: var(--blue-dark);
  font-size: 18px;
}

.rmop-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.rmop-assignment-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  border-bottom: 1px solid var(--line);
}

.rmop-assignment-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  border-radius: 6px 6px 0 0;
  background: #f8fafc;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
}

.rmop-assignment-tabs button.active {
  background: #fff;
  color: var(--blue-dark);
  border-color: var(--blue);
  border-bottom-color: #fff;
}

.rmop-assignment-panels {
  padding-top: 10px;
}

.rmop-assignment-tab-panel {
  display: none;
}

.rmop-assignment-tab-panel.active {
  display: block;
}

.rmop-assignment-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.rmop-assignment-section.wide {
  grid-column: 1 / -1;
}

.rmop-assignment-section h4 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 14px;
}

.rmop-assignment-section .compact input {
  min-height: 32px;
}

.rmop-status-badge {
  display: block;
  width: 100%;
  min-width: 72px;
  padding: 5px 6px;
  border: 0;
  border-radius: 0;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

span.rmop-status-badge {
  cursor: default;
}

.rmop-status-manual {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.18);
}

.rmop-status-complete {
  background: #22c55e;
  color: #052e16;
}

.rmop-status-ready {
  background: #dbeafe;
  color: #1e3a8a;
}

.rmop-status-issued {
  background: #bbf7d0;
  color: #14532d;
}

.rmop-status-partial,
.rmop-status-tolerance,
.rmop-status-alternative {
  background: #facc15;
  color: #422006;
}

.rmop-status-missing,
.rmop-status-blocked {
  background: #fecdd3;
  color: #7f1d1d;
}

.bom-cut-entry-block {
  display: grid;
  gap: 12px;
}

.bom-cut-entry-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-cut-entry-toolbar label {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 130px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-cut-entry-toolbar input {
  min-height: 34px;
}

.bom-cut-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #cbdbea;
}

.bom-cut-section-tabs button {
  min-height: 34px;
  border-color: #cbdbea;
  background: #f4f8fc;
  color: var(--blue-dark);
}

.bom-cut-section-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.bom-cut-section-panel {
  display: grid;
  gap: 10px;
}

.bom-cut-section-panel[hidden] {
  display: none;
}

.bom-cut-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bom-cut-section-head > div {
  display: grid;
  gap: 3px;
}

.bom-cut-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.bom-cut-sort-head {
  width: 100%;
  min-height: 28px;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font: inherit;
  text-align: left;
}

.bom-cut-sort-head::after {
  content: "";
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
}

.bom-cut-sort-head.active[data-sort-dir="asc"]::after {
  content: "^";
}

.bom-cut-sort-head.active[data-sort-dir="desc"]::after {
  content: "v";
}

.bom-cut-entry-table th small,
.bom-cut-table th small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.bom-cut-entry-table {
  min-width: 1780px;
}

.bom-cut-other-entry-table {
  min-width: 1540px;
}

.bom-cut-wood-entry-table {
  min-width: 2240px;
}

.bom-cut-entry-summary-table {
  min-width: 880px;
}

.bom-cut-entry-block .empty.success {
  border-color: #86efac;
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
}

.bom-cut-entry-table th,
.bom-cut-entry-table td,
.bom-cut-wood-entry-table th,
.bom-cut-wood-entry-table td,
.bom-cut-copy-table th,
.bom-cut-copy-table td,
.bom-cut-table th,
.bom-cut-table td,
.bom-cut-summary-table th,
.bom-cut-summary-table td,
.bom-cut-entry-summary-table th,
.bom-cut-entry-summary-table td,
.bom-cut-wood-table th,
.bom-cut-wood-table td {
  vertical-align: top;
}

.bom-cut-entry-table input,
.bom-cut-entry-table select,
.bom-cut-other-entry-table input,
.bom-cut-other-entry-table select,
.bom-cut-wood-entry-table input,
.bom-cut-wood-entry-table select {
  width: 100%;
  min-width: 72px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.bom-cut-other-entry-table th,
.bom-cut-other-entry-table td {
  vertical-align: top;
}

.bom-cut-other-entry-table td:nth-child(1) select,
.bom-cut-other-entry-table td:nth-child(2) input,
.bom-cut-other-entry-table td:nth-child(5) input,
.bom-cut-other-entry-table td:nth-child(6) input,
.bom-cut-other-entry-table td:nth-child(11) select,
.bom-cut-other-entry-table td:nth-child(12) input {
  min-width: 140px;
}

.bom-cut-entry-table td:nth-child(4) input,
.bom-cut-entry-table td:nth-child(5) input {
  min-width: 150px;
}

.bom-cut-entry-table td:nth-child(1) input,
.bom-cut-entry-table td:nth-child(10) input,
.bom-cut-entry-table td:nth-child(11) input,
.bom-cut-entry-table td:nth-child(12) input,
.bom-cut-entry-table td:nth-child(13) input,
.bom-cut-entry-table td:nth-child(14) input {
  min-width: 110px;
}

.bom-cut-entry-table td:nth-child(11) select,
.bom-cut-entry-table td:nth-child(12) select,
.bom-cut-entry-table td:nth-child(13) select,
.bom-cut-entry-table td:nth-child(14) select,
.bom-cut-wood-entry-table select {
  min-width: 128px;
}

.bom-cut-wood-group-head {
  text-align: center;
  font-weight: 900;
}

.bom-cut-wood-group-lijado {
  background: #bbf7d0;
  color: #065f46;
}

.bom-cut-wood-group-cortado {
  background: #fed7aa;
  color: #9a3412;
}

.bom-cut-wood-entry-table td[data-bom-cut-wood-group] {
  background: #fff;
  border-left-color: #edf2f7;
}

.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="lijado"] td[data-bom-cut-wood-group="lijado"],
.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="lijado"] td[data-bom-cut-wood-group="lijado"] input {
  background: #bbf7d0;
  border-color: #22c55e;
}

.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="cortado"] td[data-bom-cut-wood-group="cortado"],
.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="cortado"] td[data-bom-cut-wood-group="cortado"] input {
  background: #fed7aa;
  border-color: #f97316;
}

.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="lijado"] td[data-bom-cut-wood-group="cortado"],
.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="cortado"] td[data-bom-cut-wood-group="lijado"] {
  opacity: 0.58;
}

.bom-cut-wood-entry-table input[readonly] {
  background: #eef2f7;
  color: var(--muted);
  cursor: default;
}

.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="cortado"] td[data-bom-cut-wood-group="cortado"] input[readonly],
.bom-cut-wood-entry-table tr[data-bom-cut-wood-delivery="lijado"] td[data-bom-cut-wood-group="cortado"] input[readonly] {
  font-weight: 800;
  color: var(--blue-dark);
}

.bom-cut-draft-row td {
  background: #f8fbff;
}

.bom-cut-draft-row strong {
  color: var(--blue-dark);
  white-space: nowrap;
}

.bom-documents-view {
  display: grid;
  gap: 12px;
}

.bom-doc-empty-state {
  border-color: #d4e4f4;
  background: #f8fbff;
}

.bom-doc-main {
  display: grid;
  gap: 12px;
}

.bom-doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-doc-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-doc-filter-panel label {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 190px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-doc-filter-panel select {
  min-height: 34px;
  font-size: 12px;
}

.bom-doc-edit-form {
  display: grid;
  gap: 12px;
}

.bom-doc-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bom-doc-edit-grid label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-doc-edit-grid .wide {
  grid-column: span 2;
}

.bom-doc-edit-grid input,
.bom-doc-edit-grid select {
  width: 100%;
  min-height: 34px;
  font-size: 12px;
}

.bom-doc-route-map {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-doc-route-map strong {
  display: block;
  color: var(--blue-dark);
}

.bom-doc-route-map span {
  color: var(--muted);
}

.bom-doc-route-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bom-doc-route-checks label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.bom-doc-route-checks input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.bom-doc-route-checks span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--blue-dark);
}

.bom-doc-route-checks small {
  min-width: 24px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #eef3f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.bom-doc-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.bom-doc-table {
  min-width: 1360px;
}

.bom-render-table {
  min-width: 940px;
}

.bom-doc-table th,
.bom-doc-table td {
  vertical-align: top;
}

.bom-doc-order-chip {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #cfe0f0;
  border-radius: 6px;
  background: #eef6ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.bom-doc-order-tools {
  display: grid;
  grid-template-columns: 28px 34px 28px;
  gap: 5px;
  align-items: center;
}

.bom-doc-order-tools button {
  min-height: 28px;
  padding: 4px;
  font-size: 11px;
}

.bom-doc-order-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bom-doc-area-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.bom-doc-preview-thumb {
  width: 76px;
  min-width: 76px;
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 7px;
  border: 1px solid #c9d8e8;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--blue-dark);
  text-align: center;
  box-shadow: none;
}

.bom-doc-preview-thumb span {
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #fff;
  color: #0d4f8b;
  font-size: 13px;
  font-weight: 900;
}

.bom-doc-preview-thumb small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bom-doc-preview-thumb:hover {
  border-color: #1d70b8;
  background: #eef6ff;
}

.bom-doc-preview-large {
  min-height: 460px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed #c9d8e8;
  border-radius: 6px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
  color: var(--muted);
  text-align: center;
}

.bom-doc-preview-large strong {
  min-width: 110px;
  padding: 16px 18px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 34px;
  font-weight: 900;
}

.bom-doc-preview-large span,
.bom-doc-preview-large small {
  max-width: 520px;
  line-height: 1.35;
}

.bom-cost-review {
  display: grid;
  gap: 14px;
}

.bom-cost-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

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

.bom-cost-summary-grid article {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.bom-cost-summary-grid span,
.bom-cost-summary-grid small {
  color: var(--muted);
}

.bom-cost-summary-grid strong {
  color: var(--blue-dark);
  font-size: 17px;
}

.bom-cost-table-wrap {
  overflow-x: auto;
}

.bom-cost-review-table {
  min-width: 680px;
}

.bom-cost-review-table th,
.bom-cost-review-table td {
  vertical-align: top;
}

.bom-cost-state-button {
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  font-size: 11px;
}

.bom-cost-state-button:hover {
  filter: brightness(0.97);
  text-decoration: underline;
}

.bom-cost-observation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.bom-cost-observation-grid article {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.bom-cost-observation-grid strong {
  color: var(--blue-dark);
}

.bom-cost-observation-list {
  display: grid;
  gap: 10px;
}

.bom-cost-observation-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 6px;
  background: #f8fbff;
}

.bom-cost-observation-item p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.bom-cost-observation-item p strong {
  color: var(--blue-dark);
  font-size: 11px;
  text-transform: uppercase;
}

.bom-cost-observation-item p span {
  color: var(--muted);
  line-height: 1.35;
}

.bom-cost-observation-item label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bom-cost-observation-item textarea {
  width: 100%;
  min-height: 58px;
  padding: 7px 8px;
  resize: vertical;
}

.bom-cost-observation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.bom-approval-observations {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #f0c8c2;
  border-left: 4px solid #c0392b;
  border-radius: 8px;
  background: #fffafa;
}

.bom-approval-observations-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.bom-approval-observations-head h4,
.bom-approval-observations-head p {
  margin: 0;
}

.bom-approval-observation-general {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #efd8a4;
  border-radius: 7px;
  background: #fffaf0;
}

.bom-approval-observation-general strong {
  color: #8a5600;
  font-size: 12px;
  text-transform: uppercase;
}

.bom-approval-observation-general p,
.bom-approval-observation-reason p {
  margin: 0;
  line-height: 1.45;
}

.bom-approval-observation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bom-approval-observation-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.bom-approval-observation-card header {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.bom-approval-observation-card header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bom-approval-observation-card header small {
  color: #b42318;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.bom-approval-observation-card header strong {
  overflow-wrap: anywhere;
  color: var(--blue-dark);
}

.bom-approval-observation-number {
  display: inline-grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #fde8e5;
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
}

.bom-approval-observation-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.bom-approval-observation-meta div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 5px;
  background: #f5f8fb;
}

.bom-approval-observation-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.bom-approval-observation-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.bom-approval-observation-reason {
  display: grid;
  gap: 3px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.bom-approval-observation-reason > strong {
  color: #b42318;
  font-size: 10px;
  text-transform: uppercase;
}

.supply-nav {
  margin-top: 10px;
}

.supply-cost-status-strip {
  margin-top: 10px;
}

.supply-cost-table {
  overflow-x: auto;
}

.supply-cost-table table {
  min-width: 980px;
  table-layout: fixed;
}

.supply-cost-table th:nth-child(1) { width: 29%; }
.supply-cost-table th:nth-child(2) { width: 12%; }
.supply-cost-table th:nth-child(3) { width: 20%; }
.supply-cost-table th:nth-child(4) { width: 17%; }
.supply-cost-table th:nth-child(5) { width: 13%; }
.supply-cost-table th:nth-child(6) { width: 9%; }

.supply-cost-table th,
.supply-cost-table td {
  overflow-wrap: anywhere;
}

.supply-cost-update-policy {
  margin: 10px 0;
}

.supply-cost-analysis-panel,
.supply-bom-cost-detail,
.supply-bom-cost-detail .subpanel {
  min-width: 0;
  max-width: 100%;
}

.supply-bom-cost-detail {
  overflow-x: hidden;
}

.supply-bom-cost-section {
  margin-top: 10px;
  padding: 10px 12px;
}

.supply-bom-cost-section .section-head {
  margin-bottom: 8px;
}

.supply-bom-cost-material-search {
  display: grid;
  grid-template-columns: minmax(240px, 520px) auto;
  gap: 8px 12px;
  align-items: end;
  margin: 0 0 10px;
}

.supply-bom-cost-material-search label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.supply-bom-cost-material-search input {
  width: 100%;
}

.supply-bom-cost-material-search small {
  padding-bottom: 9px;
}

.supply-bom-cost-material-empty {
  margin: 0 0 10px;
}

.supply-bom-cost-section h4,
.supply-bom-cost-area-summary h4 {
  margin: 4px 0 8px;
}

.supply-cost-table th,
.supply-cost-table td {
  vertical-align: top;
}

.supply-cost-filterbar {
  grid-template-columns: minmax(320px, 1fr) minmax(110px, 140px) auto auto;
}

.supply-bom-cost-advanced-filters {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.supply-bom-cost-list-summary {
  margin: 8px 0;
}

.supply-bom-cost-approval-modal {
  width: min(1320px, calc(100vw - 36px));
}

.supply-bom-cost-approval-table {
  min-width: 1080px;
}

.supply-bom-cost-approval-table th:first-child {
  width: 110px;
}

.supply-bom-cost-approval-table th:last-child {
  width: 160px;
}

.supply-bom-cost-update-modal {
  width: min(1380px, calc(100vw - 36px));
}

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

.cost-update-summary-grid article {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.cost-update-summary-grid article strong {
  color: var(--blue-dark);
  font-size: 20px;
}

.cost-update-summary-grid article span {
  color: var(--muted);
  font-size: 12px;
}

.cost-update-create-form {
  display: grid;
  grid-template-columns: minmax(300px, 1.4fr) minmax(220px, .8fr) auto;
  gap: 12px;
  align-items: end;
}

.cost-update-create-form label {
  display: grid;
  gap: 5px;
}

.cost-update-batch-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 10px 0 6px;
}

.cost-update-progress-label {
  display: flex;
  flex-direction: column;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.cost-update-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf3;
}

.cost-update-progress span {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width .2s ease;
}

.cost-update-items-wrap {
  max-height: 430px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cost-update-items {
  min-width: 1040px;
}

.cost-update-items th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.cost-update-items th:first-child { width: 29%; }
.cost-update-items th:nth-child(2) { width: 15%; }
.cost-update-items th:nth-child(n+3) { white-space: nowrap; }

.cost-update-cancel {
  float: right;
  margin-top: -36px;
}

.cost-update-history {
  margin-top: 14px;
}

.cost-update-history summary {
  cursor: pointer;
  font-weight: 700;
}

.cost-delta-up {
  color: #a33b23;
  font-weight: 700;
}

.cost-delta-down {
  color: #087d52;
  font-weight: 700;
}

.error-text {
  display: inline-block;
  max-width: 260px;
  margin-top: 4px;
}

.supply-cost-basis-tabs {
  margin: 12px 0 16px;
  width: fit-content;
}

.supply-cost-basis-tabs a {
  min-width: 190px;
  text-align: center;
}

.supply-actual-cost-empty {
  border: 1px solid #d8e2ec;
  border-radius: 10px;
  padding: 16px;
  background: #f8fbfe;
}

.supply-actual-cost-kpis {
  margin-top: 14px;
}

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

.supply-actual-cost-sources article {
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.supply-actual-cost-sources p {
  margin: 6px 0 0;
  color: #58697a;
}

.supply-bom-cost-material-table-wrap {
  max-width: 100%;
  overflow-x: visible;
}

.supply-bom-cost-material-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.supply-bom-cost-material-table col.material { width: 38%; }
.supply-bom-cost-material-table col.quantity { width: 8%; }
.supply-bom-cost-material-table col.unit { width: 9%; }
.supply-bom-cost-material-table col.unit-cost { width: 15%; }
.supply-bom-cost-material-table col.total { width: 13%; }
.supply-bom-cost-material-table col.percentage { width: 9%; }
.supply-bom-cost-material-table col.action { width: 10%; }

.supply-bom-cost-material-table.has-actions col.material { width: 32%; }
.supply-bom-cost-material-table.has-actions col.quantity { width: 7%; }
.supply-bom-cost-material-table.has-actions col.unit { width: 8%; }
.supply-bom-cost-material-table.has-actions col.unit-cost { width: 14%; }
.supply-bom-cost-material-table.has-actions col.total { width: 12%; }
.supply-bom-cost-material-table.has-actions col.percentage { width: 9%; }

.supply-bom-cost-material-table th,
.supply-bom-cost-material-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.supply-bom-cost-detail table th {
  position: static;
}

.supply-bom-cost-detail table th,
.supply-bom-cost-detail table td {
  padding: 7px 8px;
  line-height: 1.25;
}

.supply-bom-cost-labor-table-wrap,
.supply-bom-cost-area-summary-wrap {
  max-width: 100%;
  overflow-x: visible;
}

.supply-bom-cost-labor-table,
.supply-bom-cost-area-summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.supply-bom-cost-labor-table col.order { width: 7%; }
.supply-bom-cost-labor-table col.area { width: 27%; }
.supply-bom-cost-labor-table col.operation { width: 30%; }
.supply-bom-cost-labor-table col.hours { width: 9%; }
.supply-bom-cost-labor-table col.rate { width: 13%; }
.supply-bom-cost-labor-table col.total { width: 14%; }

.supply-bom-cost-area-summary {
  margin-top: 10px;
}

.supply-bom-cost-area-summary-table col.area { width: 52%; }
.supply-bom-cost-area-summary-table col.lines { width: 12%; }
.supply-bom-cost-area-summary-table col.total { width: 22%; }
.supply-bom-cost-area-summary-table col.missing { width: 14%; }

.supply-bom-cost-labor-table th,
.supply-bom-cost-labor-table td,
.supply-bom-cost-area-summary-table th,
.supply-bom-cost-area-summary-table td {
  min-width: 0;
  overflow-wrap: anywhere;
}

.supply-bom-cost-labor-table td:nth-child(n+4),
.supply-bom-cost-area-summary-table td:nth-child(n+2) {
  white-space: nowrap;
}

.supply-bom-cost-missing .notice {
  margin-bottom: 0;
}

.supply-bom-cost-material-table th:not(:first-child),
.supply-bom-cost-material-table td:not(:first-child) {
  padding-left: 8px;
  padding-right: 8px;
}

.supply-cost-sort-link {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.supply-cost-sort-link:hover,
.supply-cost-sort-link.active {
  color: var(--blue);
  text-decoration: underline;
}

.supply-cost-sort-state {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.supply-cost-material-action .button-link {
  min-width: 0;
  padding: 7px 9px;
  white-space: normal;
}

.supply-cost-material-observation-picker {
  position: relative;
}

.supply-cost-material-observation-picker > summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
}

.supply-cost-material-observation-picker > summary::-webkit-details-marker {
  display: none;
}

.supply-cost-material-observation-picker:has(textarea:not(:placeholder-shown)) > summary {
  border-color: #13795b;
  background: #e7f7f0;
  color: #0d6048;
}

.supply-cost-material-observation-picker[open]::before {
  content: "";
  position: fixed;
  z-index: 899;
  inset: 0;
  background: rgba(23, 42, 58, .5);
}

.supply-cost-material-observation-editor {
  display: grid;
  position: fixed;
  z-index: 900;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  gap: 12px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 50, 80, .28);
  transform: translate(-50%, -50%);
}

.supply-cost-material-observation-editor label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.supply-cost-material-observation-editor textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
}

.supply-bom-cost-material-observation-modal {
  width: min(760px, calc(100vw - 36px));
}

.supply-cost-observed-material {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(110px, .7fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.supply-cost-observed-material span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .cost-update-create-form {
    grid-template-columns: 1fr 1fr;
  }

  .cost-update-create-form button {
    grid-column: 1 / -1;
  }

  .supply-bom-cost-advanced-filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .supply-actual-cost-sources {
    grid-template-columns: 1fr;
  }

  .supply-bom-cost-material-table {
    font-size: 12px;
  }

  .supply-cost-observed-material {
    grid-template-columns: 1fr 1fr;
  }

  .bom-detail-head,
  .bom-detail-identity {
    grid-template-columns: 1fr;
  }

  .bom-detail-actions {
    justify-content: flex-start;
  }

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

  .bom-edit-draft-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .custom-series-document-roadmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bom-general-edit-grid,
  .bom-doc-edit-grid,
  .bom-doc-route-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cost-update-summary-grid,
  .cost-update-create-form {
    grid-template-columns: 1fr;
  }

  .bom-approval-observation-list,
  .bom-approval-observation-meta {
    grid-template-columns: 1fr;
  }

  .bom-approval-observations-head {
    display: grid;
  }

  .cost-update-cancel {
    float: none;
    margin-top: 8px;
  }

  .supply-bom-cost-advanced-filters {
    grid-template-columns: 1fr;
  }

  .supply-bom-cost-material-search {
    grid-template-columns: 1fr;
  }

  .supply-bom-cost-material-search small {
    padding-bottom: 0;
  }

  .supply-bom-cost-material-table-wrap {
    overflow-x: auto;
  }

  .supply-bom-cost-material-table {
    min-width: 760px;
  }

  .supply-cost-observed-material {
    grid-template-columns: 1fr;
  }

  .bom-detail-summary,
  .bom-detail-identity,
  .bom-edit-draft-panel,
  .bom-cost-summary-grid,
  .bom-route-remove-impact,
  .custom-series-validation-layout,
  .custom-series-document-roadmap,
  .bom-general-edit-grid,
  .bom-doc-edit-grid,
  .bom-doc-route-checks {
    grid-template-columns: 1fr;
  }

  .bom-general-edit-grid .wide,
  .bom-general-edit-grid .span-2,
  .bom-doc-edit-grid .wide {
    grid-column: auto;
  }

  .bom-detail-field {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .bom-area-card-head {
    display: grid;
  }
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 44, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 21;
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 70px);
  overflow: auto;
  margin: 34px auto;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(23, 32, 44, 0.22);
}

.material-reference-cost-modal-panel {
  width: min(900px, calc(100vw - 48px));
}

.material-internal-issue-modal-panel {
  width: min(1220px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 16px;
}

.material-internal-issue-modal-panel form,
.material-internal-issue-context,
.material-internal-issue-lines {
  display: grid;
  gap: 12px;
}

.material-internal-issue-common-grid,
.material-internal-issue-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.material-internal-issue-context {
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.material-internal-issue-modal-panel .section-head,
.material-internal-issue-context h4,
.material-internal-issue-context p,
.material-internal-issue-lines h4,
.material-internal-issue-lines p {
  margin-top: 0;
  margin-bottom: 0;
}

.material-internal-issue-context[hidden] {
  display: none;
}

.material-internal-issue-context label,
.material-internal-issue-common-grid label,
.material-internal-issue-line label,
.material-internal-issue-notes {
  display: grid;
  gap: 5px;
}

.material-internal-issue-context select[multiple] {
  min-height: 126px;
}

.material-internal-issue-context-grid .wide {
  grid-column: 1 / -1;
}

.material-internal-issue-lines {
  gap: 7px;
  padding-top: 2px;
}

.material-internal-issue-lines .material-alert {
  margin: 0;
}

.material-internal-issue-line-list {
  display: grid;
  gap: 8px;
}

.material-internal-issue-line {
  display: grid;
  grid-template-columns: 30px minmax(300px, 2fr) minmax(120px, .65fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.material-internal-issue-line-number {
  align-self: center;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--blue-dark);
  background: #edf5fb;
  font-weight: 700;
}

.material-internal-issue-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  bottom: -16px;
  margin: 0 -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.material-internal-issue-links {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.material-internal-issue-links > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-assistance,
.installation-requests {
  display: grid;
  gap: 12px;
}

.service-assistance .section-head,
.installation-requests .section-head {
  margin-bottom: 0;
}

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

.service-assistance .detail-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfd;
}

.service-assistance .detail-grid .wide,
.service-assistance .service-delivery-form .wide {
  grid-column: 1 / -1;
}

.service-assistance .detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.service-assistance .detail-grid strong {
  overflow-wrap: anywhere;
}

.service-assistance .compact-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.service-assistance .compact-form {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: end;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
}

.service-assistance .service-delivery-form {
  grid-template-columns: repeat(2, minmax(170px, 1fr));
}

@media (max-width: 900px) {
  .material-internal-issue-common-grid,
  .material-internal-issue-context-grid {
    grid-template-columns: 1fr 1fr;
  }
  .material-internal-issue-line {
    grid-template-columns: 30px minmax(240px, 1fr) minmax(110px, .4fr) auto;
  }
  .material-internal-issue-line label:nth-of-type(3) {
    grid-column: 2 / 4;
  }
  .service-assistance .stock-summary,
  .service-assistance .detail-grid,
  .service-assistance .compact-form,
  .service-assistance .service-delivery-form {
    grid-template-columns: 1fr;
  }
  .service-assistance .detail-grid .wide,
  .service-assistance .service-delivery-form .wide {
    grid-column: auto;
  }
}

.labor-rate-create-modal-panel {
  width: min(960px, calc(100vw - 48px));
}

.labor-rate-create-modal-panel .wide {
  grid-column: 1 / -1;
}

.labor-rate-area-selector {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.labor-rate-area-selector legend {
  padding: 0 6px;
  color: var(--blue-dark);
  font-weight: 700;
}

.labor-rate-area-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  max-height: min(300px, 38vh);
  overflow: auto;
  margin-top: 10px;
}

.material-reference-picker .sales-quote-picker-menu {
  position: static;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-top: 4px;
}

.material-reference-picker .sales-quote-picker-options {
  max-height: min(320px, 38vh);
}

.bom-print-options-modal {
  width: min(760px, calc(100vw - 48px));
}

.bom-print-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bom-print-options-grid legend {
  padding: 0 6px;
  color: var(--blue-dark);
  font-weight: 700;
}

.bom-print-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #f7fafc;
  border: 1px solid #d8e2ec;
  border-radius: 7px;
  cursor: pointer;
}

.bom-print-option input {
  width: auto;
  margin: 0;
}

.bom-print-option:has(input:checked) {
  color: var(--blue-dark);
  background: #edf6ff;
  border-color: #8ab7df;
}

.bom-print-options-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 680px) {
  .bom-print-options-grid {
    grid-template-columns: 1fr;
  }

  .bom-print-options-actions > * {
    width: 100%;
  }
}

.sigems-confirm-modal {
  z-index: 100;
}

.sigems-confirm-modal .modal-backdrop {
  z-index: 100;
  background: rgba(15, 23, 42, 0.58);
}

.sigems-confirm-panel {
  z-index: 101;
  width: min(520px, calc(100vw - 36px));
  margin: min(18vh, 150px) auto 24px;
  padding: 22px;
  overflow: visible;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.sigems-confirm-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.sigems-confirm-heading h2,
.sigems-confirm-heading p {
  margin: 0;
}

.sigems-confirm-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #fff4d6;
  color: #925d00;
  font-size: 22px;
  font-weight: 900;
}

.sigems-confirm-panel[data-tone="danger"] .sigems-confirm-icon {
  background: #fee2e2;
  color: #b42318;
}

.sigems-confirm-panel[data-tone="info"] .sigems-confirm-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.sigems-confirm-message {
  margin: 18px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.sigems-confirm-detail {
  margin: 12px 0 0;
  padding: 11px 12px;
  border-left: 3px solid #e5a400;
  border-radius: 4px;
  background: #fffaf0;
  color: var(--muted);
  line-height: 1.45;
}

.sigems-confirm-panel[data-tone="danger"] .sigems-confirm-detail {
  border-left-color: #dc2626;
  background: #fff7f7;
}

.sigems-confirm-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.sigems-confirm-action.is-danger {
  border-color: #b42318;
  background: #b42318;
}

.sigems-confirm-action.is-danger:hover {
  border-color: #8f1d14;
  background: #8f1d14;
}

body.rmop-pre-note-modal-open {
  overflow: hidden;
}

.rmop-pre-note-modal {
  z-index: 60;
}

.rmop-pre-note-modal .modal-backdrop {
  z-index: 60;
}

.rmop-pre-note-modal .bom-native-line-editor-panel {
  z-index: 61;
}

.rmop-pre-note-modal-panel {
  z-index: 61;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rmop-pre-note-modal-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.rmop-pre-note-modal-body .table-wrap {
  max-height: calc(100vh - 310px);
  overflow: auto;
}

.wide-modal {
  width: min(1320px, calc(100vw - 36px));
}

.material-detail-modal {
  width: min(1360px, calc(100vw - 36px));
}

.material-stock-focus-modal {
  width: min(1050px, calc(100vw - 36px));
}

.material-detail-head {
  align-items: flex-start;
}

.material-detail-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.material-reference-preview.compact {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.material-reference-preview.compact img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.material-detail-title {
  min-width: 0;
}

.material-detail-title h2 {
  margin-bottom: 8px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.material-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-detail-summary {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  margin-bottom: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.material-detail-summary > div {
  flex: 1 0 120px;
  min-width: 120px;
  padding: 2px 12px;
  border-right: 1px solid var(--line);
}

.material-detail-summary > div:last-child {
  border-right: 0;
}

.material-detail-summary dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.material-detail-summary dd {
  margin: 0;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.material-detail-tabs {
  display: flex;
  flex-wrap: nowrap;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.material-detail-tabs a {
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.material-detail-tab-groups {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.material-detail-tab-group {
  display: grid;
  gap: 6px;
}

.material-detail-tab-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--blue-dark);
}

.material-detail-tab-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.material-detail-related-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.material-detail-related-links > strong {
  margin-right: 2px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.material-detail-readonly-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #eff6ff;
  color: var(--blue-dark);
  font-weight: 700;
}

.material-detail-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.material-detail-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.material-detail-sections-compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.material-quick-profile {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.material-quick-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.material-quick-card h3 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 15px;
}

.material-quick-card div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.material-quick-card span {
  color: var(--muted);
  font-weight: 700;
}

.material-detail-section {
  min-width: 0;
}

.material-detail-section-wide {
  grid-column: 1 / -1;
}

.material-detail-list {
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
}

.material-detail-list dt,
.material-detail-list dd {
  line-height: 1.35;
}

.material-edit-params-form {
  display: grid;
  gap: 12px;
}

.material-edit-image-form {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.material-edit-image-form .material-new-reference-preview {
  min-height: 110px;
  height: 110px;
}

.material-edit-image-controls {
  display: grid;
  gap: 8px;
}

.material-edit-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.material-edit-check-grid .check {
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.material-edit-check-grid .material-edit-option {
  padding: 10px;
}

.material-edit-format-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.6fr);
  gap: 8px;
  margin-top: 10px;
}

.material-edit-format-settings > select:first-of-type {
  grid-column: 1;
}

.material-delivery-mode-grid .check {
  align-items: flex-start;
}

.material-delivery-mode-grid .check span {
  display: grid;
  gap: 3px;
}

.material-delivery-mode-grid .check small {
  color: var(--muted);
  line-height: 1.35;
}

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

.stock-summary article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fbfe;
}

.stock-summary strong {
  display: block;
  color: var(--blue-dark);
  font-size: 22px;
}

.stock-summary span {
  color: var(--muted);
}

.stock-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.material-operational-stock-summary .is-available {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.material-operational-stock-summary .is-reserved {
  border-color: #fde68a;
  background: #fffbeb;
}

.material-operational-stock-summary .is-total {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.material-stock-location-title {
  margin: 4px 0 10px;
  color: var(--blue-dark);
  font-size: 14px;
}

.material-stock-last-update {
  display: grid;
  gap: 3px;
  align-items: start;
}

.material-stock-last-update .badge {
  justify-self: start;
}

.material-movement-scope-tabs {
  margin: 0 0 12px;
  overflow-x: auto;
}

.material-movement-scope-tabs a {
  white-space: nowrap;
}

.material-movement-summary {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.material-movement-filters {
  align-items: end;
}

.material-movement-detail,
.material-stock-source {
  min-width: 0;
  margin: 0 0 14px;
}

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

.material-stock-operational {
  border-left: 4px solid #16a34a;
}

.material-stock-referential {
  border-left: 4px solid #d97706;
  background: #fffbeb;
}

.material-operational-available {
  background: #f0fdf4;
  color: #166534;
}

.material-movements-wrap,
.material-stock-source .table-wrap {
  max-width: 100%;
  overflow: auto;
}

.material-movements-table {
  min-width: 1280px;
}

.material-movements-table.without-costs {
  min-width: 1040px;
}

.material-operational-stock-table {
  min-width: 760px;
  table-layout: fixed;
}

.material-operational-stock-table th:first-child,
.material-operational-stock-table td:first-child {
  width: 24%;
}

.material-operational-stock-table th:nth-child(2),
.material-operational-stock-table td:nth-child(2),
.material-operational-stock-table th:nth-child(3),
.material-operational-stock-table td:nth-child(3),
.material-operational-stock-table th:nth-child(4),
.material-operational-stock-table td:nth-child(4) {
  width: 15%;
}

.material-operational-stock-table th:last-child,
.material-operational-stock-table td:last-child {
  width: 31%;
}

.material-operational-identity-table {
  min-width: 760px;
  table-layout: fixed;
}

.material-operational-reservation-table {
  min-width: 980px;
}

.material-operational-reservation-table td,
.material-operational-reservation-table th {
  vertical-align: top;
}

.material-operational-identity-table th:nth-child(1),
.material-operational-identity-table td:nth-child(1) { width: 12%; }
.material-operational-identity-table th:nth-child(2),
.material-operational-identity-table td:nth-child(2) { width: 19%; }
.material-operational-identity-table th:nth-child(3),
.material-operational-identity-table td:nth-child(3) { width: 18%; }
.material-operational-identity-table th:nth-child(4),
.material-operational-identity-table td:nth-child(4),
.material-operational-identity-table th:nth-child(5),
.material-operational-identity-table td:nth-child(5),
.material-operational-identity-table th:nth-child(6),
.material-operational-identity-table td:nth-child(6) { width: 13%; }
.material-operational-identity-table th:last-child,
.material-operational-identity-table td:last-child { width: 12%; }

.material-referential-stock-table {
  min-width: 940px;
}

.design-detail-modal {
  width: min(1280px, calc(100vw - 48px));
}

.design-kpis {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.design-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
  padding: 14px;
  min-width: 0;
}

.detail-section-wide {
  grid-column: span 2;
}

.detail-section h3 {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 15px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1.25fr);
  gap: 8px 12px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-detail-modal {
  width: min(1180px, calc(100vw - 48px));
}

.client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.client-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.client-tabs a.active {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.material-view-tabs {
  margin: 0 0 14px;
}

.material-view-tabs .disabled {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #f5f7fa;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.hr-detail-modal .section-head {
  align-items: flex-start;
}

.hr-detail-modal .toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hr-detail-kpis {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.hr-detail-kpis article,
.hr-production-kpis article {
  min-width: 0;
}

.hr-detail-kpis strong,
.hr-production-kpis strong {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hr-production-kpis {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(130px, 1fr));
}

.hr-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.hr-detail-wide {
  grid-column: 1 / -1;
}

.hr-detail-table {
  min-width: 0;
  margin-top: 8px;
}

.hr-detail-table th {
  width: 180px;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.hr-detail-table td {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hr-operations-table,
.hr-targets-table,
.hr-agenda-table {
  min-width: 760px;
}

.hr-agenda-table td:nth-child(4) {
  min-width: 280px;
}

@media (max-width: 900px) {
  .hr-detail-kpis,
  .hr-production-kpis,
  .hr-detail-grid {
    grid-template-columns: 1fr;
  }

  .hr-detail-table th {
    width: auto;
  }
}

.sales-quote-detail-modal {
  width: min(1220px, calc(100vw - 48px));
}

.sales-order-detail-modal,
.sales-quote-detail-modal {
  width: min(1220px, calc(100vw - 48px));
}

.sales-order-page-detail {
  display: grid;
  gap: 14px;
}

.sales-order-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.sales-order-title-block {
  display: grid;
  align-content: center;
  gap: 8px;
}

.sales-order-title-block h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

.sales-order-badges,
.sales-order-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sales-order-amount-box {
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: end;
  padding: 12px;
  border: 1px solid #b9d3ed;
  border-radius: 8px;
  background: #fff;
}

.sales-order-amount-box span,
.sales-order-amount-box small {
  color: var(--muted);
  font-weight: 700;
}

.sales-order-amount-box strong {
  color: var(--blue-dark);
  font-size: 26px;
  line-height: 1.1;
  text-align: right;
}

.sales-order-actionbar {
  justify-content: flex-end;
}

.sales-order-summary-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.sales-order-tabs,
.sales-quote-tabs {
  margin-top: 12px;
}

.sales-order-tabs {
  gap: 0;
  margin: 14px 0 0;
  border-bottom: 0;
}

.sales-order-tabs a {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: #eef3f7;
  color: #34495e;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0;
}

.sales-order-tabs a.active {
  background: #fff;
  color: #1abc9c;
  border: 0;
}

.sales-order-sections,
.sales-quote-sections {
  display: grid;
  gap: 12px;
}

.sales-order-tab-body {
  padding: 16px 24px 28px;
  background: #fff;
}

.sales-order-tab-body .subpanel {
  border: 0;
  padding: 0;
  background: #fff;
}

.order-legacy-card {
  display: grid;
  gap: 14px;
}

.sales-order-legacy-summary {
  padding: 10px 0 12px;
}

.sales-order-ficha {
  color: #003a69;
  font-size: 12px;
}

.sales-order-ficha-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
}

.sales-order-ficha-column,
.sales-order-ficha-full {
  display: grid;
  gap: 5px;
}

.sales-order-ficha-full {
  margin-top: 10px;
}

.sales-order-ficha-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 18px;
}

.sales-order-ficha-row span {
  color: #33465b;
  font-weight: 700;
}

.sales-order-ficha-row strong {
  color: #003a69;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sales-order-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 4px 0 10px;
}

.sales-order-line-actions form {
  margin: 0;
}

.sales-order-detail-list {
  grid-template-columns: 180px minmax(0, 1fr) 180px minmax(0, 1fr);
}

.sales-order-detail-list .wide {
  grid-column: span 3;
}

.sales-order-lines-table {
  min-width: 1300px;
  font-size: 12px;
}

.sales-order-lines-table th:nth-child(3),
.sales-order-lines-table td:nth-child(3),
.sales-order-lines-table th:nth-child(5),
.sales-order-lines-table td:nth-child(5),
.sales-order-lines-table th:nth-child(7),
.sales-order-lines-table td:nth-child(7) {
  min-width: 210px;
}

.sales-order-lines-table th:nth-child(2),
.sales-order-lines-table td:nth-child(2) {
  min-width: 100px;
}

.sales-order-lines-table th:first-child,
.sales-order-lines-table td:first-child {
  min-width: 72px;
  text-align: center;
}

.sales-order-lines-table th:last-child,
.sales-order-lines-table td:last-child {
  min-width: 84px;
  text-align: center;
}

.sales-order-lines-table th:nth-last-child(2),
.sales-order-lines-table td:nth-last-child(2) {
  min-width: 180px;
  max-width: 280px;
}

.sales-order-line-observation {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.sales-order-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sales-order-notes-table {
  min-width: 940px;
}

.sales-order-movements-table {
  min-width: 1180px;
  font-size: 12px;
}

.sales-order-movements-table th:nth-child(2),
.sales-order-movements-table td:nth-child(2),
.sales-order-movements-table th:nth-child(8),
.sales-order-movements-table td:nth-child(8) {
  min-width: 220px;
}

.sales-order-page-detail h4 {
  margin: 10px 0 8px;
  color: var(--blue-dark);
}

.sales-quote-page-detail h4 {
  margin: 10px 0 8px;
  color: var(--blue-dark);
}

.sales-quote-page-detail .sales-quote-close-form {
  display: inline-flex;
  margin: 0;
}

.sales-quote-page-detail .sales-quote-close-button {
  min-height: 36px;
  padding: 0 12px;
}

.quote-legacy-actions,
.quote-legacy-buttons {
  justify-content: flex-start;
}

.quote-legacy-buttons {
  margin: 0;
}

.sales-quote-tco-refresh-form {
  display: inline-flex;
  margin: 0;
}

.sales-quote-image-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.sales-quote-image-toggle label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 700;
}

.sales-quote-image-toggle input {
  margin: 0;
}

.sales-quote-action-notice {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #f2d9a6;
  border-radius: 4px;
  background: #fff7e6;
  color: #8a5a00;
  font-weight: 700;
}

.sales-quote-legacy-tabs a {
  justify-content: center;
  min-width: 112px;
}

.sales-quote-documents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.sales-quote-product-board {
  display: grid;
  gap: 10px;
}

.sales-quote-products-table {
  min-width: 1040px;
}

.sales-quote-products-table th:nth-child(2),
.sales-quote-products-table td:nth-child(2),
.sales-quote-products-table th:nth-child(3),
.sales-quote-products-table td:nth-child(3),
.sales-quote-products-table th:nth-child(4),
.sales-quote-products-table td:nth-child(4),
.sales-quote-products-table th:nth-child(5),
.sales-quote-products-table td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

.sales-quote-products-table th:nth-child(7),
.sales-quote-products-table td:nth-child(7) {
  white-space: nowrap;
}

.sales-quote-products-table th:last-child,
.sales-quote-products-table td:last-child {
  white-space: nowrap;
}

.sales-quote-products-table .sales-quote-image-head,
.sales-quote-products-table .sales-quote-image-cell {
  width: 76px;
  min-width: 76px;
  text-align: center;
  white-space: nowrap;
}

.sales-quote-products-table th:first-child,
.sales-quote-products-table td:first-child {
  min-width: 300px;
}

.sales-quote-products-table tfoot th {
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.sales-quote-summary-row th {
  padding-top: 8px;
  padding-bottom: 8px;
  font-weight: 600;
  text-align: right;
  vertical-align: middle;
  background: #fff;
}

.sales-quote-summary-row th:first-child {
  color: #69584e;
  font-weight: 500;
}

.sales-quote-summary-input-form {
  display: inline-flex;
  justify-content: flex-end;
  margin: 0;
}

.sales-quote-summary-input-form input {
  width: 76px;
  min-height: 26px;
  padding: 3px 6px;
  border-color: #f2d9a6;
  border-radius: 3px;
  background: #fff2d7;
  text-align: center;
}

.sales-quote-discount-amount {
  color: #d65b5b;
  font-weight: 500;
}

.sales-quote-charge-row th:first-child {
  color: #e64b7c;
}

.sales-quote-charge-delete-form {
  display: inline-flex;
  justify-content: flex-end;
  margin: 0;
}

.sales-quote-charge-delete-form .danger {
  border-color: #fecaca;
  color: #b42318;
}

.sales-quote-grand-total th {
  border-top: 2px solid #36404a;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.quotation-commercial-print {
  position: relative;
  width: var(--quotation-page-width, 190mm);
  min-height: var(--quotation-page-height, 270mm);
  padding: 6mm 0 calc(var(--quotation-footer-space, 24mm) + 10mm);
  box-sizing: border-box;
  overflow: hidden;
  color: #777;
  font-size: 10px;
}

.quotation-page-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
}

.quotation-letterhead,
.quotation-client-row,
.quotation-note-details,
.quotation-lines-table,
.quotation-validity {
  position: relative;
  z-index: 1;
}

.quotation-letterhead {
  position: relative;
  display: block;
  width: 90%;
  min-height: var(--quotation-header-space, 42mm);
  margin: 0 auto 2mm;
}

.quotation-brand {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  color: #004b93;
  font-weight: 800;
  z-index: 2;
}

.quotation-header-image {
  display: block;
  width: 100%;
  max-height: 34mm;
  margin: 0 0 2mm;
  object-fit: contain;
}

.quotation-letterhead.has-header-image {
  display: grid;
  gap: 2mm;
  min-height: var(--quotation-header-space, 48mm);
}

.quotation-letterhead.has-header-image .quotation-brand,
.quotation-letterhead.has-header-image .quotation-heading {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  transform: none;
}

.quotation-letterhead.has-header-image.logo-left .quotation-brand {
  justify-self: start;
}

.quotation-letterhead.has-header-image.logo-center .quotation-brand {
  left: auto;
  justify-self: center;
  transform: none;
}

.quotation-letterhead.has-header-image.logo-right .quotation-brand {
  right: auto;
  left: auto;
  justify-self: end;
}

.quotation-letterhead.logo-center .quotation-brand {
  left: 50%;
  text-align: center;
  transform: translateX(-50%);
}

.quotation-letterhead.logo-right .quotation-brand {
  right: 0;
  left: auto;
  text-align: right;
}

.quotation-logo {
  width: var(--quotation-logo-width, 48mm);
  max-width: 92mm;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}

.quotation-letterhead.logo-center .quotation-logo {
  object-position: center center;
}

.quotation-letterhead.logo-right .quotation-logo {
  object-position: right center;
}

.quotation-heading {
  position: absolute;
  top: 24mm;
  right: 0;
  left: 0;
  text-align: center;
}

.quotation-letterhead-spacer {
  display: none;
}

.quotation-heading h1 {
  margin: 0 0 5px;
  color: #00519a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.quotation-heading strong {
  color: #ef4444;
  font-size: 15px;
  font-weight: 800;
}

.quotation-client-row {
  display: grid;
  grid-template-columns: 27% 38% 35%;
  gap: 10px;
  width: var(--quotation-content-width, 168mm);
  max-width: calc(100% - 28mm);
  margin: 0 auto 3.5mm;
  color: #1b5f9d;
  font-size: 9.5px;
}

.quotation-client-data {
  color: #697386;
  line-height: 1.25;
}

.quotation-client-data.right {
  text-align: right;
}

.quotation-client-data p {
  margin: 0 0 2px;
}

.quotation-small-meta {
  margin-top: 3px !important;
  color: #777;
  font-size: 8.5px;
}

.quotation-note-details {
  width: var(--quotation-content-width, 168mm);
  max-width: calc(100% - 28mm);
  margin: 0 auto 3mm;
  padding-top: 5px;
  border-top: 1px solid #cbd5e1;
  color: #334155;
  font-size: 9px;
}

.quotation-note-details p {
  margin: 4px 0;
}

.quotation-side-warning {
  position: absolute;
  top: 72mm;
  right: 3.5mm;
  width: 6mm;
  height: 105mm;
  overflow: hidden;
  color: #1b8bd2;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: 5px;
  line-height: 1.15;
  text-align: left;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.quotation-lines-table {
  width: var(--quotation-content-width, 168mm);
  max-width: calc(100% - 28mm);
  min-width: 0;
  margin: 0 auto;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  color: #777;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: 8.8px;
  line-height: 1.15;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.quotation-lines-table th,
.quotation-lines-table td {
  padding: 4px 5px;
  border: 1px solid #d9d9d9;
  vertical-align: top;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.quotation-lines-table th {
  color: #1b5f9d;
  font-weight: 800;
  background: #fff;
  font-size: 9.3px;
}

.quotation-lines-table tbody tr:nth-child(even) {
  background: #f2f2f2;
}

.quotation-lines-table thead {
  display: table-header-group;
}

.quotation-lines-table tfoot {
  display: table-row-group;
  page-break-inside: avoid;
}

.quotation-lines-table tr {
  page-break-inside: avoid;
}

.quotation-lines-table td strong {
  color: #003f7a;
  font-weight: 800;
}

.quotation-image-cell {
  text-align: center;
  vertical-align: middle;
}

.quotation-line-image {
  display: block;
  width: 12mm;
  height: 10mm;
  margin: 0 auto;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  object-fit: cover;
  background: #fff;
}

.quotation-image-placeholder {
  color: #94a3b8;
  font-size: 8px;
}

.quotation-lines-table td span,
.quotation-lines-table tfoot span {
  color: #697386;
  font-size: 7.8px;
  line-height: 1.25;
}

.quotation-lines-table tfoot th,
.quotation-lines-table tfoot td {
  background: #f7f7f7;
  font-weight: 700;
}

.quotation-old-total {
  color: #ff9090 !important;
  text-decoration: line-through;
}

.quotation-discount-amount {
  color: #ef4444 !important;
}

.quotation-grand-total th,
.quotation-grand-total td {
  border-top: 2px solid #64748b;
  color: #003f7a;
  font-size: 10px;
}

.quotation-validity {
  width: var(--quotation-content-width, 168mm);
  max-width: calc(100% - 28mm);
  margin: 3mm auto 0;
  color: #667085;
  font-size: 8.8px;
  page-break-inside: avoid;
}

.quotation-footer {
  position: absolute;
  right: 0;
  bottom: 6mm;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--quotation-qr-size, 14mm);
  column-gap: 10mm;
  row-gap: 2mm;
  align-items: end;
  width: 90%;
  max-width: 160mm;
  margin: 0 auto;
  padding-top: 3mm;
  min-height: var(--quotation-footer-space, 24mm);
  box-sizing: border-box;
  border-top: 1px solid #dedede;
  color: #0b67b2;
  font-size: 9px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.quotation-commercial-print.has-page-background .quotation-footer {
  border-top: 0;
  background: transparent;
}

.quotation-footer-image {
  grid-column: 1;
  width: 100%;
  max-height: calc(var(--quotation-footer-space, 24mm) - 5mm);
  object-fit: contain;
  object-position: left bottom;
}

.quotation-footer-years strong {
  display: block;
  color: #9ca3af;
  font-size: 17px;
  line-height: 0.95;
}

.quotation-footer-years small {
  display: block;
  margin-top: 2px;
  color: #a1a7b3;
  font-size: calc(var(--quotation-footer-text-size, 8px) * 0.72);
  line-height: 1.1;
}

.quotation-footer-years {
  grid-column: 1;
  justify-self: start;
}

.quotation-footer-contact small {
  display: block;
  color: #94a3b8;
  font-size: var(--quotation-footer-text-size, 8px);
  line-height: 1.2;
}

.quotation-footer-contact {
  grid-column: 2;
  display: grid;
  gap: 3px;
  justify-self: center;
  justify-items: center;
  text-align: center;
}

.quotation-footer-contact span {
  color: #0873c9;
  font-size: var(--quotation-footer-text-size, 8px);
  font-weight: 700;
  line-height: 1.2;
}

.quotation-footer-social {
  grid-column: 3;
  justify-self: center;
  color: #0873c9;
  font-size: var(--quotation-footer-text-size, 8px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: pre-line;
}

.quotation-qr {
  grid-column: 2;
  justify-self: end;
  align-self: end;
  width: var(--quotation-qr-size, 14mm);
  height: var(--quotation-qr-size, 14mm);
  object-fit: contain;
}

.quotation-footer.qr-left .quotation-qr {
  grid-column: 1;
  justify-self: start;
}

.quotation-footer.qr-left {
  grid-template-columns: var(--quotation-qr-size, 14mm) minmax(0, 1fr);
}

.quotation-footer.qr-left .quotation-footer-image {
  grid-column: 2;
  object-position: right bottom;
}

.quotation-footer.qr-left .quotation-footer-years {
  grid-column: 2;
  justify-self: center;
}

.quotation-footer.qr-left .quotation-footer-contact {
  grid-column: 3;
}

.quotation-footer.qr-left .quotation-footer-social {
  grid-column: 4;
  justify-self: end;
}

.quotation-footer.qr-center .quotation-qr {
  grid-column: 2;
  justify-self: center;
}

.quotation-footer.qr-center {
  grid-template-columns: minmax(0, 1fr) var(--quotation-qr-size, 14mm) minmax(0, 1fr);
}

.quotation-footer.qr-center .quotation-footer-image {
  grid-column: 1;
}

.quotation-footer.qr-center .quotation-footer-contact {
  grid-column: 2;
}

.quotation-footer.qr-center .quotation-footer-social {
  grid-column: 4;
  justify-self: end;
}

@media print {
  body.print-body .quotation-commercial-print {
    width: var(--quotation-page-width, 216mm);
    min-height: var(--quotation-page-height, 279mm);
    padding: 10mm 0 calc(var(--quotation-footer-space, 24mm) + 12mm);
    margin: 0;
    overflow: visible;
  }

  body.print-body .quotation-commercial-print.has-page-background {
    padding-top: 0;
  }

  .quotation-page-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .quotation-lines-table {
    width: var(--quotation-content-width, 168mm);
    max-width: var(--quotation-content-width, 168mm);
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quotation-lines-table th,
  .quotation-lines-table td {
    border: 0.35pt solid #d9d9d9 !important;
  }

  .quotation-line-image {
    width: 12mm;
    height: 10mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quotation-lines-table tbody tr:nth-child(even),
  .quotation-lines-table tfoot th,
  .quotation-lines-table tfoot td {
    background: #f2f2f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quotation-footer {
    position: fixed;
    right: auto;
    bottom: 6mm;
    left: 50%;
    width: 160mm;
    max-width: 90%;
    height: var(--quotation-footer-space, 24mm);
    margin: 0;
    padding-right: 0;
    padding-left: 0;
    transform: translateX(-50%);
    background: #fff;
    z-index: 5;
  }

  .quotation-side-warning {
    position: fixed;
    top: 72mm;
    right: 3.5mm;
  }
}

.sales-quote-add-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.sales-quote-orange-button {
  min-height: 30px;
  min-width: 96px;
  border: 0;
  border-radius: 999px;
  background: #f5a623;
  color: #fff;
  font-weight: 800;
  box-shadow: none;
}

.sales-quote-orange-button:hover {
  background: #e79211;
}

.sales-quote-draft-row > td {
  padding: 8px;
  background: #f8fbff;
}

.sales-quote-draft-product {
  display: grid;
  gap: .45rem;
  min-width: 0;
}

.sales-quote-draft-product .sales-quote-native-client-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  max-width: none;
  margin-top: 0;
}

.sales-quote-line-form {
  margin: 0;
}

.sales-quote-line-product-form {
  margin: 0 0 4px;
}

.sales-quote-product-meta {
  display: grid;
  gap: 2px;
  margin-top: 3px;
  line-height: 1.25;
}

.sales-quote-line-detail-note {
  color: #596474;
  overflow-wrap: anywhere;
}

.sales-quote-line-qty-form {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
}

.sales-quote-line-qty-form input,
.sales-quote-line-discount-form input {
  width: 58px;
  min-height: 28px;
  padding: 3px 6px;
  text-align: center;
}

.sales-quote-line-discount-form {
  display: inline-flex;
  justify-content: flex-end;
  margin: 0;
}

.sales-quote-line-discount-form input {
  width: 64px;
  border-color: #f2d9a6;
  background: #fff2d7;
}

.sales-quote-price-cell,
.sales-quote-total-cell {
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.sales-quote-thumb {
  width: 58px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 2px;
  border: 1px solid #c9d5e1;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.sales-quote-thumb:hover,
.sales-quote-thumb:focus {
  border-color: #0b66b3;
  box-shadow: 0 0 0 2px rgba(11, 102, 179, 0.12);
}

.sales-quote-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sales-quote-thumb-placeholder {
  width: 58px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px dashed #c9d5e1;
  border-radius: 4px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.sales-quote-image-panel {
  width: min(880px, calc(100vw - 48px));
}

.sales-quote-image-frame {
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: calc(100vh - 210px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  overflow: auto;
}

.sales-quote-image-frame img {
  max-width: 100%;
  max-height: calc(100vh - 250px);
  object-fit: contain;
}

.sales-quote-old-total {
  color: #d65b5b;
}

.sales-quote-hidden-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tiny-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.sales-quote-line-detail-text {
  display: block;
  max-width: 260px;
  margin-bottom: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.sales-quote-line-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.sales-quote-line-actions form {
  margin: 0;
}

.sales-quote-icon-button {
  min-height: 28px;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
}

.sales-quote-icon-button.sales-quote-has-detail {
  border-color: #f5a623;
  background: #fff7e8;
  color: #a25d00;
}

.sales-quote-line-actions .danger {
  border-color: #fecaca;
  color: #b42318;
}

.sales-quote-line-panel {
  width: min(560px, calc(100vw - 48px));
}

.sales-quote-discount-panel {
  width: min(520px, calc(100vw - 48px));
}

.sales-quote-discount-head {
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sales-quote-discount-form {
  display: grid;
  gap: 14px;
}

.sales-quote-charge-panel {
  width: min(520px, calc(100vw - 48px));
}

.sales-quote-generate-order-panel {
  width: min(560px, calc(100vw - 48px));
}

.sales-quote-generate-order-panel form {
  display: grid;
  gap: 14px;
}

.sales-quote-generate-client {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.sales-quote-generate-client strong {
  color: var(--blue-dark);
}

.sales-quote-generate-total {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sales-quote-generate-total span {
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-generate-total strong {
  color: var(--blue-dark);
  font-size: 24px;
}

.sales-quote-charge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sales-quote-settings-panel {
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 44px);
  margin: 22px auto;
  padding: 20px;
}

.sales-quote-settings-head {
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sales-quote-settings-form {
  display: grid;
  gap: 14px;
}

.sales-quote-settings-currency {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  margin: 0;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.sales-quote-settings-currency legend {
  margin-right: 10px;
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-settings-currency label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: #6b7280;
  font-weight: 600;
}

.sales-quote-settings-currency input[type="radio"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.sales-quote-settings-grid {
  display: grid;
  gap: 12px;
}

.sales-quote-settings-grid label {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0;
}

.sales-quote-settings-grid label > span {
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-settings-grid select,
.sales-quote-settings-grid textarea {
  width: 100%;
}

.sales-quote-settings-notes {
  align-items: start;
}

.sales-quote-settings-notes textarea {
  min-height: 96px;
  resize: vertical;
}

.sales-quote-settings-client {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sales-quote-settings-client h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.sales-quote-settings-client dl {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.sales-quote-settings-client dt {
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-settings-client dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
}

.sales-quote-client-tools {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.sales-quote-client-tools-label,
.sales-quote-quick-client-grid label {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-quick-client-grid input {
  width: 100%;
}

.sales-quote-native-client {
  display: grid;
  gap: 10px;
}

.sales-quote-native-client > .sales-quote-create-client-toggle {
  justify-self: start;
}

.sales-quote-client-picker-menu {
  min-width: 100%;
  max-width: min(760px, calc(100vw - 64px));
}

.sales-quote-create-client-toggle {
  width: 100%;
  margin-top: 8px;
  white-space: nowrap;
}

.sales-quote-client-no-results {
  border-top: 1px solid var(--line);
}

.sales-quote-quick-client {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.sales-quote-quick-client summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.sales-quote-quick-client-message {
  margin: 10px 0 0;
}

.sales-quote-quick-client-message[hidden] {
  display: none;
}

.sales-quote-quick-client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 12px;
}

.sales-quote-quick-client-grid .wide {
  grid-column: 1 / -1;
}

.sales-quote-quick-client-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.sales-quote-settings-footer {
  margin-top: 0;
}

.sales-quote-discount-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.sales-quote-discount-options legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-discount-options legend span,
.sales-quote-discount-extra p span {
  color: #d65b5b;
}

.sales-quote-discount-option,
.sales-quote-discount-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.2;
}

.sales-quote-discount-option input[type="radio"],
.sales-quote-discount-check input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.sales-quote-discount-extra {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sales-quote-discount-extra p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.sales-quote-discount-footer {
  margin-top: 0;
}

.sales-quote-line-panel textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

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

.sales-quote-line-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 72px 92px 120px 120px minmax(150px, auto);
  gap: 8px;
  align-items: center;
}

.sales-quote-picker {
  position: relative;
  min-width: 0;
}

.sales-quote-picker-button {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
  border: 1px solid #b8c7d5;
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  font-weight: 600;
  text-align: left;
}

.sales-quote-picker-button::after {
  content: "\25be";
  color: var(--muted);
  font-size: 11px;
}

.sales-quote-picker-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  min-width: min(720px, calc(100vw - 64px));
  max-width: min(860px, calc(100vw - 64px));
  border: 1px solid #b8c7d5;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.sales-quote-picker-menu input {
  width: calc(100% - 8px);
  min-height: 36px;
  margin: 4px;
  font-size: 12px;
}

.sales-quote-picker-options {
  display: grid;
  max-height: min(460px, calc(100vh - 220px));
  overflow: auto;
}

.sales-quote-picker-options button {
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  justify-content: flex-start;
  background: #fff;
  color: #596474;
  box-shadow: none;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}

.sales-quote-picker-options button:hover,
.sales-quote-picker-options button:focus {
  background: #5897fb;
  color: #fff;
}

.sales-quote-picker-options button.sales-quote-picker-option-warning {
  color: #8a5a00;
  background: #fffaf0;
}

.sales-quote-picker-options button.sales-quote-picker-option-warning:hover,
.sales-quote-picker-options button.sales-quote-picker-option-warning:focus {
  background: #5897fb;
  color: #fff;
}

.bom-tapiz-picker .sales-quote-picker-options button[aria-selected="true"] {
  background: #e8f1ff;
  color: #165da8;
  box-shadow: inset 3px 0 0 #1d70c9;
}

.bom-tapiz-selected-designs {
  display: block;
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px solid #d7e1eb;
  border-radius: 4px;
  background: #f7fafc;
  color: #425466;
  font-size: 12px;
  line-height: 1.4;
}

.sales-quote-picker-empty {
  padding: 8px;
}

.material-new-picker-label {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.material-master-picker {
  width: 100%;
}

.material-master-picker-menu {
  min-width: min(560px, calc(100vw - 48px));
}

.material-master-picker-options button {
  display: grid;
  gap: 2px;
}

.material-master-picker-options button strong,
.material-master-picker-options button span {
  display: block;
}

.material-master-picker-options button span {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.86;
}

.material-master-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid #dbe4ec;
}

.material-master-picker-footer button {
  min-height: 30px;
  padding: 5px 9px;
}

.material-master-picker .sales-quote-picker-button:disabled {
  cursor: not-allowed;
  background: #eef2f6;
  color: var(--muted);
  opacity: 0.78;
}

.material-category-inline-modal {
  z-index: 70;
}

.material-category-inline-panel {
  width: min(520px, calc(100vw - 32px));
  margin-top: min(16vh, 120px);
}

.material-config-primary-tabs {
  margin-bottom: 16px;
}

.material-category-admin {
  min-width: 0;
}

.material-category-admin-head {
  align-items: start;
  gap: 16px;
}

.material-category-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.material-category-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 190px) auto auto;
  align-items: end;
  gap: 10px;
  margin: 14px 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.material-category-filter-form label {
  min-width: 0;
}

.material-category-filter-form input,
.material-category-filter-form select,
.material-category-filter-form button,
.material-category-filter-form .button-link {
  min-height: 38px;
}

.material-category-result-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.material-category-table-wrap {
  max-width: 100%;
  overflow: visible;
}

.material-category-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.material-category-table th:nth-child(1),
.material-category-table td:nth-child(1) {
  width: 30%;
  min-width: 0;
}

.material-category-table th:nth-child(2),
.material-category-table td:nth-child(2) {
  width: 22%;
  min-width: 0;
}

.material-category-table th:nth-child(3),
.material-category-table td:nth-child(3) {
  width: 18%;
  min-width: 0;
}

.material-category-table th:nth-child(4),
.material-category-table td:nth-child(4) {
  width: 12%;
  min-width: 0;
}

.material-category-table th:nth-child(5),
.material-category-table td:nth-child(5) {
  width: 210px;
  min-width: 190px;
}

.material-category-table th,
.material-category-table td {
  vertical-align: middle;
  padding: 8px 10px;
  line-height: 1.25;
}

.material-category-table th:nth-child(1),
.material-category-table td:nth-child(1),
.material-category-table th:nth-child(2),
.material-category-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.material-category-actions-heading,
.material-category-actions-cell {
  text-align: right;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.material-category-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: max-content;
}

.material-category-row-actions button {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  min-height: 32px;
  padding: 5px 9px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.material-category-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.material-category-pagination .active {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}

.material-category-admin-modal {
  z-index: 70;
}

.material-category-admin-panel {
  width: min(520px, calc(100vw - 32px));
  margin-top: min(16vh, 120px);
}

.material-category-admin-panel .section-head {
  align-items: start;
}

.material-category-admin-panel .form-grid {
  grid-template-columns: 1fr;
}

.material-category-admin-panel .wide {
  grid-column: 1;
}

.material-category-confirm {
  align-items: start;
  max-width: none;
  padding: 10px;
  border: 1px solid #f0c8c5;
  border-radius: 6px;
  background: #fff6f5;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 1100px) and (min-width: 769px) {
  .material-category-table th:nth-child(5),
  .material-category-table td:nth-child(5) {
    width: 150px;
    min-width: 140px;
  }

  .material-category-row-actions {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .material-category-row-actions button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .material-master-picker-menu {
    min-width: min(92vw, 560px);
    max-width: 92vw;
    left: auto;
    right: 0;
  }

  .material-category-admin-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .material-category-filter-form {
    grid-template-columns: 1fr;
  }

  .material-category-head-actions {
    justify-content: flex-start;
  }

  .material-category-filter-form button,
  .material-category-filter-form .button-link {
    justify-content: center;
    width: 100%;
  }

  .material-category-table {
    display: block;
  }

  .material-category-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .material-category-table tbody,
  .material-category-table tr,
  .material-category-table td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }

  .material-category-table tr {
    margin: 10px 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
  }

  .material-category-table td {
    display: grid;
    grid-template-columns: minmax(112px, 38%) 1fr;
    gap: 8px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid #edf1f4;
    text-align: left;
  }

  .material-category-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .material-category-table td:last-child {
    border-bottom: 0;
  }

  .material-category-table td.material-category-actions-cell {
    display: grid;
    grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
    white-space: normal;
  }

  .material-category-table td.material-category-actions-cell::before {
    align-self: center;
  }

  .material-category-row-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .material-category-pagination {
    justify-content: flex-start;
  }
}

@media (max-width: 390px) {
  .material-config-primary-tabs a,
  .material-config-tabs a {
    flex: 1 1 auto;
    justify-content: center;
  }

  .material-category-table td {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .material-category-table td.material-category-actions-cell {
    grid-template-columns: 1fr;
  }

  .material-category-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .material-category-row-actions button {
    width: 100%;
    min-width: 0;
  }

  .material-category-admin-panel {
    width: calc(100vw - 16px);
    margin: 8px auto;
    max-height: calc(100vh - 16px);
  }
}

.sales-order-tapiz {
  min-width: 0;
  overflow-x: hidden;
}
.sales-order-tapiz-overview {
  min-width: 0;
}
.sales-order-tapiz-overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin: .75rem 0 1rem;
}
.sales-order-tapiz-overview-kpis > div {
  display: grid;
  gap: .2rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #f8fafc;
}
.sales-order-tapiz-overview-kpis span {
  color: var(--muted);
  font-size: .78rem;
}
.sales-order-tapiz-overview-kpis strong {
  color: var(--text);
  font-size: 1.05rem;
}
.sales-order-tapiz-overview-table {
  min-width: 1050px;
}
.sales-order-tapiz-overview-table th:nth-child(1) { width: 20%; }
.sales-order-tapiz-overview-table th:nth-child(2) { width: 28%; }
.sales-order-tapiz-overview-table th:nth-child(3) { width: 12%; }
.sales-order-tapiz-overview-table th:nth-child(4) { width: 14%; }
.sales-order-tapiz-overview-table th:nth-child(5) { width: 18%; }
.sales-order-tapiz-overview-table th:nth-child(6) { width: 8%; }
.sales-order-tapiz-overview-table td {
  vertical-align: top;
}
.sales-order-tapiz-overview-table small {
  color: var(--muted);
  line-height: 1.35;
}
.sales-order-tapiz-status-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.sales-order-tapiz-status-button:hover,
.sales-order-tapiz-status-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(31, 111, 178, .25);
}
.sales-order-tapiz-overview-action {
  text-align: center;
  white-space: nowrap;
}
.sales-order-tapiz .section-head {
  align-items: flex-start;
}
.sales-order-tapiz-empty {
  display: grid;
  gap: .3rem;
  padding: 1.1rem;
  border: 1px dashed var(--line);
  border-radius: .65rem;
  background: #f8fafc;
  color: var(--muted);
}
.sales-order-tapiz-empty strong { color: var(--text); }
.sales-order-tapiz-summary {
  margin: 0 0 .9rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #f8fafc;
}
.sales-order-tapiz-summary .section-head { margin-bottom: .55rem; }
.sales-order-tapiz-summary h4 { margin: 0; }
.sales-order-tapiz-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
  gap: .65rem;
}
.sales-order-tapiz-card {
  min-width: 0;
  overflow: hidden;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #fff;
}
.sales-order-tapiz-card.is-inactive { opacity: .7; }
.sales-order-tapiz-card > header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.sales-order-tapiz-card h4,
.sales-order-tapiz-card .eyebrow { margin: 0; }
.sales-order-tapiz-card h4 { overflow-wrap: anywhere; }
.sales-order-tapiz-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem;
  margin: .6rem 0;
}
.sales-order-tapiz-kpis > div {
  min-width: 0;
  display: grid;
  gap: .15rem;
  padding: .42rem;
  border-radius: .5rem;
  background: #f3f7fb;
}
.sales-order-tapiz-kpis strong,
.sales-order-tapiz-detail dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
.sales-order-tapiz-kpis span,
.sales-order-tapiz-lines small {
  color: var(--muted);
  font-size: .74rem;
}
.sales-order-tapiz-kpis small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.3;
}
.sales-order-tapiz-modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem 1rem;
  margin-bottom: .65rem;
  color: var(--muted);
  font-size: .82rem;
}
.sales-order-tapiz-modal-meta strong { color: var(--text); }
.sales-order-tapiz-detail-head h3,
.sales-order-tapiz-detail-head p { margin-bottom: .25rem; }
.sales-order-tapiz-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: .7rem;
  margin-top: .7rem;
}
.sales-order-tapiz-info-panel {
  min-width: 0;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fbfdff;
}
.sales-order-tapiz-info-panel h4 {
  margin: 0 0 .55rem;
  color: #174f78;
}
.sales-order-tapiz-detail {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: .28rem .55rem;
  margin: 0;
  font-size: .86rem;
}
.sales-order-tapiz-detail dt { color: var(--muted); }
.sales-order-tapiz-detail dd { margin: 0; overflow-wrap: anywhere; }
.sales-order-tapiz-stock-list {
  display: grid;
  gap: .15rem;
  margin-top: .35rem;
  color: var(--muted);
}
.sales-order-tapiz-shortage {
  display: block;
  margin-top: .35rem;
  color: #9a5b00;
}
.sales-order-tapiz-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}
.sales-order-tapiz-action-group {
  display: grid;
  align-content: start;
  gap: .6rem;
  min-width: 0;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #f8fafc;
}
.sales-order-tapiz-action-group > div:first-child {
  display: grid;
  gap: .15rem;
}
.sales-order-tapiz-action-group small {
  color: var(--muted);
  line-height: 1.3;
}
.sales-order-tapiz-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.sales-order-tapiz-action-buttons button { min-width: 0; }
.sales-order-tapiz-action-buttons .secondary.danger {
  border-color: #efb7b7;
  color: #a51d1d;
  background: #fff;
}
.sales-order-tapiz-action-buttons .secondary.danger:hover {
  background: #fff1f2;
}
.sales-order-tapiz-action-note {
  display: block;
  padding: .45rem .55rem;
  border-radius: .45rem;
  background: #fff7ed;
  color: #9a5b00;
  font-size: .78rem;
  line-height: 1.35;
}
.sales-order-tapiz-action-note.is-ready {
  background: #ecfdf3;
  color: #166534;
}
.sales-order-tapiz-summary {
  min-width: 0;
  padding: .65rem;
}
.sales-order-tapiz-summary .table-scroll { max-width: 100%; }
@media (max-width: 1050px) {
  .sales-order-tapiz-overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-order-tapiz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-order-tapiz-actions { grid-template-columns: 1fr; }
}
.sales-order-tapiz-action-buttons form { margin: 0; }
.sales-order-tapiz-cell { display: grid; gap: .2rem; min-width: 0; }
.sales-order-tapiz-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: .22rem .45rem;
  border: 1px solid #b9cbe0;
  border-radius: .4rem;
  background: #f7fbff;
  color: #165b91;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.sales-order-tapiz-chip:hover,
.sales-order-tapiz-chip:focus-visible { border-color: #1f6fb2; background: #eaf4ff; }
.sales-order-tapiz-assignment {
  display: grid;
  gap: .08rem;
  padding: .38rem .5rem;
  line-height: 1.15;
}
.sales-order-tapiz-assignment strong { font-size: .78rem; color: #123f63; }
.sales-order-tapiz-assignment small { color: var(--muted); font-size: .68rem; font-weight: 600; }
.sales-order-tapiz-chip-code {
  color: #1f6fb2;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .02em;
}
button.sales-order-tapiz-chip { cursor: pointer; text-align: left; }
.sales-order-tapiz-action { border-style: dashed; }
.sales-order-tapiz-add-link { width: fit-content; padding: 0; font-size: .76rem; }
.sales-order-tapiz-line.is-disabled { opacity: .62; background: #f8fafc; }
.sales-order-tapiz-cuts { margin-top: 1rem; }
.sales-order-tapiz-cuts td:last-child { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.sales-order-tapiz-cuts form { margin: 0; }
.sales-order-tapiz-cut-actions {
  margin-top: .85rem;
  padding: .75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.sales-order-tapiz-modal .modal-panel { width: min(1040px, calc(100vw - 36px)); }
.sales-order-tapiz-detail-modal .modal-panel { width: min(1080px, calc(100vw - 36px)); }
.sales-order-tapiz-detail-modal .sales-order-tapiz-card {
  border: 0;
  padding: 0;
}
.sales-order-tapiz-reservation-summary {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(120px, 1fr));
  gap: .65rem;
  margin-bottom: .8rem;
}
.sales-order-tapiz-reservation-summary > div {
  display: grid;
  gap: .2rem;
  padding: .7rem;
  border-radius: .55rem;
  background: #f3f7fb;
}
.sales-order-tapiz-reservation-summary span { color: var(--muted); font-size: .75rem; }
.sales-order-tapiz-stock-table input { min-width: 115px; }
.sales-order-tapiz-stock-table td:last-child { display: grid; gap: .2rem; }
.sales-order-tapiz-stock-table small { color: var(--muted); }
.sales-order-tapiz-reservation-live {
  margin: .75rem 0;
  padding: .65rem .75rem;
  border-radius: .5rem;
  background: #eaf7ef;
  color: #166534;
  font-weight: 700;
}
.sales-order-tapiz-reservation-live.is-over { background: #fff1f0; color: #b42318; }
.sales-order-tapiz-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.sales-order-tapiz-form-grid > .wide { grid-column: 1 / -1; }
.sales-order-tapiz-form-grid > .sales-order-tapiz-lines { order: -2; }
.sales-order-tapiz-form-grid > .sales-order-tapiz-meterage-suggestions { order: -1; }
.sales-order-tapiz-form-grid label { min-width: 0; }
.sales-order-tapiz-form-grid input,
.sales-order-tapiz-form-grid select,
.sales-order-tapiz-form-grid textarea { width: 100%; }
.sales-order-tapiz-form-grid input[type="search"] {
  margin-bottom: .35rem;
}
.sales-order-tapiz-lines {
  display: grid;
  gap: .45rem;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
}
.sales-order-tapiz-lines legend { padding: 0 .3rem; font-weight: 700; }
.sales-order-tapiz-lines > p { margin: 0; }
.sales-order-tapiz-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  align-items: start;
  padding: .55rem;
  border: 1px solid #dbe4ee;
  border-radius: .5rem;
  background: #fff;
}
.sales-order-tapiz-line:has([data-order-tapiz-line-quantity]) {
  grid-template-columns: auto minmax(0, 1fr) 5.5rem;
}
.sales-order-tapiz-line [data-order-tapiz-line-quantity] {
  width: 5rem;
  margin-top: 0;
}
.sales-order-tapiz-line:has(input:checked) {
  border-color: #1f6fb2;
  background: #eff7ff;
}
.sales-order-tapiz-line input { width: auto; margin-top: .15rem; }
.sales-order-tapiz-line span { display: grid; gap: .12rem; }
.sales-order-tapiz-client-detail { color: var(--text); font-style: italic; }
.sales-order-tapiz-line-with-series {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .45rem;
}
.sales-order-tapiz-line-with-series > span { padding: .1rem .15rem; }
.sales-order-tapiz-series-list {
  display: grid;
  gap: .35rem;
  padding-left: 1rem;
  border-left: 2px solid #dbe4ee;
}
.sales-order-tapiz-series-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .55rem;
  align-items: start;
  padding: .4rem .5rem;
  border: 1px solid #e1e8f0;
  border-radius: .4rem;
  background: #fbfdff;
}
.sales-order-tapiz-series-line:has(input:checked) {
  border-color: #1f6fb2;
  background: #eff7ff;
}
.sales-order-tapiz-series-line span { display: grid; gap: .1rem; }
.sales-order-tapiz-series-line small { color: var(--muted); }
.sales-order-tapiz-series-line.is-assigned {
  opacity: .62;
  background: #f5f7fa;
}
.sales-order-tapiz-selection-summary {
  position: sticky;
  bottom: -.75rem;
  padding: .55rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  background: #eaf4ff;
  color: #164e78;
  font-weight: 700;
}
.sales-order-tapiz-selection-summary.is-warning,
[data-order-tapiz-bom-hint].is-warning {
  border-color: #f59e0b;
  background: #fff3cd;
  color: #7c2d12;
  box-shadow: inset 4px 0 0 #f59e0b;
  font-weight: 700;
}
.sales-order-tapiz-meterage-suggestions {
  display: grid;
  gap: .65rem;
  padding: .75rem;
  border: 1px solid #bfd8ee;
  border-radius: .55rem;
  background: #f7fbff;
}
.sales-order-tapiz-suggestions-head strong { color: #164e78; }
.sales-order-tapiz-suggestions-head p { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }
.sales-order-tapiz-suggestion-list { display: grid; gap: .55rem; }
.sales-order-tapiz-suggestion {
  display: grid;
  gap: .5rem;
  padding: .65rem;
  border: 1px solid #dbe4ee;
  border-radius: .5rem;
  background: #fff;
}
.sales-order-tapiz-suggestion-title {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  justify-content: space-between;
}
.sales-order-tapiz-suggestion-title > div { display: grid; gap: .12rem; }
.sales-order-tapiz-suggestion-title span { color: var(--muted); font-size: .76rem; }
.sales-order-tapiz-suggestion-count {
  flex: 0 0 auto;
  padding: .22rem .5rem;
  border-radius: 999px;
  background: #fff2d8;
  color: #9a5b00 !important;
  font-weight: 700;
}
.sales-order-tapiz-multiple-hint,
.sales-order-tapiz-manual-suggestion {
  margin: 0;
  padding: .5rem .6rem;
  border-radius: .4rem;
  background: #fff8e8;
  color: #694400;
  font-size: .8rem;
}
.sales-order-tapiz-suggestion-options { display: grid; gap: .4rem; }
.sales-order-tapiz-suggestion-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .5rem .6rem;
  border: 1px solid #e1e8f0;
  border-radius: .4rem;
  background: #fbfdff;
}
.sales-order-tapiz-suggestion-option > div { display: grid; gap: .08rem; }
.sales-order-tapiz-suggestion-option span,
.sales-order-tapiz-suggestion-option small { color: var(--muted); }
.sales-order-tapiz-suggestion-option.is-selected-family { border-color: #1f6fb2; background: #eff7ff; }
.sales-order-tapiz-suggestion-option.is-out-of-range { opacity: .68; }
.sales-order-tapiz-suggestion-result { color: #164e78; white-space: nowrap; }
@media (max-width: 760px) {
  .sales-order-tapiz-overview-kpis { grid-template-columns: 1fr; }
  .sales-order-tapiz-detail-layout { grid-template-columns: 1fr; }
  .sales-order-tapiz-form-grid { grid-template-columns: 1fr; }
  .sales-order-tapiz-form-grid > .wide { grid-column: auto; }
  .sales-order-tapiz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-order-tapiz-detail { grid-template-columns: 1fr; }
  .sales-order-tapiz-reservation-summary { grid-template-columns: 1fr; }
  .sales-order-tapiz-suggestion-title { display: grid; }
  .sales-order-tapiz-suggestion-count { justify-self: start; }
  .sales-order-tapiz-suggestion-option { grid-template-columns: 1fr; }
}

.material-wood-transformation-card {
  margin-bottom: 1rem;
}
.material-wood-transformation-modal-panel {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
}
.material-wood-transformation-modal-panel > .muted {
  margin-top: -.55rem;
}
.material-wood-transformation-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  cursor: pointer;
}
.material-wood-transformation-card[open] > summary {
  margin-bottom: 1rem;
}
.material-wood-output-row {
  margin-bottom: .8rem;
  padding: .85rem;
  border: 1px solid var(--border, #d9e1ea);
  border-radius: .65rem;
  background: var(--panel, #fff);
}
.material-wood-output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .65rem;
}
.material-wood-output-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.material-inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(95px, .45fr);
  gap: .4rem;
}
.material-wood-output-result {
  display: grid;
  align-content: center;
  gap: .2rem;
  padding: .55rem .7rem;
  border-radius: .55rem;
  background: rgba(15, 118, 110, .08);
}
.material-wood-output-result span,
.material-wood-output-result small {
  color: var(--muted, #64748b);
}
.material-series-code-fields {
  display: grid;
  gap: .35rem;
}
.material-series-auto {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--muted, #64748b);
}
.material-series-auto input {
  width: auto;
}
.material-wood-material-picker .sales-quote-picker-menu {
  min-width: min(620px, calc(100vw - 64px));
}
.material-wood-totals {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding: .75rem;
  border-radius: .55rem;
  background: rgba(37, 99, 235, .07);
}
.danger-text { color: #b91c1c !important; }

@media (max-width: 1100px) {
  .material-wood-output-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .material-wood-transformation-modal-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
  }
  .material-wood-transformation-card > summary,
  .material-wood-output-head,
  .material-wood-totals { align-items: flex-start; flex-direction: column; }
  .material-wood-output-grid { grid-template-columns: 1fr; }
}

.material-purchase-indicator {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  margin-top: .2rem;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100%;
  color: #9a3412;
  font-size: .72rem;
  line-height: 1.15;
  text-decoration: none;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.material-purchase-indicator:hover,
.material-purchase-indicator:focus-visible {
  text-decoration: underline;
}

.material-purchase-created-notice {
  margin: .75rem 0;
}

.material-purchase-existing-warning {
  display: grid;
  gap: .5rem;
  margin: .65rem 0;
}

.material-purchase-existing-warning[hidden],
.material-purchase-existing-list section[hidden] {
  display: none;
}

.material-purchase-existing-list {
  display: grid;
  gap: .45rem;
}

.material-purchase-existing-list section {
  padding: .5rem .6rem;
  border: 1px solid #f1cf86;
  border-radius: 6px;
  background: #fff;
}

.material-purchase-existing-list ul {
  display: grid;
  gap: .2rem;
  margin: .35rem 0 0;
  padding: 0;
  list-style: none;
}

.material-purchase-existing-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  color: var(--muted);
  font-size: .78rem;
}

.material-purchase-existing-confirm {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  padding-top: .25rem;
  cursor: pointer;
}

.material-purchase-existing-confirm input {
  margin-top: .2rem;
}

.material-purchase-details-panel {
  width: min(780px, calc(100vw - 48px));
}

.material-purchase-details-help {
  margin: -.25rem 0 1rem;
}

.material-purchase-material-panel[hidden] {
  display: none;
}

.material-purchase-list-count {
  margin-bottom: .45rem;
  color: var(--muted);
  font-size: .78rem;
}

.material-purchase-request-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.material-purchase-request-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .8rem;
}

.material-purchase-request-table th,
.material-purchase-request-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.material-purchase-request-table th {
  background: #f7f9fb;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.material-purchase-request-table th:nth-child(1) { width: 32%; }
.material-purchase-request-table th:nth-child(2) { width: 18%; }
.material-purchase-request-table th:nth-child(3) { width: 20%; }
.material-purchase-request-table th:nth-child(4) { width: 15%; }
.material-purchase-request-table th:nth-child(5) { width: 15%; }

.material-purchase-request-table tbody tr:last-child td {
  border-bottom: 0;
}

.material-purchase-request-table td strong,
.material-purchase-request-table td small {
  display: block;
}

.material-purchase-request-table td small {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .material-purchase-details-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
  }
}

.sales-quote-stock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  padding: 3px 8px;
  border: 0;
  border-radius: 3px;
  background: #6d62c7;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
  white-space: nowrap;
}

.sales-quote-stock-badge.muted {
  background: #edf2f7;
  color: var(--muted);
}

.sales-quote-qty-field {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.sales-quote-qty-field input {
  width: 58px;
  min-height: 28px;
  padding: 3px 6px;
  text-align: center;
}

.sales-quote-draft-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.sales-quote-draft-actions button {
  min-height: 30px;
  padding: 6px 9px;
  white-space: nowrap;
}

.sales-quote-stock-panel {
  width: min(1040px, calc(100vw - 48px));
}

.sales-quote-stock-table {
  min-width: 940px;
}

.sales-quote-stock-table th,
.sales-quote-stock-table td {
  vertical-align: middle;
}

.sales-quote-stock-series-scroll {
  max-height: min(680px, calc(100vh - 245px));
}

.sales-quote-stock-color-chip {
  min-width: 132px;
}

.sales-quote-stock-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sales-quote-split-form {
  margin: 0;
}

@media (max-width: 900px) {
  .sales-quote-line-grid {
    grid-template-columns: minmax(240px, 1fr) 64px 86px 108px 108px;
  }

  .sales-quote-charge-grid {
    grid-template-columns: 1fr;
  }

  .sales-quote-discount-options {
    grid-template-columns: 1fr;
  }

  .sales-quote-settings-grid label,
  .sales-quote-settings-client dl,
  .sales-quote-client-tools,
  .sales-quote-quick-client-grid {
    grid-template-columns: 1fr;
  }

  .sales-quote-draft-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.sales-order-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.sales-order-table-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-weight: 400;
}

.sales-order-table-toolbar input {
  min-height: 32px;
  width: 180px;
}

.sales-order-reconcile-form {
  display: inline-flex;
  margin: 0;
}

.sales-order-delivery-picker {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.sales-order-delivery-picker > summary {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 800;
}

.sales-order-delivery-picker > p {
  margin: 0;
  padding: 0 14px 10px;
}

.sales-order-delivery-picker > .table-scroll {
  margin: 0 14px 14px;
}

.sales-order-color-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 2px;
  background: #6b3b34;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
}

.sales-order-color-action {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.sales-order-color-action:hover,
.sales-order-color-action:focus-visible {
  filter: brightness(.9);
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.sales-order-line-note-icon,
.sales-order-line-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.sales-order-line-note-icon {
  background: #eaf2ff;
  color: #0b5cad;
  border: 1px solid #b9d6ff;
}

.sales-order-line-check {
  color: #134e4a;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.sales-order-line-check input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.sales-order-add-menu {
  position: relative;
  display: inline-flex;
}

.sales-order-add-menu > div {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 150px;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sales-order-add-menu.open > div {
  display: grid;
}

.sales-order-add-menu > div button {
  border: 0;
  border-radius: 0;
  justify-content: flex-start;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.sales-order-add-menu > div button:hover {
  background: #edf4ff;
}

.sales-order-series-modal {
  max-width: min(1040px, calc(100vw - 48px));
}

.sales-order-design-modal {
  max-width: min(1040px, calc(100vw - 48px));
}

.sales-order-series-modal,
.sales-order-design-modal,
.sales-order-client-design-modal,
.sales-order-send-modal {
  max-height: calc(100vh - 36px);
  margin-top: 18px;
  margin-bottom: 18px;
}

.sales-order-send-modal {
  max-width: min(760px, calc(100vw - 48px));
}

.sales-order-send-fields {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.sales-order-send-fields .wide {
  grid-column: 1 / -1;
}

.sales-order-modal-toolbar,
.sales-order-design-selector {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sales-order-modal-toolbar label,
.sales-order-design-selector label {
  margin: 0;
}

.sales-order-design-selector > label:first-child {
  flex: 1 1 620px;
}

.sales-order-design-combo,
.sales-order-select-combo {
  position: relative;
  min-width: min(620px, 78vw);
  width: 100%;
}

.sales-order-design-combo-button,
.sales-order-select-combo-button {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
  border: 1px solid #b8c7d5;
  background: #fff;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  box-shadow: none;
}

.sales-order-design-combo-button::after,
.sales-order-select-combo-button::after {
  content: "▾";
  color: var(--muted);
  font-size: 11px;
}

.sales-order-design-combo-menu,
.sales-order-select-combo-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  border: 1px solid #b8c7d5;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.sales-order-design-combo-menu input,
.sales-order-select-combo-menu input {
  width: calc(100% - 8px);
  min-height: 30px;
  margin: 4px;
}

.sales-order-design-options,
.sales-order-select-options {
  display: grid;
  max-height: min(380px, calc(100vh - 270px));
  overflow: auto;
}

.sales-order-design-options button,
.sales-order-select-options button {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  justify-content: flex-start;
  background: #fff;
  color: #596474;
  box-shadow: none;
  font-weight: 700;
  text-align: left;
}

.sales-order-design-options button:hover,
.sales-order-design-options button:focus,
.sales-order-select-options button:hover,
.sales-order-select-options button:focus {
  background: #5897fb;
  color: #fff;
}

.sales-order-series-picker {
  max-height: min(680px, calc(100vh - 245px));
}

.sales-order-series-picker table {
  min-width: 940px;
}

.compact-table td.sales-order-series-state,
.compact-table td.sales-order-series-location {
  color: #fff;
  text-align: center;
  vertical-align: middle;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.3);
}

.compact-table td.sales-order-series-state {
  min-width: 58px;
}

.compact-table td.sales-order-series-location {
  min-width: 76px;
}

.sales-order-series-state.available {
  background: #078337;
}

.sales-order-series-state.sold {
  background: #b42318;
}

.sales-order-series-state.process {
  background: #daaa32;
}

.sales-order-series-state.order-process {
  background: #df7401;
}

.sales-order-series-state.order-available {
  background: #2e75b6;
}

.sales-order-series-state.maintenance {
  background: #222a35;
}

.sales-order-series-state.assistance {
  background: #6a0888;
}

.sales-order-series-state.other {
  background: #334155;
}

.sales-order-client-design-modal textarea {
  min-height: 150px;
}

.sales-order-green-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #81c784;
  border-radius: 3px;
  background: #67c15e;
  color: #fff;
  font-weight: 800;
}

label.sales-order-green-check {
  cursor: pointer;
}

.sales-order-green-check input {
  accent-color: #67c15e;
}

.icon-button {
  min-width: 32px;
  width: 32px;
  padding-inline: 0;
}

.sales-order-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.sales-order-file-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.sales-order-file-scope {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.sales-order-file-scope.production {
  border-top: 4px solid #2563eb;
}

.sales-order-file-scope.commercial {
  border-top: 4px solid #7c3aed;
  background: #fcfaff;
}

.sales-order-file-scope > .section-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.sales-order-file-scope h4,
.sales-order-file-scope h5 {
  margin: .15rem 0 .35rem;
}

.sales-order-file-scope .sales-order-quote-pdf {
  margin-bottom: 14px;
}

.sales-order-file-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 118px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.sales-order-file-card strong,
.sales-order-file-card span,
.sales-order-file-card small {
  display: block;
  overflow-wrap: anywhere;
}

.sales-order-file-card .table-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: 2px;
}

.sales-order-file-reclassify {
  display: inline-flex;
}

.sales-order-file-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 56px;
  border: 2px solid #6d7bd9;
  border-radius: 4px;
  color: #4f5cc7;
  font-size: 11px;
  font-weight: 900;
  background: #fff;
}

.sales-order-file-icon.image {
  border-color: #f2a52b;
  color: #d97706;
}

.sales-order-file-icon.pdf {
  border-color: #df3b3b;
  color: #c12828;
}

.sales-order-file-icon.cad {
  border-color: #198f7a;
  color: #0f766e;
}

.sales-order-file-icon.private {
  border-color: #7c3aed;
  color: #6d28d9;
}

.sales-order-file-modal {
  width: min(720px, calc(100vw - 48px));
}

.sales-order-file-form {
  grid-template-columns: 1fr;
}

@media (max-width: 980px) {
  .sales-order-file-scope-grid {
    grid-template-columns: 1fr;
  }
}

.sales-order-receipts-table,
.sales-order-materials-table {
  min-width: 1080px;
  font-size: 12px;
}

.sales-order-history.timeline {
  margin-top: 8px;
}

.inline-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.inline-filter-form label {
  min-width: min(360px, 100%);
}

.client-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: start;
}

.client-address-list,
.client-history-list {
  display: grid;
  gap: 8px;
}

.client-address-list article,
.client-history-list article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.client-address-list span,
.client-history-list small {
  display: block;
}

.client-history-list article {
  grid-template-columns: minmax(130px, 1fr) auto auto;
  align-items: center;
}

.client-history-list small {
  grid-column: 1 / -1;
}

.client-data-list {
  max-width: 760px;
}

.client-address-editor {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.client-address-map {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #edf2f7;
}

.client-map-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
}

.client-related-preview {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.client-related-modal {
  box-shadow: 0 12px 28px rgba(32, 39, 51, 0.12);
}

.client-bulk-actions,
.client-portfolio-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 10px 0;
}

.client-bulk-actions label,
.client-portfolio-form label {
  min-width: 220px;
}

.inline-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #b8c7d5;
  border-radius: 6px;
  background: #f8fbfe;
  padding: 8px 10px;
  color: var(--blue-dark);
  font-weight: 700;
}

.inline-confirm span {
  margin-right: auto;
}

.row-check,
.checkline input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.checkline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.bom-mini-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.bom-mini-item span,
.bom-mini-item em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.design-bom-tab-stack {
  display: grid;
  gap: 16px;
}

.design-operation-stack {
  display: grid;
  gap: 16px;
}

.design-recipe-prices .section-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.design-recipe-prices .notice {
  margin: 10px 0;
}

.design-recipe-price-table {
  width: 100%;
  table-layout: fixed;
}

.design-recipe-price-table td > span,
.design-recipe-price-table td > strong {
  display: block;
}

.design-recipe-price-table th:first-child { width: 31%; }
.design-recipe-price-table th:nth-child(2) { width: 27%; }
.design-recipe-price-table th:nth-child(3) { width: 22%; }
.design-recipe-price-table th:last-child { width: 20%; }

.design-recipe-price-table td {
  overflow-wrap: anywhere;
}

.design-recipe-price-table button {
  white-space: nowrap;
}

.design-recipe-price-badges,
.design-recipe-price-modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.design-recipe-price-rate {
  margin: 8px 0 12px;
  line-height: 1.4;
}

.design-recipe-price-modal-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.design-recipe-price-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.design-recipe-price-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.design-recipe-price-history > summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 700;
}

.design-recipe-price-history .table-wrap {
  margin-top: 12px;
}

.design-bom-summary-card,
.design-areas-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.design-areas-card > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.design-areas-card > summary::-webkit-details-marker {
  display: none;
}

.design-areas-card > summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.design-areas-card-body {
  margin-top: 14px;
}

.design-bom-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.design-bom-facts article {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faff;
}

.design-bom-facts span {
  color: var(--muted);
  font-size: 12px;
}

.design-bom-name-row {
  align-items: end;
}

.design-areas-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.design-areas-table {
  width: 100%;
  min-width: 760px;
}

.design-areas-table thead th {
  background: #f3f7fb;
}

.design-areas-table th:first-child,
.design-areas-table td:first-child {
  width: 78px;
}

.design-areas-table th:last-child,
.design-areas-table td:last-child {
  width: 110px;
}

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

.legacy-image-card {
  border: 1px dashed #b9cbe0;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  overflow-wrap: anywhere;
}

.legacy-image-card span {
  color: var(--muted);
  font-weight: 700;
}

.legacy-image-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.design-image-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
}

.compact-table {
  font-size: 12px;
}

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

.location-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 8px 10px;
  border-radius: 4px;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.note-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.note-metrics article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fbfe;
}

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

.note-metrics strong {
  display: block;
  color: var(--blue-dark);
  font-size: 20px;
  line-height: 1.1;
}

.note-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 1.6fr);
  gap: 12px;
}

.note-document-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(560px, 1.55fr);
  gap: 12px;
}

.note-document-card > .wide {
  min-width: 0;
}

.material-rmop-document-meta {
  display: grid;
  gap: 8px;
  margin: 6px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.material-rmop-document-meta strong {
  color: var(--ink);
}

.material-rmop-document-op {
  color: var(--muted);
}

.material-rmop-document-meta-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 8px 28px;
}

.material-rmop-document-meta-columns > div {
  display: grid;
  gap: 6px;
}

@media (max-width: 720px) {
  .material-rmop-document-meta-columns {
    grid-template-columns: 1fr;
  }
}

.material-rmop-document-card {
  display: grid;
  gap: 12px;
}

.material-rmop-visible-requirements {
  min-width: 0;
}

.material-rmop-requirement-counts {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 12px;
}

.material-rmop-visible-matrix-wrap {
  max-height: min(62vh, 680px);
  overflow: auto;
}

.material-rmop-visible-matrix-table {
  min-width: 1480px;
}

.material-rmop-visible-matrix-table th,
.material-rmop-visible-matrix-table td {
  vertical-align: top;
}

.material-rmop-visible-matrix-table .material-alert {
  display: inline-block;
  margin: 0;
}

.material-rmop-visible-matrix-table tr.rmop-requirement-blocked td {
  background: #fff7f4;
}

@media (max-width: 720px) {
  .material-rmop-requirement-counts {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

.material-rmop-clean-panel {
  display: block;
}

.material-rmop-matrix-table {
  min-width: 1580px;
  table-layout: fixed;
}

.material-rmop-matrix-table th:first-child,
.material-rmop-matrix-table td:first-child {
  min-width: 48px;
}

.material-rmop-matrix-table th:nth-child(2),
.material-rmop-matrix-table td:nth-child(2) {
  width: 94px;
  min-width: 94px;
  max-width: 94px;
}

.material-rmop-matrix-table th:nth-child(3),
.material-rmop-matrix-table td:nth-child(3) {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
}

.material-rmop-matrix-table th:nth-child(4),
.material-rmop-matrix-table td:nth-child(4) {
  min-width: 76px;
}

.material-rmop-matrix-table th:nth-last-child(2),
.material-rmop-matrix-table td:nth-last-child(2) {
  min-width: 128px;
}

.material-rmop-matrix-table th:last-child,
.material-rmop-matrix-table td:last-child {
  min-width: 116px;
}

.material-rmop-matrix-table .series-col {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}

.material-rmop-matrix-table .total-col,
.material-rmop-matrix-table .issue-col {
  min-width: 112px;
}

.material-rmop-issue-input {
  box-sizing: border-box;
  width: 76px;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.material-rmop-total-input {
  background: #eef6ff;
  cursor: pointer;
}

.material-rmop-total-input:hover,
.material-rmop-total-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(31, 111, 178, 0.12);
}

.rmop-editable-matrix {
  min-width: 1420px;
}

.rmop-editable-matrix th,
.rmop-editable-matrix td {
  vertical-align: top;
}

.rmop-editable-matrix .series-col {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.rmop-editable-matrix .total-col {
  width: 116px;
  min-width: 116px;
}

.rmop-edit-row td {
  background: #f3f8ff;
}

.rmop-matrix-live-summary,
.rmop-distribution-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.rmop-matrix-line-editor,
.rmop-matrix-resolution,
.rmop-matrix-quantity {
  display: grid;
  gap: 5px;
}

.rmop-matrix-line-editor {
  min-width: 190px;
  padding: 7px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #fff;
}

.rmop-matrix-line-editor + .rmop-matrix-line-editor {
  margin-top: 8px;
}

.rmop-matrix-resolution > span,
.rmop-matrix-quantity > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.rmop-matrix-resolution select,
.rmop-matrix-quantity input {
  width: 100%;
  min-width: 0;
}

.rmop-matrix-line-warning {
  color: var(--muted);
  line-height: 1.35;
}

.rmop-distribution-group {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.rmop-distribution-group h4 {
  margin: 0;
}

.rmop-distribution-series {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding-left: 20px;
}

.rmop-warehouse-rows {
  display: grid;
  gap: 8px;
}

.rmop-warehouse-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(130px, 0.6fr) minmax(210px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #f8fbff;
}

.rmop-warehouse-row label {
  display: grid;
  gap: 4px;
}

.rmop-warehouse-row [data-rmop-warehouse-available] {
  align-self: center;
}

.rmop-distribution-global-warning {
  margin: 12px 0;
}

@media (max-width: 820px) {
  .rmop-warehouse-row {
    grid-template-columns: 1fr;
  }
}

.rmop-delivered-button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--text);
  text-align: right;
  cursor: pointer;
  font-family: inherit;
}

.rmop-delivered-button:hover,
.rmop-delivered-button:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(31, 111, 178, 0.12);
}

.rmop-delivered-button strong {
  color: var(--blue-dark);
  font-size: 14px;
}

.rmop-delivered-button small,
.rmop-delivered-button span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.rmop-delivery-preview-modal {
  width: min(1120px, calc(100vw - 48px));
}

.material-rmop-delivery-meta,
.rmop-delivery-defaults {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 18px;
  margin: 12px 0;
}

.material-rmop-delivery-meta > div {
  display: grid;
  gap: 5px;
}

.material-rmop-delivery-meta span {
  color: var(--muted);
}

.material-rmop-delivery-meta strong {
  color: var(--ink);
}

.rmop-delivery-defaults {
  align-items: end;
}

.rmop-delivery-defaults .checkline {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.rmop-delivery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 10px;
  border-bottom: 1px solid var(--line);
}

.rmop-delivery-tabs button {
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
  color: var(--muted);
  min-height: 34px;
  padding: 7px 12px;
  font-weight: 800;
}

.rmop-delivery-tabs button.active {
  background: #fff;
  color: var(--blue-dark);
  border-color: var(--blue);
  border-bottom-color: #fff;
}

.rmop-delivery-tab-panel {
  display: none;
}

.rmop-delivery-tab-panel.active {
  display: block;
}

.note-side-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 12px;
}

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

.subpanel h3 {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 15px;
}

.kv-grid {
  display: grid;
  gap: 8px;
}

.kv-grid p,
.note-observation {
  margin: 0;
  line-height: 1.45;
}

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

.note-edit-form {
  display: grid;
  gap: 12px;
}

.note-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.note-edit-grid .wide-field {
  grid-column: 1 / -1;
}

.note-edit-grid textarea {
  resize: vertical;
}

.add-series-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.add-series-form label {
  flex: 1;
  max-width: 320px;
}

.inline-delete-form {
  margin: 0;
}

.status-change-form {
  display: grid;
  gap: 10px;
}

.status-change-form textarea {
  resize: vertical;
}

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

.status-history-list article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #f8fbfe;
}

.status-history-list strong,
.status-history-list span {
  display: block;
}

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

.status-history-list p,
.compact-empty {
  margin: 6px 0 0;
}

.print-body {
  margin: 0;
  background: #d7dce3;
  color: #172335;
  font-family: Arial, sans-serif;
}

.print-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
}

.print-page {
  width: 190mm;
  min-height: 270mm;
  margin: 12px auto;
  padding: 16mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.22);
}

.print-page.compact-print {
  width: 153mm;
  min-height: 204mm;
  padding: 8mm;
}

.print-page.quotation-commercial-print {
  width: var(--quotation-page-width, 190mm);
  min-height: var(--quotation-page-height, 270mm);
  padding: 6mm 0 calc(var(--quotation-footer-space, 24mm) + 10mm);
  overflow: hidden;
}

.print-page.quotation-commercial-print.has-page-background.paper-Letter {
  width: 216mm;
  min-height: 279mm;
}

.print-page.quotation-commercial-print.has-page-background.paper-A4 {
  width: 210mm;
  min-height: 297mm;
}

.print-page.quotation-commercial-print.has-page-background.paper-medio_oficio_2 {
  width: 165mm;
  min-height: 216mm;
}

@media print {
  body.print-body .print-page.quotation-commercial-print {
    width: var(--quotation-page-width, 216mm);
    min-height: var(--quotation-page-height, 279mm);
    padding: 10mm 0 calc(var(--quotation-footer-space, 24mm) + 12mm);
    overflow: visible;
    margin: 0;
  }

  body.print-body .print-page.quotation-commercial-print.has-page-background {
    padding-top: 0;
  }
}

@media print {
  body.print-body .quotation-commercial-print {
    padding-top: var(--quotation-header-space, 42mm) !important;
    padding-bottom: calc(var(--quotation-footer-space, 24mm) + 12mm) !important;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  body.print-body .quotation-commercial-print.has-page-background {
    padding-top: var(--quotation-header-space, 42mm) !important;
  }

  body.print-body .quotation-letterhead {
    margin-top: calc(-1 * var(--quotation-header-space, 42mm));
  }
}

.print-header {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.1fr;
  gap: 14px;
  align-items: start;
  border-bottom: 1px solid #d7e0eb;
  padding-bottom: 14px;
}

.print-brand {
  display: grid;
  gap: 8px;
  color: var(--blue-dark);
  font-size: 12px;
}

.print-logo {
  max-width: 145px;
  max-height: 70px;
  object-fit: contain;
}

.print-title {
  text-align: center;
}

.print-title h1 {
  margin: 28px 0 8px;
  color: var(--blue-dark);
  font-size: 22px;
  letter-spacing: 0;
}

.print-title span {
  color: #b42318;
  font-size: 17px;
  font-weight: 800;
}

.print-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  margin: 0;
  font-size: 11px;
}

.print-meta dt {
  font-weight: 800;
}

.print-meta dd {
  margin: 0;
}

.print-note-details {
  margin: 16px 0;
  font-size: 12px;
}

.print-note-details p {
  margin: 6px 0;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.print-table th,
.print-table td {
  border: 1px solid #c9d5e3;
  padding: 7px 8px;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.print-table th {
  color: var(--blue-dark);
  background: #eef4fa;
}

.print-table span {
  color: var(--muted);
}

.delivery-note-print .print-header {
  grid-template-columns: 0.95fr 0.8fr 1fr;
  gap: 8px;
  padding-bottom: 8px;
}

.delivery-note-print .print-logo {
  max-width: 98px;
  max-height: 42px;
}

.delivery-note-print .print-title h1 {
  margin: 14px 0 6px;
  font-size: 19px;
  line-height: 1.12;
}

.delivery-note-print .print-title span {
  font-size: 15px;
}

.delivery-note-print .print-meta {
  font-size: 9px;
  gap: 3px 6px;
}

.delivery-note-print .print-note-details {
  margin: 10px 0;
  font-size: 10px;
}

.delivery-print-table {
  font-size: 8.5px;
}

.delivery-print-table th,
.delivery-print-table td {
  padding: 4px 5px;
}

.delivery-note-print .signature-grid {
  gap: 18px;
  margin-top: 30px;
  font-size: 9px;
}

.delivery-note-print .print-footer {
  margin-top: 34px;
  font-size: 8px;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 42px;
  font-size: 11px;
}

.signature-grid div {
  border-top: 1px solid #27364a;
  padding-top: 8px;
  min-height: 34px;
}

.print-footer {
  border-top: 1px solid #d7e0eb;
  margin-top: 48px;
  padding-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

.design-edit-form {
  margin: 0;
}

.compact-kpis article {
  padding: 10px;
}

.compact-kpis strong {
  font-size: 18px;
}

.tabbed-editor > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 16px;
}

.tab-nav label {
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-weight: 700;
  background: transparent;
}

#tab-general:checked ~ .tab-nav label[for="tab-general"],
#tab-medidas:checked ~ .tab-nav label[for="tab-medidas"],
#tab-operacion:checked ~ .tab-nav label[for="tab-operacion"],
#tab-imagenes:checked ~ .tab-nav label[for="tab-imagenes"],
#tab-tecnicos:checked ~ .tab-nav label[for="tab-tecnicos"],
#tab-bom:checked ~ .tab-nav label[for="tab-bom"],
#new-tab-general:checked ~ .tab-nav label[for="new-tab-general"],
#new-tab-medidas:checked ~ .tab-nav label[for="new-tab-medidas"],
#new-tab-operacion:checked ~ .tab-nav label[for="new-tab-operacion"],
#new-tab-imagenes:checked ~ .tab-nav label[for="new-tab-imagenes"],
#new-tab-bom:checked ~ .tab-nav label[for="new-tab-bom"] {
  color: var(--blue-dark);
  border-color: var(--line);
  background: #f8fbfe;
}

.tab-panel {
  display: none;
  min-height: 360px;
}

#tab-general:checked ~ .panel-general,
#tab-medidas:checked ~ .panel-medidas,
#tab-operacion:checked ~ .panel-operacion,
#tab-imagenes:checked ~ .panel-imagenes,
#tab-tecnicos:checked ~ .panel-tecnicos,
#tab-bom:checked ~ .panel-bom,
#new-tab-general:checked ~ .new-panel-general,
#new-tab-medidas:checked ~ .new-panel-medidas,
#new-tab-operacion:checked ~ .new-panel-operacion,
#new-tab-imagenes:checked ~ .new-panel-imagenes,
#new-tab-bom:checked ~ .new-panel-bom {
  display: block;
}

.tab-panel h3 {
  color: var(--blue-dark);
  margin: 16px 0 10px;
}

.technical-file-upload {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
  padding: 12px;
  margin-bottom: 14px;
}

.technical-file-upload h3 {
  margin-top: 0;
}

.design-files-table .pill {
  white-space: nowrap;
}

.technical-file-thumb {
  display: block;
  width: 120px;
  height: 84px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfe;
  margin-bottom: 6px;
}

.color-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.color-preview-card {
  padding: 12px;
  border: 1px dashed #9ec2e6;
  border-radius: 6px;
  background: #f8fbfe;
}

.pill.blue {
  background: #eaf4ff;
  color: #0b5fa5;
}

.pill.gray {
  background: #eef2f6;
  color: #586576;
}

.design-color-material-link-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.design-color-material-link-form > .wide {
  grid-column: 1 / -1;
}

.design-color-material-picker .material-master-picker-menu {
  width: min(560px, calc(100vw - 64px));
  min-width: 100%;
  max-width: min(560px, calc(100vw - 64px));
}

.design-color-material-picker .sales-quote-picker-options {
  max-height: min(320px, calc(100vh - 260px));
}

.design-color-material-picker .sales-quote-picker-options button {
  overflow-wrap: break-word;
  word-break: normal;
}

.design-color-picker-search-label {
  padding: 7px 8px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.design-color-link-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cfe0ef;
  border-radius: 7px;
  background: #f7fbff;
}

.design-color-link-status > span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.design-color-custom-order-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #9ec2e6;
  border-radius: 8px;
  background: #f4f9ff;
}

.design-color-custom-order-card h3 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}

.design-color-custom-order-card p:last-of-type {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .design-color-material-link-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .design-color-material-link-form > label:nth-of-type(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .design-color-material-link-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .design-color-material-link-form > label:nth-of-type(3) {
    grid-column: auto;
  }

  .design-color-material-picker .material-master-picker-menu {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .design-color-link-status {
    grid-template-columns: minmax(0, 1fr);
  }

  .design-color-link-status > span:last-child {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  #design-color-detail .modal-panel {
    width: calc(100vw - 16px);
    margin: 8px auto;
    padding: 12px;
  }
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.check-row input {
  width: auto;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.areas-table {
  max-height: 430px;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    max-width: 100%;
    padding: 12px;
    overflow: hidden;
  }

  .sidebar .brand {
    margin-bottom: 8px;
  }

  .sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .sidebar nav .nav-label {
    display: none;
  }

  .sidebar nav a {
    flex: 0 0 auto;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .main {
    margin-left: 0;
    padding: 16px;
  }

  .metrics,
  .workflow,
  .module-grid,
  .form-grid,
  .material-new-layout,
  .material-new-two-column,
  .material-new-base-board,
  .material-new-core-grid,
  .material-new-option-row,
  .material-new-identity-grid,
  .material-new-inline-field,
  .material-new-checks,
  .material-edit-image-form,
  .material-edit-check-grid,
  .material-edit-format-settings,
  .material-searchbar,
  .advanced-filters,
  .security-layout,
  .compact-form,
  .permission-editor-toolbar,
  .permission-module-head {
    grid-template-columns: 1fr;
  }

  .material-detail-head-main {
    align-items: flex-start;
  }

  .permission-filter-tabs,
  .permission-module-counts {
    justify-content: flex-start;
  }

  .print-settings-editor,
  .print-settings-editor .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .print-live-preview {
    position: static;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .branding-upload-grid,
  .branding-upload-card {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 250px;
  }

  .wide {
    grid-column: auto;
  }

  .stock-summary,
  .material-quick-profile,
  .material-detail-sections,
  .design-kpis,
  .design-detail-grid,
  .design-bom-facts,
  .design-recipe-price-form-grid,
  .legacy-image-grid,
  .client-detail-grid,
  .note-detail-grid,
  .note-document-card,
  .note-side-grid,
  .note-metrics {
    grid-template-columns: 1fr;
  }

  .detail-section-wide {
    grid-column: auto;
  }

  .material-detail-section-wide {
    grid-column: auto;
  }

  .bom-mini-item {
    grid-template-columns: 1fr;
  }

  .bom-nav,
  .bom-tool-strip,
  .bom-status-strip,
  .table-actions-inline {
    align-items: stretch;
  }

  .bom-nav a,
  .bom-tool-strip a,
  .table-actions-inline .button-link {
    justify-content: center;
  }

  .bom-catalog-table table {
    min-width: 980px;
  }

  .bom-detail-grid,
  .custom-series-detail-grid,
  .bom-area-card-head {
    grid-template-columns: 1fr;
  }

  .bom-area-card-head {
    display: grid;
  }

  .tab-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .sales-order-detail-hero,
  .sales-order-summary-grid,
  .sales-order-ficha-columns,
  .sales-order-detail-list,
  .sales-quote-documents-grid {
    grid-template-columns: 1fr;
  }

  .sales-order-ficha-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .sales-order-amount-box {
    justify-items: start;
  }

  .sales-order-amount-box strong {
    text-align: left;
  }

  .sales-order-detail-list .wide {
    grid-column: auto;
  }

  .sales-order-actionbar {
    justify-content: flex-start;
  }
}

.sales-price-panel .section-head {
  align-items: flex-start;
}

.sales-price-searchbar {
  grid-template-columns: minmax(280px, 1fr) repeat(4, minmax(120px, 160px)) auto auto;
}

.sales-price-table {
  min-width: 1280px;
}

.sales-price-table th,
.sales-price-table td {
  text-align: center;
  vertical-align: middle;
}

.sales-price-table th:nth-child(4),
.sales-price-table td:nth-child(4) {
  min-width: 260px;
  text-align: left;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 800;
}

.stock-pill.in-stock {
  background: #d7f4e6;
  color: #11693f;
}

.stock-pill.no-stock {
  background: #eef2f6;
  color: #637083;
}

.price-thumb {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.price-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(8, 18, 28, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.loading-overlay.is-visible {
  display: grid;
}

.loading-card {
  width: min(420px, calc(100vw - 40px));
  padding: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  color: #fff;
}

.loading-mark {
  display: inline-grid;
  place-items: center;
  min-width: var(--loading-logo-size, 132px);
  min-height: var(--loading-logo-size, 132px);
  margin-bottom: 24px;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  perspective: 820px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
}

.loading-mark img {
  max-width: var(--loading-logo-size, 132px);
  max-height: var(--loading-logo-size, 132px);
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.38));
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: visible;
}

.loading-effect-flip_3d .loading-mark img {
  animation: loading-logo-flip 2.9s linear infinite;
}

.loading-effect-focus .loading-mark img {
  animation: loading-logo-focus 3s ease-in-out infinite;
}

.loading-effect-aura .loading-mark img {
  animation: loading-logo-aura 2.8s ease-in-out infinite;
}

.loading-effect-flip_3d .loading-mark span {
  animation: loading-brand-flip 2.9s linear infinite;
}

.loading-effect-focus .loading-mark span {
  animation: loading-brand-focus 3s ease-in-out infinite;
}

.loading-effect-aura .loading-mark span {
  animation: loading-brand-aura 2.8s ease-in-out infinite;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 18px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  animation: loading-spin 1.15s linear infinite;
  opacity: 0.42;
}

.loading-card h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.34);
}

.loading-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

body.loading-active {
  cursor: progress;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-logo-flip {
  to {
    transform: rotateY(360deg);
  }
}

@keyframes loading-logo-focus {
  0%,
  100% {
    filter: blur(1.2px) brightness(0.86) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.3));
    opacity: 0.74;
    transform: scale(0.96);
  }

  50% {
    filter: blur(0) brightness(1.16) drop-shadow(0 16px 34px rgba(255, 255, 255, 0.22));
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes loading-logo-aura {
  0%,
  100% {
    filter: brightness(0.92) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.32));
    transform: translateY(0) scale(0.98);
  }

  50% {
    filter: brightness(1.2) drop-shadow(0 18px 34px rgba(255, 255, 255, 0.28));
    transform: translateY(-5px) scale(1.05);
  }
}

@keyframes loading-brand-flip {
  to {
    transform: rotateY(360deg);
  }
}

@keyframes loading-brand-focus {
  0%,
  100% {
    filter: blur(1px);
    opacity: 0.72;
    transform: scale(0.96);
  }

  50% {
    filter: blur(0);
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes loading-brand-aura {
  0%,
  100% {
    opacity: 0.82;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
    transform: translateY(0) scale(0.98);
  }

  50% {
    opacity: 1;
    text-shadow: 0 0 28px rgba(255, 255, 255, 0.38), 0 2px 14px rgba(0, 0, 0, 0.36);
    transform: translateY(-4px) scale(1.04);
  }
}

@media print {
  .sales-price-panel {
    page-break-after: auto;
  }

  .sales-price-table {
    min-width: 0;
  }

  .sales-price-table th,
  .sales-price-table td {
    padding: 5px;
    font-size: 9px;
  }
}

.production-game-detail-panel {
  overflow: hidden;
}

.production-game-legacy-card {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 32px;
  padding: 18px 0 8px;
}

.production-game-media img,
.production-game-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f4f7fa;
}

.production-game-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.production-game-watermark {
  display: block;
  margin: 14px 0 26px;
  text-align: right;
  color: #c3cbd6;
  font-size: 20px;
}

.production-game-prepared-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  align-items: center;
  margin-bottom: 18px;
}

.production-game-prepared-control span {
  background: #eef2f5;
  border: 1px solid var(--border);
  border-right: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.production-game-switches {
  display: grid;
  gap: 16px;
  text-transform: uppercase;
  font-size: 12px;
  color: #334155;
}

.production-game-toggle {
  display: block;
  width: 40px;
  height: 22px;
  margin-top: 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 2px;
}

.production-game-toggle span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d1d5db;
  transition: transform .15s ease;
}

.production-game-toggle.on {
  background: #d8f5eb;
  border-color: #66cbb2;
}

.production-game-toggle.on span {
  transform: translateX(16px);
  background: #31b99b;
}

.production-game-info h3 {
  margin: 4px 0 2px;
  font-size: 21px;
  letter-spacing: 0;
}

.production-game-code-line {
  font-size: 18px;
}

.production-game-stars {
  margin: 8px 0;
  color: #f59e0b;
  letter-spacing: 2px;
}

.production-game-stars span {
  color: #cbd5e1;
}

.production-game-price {
  margin: 8px 0 18px;
  font-size: 26px;
}

.production-game-set {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  color: #64748b;
  line-height: 1.6;
}

.production-game-form-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.production-game-form-grid > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 5px 0;
}

.production-game-form-grid label,
.production-game-observations h4 {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
  margin: 0;
}

.production-game-form-grid input,
.production-game-observations textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  background: #fff;
}

.production-game-observations {
  margin: 18px 0;
}

.production-game-observations textarea {
  min-height: 74px;
  resize: vertical;
}

.production-game-kpis {
  margin: 22px 0;
}

.production-game-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0 12px;
  background: #eef3f8;
  color: #475569;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  font-size: 12px;
}

.production-game-tabs span {
  padding: 14px 10px;
}

.production-game-tabs .active {
  color: #0f766e;
}

.production-game-section {
  margin-top: 12px;
}

.compact-table .text-right {
  text-align: right;
}

.compact-table .text-center {
  text-align: center;
}

@media (max-width: 900px) {
  .production-game-legacy-card {
    grid-template-columns: 1fr;
  }

  .production-game-form-grid > div {
    grid-template-columns: 1fr;
  }
}

.production-area-control-table {
  min-width: 1420px;
}

.production-area-control-table td {
  max-width: 240px;
}
.production-area-control-area-picker {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  position: relative;
  z-index: 3;
}

.production-area-control-area-picker details {
  position: relative;
}

.production-area-control-area-picker summary {
  cursor: pointer;
  list-style: none;
}

.production-area-control-area-picker summary::-webkit-details-marker {
  display: none;
}

.production-area-control-area-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  min-width: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.production-area-control-area-menu a {
  padding: 7px 9px;
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
}

.production-area-control-area-menu a:hover,
.production-area-control-area-menu a.active {
  background: #eef6ff;
  color: var(--blue-dark);
}

.production-area-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.production-area-control-check {
  width: 36px;
  text-align: center;
}

.production-area-control-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.production-area-control-row-action button {
  min-width: 84px;
  opacity: 0.72;
}

.production-area-control-legacy-modal .compact-table th {
  width: 170px;
}

@media (max-width: 760px) {
  .material-movement-filters {
    grid-template-columns: 1fr;
  }

  .material-movement-filters > label,
  .material-movement-filters > button,
  .material-movement-filters > .button-link {
    width: 100%;
    min-width: 0;
  }

  .material-stock-source {
    padding: 10px;
  }

  .material-stock-source > .section-head,
  .material-movement-detail > .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .material-receipt-confirm-line .material-detail-definition-list {
    grid-template-columns: 1fr;
  }
}

/* MAT-UX-C1: componentes de auditoria visual acotados al modulo Materiales. */
.material-detail-definition-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.material-detail-definition-list > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
}

.material-detail-definition-list dt,
.material-detail-definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.material-detail-definition-list dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.material-rmop-source-audit {
  min-width: 0;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.material-rmop-source-audit > summary {
  padding: 13px 15px;
  cursor: pointer;
  font-weight: 800;
}

.material-rmop-source-audit-content {
  padding: 0 15px 15px;
}

.material-action-help {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

button.is-disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

button.is-disabled {
  pointer-events: none;
}

.material-physical-surface,
.material-variable-contract,
.material-conciliation-contract {
  min-width: 0;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.material-variable-contract ul {
  margin: 8px 0;
  padding-left: 22px;
}

.material-physical-historical {
  background: #fffaf0;
}

.material-rmop-source-audit-wrap,
.material-transfer-detail-wrap,
.material-lots-reference-table,
.material-history-reference-table {
  max-width: 100%;
}

.material-rmop-source-audit-table {
  min-width: 1120px;
}

.material-transfer-detail-table {
  min-width: 760px;
}

.material-delivery-scope-tabs,
.material-config-tabs {
  margin: 0 0 14px;
  max-width: 100%;
  overflow-x: auto;
}

.material-delivery-scope-tabs a,
.material-config-tabs a {
  white-space: nowrap;
}

.material-config-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.material-config-overview .material-config-card {
  margin: 0;
}

.material-transfer-list-summary {
  flex-wrap: wrap;
}

/* MAT-TRA-C2: documento multilínea y autorizaciones por almacén. */
.mat-tra-create,
.mat-tra-form,
.mat-tra-picker,
.mat-tra-lines,
.mat-tra-search-panel,
.mat-tra-review-panel,
.user-material-locations {
  min-width: 0;
  max-width: 100%;
}

.mat-tra-header-grid {
  align-items: start;
}

.mat-tra-picker,
.mat-tra-lines,
.user-material-locations {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.user-material-locations {
  grid-column: 1 / -1;
}

.user-material-locations legend {
  padding: 0 8px;
  font-weight: 700;
}

.user-material-locations-table {
  min-width: 760px;
}

.user-material-locations-table th:not(:first-child),
.user-material-locations-table td:not(:first-child) {
  text-align: center;
}

.user-material-locations-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0 auto;
}

.mat-tra-search-panel {
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
}

.mat-tra-search-results {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 10px 0;
  overflow: auto;
}

.mat-tra-search-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.mat-tra-search-option:hover,
.mat-tra-search-option:focus-visible {
  border-color: var(--primary);
  outline: 3px solid color-mix(in srgb, var(--primary) 20%, transparent);
}

.mat-tra-lines-table {
  min-width: 820px;
}

.mat-tra-lines-table td {
  vertical-align: top;
}

.mat-tra-quantity-label {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.mat-tra-quantity-label input[readonly] {
  background: #eef2f7;
  cursor: not-allowed;
}

.mat-tra-actions {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mat-tra-review-panel ol {
  display: grid;
  gap: 7px;
  max-height: 42vh;
  overflow: auto;
}

.mat-tra-review-totals {
  padding: 10px;
  border-radius: 8px;
  background: #eef6ff;
  font-weight: 700;
}

.material-variable-resolution-view .actions-cell,
.actions-cell .button-link,
.actions-cell button {
  max-width: 100%;
}

@media (max-width: 700px) {
  .material-detail-definition-list,
  .material-config-overview {
    grid-template-columns: 1fr;
  }

  .material-rmop-requirement-counts {
    grid-template-columns: 1fr;
  }

  .mat-tra-picker,
  .mat-tra-lines,
  .user-material-locations {
    padding: 10px;
  }

  .mat-tra-lines .table-wrap {
    overflow: visible;
  }

  .mat-tra-lines-table,
  .mat-tra-lines-table tbody,
  .mat-tra-lines-table tr,
  .mat-tra-lines-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .mat-tra-lines-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .mat-tra-lines-table tr {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .mat-tra-lines-table td {
    padding: 7px 0;
    border: 0;
  }

  .mat-tra-actions > * {
    width: 100%;
  }
}

/* RMM-ABAS-C1: la recepción física debe conservar todo el ancho útil en móvil. */
@media (max-width: 980px) {
  body,
  .sidebar,
  .main,
  .panel,
  .material-receipt-create-card,
  .material-receipt-create-form,
  .material-receipt-lines-section,
  .material-receipt-line-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar,
  .main,
  .panel {
    display: block;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .panel {
    overflow-x: hidden;
  }

  .material-view-tabs,
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 12px;
  }

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

  .topbar > *,
  .userbox {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .panel,
  .material-receipt-create-form {
    padding: 12px;
  }
}
/* VEN-ACC-ESP-C1: extensiones acotadas de Lista, Cotizaciones, Pedidos y Materiales. */
.sales-price-sections { margin: 0 0 1rem; }
.sales-accessory-price-filters { margin-bottom: .75rem; }
.sales-accessory-price-table { table-layout: auto; width: 100%; }
.sales-accessory-price-table.has-actions th:last-child,
.sales-accessory-price-table.has-actions td:last-child { min-width: 190px; white-space: nowrap; text-align: right; }
.sales-accessory-price-table .table-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: .45rem; }
.sales-accessory-modal { width: min(900px, calc(100vw - 2rem)); }
.sales-accessory-modal .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: .75rem;
}
.sales-accessory-modal .section-head { align-items: flex-start; }
.sales-accessory-modal .section-head > div { min-width: 0; }
.sales-accessory-modal .section-head .eyebrow { margin-bottom: .2rem; }
.sales-accessory-modal .section-head h3 { margin: 0; line-height: 1.2; }
.sales-accessory-modal .form-grid .wide { grid-column: 1 / -1; }
.sales-accessory-modal .form-grid label { min-width: 0; font-size: .82rem; }
.sales-accessory-modal .form-grid input,
.sales-accessory-modal .form-grid select { min-width: 0; }
.sales-accessory-history { margin-top: 1rem; }
.sales-quote-accessories-row > td { padding: 0 .65rem .7rem; background: color-mix(in srgb, var(--panel, #fff) 88%, #e9f2ff); }
.sales-quote-accessories-row-empty > td { height: 0; padding: 0 !important; border: 0; line-height: 0; font-size: 0; }
.sales-quote-accessories { border: 1px solid rgba(37, 99, 235, .16); border-radius: .65rem; padding: .65rem; }
.sales-quote-accessory-indicator { min-width: 2.15rem; padding-inline: .35rem; font-weight: 700; color: #075985; }
.sales-quote-accessories .section-head { margin-bottom: .45rem; }
.sales-quote-accessory-list { display: grid; gap: .4rem; }
.sales-quote-accessory-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .5rem .6rem; border: 1px solid rgba(15, 23, 42, .09); border-radius: .5rem; background: var(--panel, #fff); }
.sales-quote-accessory-list article > div:first-child,
.sales-quote-accessory-amount { display: grid; gap: .12rem; min-width: 0; }
.sales-quote-accessory-amount { text-align: right; white-space: nowrap; }
.sales-quote-accessory-total-row th,
.sales-quote-accessory-total-row td { background: rgba(37, 99, 235, .07); }
.quotation-accessory-line td { background: #f7f9fc; font-size: .92em; }
.sales-order-accessories { display: grid; gap: .85rem; }
.sales-order-accessory-card,
.material-sales-accessory-card { border: 1px solid rgba(15, 23, 42, .12); border-radius: .75rem; padding: .85rem; background: var(--panel, #fff); }
.sales-order-accessory-card > header,
.material-sales-accessory-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.sales-order-accessory-card h4,
.material-sales-accessory-card h3 { margin: .1rem 0; }
.sales-order-accessory-formula { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .75rem; padding: .65rem .75rem; border: 1px solid #bfdbfe; border-radius: .55rem; background: #eff6ff; color: #0f3f70; }
.sales-order-accessory-formula span { color: #64748b; font-weight: 700; }
.sales-order-accessory-kpis { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: .5rem; margin: .75rem 0; }
.sales-order-accessory-kpis > div { display: grid; gap: .15rem; padding: .55rem; border-radius: .5rem; background: rgba(15, 23, 42, .045); }
.sales-order-accessory-kpis span { color: var(--muted, #64748b); font-size: .78rem; }
.sales-order-accessory-destination { margin: .35rem 0 .1rem; }
.sales-order-accessory-pending-target { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(160px, auto); gap: .75rem; align-items: center; margin-top: .7rem; padding: .65rem .75rem; border: 1px solid #bfdbfe; border-radius: .55rem; background: #eff6ff; }
.sales-order-accessory-pending-target > div,
.sales-order-accessory-assignments td:first-child { display: grid; gap: .12rem; }
.sales-order-accessory-pending-target span,
.sales-order-accessory-pending-target small,
.sales-order-accessory-assignments small { color: var(--muted, #64748b); font-size: .78rem; }
.sales-order-accessory-no-series { margin: .65rem 0 0; }
.sales-order-accessory-assign-form,
.material-sales-accessory-reserve-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(130px, .35fr) auto; gap: .6rem; align-items: end; margin-top: .65rem; }
.sales-order-accessory-assign-form label { display: grid; gap: .25rem; }
.sales-order-accessory-assign-form label small { color: var(--muted, #64748b); font-size: .78rem; }
.material-sales-accessory-card { margin-bottom: .85rem; }
.material-sales-accessory-assignment { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.5fr); gap: .75rem; align-items: end; padding: .65rem 0; border-top: 1px solid rgba(15, 23, 42, .1); }
.material-sales-accessory-assignment > div:first-child { display: grid; gap: .16rem; }
.material-accessory-sale-price { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

@media (max-width: 1024px) {
  .sales-order-accessory-kpis { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .material-sales-accessory-assignment { grid-template-columns: 1fr; }
  .sales-accessory-price-table.has-actions th:last-child,
  .sales-accessory-price-table.has-actions td:last-child { min-width: 150px; }
  .sales-accessory-price-table .table-actions { flex-direction: column; align-items: stretch; }
}

@media (max-width: 768px) {
  .sales-quote-accessory-list article { grid-template-columns: 1fr; }
  .sales-quote-accessory-amount { text-align: left; }
  .sales-order-accessory-kpis { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .sales-order-accessory-assign-form,
  .material-sales-accessory-reserve-form { grid-template-columns: 1fr; }
  .sales-order-accessory-pending-target { grid-template-columns: 1fr; }
  .sales-order-accessory-card > header,
  .material-sales-accessory-card > header { flex-direction: column; }
}

@media (max-width: 480px) {
  .sales-order-accessory-kpis { grid-template-columns: 1fr 1fr; }
  .sales-price-sections { overflow-x: auto; white-space: nowrap; }
  .sales-accessory-modal { width: calc(100vw - 1rem); }
}

/* VEN-ACC-ESP-UX-C2: consulta comercial y administración aislada en Diseños. */
.design-sections,
.accessory-detail-tabs {
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.sales-accessory-thumb {
  display: block;
  width: 58px;
  height: 46px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: .45rem;
  background: #f8fafc;
}

.sales-accessory-thumb.placeholder {
  display: grid;
  place-items: center;
  padding: .25rem;
  color: var(--muted, #64748b);
  font-size: .68rem;
  line-height: 1.1;
  text-align: center;
}

.sales-accessory-price-table,
.design-accessory-table {
  width: 100%;
  table-layout: auto;
}

.sales-accessory-price-table th,
.sales-accessory-price-table td,
.design-accessory-table th,
.design-accessory-table td {
  vertical-align: middle;
}

.sales-accessory-price-table td:nth-child(2),
.design-accessory-table td:nth-child(2) {
  min-width: 210px;
}

.sales-accessory-price-table.has-actions td:last-child,
.design-accessory-table td:last-child {
  min-width: 110px;
  white-space: nowrap;
  text-align: right;
}

.design-accessory-filters,
.sales-accessory-price-filters {
  align-items: end;
}

.accessory-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  min-width: 130px;
}

.accessory-name-cell {
  display: grid;
  gap: .12rem;
}

.accessory-detail-grid {
  display: grid;
  grid-template-columns: minmax(180px, .32fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.accessory-reference-card,
.accessory-reference-large {
  min-height: 170px;
  display: grid;
  align-content: start;
  gap: .75rem;
}

.accessory-reference-card .sales-accessory-thumb,
.accessory-reference-large .sales-accessory-thumb {
  width: min(100%, 360px);
  height: auto;
  min-height: 160px;
  max-height: 280px;
}

.accessory-operation-layout,
.accessory-compat-layout,
.accessory-visual-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 1rem;
  align-items: start;
}

.accessory-operation-layout .form-grid,
.accessory-compat-layout .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
}

.accessory-operation-layout > *,
.accessory-compat-layout > *,
.accessory-visual-layout > * {
  min-width: 0;
}

.accessory-operation-layout select,
.accessory-compat-layout select {
  min-width: 0;
  max-width: 100%;
}

.accessory-stat-grid {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.design-accessory-detail .subpanel {
  margin-top: 0;
}

.sales-accessory-print-table .sales-accessory-thumb {
  width: 34px;
  height: 28px;
}

@media (max-width: 1366px) {
  .design-accessory-filters,
  .sales-accessory-price-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
  .design-accessory-table-wrap,
  .sales-accessory-commercial-wrap {
    overflow-x: auto;
  }
  .design-accessory-table,
  .sales-accessory-price-table {
    min-width: 1180px;
  }
}

@media (max-width: 1024px) {
  .accessory-operation-layout,
  .accessory-compat-layout,
  .accessory-visual-layout {
    grid-template-columns: 1fr;
  }
  .design-accessory-filters,
  .sales-accessory-price-filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
  .accessory-operation-layout .form-grid,
  .accessory-compat-layout .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .accessory-detail-grid {
    grid-template-columns: 1fr;
  }
  .accessory-detail-tabs {
    white-space: nowrap;
  }
  .design-accessory-filters,
  .sales-accessory-price-filters {
    grid-template-columns: 1fr;
  }
  .accessory-operation-layout .form-grid,
  .accessory-compat-layout .form-grid {
    grid-template-columns: 1fr;
  }
  .accessory-operation-layout .form-grid .wide,
  .accessory-compat-layout .form-grid .wide {
    grid-column: auto;
  }
  .design-accessory-table-wrap,
  .sales-accessory-commercial-wrap {
    overflow: visible;
  }
  .design-accessory-table,
  .sales-accessory-price-table,
  .design-accessory-table tbody,
  .sales-accessory-price-table tbody,
  .design-accessory-table tr,
  .sales-accessory-price-table tr,
  .design-accessory-table td,
  .sales-accessory-price-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .design-accessory-table,
  .sales-accessory-price-table {
    min-width: 0;
  }
  .design-accessory-table thead,
  .sales-accessory-price-table thead {
    display: none;
  }
  .design-accessory-table tr,
  .sales-accessory-price-table tr {
    margin-bottom: .85rem;
    padding: .75rem;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: .7rem;
    background: var(--panel, #fff);
  }
  .design-accessory-table td,
  .sales-accessory-price-table td {
    display: grid;
    grid-template-columns: minmax(105px, .38fr) minmax(0, 1fr);
    gap: .6rem;
    padding: .35rem 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .design-accessory-table td::before,
  .sales-accessory-price-table td::before {
    color: var(--muted, #64748b);
    font-size: .75rem;
    font-weight: 700;
  }
  .design-accessory-table td:nth-child(1)::before,
  .sales-accessory-price-table td:nth-child(1)::before { content: "Imagen"; }
  .design-accessory-table td:nth-child(2)::before,
  .sales-accessory-price-table td:nth-child(2)::before { content: "Accesorio"; }
  .design-accessory-table td:nth-child(3)::before,
  .sales-accessory-price-table td:nth-child(3)::before { content: "Categoría"; }
  .design-accessory-table td:nth-child(4)::before,
  .sales-accessory-price-table td:nth-child(4)::before { content: "Unidad"; }
  .design-accessory-table td:nth-child(5)::before,
  .sales-accessory-price-table td:nth-child(5)::before { content: "Control"; }
  .design-accessory-table td:nth-child(6)::before { content: "Material"; }
  .design-accessory-table td:nth-child(7)::before { content: "Comercial"; }
  .design-accessory-table td:nth-child(8)::before { content: "Precio"; }
  .design-accessory-table td:nth-child(9)::before { content: "Diseños"; }
  .design-accessory-table td:nth-child(10)::before { content: "Alertas"; }
  .design-accessory-table td:nth-child(11)::before { content: "Acciones"; }
  .sales-accessory-price-table td:nth-child(6)::before { content: "Precio BOB"; }
  .sales-accessory-price-table td:nth-child(7)::before { content: "Precio USD"; }
  .sales-accessory-price-table td:nth-child(8)::before { content: "Vigencia"; }
  .sales-accessory-price-table td:nth-child(9)::before { content: "Diseños"; }
  .sales-accessory-price-table td:nth-child(10)::before { content: "Estado"; }
  .sales-accessory-price-table td:nth-child(11)::before { content: "Acciones"; }
  .design-accessory-table td:last-child,
  .sales-accessory-price-table.has-actions td:last-child {
    text-align: left;
  }
  .accessory-stat-grid {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }
}

@media (max-width: 420px) {
  .design-accessory-table td,
  .sales-accessory-price-table td {
    grid-template-columns: 92px minmax(0, 1fr);
  }
  .accessory-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* VEN-ACC-ESP-COMP-UX-H4: búsqueda múltiple y vinculación masiva. */
.accessory-compat-bulk form,
.accessory-design-picker {
  display: grid;
  gap: .85rem;
  min-width: 0;
}

.accessory-design-picker > label {
  display: grid;
  gap: .35rem;
  font-weight: 700;
}

.accessory-design-results {
  display: grid;
  gap: .4rem;
  max-height: 390px;
  padding: .4rem;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: .65rem;
  background: var(--panel, #fff);
}

.accessory-design-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: .7rem;
  align-items: center;
  min-width: 0;
  padding: .6rem .7rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  cursor: pointer;
}

.accessory-design-result:hover,
.accessory-design-result:focus-within {
  border-color: rgba(37, 99, 235, .38);
  background: rgba(37, 99, 235, .045);
}

.accessory-design-result[aria-selected="true"] {
  border-color: rgba(22, 163, 74, .42);
  background: rgba(22, 163, 74, .06);
}

.accessory-design-result.is-linked {
  cursor: not-allowed;
  opacity: .72;
  background: rgba(148, 163, 184, .09);
}

.accessory-design-result input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.accessory-design-result-main {
  display: grid;
  gap: .12rem;
  min-width: 0;
}

.accessory-design-result-main strong,
.accessory-design-result-main span,
.accessory-design-result-main small {
  overflow-wrap: anywhere;
}

.accessory-design-result-main small {
  color: var(--muted, #64748b);
}

.accessory-design-tray {
  display: grid;
  gap: .55rem;
  padding: .75rem;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: .65rem;
  background: rgba(248, 250, 252, .72);
}

.accessory-design-tray .section-head {
  margin: 0;
}

.accessory-design-tray h4 {
  margin: 0;
}

.accessory-design-tray ul {
  display: grid;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.accessory-design-tray li {
  display: flex;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: .42rem .5rem;
  border-radius: .45rem;
  background: var(--panel, #fff);
}

.accessory-design-tray li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.accessory-design-tray li button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.accessory-compat-common-fields {
  margin-top: .2rem;
}

.accessory-linked-design-table th:last-child,
.accessory-linked-design-table td:last-child {
  min-width: 160px;
  white-space: nowrap;
  text-align: right;
}

.danger-text {
  color: var(--danger, #b91c1c) !important;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .accessory-design-results {
    max-height: 340px;
  }
}

@media (max-width: 768px) {
  .accessory-design-result {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .accessory-design-result .pill:last-child {
    grid-column: 2 / -1;
    justify-self: start;
  }
  .accessory-linked-designs .table-scroll {
    overflow: visible;
  }
  .accessory-linked-design-table,
  .accessory-linked-design-table tbody,
  .accessory-linked-design-table tr,
  .accessory-linked-design-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .accessory-linked-design-table thead {
    display: none;
  }
  .accessory-linked-design-table tr {
    margin-bottom: .75rem;
    padding: .7rem;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: .65rem;
    background: var(--panel, #fff);
  }
  .accessory-linked-design-table td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: .55rem;
    padding: .3rem 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .accessory-linked-design-table td::before {
    color: var(--muted, #64748b);
    font-size: .75rem;
    font-weight: 700;
  }
  .accessory-linked-design-table td:nth-child(1)::before { content: "Diseño"; }
  .accessory-linked-design-table td:nth-child(2)::before { content: "Estado"; }
  .accessory-linked-design-table td:nth-child(3)::before { content: "Cantidad"; }
  .accessory-linked-design-table td:nth-child(4)::before { content: "Instalación"; }
  .accessory-linked-design-table td:nth-child(5)::before { content: "Actualizado"; }
  .accessory-linked-design-table td:nth-child(6)::before { content: "Acciones"; }
}

@media (max-width: 480px) {
  .accessory-design-result {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .accessory-design-result .pill {
    grid-column: 2;
    justify-self: start;
  }
  .accessory-design-tray .section-head,
  .accessory-design-tray li {
    align-items: stretch;
    flex-direction: column;
  }
  .accessory-design-tray button,
  .accessory-compat-bulk > form > button {
    width: 100%;
  }
  .accessory-linked-design-table td {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}

/* VEN-ACC-ESP-COMP-UX-H5: selector buscable múltiple compacto. */
.accessory-design-picker.sales-quote-picker {
  position: relative;
  width: 100%;
  max-width: 820px;
}

.accessory-design-picker-button {
  display: flex;
  gap: .75rem;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: .65rem .8rem;
}

.accessory-design-picker-button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accessory-design-picker-button > small {
  margin-left: auto;
  color: var(--muted, #64748b);
  font-weight: 700;
  white-space: nowrap;
}

.accessory-design-picker-menu {
  right: auto;
  width: min(820px, calc(100vw - 64px));
  min-width: min(680px, calc(100vw - 64px));
  max-width: calc(100vw - 64px);
  padding: .8rem;
  border-radius: .65rem;
  z-index: 60;
}

.accessory-design-picker-menu:not([hidden]) {
  display: grid;
  gap: .65rem;
}

.accessory-design-picker-menu[hidden] {
  display: none !important;
}

.accessory-design-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, .45fr);
  gap: .65rem;
  align-items: end;
}

.accessory-design-picker-toolbar label {
  display: grid;
  gap: .3rem;
  min-width: 0;
  color: var(--muted, #64748b);
  font-size: .78rem;
  font-weight: 700;
}

.accessory-design-picker-toolbar input,
.accessory-design-picker-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  margin: 0;
}

.accessory-design-search-status {
  min-height: 1.2rem;
  margin: 0;
}

.accessory-design-picker-menu .accessory-design-results {
  max-height: min(330px, calc(100vh - 330px));
  padding: .3rem;
}

.accessory-design-result.is-non-operational:not(.is-linked):not(.is-unavailable) {
  background: rgba(245, 158, 11, .055);
}

.accessory-design-result.is-unavailable {
  cursor: not-allowed;
  opacity: .72;
  background: rgba(239, 68, 68, .045);
}

.accessory-design-result-main .accessory-design-client {
  color: #475569;
  font-weight: 700;
}

.pill.red {
  background: rgba(220, 38, 38, .12);
  color: #991b1b;
}

.material-costs-unvalued td {
  background: #fff1f2;
}

.material-costs-pending {
  border-color: #f3b9c2;
  background: #fff1f2;
  color: #991b1b;
}

.accessory-design-load-more {
  justify-self: center;
  min-width: 140px;
}

.accessory-design-picker-footer {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding-top: .6rem;
  border-top: 1px solid rgba(15, 23, 42, .12);
}

.accessory-design-picker-footer > div {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.accessory-design-tray ul {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.accessory-design-tray li {
  width: auto;
  max-width: 100%;
  border: 1px solid rgba(15, 23, 42, .11);
  border-radius: 999px;
  padding: .35rem .4rem .35rem .7rem;
}

.accessory-design-tray li button {
  min-height: 28px;
  padding: .25rem .55rem;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .accessory-design-picker-menu {
    width: min(680px, calc(100vw - 36px));
    min-width: min(560px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }
  .accessory-design-picker-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(170px, .45fr);
  }
  .accessory-design-picker-menu .accessory-design-results {
    max-height: min(300px, calc(100vh - 340px));
  }
}

@media (max-width: 520px) {
  .accessory-design-picker-button {
    align-items: flex-start;
    flex-direction: column;
  }
  .accessory-design-picker-button > small {
    margin-left: 0;
  }
  .accessory-design-picker-menu {
    width: calc(100vw - 28px);
    min-width: 0;
    max-width: calc(100vw - 28px);
    padding: .65rem;
  }
  .accessory-design-picker-toolbar {
    grid-template-columns: 1fr;
  }
  .accessory-design-picker-menu .accessory-design-results {
    max-height: min(340px, calc(100vh - 390px));
  }
  .accessory-design-picker-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .accessory-design-picker-footer > div {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
  }
  .accessory-design-result {
    gap: .5rem;
  }
  .accessory-design-tray ul,
  .accessory-design-tray li {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    border-radius: .55rem;
  }
}

/* VEN-COT-NAT-C1/C2: ficha de creación BOB con referencia USD fotografiada. */
.sales-quote-native-panel {
  width: min(1220px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
}
.sales-quote-new-form {
  display: grid;
  gap: .85rem;
  min-width: 0;
}
.sales-quote-new-ficha-card,
.sales-quote-new-lines-card,
.sales-quote-new-ficha {
  min-width: 0;
}
.sales-quote-new-ficha > .notice {
  margin-top: .75rem;
}
.sales-quote-new-ficha .sales-order-ficha-row > strong {
  min-width: 0;
}
.sales-quote-new-ficha .sales-order-ficha-row input,
.sales-quote-new-ficha .sales-order-ficha-row select,
.sales-quote-new-ficha .sales-order-ficha-row textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
}
.sales-quote-new-ficha .sales-order-ficha-row textarea {
  resize: vertical;
}
.sales-order-ficha-row .design-state {
  color: #fff;
}
.sales-quote-tab-disabled {
  display: grid;
  align-content: center;
  min-width: 190px;
  padding: .6rem .85rem;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted, #64748b);
  cursor: not-allowed;
  opacity: .72;
  text-align: left;
  white-space: normal;
}
.sales-quote-tab-disabled span {
  font-weight: 700;
}
.sales-quote-tab-disabled small {
  margin-top: .1rem;
  font-size: .68rem;
  line-height: 1.2;
}
.sales-quote-new-lines-card {
  display: grid;
  gap: .75rem;
}
.sales-quote-native-header-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  align-items: start;
}
.sales-quote-native-header-grid .wide,
.sales-quote-native-client { grid-column: span 2; min-width: 0; }
.sales-quote-native-product-board,
.sales-quote-native-lines {
  min-width: 0;
}
.sales-quote-native-line {
  display: table-row;
}
.sales-quote-native-line > td {
  padding-top: .65rem;
  padding-bottom: .65rem;
  vertical-align: middle;
}
.sales-quote-native-product-cell {
  min-width: 360px;
}
.sales-quote-native-line-number {
  display: block;
  margin-bottom: .35rem;
  font-size: .75rem;
  color: var(--muted, #64748b);
}
.sales-quote-native-qty {
  width: 92px;
  min-width: 72px;
}
.sales-quote-native-money {
  white-space: nowrap;
}
.sales-quote-native-manual-price-label {
  display: block;
  min-width: 130px;
  font-size: .72rem;
  color: var(--muted, #64748b);
}
.sales-quote-native-manual-price-input {
  width: 130px;
  margin-top: .2rem;
}
.sales-quote-native-client-fields {
  display: grid;
  gap: .35rem;
  margin-top: .45rem;
  max-width: 360px;
}
.sales-quote-native-client-fields label {
  display: grid;
  gap: .15rem;
  font-size: .72rem;
  color: var(--muted, #64748b);
}
.sales-quote-native-client-fields input,
.sales-quote-native-client-fields textarea {
  width: 100%;
  min-width: 0;
}
.sales-quote-native-manual-price-locked {
  display: block;
  max-width: 180px;
  font-size: .75rem;
  line-height: 1.25;
}
.sales-quote-native-row-actions {
  text-align: right;
  white-space: nowrap;
}
.sales-quote-native-row-actions .secondary {
  min-width: 82px;
  white-space: nowrap;
}
.sales-quote-native-accessories-row > td {
  padding: 0 .65rem .75rem;
  border-top: 0;
}
.sales-quote-native-line-head,
.sales-quote-native-summary,
.sales-quote-native-actions,
.sales-quote-native-accessory-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.sales-quote-native-line-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(105px, .22fr) minmax(145px, .3fr) minmax(145px, .3fr);
  gap: .65rem;
  align-items: end;
}
.sales-quote-native-line-grid > * { min-width: 0; }
.sales-quote-native-line-grid strong { display: block; padding: .65rem 0; white-space: nowrap; }
.sales-quote-native-design .sales-quote-picker-button { min-height: 42px; }
.sales-quote-native-accessories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  padding: .6rem;
  border-radius: .55rem;
  background: rgba(37, 99, 235, .055);
}
.sales-quote-native-accessory {
  display: grid;
  grid-template-columns: auto 1fr minmax(90px, 120px);
  gap: .55rem;
  align-items: center;
  min-width: 0;
  padding: .5rem;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: .5rem;
  background: var(--panel, #fff);
}
.sales-quote-native-accessory span { display: grid; gap: .1rem; min-width: 0; }
.sales-quote-native-accessory strong,
.sales-quote-native-accessory small { overflow-wrap: anywhere; }
.sales-quote-native-accessory-actions {
  justify-content: flex-start;
  margin-bottom: .45rem;
}
.sales-quote-native-accessory-actions .secondary {
  white-space: nowrap;
}
.sales-quote-native-summary {
  margin-top: .85rem;
  padding: .75rem;
  border-radius: .6rem;
  background: rgba(15, 118, 110, .08);
}
.sales-quote-native-actions { justify-content: flex-end; margin-top: .85rem; }

@media (max-width: 1024px) {
  .sales-quote-new-ficha .sales-order-ficha-columns { grid-template-columns: 1fr; gap: 18px; }
  .sales-quote-native-header-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-quote-native-line-grid { grid-template-columns: minmax(0, 1fr) minmax(110px, .28fr); }
  .sales-quote-native-accessories { grid-template-columns: 1fr; }
  .sales-quote-native-client .sales-quote-quick-client-grid { grid-template-columns: 1fr; }
  .sales-quote-tab-disabled { min-width: 160px; }
}

@media (max-width: 768px) {
  .sales-quote-native-panel { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); padding: .75rem; }
  .sales-quote-native-header-grid,
  .sales-quote-native-line-grid { grid-template-columns: 1fr; }
  .sales-quote-native-header-grid .wide,
  .sales-quote-native-client { grid-column: auto; }
  .sales-quote-native-line-head { align-items: flex-start; }
  .sales-quote-native-accessory { grid-template-columns: auto minmax(0, 1fr); }
  .sales-quote-native-accessory input[type="number"] { grid-column: 2; width: 100%; }
  .sales-quote-native-summary { align-items: flex-start; flex-direction: column; }
  .sales-quote-tab-disabled { min-width: 145px; }
}

@media (max-width: 390px) {
  .sales-quote-native-panel { width: 100vw; max-height: 100vh; border-radius: 0; }
  .sales-quote-new-ficha .sales-order-ficha-row { grid-template-columns: 1fr; gap: .3rem; }
  .sales-quote-native-actions > * { flex: 1 1 100%; }
  .sales-quote-new-actions > * { flex: 1 1 100%; }
}
.bom-finish-calculator{margin-top:14px}.bom-finish-applicability{display:grid;grid-template-columns:minmax(260px,420px) minmax(320px,1fr);gap:10px;margin:0 0 12px;padding:10px;border:1px solid #d8e2ec;border-radius:8px;background:#fbfdff}.bom-finish-applicability label{margin:0}.bom-finish-process-name{display:block;max-width:520px;margin:0 0 12px}.bom-finish-process-name small{display:block;color:#607089;margin-top:3px}.bom-finish-source-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.bom-finish-source-grid>div,.bom-finish-source-grid>label{border:1px solid #d8e2ec;border-radius:8px;padding:10px;background:#fbfdff}.bom-finish-source-grid>div{display:flex;flex-direction:column;justify-content:center}.bom-finish-source-grid span{color:#607089;font-size:12px}.bom-finish-pass-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:14px 0 8px}.bom-finish-pass-head>div{display:flex;flex-direction:column}.bom-finish-pass-head span{font-size:12px;color:#607089}.bom-finish-pass-table{min-width:1280px;table-layout:fixed}.bom-finish-pass-table th:nth-child(1){width:42px}.bom-finish-pass-table th:nth-child(2){width:230px}.bom-finish-pass-table th:nth-child(3){width:145px}.bom-finish-pass-table th:nth-child(4){width:300px}.bom-finish-pass-table th:nth-child(5),.bom-finish-pass-table th:nth-child(6),.bom-finish-pass-table th:nth-child(7){width:88px}.bom-finish-pass-table th:nth-child(8){width:130px}.bom-finish-pass-table th:nth-child(9){width:140px}.bom-finish-pass-table input,.bom-finish-pass-table select{width:100%;min-width:0}.bom-finish-material-fields{display:grid;gap:5px}.bom-finish-material-fields label{display:grid;grid-template-columns:105px 1fr;align-items:center;gap:6px;margin:0}.bom-finish-material-fields label span{font-size:11px;color:#607089}.bom-finish-pass-order{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;border-radius:50%;background:#eaf3fb;color:#07508a;font-weight:700}.bom-finish-row-actions{display:flex;gap:4px}.bom-finish-row-actions button{padding:5px 7px}.bom-finish-total,.bom-finish-material-totals{display:flex;gap:16px;flex-wrap:wrap;padding:10px;border-radius:8px;background:#eefaf2;margin:12px 0}.bom-finish-material-totals{background:#edf7ff;flex-direction:column;gap:5px}.bom-finish-no-apply-summary{padding:10px;border:1px solid #b7e3c7;border-radius:8px;background:#eefaf2}@media(max-width:900px){.bom-finish-applicability,.bom-finish-source-grid{grid-template-columns:1fr}.bom-finish-pass-scroll{overflow-x:auto}}
.bom-technical-observation-alert {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.bom-technical-observation-alert small {
  color: var(--muted);
}

/* Transporte: maqueta inicial de agenda, planificacion y ejecucion. */
.transport-shell { display: grid; gap: 1rem; }
.transport-hero,
.transport-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.transport-hero h2,
.transport-section-head h2 { margin: .15rem 0 .35rem; }
.transport-hero-actions,
.transport-week-controls,
.transport-form-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.transport-subnav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem; }
.transport-subnav-item { display: grid; gap: .15rem; padding: .7rem .8rem; border: 1px solid #d8e2ec; border-radius: 9px; background: #fff; color: inherit; text-decoration: none; }
.transport-subnav-item span { color: var(--muted); font-size: .76rem; line-height: 1.25; }
.transport-subnav-item.active { border-color: #2583c5; background: #edf7ff; box-shadow: inset 0 0 0 1px #2583c5; }
.transport-subnav-item:hover { border-color: #2583c5; }
.transport-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.transport-week-grid { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: .55rem; overflow-x: auto; }
.transport-day { min-height: 245px; padding: .6rem; border: 1px solid #d8e2ec; border-radius: 9px; background: #fbfdff; }
.transport-day.today { border-color: #2583c5; box-shadow: inset 0 3px 0 #2583c5; }
.transport-day > header { display: flex; justify-content: space-between; margin-bottom: .55rem; color: #25415c; }
.transport-day > header span { color: var(--muted); font-size: .8rem; }
.transport-route-card { display: grid; gap: .35rem; margin-bottom: .55rem; padding: .65rem; border-left: 4px solid #8f9aaa; border-radius: 7px; background: #fff; box-shadow: 0 1px 3px rgba(38, 57, 77, .08); }
.transport-route-card.silver { border-left-color: #8f9aaa; }
.transport-route-card.blue { border-left-color: #2f78bd; }
.transport-route-card h4 { margin: .1rem 0 0; }
.transport-route-card-top,
.transport-route-meta { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.transport-route-meta { color: var(--muted); font-size: .76rem; }
.button-link.compact,
.transport-table .compact,
.transport-request-card .compact { padding: .35rem .55rem; font-size: .78rem; }
.transport-callout { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border: 1px solid #b7d9ee; border-radius: 9px; background: #edf7ff; }
.transport-callout span { flex: 1; color: #456176; }
.transport-callout.warning { border-color: #ead18d; background: #fff9e8; }
.transport-calendar-scroll { overflow-x: auto; }
.transport-calendar { display: grid; grid-template-columns: 68px repeat(7, minmax(170px, 1fr)); grid-template-rows: 82px 720px; min-width: 1330px; border: 1px solid #d8e2ec; border-radius: 9px; background: #fff; }
.transport-calendar-corner { display: flex; align-items: center; justify-content: center; border-right: 1px solid #d8e2ec; border-bottom: 1px solid #d8e2ec; color: var(--muted); font-size: .76rem; }
.transport-calendar-day-head { display: grid; gap: .25rem; align-content: center; padding: .45rem .55rem; border-right: 1px solid #d8e2ec; border-bottom: 1px solid #d8e2ec; color: #25415c; }
.transport-calendar-day-title { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.transport-calendar-day-title span { color: var(--muted); font-size: .8rem; }
.transport-calendar-day-meta { display: grid; gap: .08rem; min-width: 0; color: #526a7d; font-size: .62rem; line-height: 1.15; }
.transport-calendar-day-meta span,
.transport-calendar-day-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transport-calendar-day-meta b { color: #38536d; }
.transport-calendar-day-meta small { color: var(--muted); }
.transport-calendar-day-head.today { background: #edf7ff; box-shadow: inset 0 3px 0 #2583c5; }
.transport-calendar-hours { display: grid; grid-template-rows: repeat(12, 60px); border-right: 1px solid #d8e2ec; color: var(--muted); font-size: .72rem; text-align: right; }
.transport-calendar-hours span { padding: .25rem .45rem 0 0; border-bottom: 1px solid #e6edf3; }
.transport-calendar-day-body { position: relative; overflow: hidden; border-right: 1px solid #d8e2ec; background: repeating-linear-gradient(to bottom, #fff 0, #fff 59px, #e6edf3 60px); }
.transport-calendar-day-body.today { background: repeating-linear-gradient(to bottom, #fafdff 0, #fafdff 59px, #d9e9f4 60px); }
.transport-calendar-day-body.closed { background: repeating-linear-gradient(to bottom, #f6f8fa 0, #f6f8fa 59px, #e3e8ee 60px); }
.transport-calendar-slot { position: absolute; z-index: 0; display: block; width: 100%; min-width: 0; max-width: none; height: 60px; margin: 0; padding: 0; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; color: transparent; font: inherit; appearance: none; cursor: pointer; }
.transport-calendar-slot:hover,
.transport-calendar-slot:focus-visible { z-index: 1; outline: 2px solid rgba(37, 131, 197, .45); outline-offset: -2px; background: rgba(37, 131, 197, .08); }
.transport-calendar-slot:disabled { pointer-events: none; cursor: not-allowed; opacity: 1; }
.transport-calendar-event { position: absolute; z-index: 2; display: grid; align-content: start; gap: .12rem; overflow: hidden; padding: .42rem .45rem; border: 0; border-left: 4px solid #8f9aaa; border-radius: 6px; color: #1f3244; text-align: left; box-shadow: 0 2px 5px rgba(38, 57, 77, .16); font-size: .72rem; line-height: 1.15; cursor: pointer; }
.transport-calendar-event.silver { border-left-color: #69798b; background: #e9eef3; }
.transport-calendar-event.blue { border-left-color: #1e62a0; background: #dbeeff; }
.transport-calendar-event:hover { z-index: 3; filter: brightness(.98); box-shadow: 0 3px 9px rgba(38, 57, 77, .22); }
.transport-calendar-event strong { font-size: .72rem; }
.transport-calendar-event span { font-weight: 700; }
.transport-calendar-event small { color: #526a7d; }
.transport-calendar-legend { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .78rem; }
.transport-calendar-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.transport-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.transport-legend-dot.silver { background: #69798b; }
.transport-legend-dot.blue { background: #1e62a0; }
.transport-request-layout,
.transport-planning-layout { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.4fr); gap: 1rem; }
.transport-prototype-form { display: grid; gap: .8rem; }
.transport-prototype-form textarea { min-height: 74px; resize: vertical; }
.transport-request-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .65rem; padding: .7rem 0; border-bottom: 1px solid #e5ebf1; }
.transport-request-card:last-child { border-bottom: 0; }
.transport-request-card strong,
.transport-request-card span { display: block; }
.transport-request-card span { margin-top: .15rem; color: var(--muted); font-size: .8rem; }
.transport-table { min-width: 780px; }
.transport-table th { white-space: nowrap; }
.transport-table td { vertical-align: top; }
.transport-summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.transport-summary-strip > div { display: grid; gap: .15rem; padding: .7rem; border-radius: 8px; background: #f2f7fb; }
.transport-summary-strip span { color: var(--muted); font-size: .78rem; }
.transport-timeline { display: grid; gap: .1rem; }
.transport-timeline-row { display: grid; grid-template-columns: 58px 16px minmax(0, 1fr) auto; align-items: center; gap: .55rem; min-height: 48px; }
.transport-timeline-row time { font-weight: 700; color: #38536d; }
.transport-timeline-dot { width: 11px; height: 11px; border: 3px solid #2583c5; border-radius: 50%; background: #fff; }
.transport-timeline-row strong,
.transport-timeline-row small { display: block; }
.transport-timeline-row small { color: var(--muted); }
.transport-impact,
.transport-gps-note { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1rem; padding: .75rem; border-radius: 8px; background: #eefaf2; }
.transport-impact span,
.transport-gps-note span { color: #456176; }
.transport-gps-note { background: #edf7ff; }
.transport-route-table td:nth-child(5),
.transport-route-table td:nth-child(6) { white-space: nowrap; }
.transport-modal .modal-panel { width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; }
.transport-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.transport-detail-grid > div { display: grid; gap: .15rem; padding: .7rem; border: 1px solid #d8e2ec; border-radius: 8px; background: #f8fbfd; }
.transport-detail-grid span,
.transport-slot-selected span { color: var(--muted); font-size: .78rem; }
.transport-modal-route-summary { padding: .8rem; border-radius: 8px; background: #edf7ff; }
.transport-modal-route-summary p { margin: .35rem 0 0; color: #456176; line-height: 1.55; }
.transport-slot-selected { display: grid; gap: .15rem; margin-bottom: .8rem; padding: .75rem; border: 1px solid #b7d9ee; border-radius: 8px; background: #edf7ff; }
.transport-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.transport-modal-footer .muted { flex: 1; }
@media (max-width: 1100px) {
  .transport-subnav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transport-calendar { min-width: 1330px; }
}
@media (max-width: 800px) {
  .transport-hero,
  .transport-section-head { flex-direction: column; }
  .transport-request-layout,
  .transport-planning-layout { grid-template-columns: 1fr; }
  .transport-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transport-callout { align-items: flex-start; flex-direction: column; }
  .transport-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transport-modal-footer { align-items: stretch; flex-direction: column; }
}
@media (max-width: 520px) {
  .transport-subnav { grid-template-columns: 1fr 1fr; }
  .transport-metrics { grid-template-columns: 1fr 1fr; }
  .transport-request-card { grid-template-columns: 1fr; align-items: flex-start; }
  .transport-summary-strip { grid-template-columns: 1fr; }
  .transport-calendar-legend { align-items: flex-start; flex-direction: column; }
  .transport-detail-grid { grid-template-columns: 1fr; }
}
