:root {
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #17211b;
  --muted: #6b766f;
  --line: #e2e9e2;
  --dark: #111b16;
  --dark-2: #17231d;
  --accent: #22c55e;
  --accent-2: #16a34a;
  --accent-soft: #dcfce7;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #2563eb;
  --border: var(--line);
  --line-strong: #b8c7bc;
  --green-dark: #166534;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 55px rgba(17, 27, 22, 0.08);
  --shadow-soft: 0 10px 30px rgba(17, 27, 22, 0.06);
  --font: "Inter", "Segoe UI", Roboto, Helvetica, Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  /* Design System v1: semantic aliases. Existing tokens stay available for compatibility. */
  --color-canvas: var(--bg);
  --color-surface: var(--surface);
  --color-surface-subtle: var(--surface-soft);
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --color-border: var(--line);
  --color-border-strong: var(--line-strong);
  --color-brand: var(--accent);
  --color-brand-strong: var(--accent-2);
  --color-status-success: var(--green-dark);
  --color-status-warning: var(--warning);
  --color-status-danger: var(--danger);
  --color-status-info: var(--info);
  --font-sans: var(--font);
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --radius-control: var(--radius-sm);
  --radius-surface: var(--radius-md);
  --shadow-surface: var(--shadow-soft);
  --focus-ring-color: #166534;
  --focus-ring-color-dark: #bbf7d0;
  --focus-ring: 0 0 0 3px var(--focus-ring-color);
  --motion-fast: 160ms;
  --motion-standard: 180ms;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 78px;
  --quick-panel-width: clamp(390px, 34vw, 540px);
  --topbar-height: 80px;
  --settings-anchor-scroll-offset: 168px;
}

.marketplace-page {
  width: 100%;
}

.marketplace-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.marketplace-page-header h1 {
  margin: 2px 0 6px;
  font-size: 2rem;
  letter-spacing: 0;
}

.marketplace-page-header p {
  margin-bottom: 0;
}

.marketplace-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.marketplace-summary > span {
  display: grid;
  gap: 1px;
  min-width: 92px;
  padding: 10px 14px;
}

.marketplace-summary > span + span {
  border-left: 1px solid var(--line);
}

.marketplace-summary strong {
  font-size: 1.05rem;
  line-height: 1.1;
}

.marketplace-summary small {
  color: var(--muted);
  font-size: 0.72rem;
}

.marketplace-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.marketplace-tabs a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  padding: 7px 10px;
  text-decoration: none;
}

.marketplace-tabs a:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.marketplace-tabs a.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.marketplace-tabs a small {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(23, 33, 27, 0.08);
  color: inherit;
  text-align: center;
}

.marketplace-tabs a.active small {
  background: rgba(255, 255, 255, 0.15);
}

.marketplace-tab-index,
.marketplace-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf4ee;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 850;
}

.marketplace-tabs a.active .marketplace-tab-index {
  background: var(--accent);
  color: #07130c;
}

.marketplace-list-panel,
.marketplace-generate-panel,
.marketplace-snapshot-panel {
  padding: 18px 20px;
}

.marketplace-section-heading,
.marketplace-snapshot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.marketplace-section-heading h2,
.marketplace-section-heading p,
.marketplace-snapshot-header h2,
.marketplace-snapshot-header p {
  margin: 0;
}

.marketplace-section-heading p,
.marketplace-snapshot-header p {
  margin-top: 3px;
}

.marketplace-table {
  min-width: 860px;
}

.marketplace-table th {
  white-space: nowrap;
}

.marketplace-table tbody tr:hover {
  background: #f8fbf8;
}

.marketplace-number,
.marketplace-currency {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.marketplace-currency {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef3f8;
  color: #1f4f78;
}

.marketplace-empty-state {
  padding: 28px 16px !important;
  color: var(--muted);
  text-align: center;
}

.marketplace-create-panel {
  padding: 0;
  overflow: hidden;
}

.marketplace-create-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 13px 18px;
  cursor: pointer;
  list-style: none;
}

.marketplace-create-panel > summary::-webkit-details-marker,
.marketplace-advanced-panel > summary::-webkit-details-marker {
  display: none;
}

.marketplace-create-panel > summary span:first-child {
  display: grid;
  gap: 2px;
}

.marketplace-create-panel > summary small {
  color: var(--muted);
  font-weight: 500;
}

.marketplace-create-panel[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.marketplace-summary-action {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.marketplace-form {
  padding: 20px;
}

.marketplace-form-section + .marketplace-form-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.marketplace-form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.marketplace-form-section-title h3,
.marketplace-form-section-title p {
  margin: 0;
}

.marketplace-form-section-title p {
  margin-top: 2px;
}

.marketplace-form-grid {
  align-items: start;
}

.marketplace-field {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
}

.marketplace-field > span:first-child {
  color: #56645b;
  font-size: 0.78rem;
  font-weight: 850;
}

.marketplace-field-wide {
  grid-column: 1 / -1;
}

.marketplace-column-builder {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.marketplace-column-builder-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.marketplace-column-builder-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.marketplace-column-builder-heading small,
.marketplace-column-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.marketplace-column-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.marketplace-column-list > div,
.marketplace-column-list ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.marketplace-column-list label {
  display: flex;
  align-items: flex-start;
  min-height: 42px;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.marketplace-column-list label:hover {
  border-color: #a8d8b6;
  background: #f0faf3;
}

.marketplace-column-list input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  margin-top: 1px;
  padding: 0;
  accent-color: var(--accent);
}

.marketplace-column-note {
  margin: 0;
  padding-top: 2px;
}

.marketplace-config-active {
  align-self: end;
}

.marketplace-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-self: stretch;
}

.marketplace-toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 750;
}

.marketplace-toggle-row input {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.marketplace-policy-picker {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #bfe8ca;
  border-radius: 8px;
  background: #f3fbf5;
}

.marketplace-policy-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.marketplace-policy-intro > div {
  display: grid;
  gap: 2px;
}

.marketplace-policy-intro small {
  color: var(--muted);
}

.marketplace-policy-options > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.marketplace-policy-options > div > div {
  min-width: 0;
}

.marketplace-policy-options label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.marketplace-policy-options input {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  padding: 0;
  accent-color: var(--accent);
}

.marketplace-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.marketplace-source-group {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.marketplace-source-group legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 850;
}

.marketplace-choice-help {
  min-height: 34px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.marketplace-policy-note {
  margin: 0 0 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--accent);
  background: #f3fbf5;
  color: #405348;
  font-size: 0.8rem;
  line-height: 1.4;
}

.marketplace-source-group.is-policy-disabled {
  align-self: start;
  border-color: #bfe8ca;
  background: #f8fcf9;
}

.marketplace-source-group.is-policy-disabled .marketplace-choice-toolbar,
.marketplace-source-group.is-policy-disabled .marketplace-choice-list {
  display: none;
}

.marketplace-price-policy {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #bfe8ca;
  border-radius: 8px;
  background: #f3fbf5;
}

.marketplace-price-policy .marketplace-toggle-row {
  background: var(--surface);
}

.marketplace-price-policy > div {
  display: grid;
  gap: 3px;
}

.marketplace-price-policy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.marketplace-policy-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid #a9dfb8;
  border-radius: 999px;
  background: #eaf9ee;
  color: #086b29;
  font-size: 0.7rem;
  font-weight: 850;
}

.marketplace-policy-badge.muted {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.marketplace-cell-note {
  display: block;
  max-width: 190px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.marketplace-api-scope-picker,
.marketplace-api-scope-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid #bfe8ca;
  border-radius: 8px;
  background: #f3fbf5;
}

.marketplace-api-scope-picker > div {
  display: grid;
  flex: 1;
  gap: 4px;
}

.marketplace-api-scope-picker p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.marketplace-api-scope-picker .marketplace-field {
  width: min(100%, 360px);
}

.marketplace-schedule-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #d7e4da;
  border-radius: 10px;
  background: #f8fbf9;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.marketplace-schedule-panel.is-enabled {
  border-color: #98ddb0;
  background: #f1fbf4;
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.06);
}

.marketplace-schedule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.marketplace-schedule-heading > div {
  display: grid;
  gap: 4px;
}

.marketplace-schedule-heading strong {
  font-size: 0.98rem;
}

.marketplace-schedule-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.marketplace-schedule-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 132px;
  min-height: 44px;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
}

.marketplace-schedule-panel.is-enabled .marketplace-schedule-switch {
  border-color: #74cf93;
  background: #e8f8ed;
  color: #126b34;
}

.marketplace-schedule-switch input {
  width: 1.08rem;
  height: 1.08rem;
  min-width: 1.08rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.marketplace-schedule-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.marketplace-schedule-controls[hidden],
.marketplace-schedule-field[hidden] {
  display: none;
}

.marketplace-schedule-preview {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid #42b96a;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: #245a36;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.4;
}

.marketplace-schedule-preview.is-warning {
  border-left-color: #d99a28;
  background: #fff9eb;
  color: #7a5210;
}

.marketplace-schedule-dependency {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.marketplace-origin-badge {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.marketplace-choice-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.marketplace-choice-toolbar input {
  min-width: 0;
}

.marketplace-choice-toolbar > div {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.marketplace-choice-list {
  min-height: 90px;
  max-height: 230px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
  border-top: 1px solid var(--line);
}

.marketplace-choice-list > div,
.marketplace-choice-list ul {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.marketplace-choice-list > div > div,
.marketplace-choice-list li {
  border-radius: 5px;
}

.marketplace-choice-list > div > div:hover,
.marketplace-choice-list li:hover {
  background: #edf7f0;
}

.marketplace-choice-list label {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  gap: 7px;
  margin: 0;
  padding: 6px 7px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.marketplace-choice-list input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  padding: 0;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--accent);
}

.marketplace-hierarchy-provider + .marketplace-hierarchy-provider {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.marketplace-hierarchy-provider-title {
  position: sticky;
  top: -4px;
  z-index: 1;
  padding: 7px 8px;
  background: #f3f8f4;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.marketplace-hierarchy-branch {
  margin: 5px 0 5px 8px;
  border-left: 2px solid #b8dec4;
}

.marketplace-hierarchy-branch-title {
  padding: 5px 8px;
  color: #386148;
  font-size: 0.74rem;
  font-weight: 800;
}

.marketplace-hierarchy-branch-body {
  padding-left: 6px;
}

.marketplace-hierarchy-provider-body > div:hover,
.marketplace-hierarchy-branch-body > div:hover {
  background: #edf7f0;
}

.marketplace-latest-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid #bce7c8;
  border-radius: 999px;
  background: #e8f8ed;
  color: #176c36;
  font-size: 0.67rem;
  font-weight: 850;
  white-space: nowrap;
}

.marketplace-choice-empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.marketplace-advanced-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.marketplace-advanced-panel > summary {
  padding: 13px 0;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.marketplace-advanced-panel > summary::before {
  content: "+";
  display: inline-flex;
  justify-content: center;
  width: 22px;
  margin-right: 5px;
  color: var(--accent-2);
}

.marketplace-advanced-panel[open] > summary::before {
  content: "-";
}

.marketplace-advanced-panel > .form-grid {
  padding-bottom: 16px;
}

.marketplace-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 18px;
}

.marketplace-generate-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.marketplace-generate-form label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #56645b;
  font-size: 0.78rem;
  font-weight: 850;
}

.marketplace-generate-form button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.marketplace-generate-form button svg {
  width: 18px;
  height: 18px;
}

.marketplace-generation-summary,
.marketplace-snapshot-policy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  border: 1px solid #bfe8ca;
  border-radius: 8px;
  background: #f3fbf5;
  overflow: hidden;
}

.marketplace-generation-summary[hidden] {
  display: none;
}

.marketplace-generation-summary > span,
.marketplace-snapshot-policy > span {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
}

.marketplace-generation-summary > span + span,
.marketplace-snapshot-policy > span + span {
  border-left: 1px solid #cfead6;
}

.marketplace-generation-summary small,
.marketplace-snapshot-policy small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.marketplace-generation-summary strong,
.marketplace-snapshot-policy strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.marketplace-snapshot-policy {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 14px;
}

.marketplace-api-assignment-note {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #cfead6;
  border-radius: 9px;
  background: #f3fbf5;
}

.marketplace-empty-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f2df8a;
  border-radius: 8px;
  background: #fff8db;
}

.marketplace-row-actions,
.marketplace-snapshot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.marketplace-table .marketplace-row-actions {
  justify-content: center;
}

.marketplace-history-table .table-action-cell {
  width: 112px;
}

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

.marketplace-delete-control {
  position: relative;
}

.marketplace-delete-control > summary {
  list-style: none;
  cursor: pointer;
}

.marketplace-delete-control > summary::-webkit-details-marker {
  display: none;
}

.marketplace-delete-form {
  position: absolute;
  z-index: 4;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, 82vw);
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(13, 30, 21, 0.16);
  text-align: left;
}

.marketplace-delete-form p {
  margin: 0;
}

.marketplace-delete-form label {
  font-weight: 700;
  font-size: 0.82rem;
}

.marketplace-delete-form input {
  min-width: 0;
  width: 100%;
}

.marketplace-delete-form .button.danger {
  justify-self: start;
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.marketplace-cleanup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid #f1c7c7;
  border-radius: 12px;
  background: #fff8f8;
}

.marketplace-cleanup-panel h3,
.marketplace-cleanup-panel p {
  margin-top: 0;
}

.marketplace-cleanup-form {
  display: grid;
  align-content: start;
  gap: 8px;
}

.marketplace-cleanup-form label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.marketplace-cleanup-form input:not([type="checkbox"]) {
  width: 100%;
}

.marketplace-cleanup-form .button.danger {
  justify-self: start;
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.marketplace-hash {
  display: inline-block;
  max-width: 230px;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.marketplace-selected-row {
  background: #effaf2;
  box-shadow: inset 3px 0 0 var(--accent);
}

.marketplace-snapshot-header h2 {
  overflow-wrap: anywhere;
}

.marketplace-snapshot-actions > span {
  display: grid;
  gap: 1px;
  min-width: 88px;
  padding: 4px 10px;
  border-left: 1px solid var(--line);
}

.marketplace-snapshot-actions small {
  color: var(--muted);
}

.marketplace-warning-list {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.marketplace-warning-list span {
  background: #fff8db;
  border: 1px solid #f2df8a;
  border-radius: 6px;
  padding: 7px 10px;
}

.marketplace-warning-list small {
  display: block;
  margin-top: 4px;
  color: #5f4a11;
  font-size: 0.78rem;
  line-height: 1.35;
}

.marketplace-snapshot-toolbar,
.marketplace-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f8fbf8;
}

.marketplace-snapshot-toolbar {
  margin-bottom: 10px;
  border-radius: 8px;
}

.marketplace-snapshot-range {
  display: grid;
  gap: 2px;
}

.marketplace-snapshot-range span,
.marketplace-pagination-summary {
  color: var(--muted);
  font-size: 0.85rem;
}

.marketplace-page-size,
.marketplace-page-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.marketplace-page-size a,
.marketplace-page-size-current,
.marketplace-pagination a,
.marketplace-pagination .current,
.marketplace-pagination .disabled,
.marketplace-pagination .ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.marketplace-page-size-current,
.marketplace-pagination .current {
  border-color: var(--accent);
  background: var(--accent);
  color: #07130c;
}

.marketplace-pagination {
  margin-top: 10px;
  border-radius: 8px;
}

.marketplace-pagination .disabled,
.marketplace-pagination .ellipsis {
  color: var(--muted);
  background: #f3f6f3;
}

.marketplace-source-line {
  display: block;
  line-height: 1.35;
}

.marketplace-api-panel {
  padding: 18px 20px;
}

.marketplace-connector-panel {
  margin: 18px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.marketplace-connector-panel .marketplace-api-status {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.marketplace-api-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.marketplace-api-status > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
}

.marketplace-api-status > span + span {
  border-left: 1px solid var(--line);
}

.marketplace-api-status small,
.marketplace-api-endpoints > div > span,
.marketplace-token-reveal small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.marketplace-api-status strong {
  overflow-wrap: anywhere;
}

.marketplace-api-scope-note {
  justify-content: flex-start;
  margin-bottom: 14px;
  color: #14532d;
  font-size: 0.82rem;
  line-height: 1.45;
}

.marketplace-api-scope-note strong {
  flex: 0 0 auto;
}

.marketplace-api-notice {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.82rem;
}

.marketplace-api-notice.warning {
  border-color: #f2df8a;
  background: #fff8db;
}

.marketplace-api-notice.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.marketplace-token-reveal {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
}

.marketplace-token-reveal > div:first-child {
  display: grid;
  gap: 2px;
}

.marketplace-api-endpoints {
  display: grid;
  gap: 9px;
}

.marketplace-api-endpoints > div {
  display: grid;
  gap: 5px;
}

.marketplace-api-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 7px;
}

.marketplace-api-value code {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf7;
  color: #1f4430;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.marketplace-api-value .icon-button {
  width: 38px;
  height: 38px;
}

.marketplace-api-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.marketplace-api-actions form {
  margin: 0;
}

.marketplace-manual-confirmation {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.4fr) auto;
  align-items: end;
  gap: 7px;
  width: min(100%, 680px);
}

.marketplace-manual-confirmation label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.marketplace-manual-confirmation input {
  min-width: 0;
}

@media (max-width: 900px) {
  .marketplace-page-header,
  .marketplace-section-heading,
  .marketplace-snapshot-header {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-summary {
    align-self: stretch;
  }

  .marketplace-source-grid,
  .marketplace-toggle-group,
  .marketplace-policy-options > div,
  .marketplace-column-list > div,
  .marketplace-column-list ul {
    grid-template-columns: 1fr;
  }

  .marketplace-price-policy,
  .marketplace-generation-summary,
  .marketplace-snapshot-policy,
  .marketplace-cleanup-panel {
    grid-template-columns: 1fr;
  }

  .marketplace-api-scope-picker,
  .marketplace-api-scope-note {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-api-scope-picker .marketplace-field {
    width: 100%;
  }

  .marketplace-schedule-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-schedule-switch {
    align-self: flex-start;
  }

  .marketplace-schedule-controls {
    grid-template-columns: 1fr;
  }

  .marketplace-generation-summary > span + span,
  .marketplace-snapshot-policy > span + span {
    border-top: 1px solid #cfead6;
    border-left: 0;
  }

  .marketplace-generate-form {
    grid-template-columns: 1fr;
  }

  .marketplace-generate-form button {
    justify-content: center;
  }

  .marketplace-snapshot-actions {
    justify-content: flex-start;
  }

  .marketplace-api-assignment-note {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-api-status,
  .marketplace-connector-panel .marketplace-api-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketplace-api-status > span + span {
    border-left: 0;
  }

  .marketplace-api-status > span:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .marketplace-api-status > span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .marketplace-manual-confirmation {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .marketplace-snapshot-toolbar,
  .marketplace-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-page-size,
  .marketplace-page-links {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .marketplace-tabs {
    grid-template-columns: 1fr;
  }

  .marketplace-summary {
    grid-template-columns: 1fr;
  }

  .marketplace-summary > span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .marketplace-choice-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-choice-toolbar > div .button {
    flex: 1 1 0;
  }

  .marketplace-choice-toolbar > div {
    width: 100%;
  }

  .marketplace-create-panel > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .marketplace-column-builder-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-column-actions .button {
    flex: 1 1 0;
  }

  .marketplace-api-status,
  .marketplace-connector-panel .marketplace-api-status {
    grid-template-columns: 1fr;
  }

  .marketplace-api-status > span:nth-child(even) {
    border-left: 0;
  }

  .marketplace-api-status > span + span {
    border-top: 1px solid var(--line);
  }

  .marketplace-api-actions,
  .marketplace-api-actions form,
  .marketplace-api-actions button,
  .marketplace-api-actions .button {
    width: 100%;
  }

  .marketplace-summary-action {
    align-self: stretch;
    text-align: center;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 34rem),
    linear-gradient(135deg, #eef5ed 0%, #f8fbf8 48%, #edf4ee 100%);
  color: var(--ink);
}

a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 650;
}

a:hover {
  color: #0f7a38;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.12), transparent 42%),
    var(--dark);
  color: white;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  margin-bottom: 30px;
}

.brand:hover {
  color: white;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #052e16;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.08em;
  font-size: 15px;
}

.brand small {
  color: #a7b7ac;
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-label {
  color: #7d8d82;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 18px 10px 6px;
}

.sidebar-nav a {
  color: #dfe8e1;
  padding: 12px 13px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav a.active {
  color: #052e16;
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.25);
}

.workspace {
  min-width: 0;
  transition: padding-right 190ms ease;
}

.workspace:focus {
  outline: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 34px;
  background: rgba(244, 247, 244, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 233, 226, 0.86);
}

.topbar-heading > div > strong {
  display: block;
  font-size: 22px;
  letter-spacing: 0;
}

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

.environment-pill,
.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.exchange-rate-pill {
  position: relative;
  color: #294334;
  border-color: #d5e2d8;
  background: #f8fbf8;
  white-space: normal;
}

.exchange-rate-pill.is-stale {
  color: #755a20;
  border-color: #e7d5a9;
  background: #fffdf7;
}

.exchange-rate-pill.is-unavailable {
  color: #506057;
  border-color: #d9e1db;
  background: #f8faf8;
}

.container {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 30px 34px 46px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.04em;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.03;
}

.container > h1:first-child {
  margin-bottom: 10px;
}

.container > h1:first-child + .muted,
.container > h1:first-child + p {
  max-width: 900px;
}

h2 {
  margin-top: 0;
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 28px;
  background:
    radial-gradient(circle at 90% 20%, rgba(34, 197, 94, 0.38), transparent 18rem),
    linear-gradient(135deg, #102019 0%, #172b20 58%, #0f1914 100%);
  color: white;
  box-shadow: var(--shadow);
}

.hero-panel h1,
.hero-panel h2,
.hero-panel p {
  color: inherit;
}

.hero-panel .muted {
  color: #b7c8bd;
}

.hero-side {
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-side-actions {
  min-width: 0;
}

.saas-action-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.saas-action-stack .button,
.saas-action-stack button {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.saas-action-stack form {
  margin: 0;
}

.saas-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  font-weight: 800;
}

.card,
.kpi {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 233, 226, 0.88);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  margin-bottom: 18px;
}

.card {
  overflow-x: auto;
}

.table-card {
  overflow: visible;
}

.card > :last-child {
  margin-bottom: 0;
}

.card p {
  line-height: 1.55;
}

.card.compact {
  padding: 14px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.page-actions p,
.page-actions form {
  margin: 0;
}

.page-actions .button.secondary {
  box-shadow: none;
}

.form-card {
  max-width: 980px;
}

.form-card form {
  margin-top: 18px;
}

.table-card h2 {
  margin-bottom: 14px;
}

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

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

.helper-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  padding: 14px 16px;
}

.helper-card strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.helper-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inventory-action-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  margin: 16px 0 18px;
}

.inventory-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  padding: 12px;
}

.inventory-action-group-primary {
  border-color: rgba(34, 197, 94, 0.20);
  background: rgba(34, 197, 94, 0.08);
}

.inventory-action-group-links {
  align-content: center;
  justify-content: flex-start;
}

.inventory-consult-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.inventory-consult-link:hover,
.inventory-consult-link.is-current {
  background: #eaf8ef;
  border-color: #a7e0b7;
  color: var(--brand);
}

.action-group-label {
  flex: 1 0 100%;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.action-group-help {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inventory-status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-left: 5px solid #0f766e;
  border-radius: 16px;
  background: rgba(20, 184, 166, 0.08);
  margin: 0 0 16px;
  padding: 14px 16px;
}

.inventory-status-band div {
  min-width: 0;
}

.inventory-status-band strong,
.inventory-status-band span {
  display: block;
}

.inventory-status-band span {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 3px;
}

.inventory-helper-grid {
  margin-top: 0;
}

.table-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.table-heading-row h2 {
  margin-bottom: 4px;
}

.table-heading-row .muted {
  margin: 0;
}

.inventory-table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  min-width: 0;
}

.inventory-table-actions .catalog-list-controls {
  margin-left: 0;
}

.inventory-per-page-form {
  margin: 0;
}

.assistant-data {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 16px 0 0;
}

.assistant-data dt {
  color: var(--muted);
  font-weight: 850;
}

.assistant-data dd {
  margin: 0;
  color: var(--ink);
}

.assistant-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink);
}

.assistant-list li + li {
  margin-top: 8px;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.inventory-kpis {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.kpi {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
}

.kpi strong {
  display: block;
  font-size: clamp(20px, 2vw, 34px);
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
  z-index: 1;
}

.kpi span {
  color: var(--muted);
  font-weight: 750;
}

.purchase-reconciliation-kpis .kpi {
  min-height: 92px;
}

.purchase-reconciliation-kpis .kpi strong {
  font-size: 22px;
}

.purchase-reconciliation-notes {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 650;
}

.purchase-reconciliation-notes li + li {
  margin-top: 6px;
}

.purchase-reconciliation-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.purchase-reconciliation-group h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.stacked-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.stacked-form input[type="text"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.stacked-form .section-actions {
  gap: 6px;
  justify-content: flex-start;
}

.stacked-form .button {
  min-height: 36px;
  padding: 8px 10px;
}

.kpi small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.kpi-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.kpi-link:hover,
.kpi-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 18px 38px rgba(10, 31, 24, 0.10);
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.kpi-link.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), var(--shadow-soft);
}

.kpi-danger::after {
  background: rgba(239, 68, 68, 0.12);
}

.kpi-warning::after {
  background: rgba(245, 158, 11, 0.16);
}

.kpi-legacy::after {
  background: rgba(20, 184, 166, 0.13);
}

.saas-health-summary h2 {
  margin-bottom: 12px;
}

.saas-health-card {
  overflow: visible;
}

.saas-health-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.saas-health-item {
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid #0f766e;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 16px;
}

.saas-health-critica {
  border-left-color: #dc2626;
  background: rgba(254, 242, 242, 0.72);
}

.saas-health-advertencia {
  border-left-color: #d97706;
  background: rgba(255, 251, 235, 0.72);
}

.saas-health-item .badge {
  margin-right: 8px;
}

.saas-health-item p {
  margin: 6px 0 0;
}

.saas-health-item-action {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.saas-health-item-action > strong {
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 640px) {
  .saas-health-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .saas-health-item-action {
    align-items: flex-start;
    text-align: left;
  }
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  vertical-align: middle;
}

th {
  text-align: left;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:hover td {
  background: #fbfdfb;
}

td:first-child a {
  font-weight: 850;
}

.supplier-table-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.supplier-table-copy {
  min-width: 0;
}

.supplier-logo-thumb,
.supplier-logo-placeholder {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.supplier-logo-thumb {
  object-fit: contain;
  padding: 0.25rem;
}

.supplier-logo-placeholder {
  display: inline-grid;
  place-items: center;
  color: #0f7a38;
  background: #e8f6ed;
  font-weight: 900;
}

tr:last-child td {
  border-bottom: 0;
}

th:first-child {
  border-top-left-radius: 12px;
}

th:last-child {
  border-top-right-radius: 12px;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d7e0d8;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--focus-ring-color);
  border-color: var(--accent);
}

textarea {
  min-height: 96px;
}

form p {
  margin: 0 0 14px;
}

.helptext {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  margin-top: 6px;
}

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

.inline-field-action .button,
.inline-field-action button {
  min-height: 46px;
  white-space: nowrap;
}

form ul.errorlist,
.errorlist {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
  list-style-position: inside;
}

label {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  background: var(--dark);
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(17, 27, 22, 0.12);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

button:hover,
.button:hover {
  color: white;
  background: #203328;
}

button:disabled,
.button[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
}

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

.button.secondary:hover {
  background: #dff0e3;
  color: var(--ink);
}

.button.ghost,
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.ghost:hover,
button.ghost:hover {
  background: rgba(17, 27, 22, 0.06);
  color: var(--ink);
}

button.danger,
.button.danger {
  background: var(--danger);
}

.search-form,
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.container > p:has(.button),
.card > p:has(.button) {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-actions form {
  margin: 0;
}

.documentos-sunat-lista {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.documento-sunat {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 14px 14px;
}

.documento-sunat > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  min-height: 48px;
}

.documento-sunat > summary::-webkit-details-marker {
  display: none;
}

.documento-sunat > summary span:nth-child(2) {
  color: var(--muted);
  flex: 1 1 240px;
}

.documento-sunat h4 {
  font-size: 0.92rem;
  margin: 16px 0 8px;
}

.documento-sunat-historial {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 10px 0;
  padding-left: 20px;
}

.inline-alert {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: #f8fffb;
  color: var(--muted);
}

.inline-alert strong {
  color: var(--ink);
}

.inline-alert.warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.pos-terminal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 16px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.pos-register {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.pos-register-header,
.pos-toolbar,
.pos-cart-panel,
.pos-recent-panel,
.pos-checkout-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #dfe8e2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.pos-register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.pos-register-header h1 {
  margin: 2px 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.pos-register-header p {
  margin: 0;
}

.pos-register-meta,
.pos-filter-row,
.pos-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-register-meta a,
.pos-filter,
.pos-action-button {
  min-height: 38px;
  border: 1px solid #dfe8e2;
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  box-shadow: none;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 850;
}

.pos-register-meta a:hover,
.pos-filter:hover,
.pos-filter.is-active,
.pos-action-button:hover {
  background: #eaf7ee;
  color: #125c2c;
}

.pos-alert {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  padding: 12px 14px;
  color: #991b1b;
  font-weight: 750;
}

.pos-readiness {
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
  padding: 12px 14px;
  color: #9a3412;
}

.pos-readiness strong {
  color: #7c2d12;
}

.pos-readiness ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.pos-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.pos-search {
  display: grid;
  gap: 6px;
  margin: 0;
}

.pos-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pos-search input {
  min-height: 44px;
  border-radius: 8px;
}

.pos-filter {
  cursor: pointer;
}

.pos-filter-tools {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.pos-results-count {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 12px;
  max-height: 440px;
  min-width: 0;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  overscroll-behavior: contain;
}

.pos-product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-height: 182px;
  width: 100%;
  border: 1px solid #dfe8e2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
  padding: 12px;
  text-align: left;
}

.pos-product-card[hidden] {
  display: none;
}

.pos-product-card:not(:disabled):hover,
.pos-product-card:not(:disabled):focus-visible {
  border-color: #14b8a6;
  background: #f7fffc;
  color: var(--ink);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.09);
}

.pos-product-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border-radius: 6px;
  background: #eef4f3;
  color: #0f3f3b;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
}

.pos-product-visual img {
  width: 100%;
  height: 64px;
  object-fit: contain;
}

.pos-product-card.is-unavailable {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.72;
}

.pos-product-body {
  display: grid;
  gap: 4px;
}

.pos-product-code,
.pos-product-category {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-body strong {
  display: -webkit-box;
  min-height: 38px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pos-product-category,
.pos-product-code,
.pos-product-footer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

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

.pos-product-footer strong {
  color: #0f3f3b;
  font-size: 14px;
  white-space: nowrap;
}

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

.pos-section-title h2 {
  margin: 0;
  font-size: 18px;
}

.pos-section-title .eyebrow {
  margin: 0 0 3px;
}

.pos-status {
  display: inline-flex;
  max-width: 260px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-cart-panel,
.pos-recent-panel,
.pos-checkout-card {
  padding: 14px;
}

.pos-cart-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.pos-cart-table {
  min-width: 760px;
  font-size: 13px;
}

.pos-cart-table th,
.pos-cart-table td {
  padding: 9px 8px;
}

.pos-cart-table select {
  min-width: 220px;
}

.pos-cart-table input,
.pos-cart-table select,
.pos-cart-table textarea {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 9px;
}

.pos-cart-table textarea {
  min-width: 150px;
  resize: vertical;
}

.pos-serial-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  font-size: 12px;
}

.pos-cart-table tr.is-active td {
  background: #f8fffb;
}

.pos-line-number {
  width: 38px;
  color: var(--muted);
  font-weight: 900;
}

.pos-qty-control {
  display: grid;
  grid-template-columns: 32px minmax(58px, 1fr) 32px;
  gap: 5px;
  align-items: center;
}

.pos-qty-control button,
.pos-row-clear {
  min-height: 32px;
  border-radius: 8px;
  background: #eef4f3;
  color: var(--ink);
  box-shadow: none;
  padding: 6px 8px;
  font-size: 12px;
}

.pos-qty-control button:hover,
.pos-row-clear:hover {
  background: #dff0ed;
  color: var(--ink);
}

.pos-row-clear {
  background: #fff1f2;
  color: #9f1239;
}

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

.pos-recent-item {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px 12px;
  color: var(--ink);
}

.pos-recent-item span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-recent-item em {
  color: #0f3f3b;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.pos-empty-state {
  border: 1px dashed #cfdad2;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
  color: var(--muted);
  font-weight: 750;
}

.pos-search-empty {
  margin-top: -4px;
}

.pos-checkout {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.pos-checkout-card {
  display: grid;
  gap: 14px;
  border-left: 4px solid #f97316;
}

.pos-order-strip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  padding: 12px;
}

.pos-order-strip span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.pos-form-stack {
  display: grid;
  gap: 10px;
}

.pos-form-stack p {
  margin: 0;
}

.pos-form-stack label {
  margin-bottom: 4px;
}

.pos-form-stack input,
.pos-form-stack select,
.pos-form-stack textarea {
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 10px;
}

.pos-form-stack textarea {
  min-height: 72px;
}

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

.pos-live-cart {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  padding: 12px;
}

.pos-live-cart h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.pos-live-lines {
  display: grid;
  gap: 7px;
}

.pos-live-lines p {
  margin: 0;
}

.pos-live-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pos-live-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-live-line strong {
  color: var(--ink);
  white-space: nowrap;
}

.pos-total-box {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pos-total-box div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.pos-total-box dt {
  color: var(--muted);
  font-weight: 800;
}

.pos-total-box dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

.pos-total-box .pos-total-main {
  align-items: center;
  border-bottom: 0;
  border-radius: 8px;
  background: #ecfdf5;
  padding: 12px;
}

.pos-total-main dd {
  color: #047857;
  font-size: 22px;
}

.pos-pay-button {
  min-height: 52px;
  width: 100%;
  border-radius: 8px;
  background: #f97316;
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.2);
}

.pos-pay-button:hover {
  background: #ea580c;
}

.pos-pay-button:disabled,
.pos-pay-button:disabled:hover {
  background: #d1d5db;
  color: #6b7280;
  box-shadow: none;
  cursor: not-allowed;
}

.pos-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pos-action-button {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.search-form input,
.filters input {
  flex: 1 1 260px;
}

.filters select {
  flex: 0 1 240px;
}

.commercial-search-card {
  overflow: visible;
}

.commercial-search-form {
  align-items: stretch;
  gap: 12px;
}

.commercial-search-primary {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 220px) auto;
  width: 100%;
}

.commercial-search-form input[type="search"] {
  flex: none;
  width: 100%;
}

.commercial-sort-field {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 5px;
  margin: 0;
  text-transform: uppercase;
}

.commercial-sort-field select,
.commercial-item-order-select {
  width: 100%;
}

.commercial-search-form.is-enhanced .commercial-native-control {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.commercial-filter-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding-top: 10px;
  width: 100%;
}

.commercial-chip-field {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.commercial-filter-label {
  color: var(--muted);
  display: none;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.commercial-chip-group {
  align-items: center;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

.commercial-search-form.is-enhanced .commercial-filter-label,
.commercial-search-form.is-enhanced .commercial-chip-group {
  display: inline-flex;
}

.commercial-filter-chip {
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: none;
  color: var(--ink);
  font-size: 13px;
  min-height: 36px;
  padding: 7px 11px;
}

.commercial-filter-chip:hover {
  background: #eaf5ee;
  color: var(--ink);
}

.commercial-filter-chip.is-active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.commercial-filter-chip svg {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.commercial-section-order-wrap {
  flex: 1 1 360px;
}

.commercial-stock-field {
  margin-left: auto;
}

.commercial-section-order-wrap.is-hidden {
  display: none;
}

.commercial-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.commercial-icon-button {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 12px;
}

.commercial-icon-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.commercial-icon-button.commercial-search-button {
  background: var(--dark);
  color: #fff;
}

.commercial-icon-button.commercial-search-button:hover {
  background: #203328;
  color: #fff;
}

.commercial-icon-button.commercial-search-button.is-loading {
  background: #4b5a51;
  color: #fff;
  opacity: 1;
}

.commercial-icon-button.commercial-search-button.is-loading svg {
  opacity: 0;
}

.commercial-icon-button.commercial-search-button.is-loading::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  animation: commercial-search-spin 0.72s linear infinite;
}

@keyframes commercial-search-spin {
  to {
    transform: rotate(360deg);
  }
}

.commercial-icon-button.commercial-reset-button {
  background: #f8fbf9;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: none;
}

.commercial-icon-button.commercial-reset-button:hover {
  background: #eaf5ee;
  color: var(--ink);
}

.commercial-rule-details {
  flex: 1 1 100%;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 0;
  padding: 10px 12px;
}

.commercial-rule-details.has-active-rules {
  background: #f3fbf6;
  border-color: rgba(34, 197, 94, 0.28);
}

.commercial-rule-details summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  width: 100%;
}

.commercial-rule-details summary::-webkit-details-marker {
  display: none;
}

.commercial-rule-summary-main,
.commercial-rule-summary-values {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.commercial-rule-summary-main {
  color: var(--ink);
}

.commercial-rule-summary-main svg {
  height: 18px;
  width: 18px;
}

.commercial-rule-summary-values {
  justify-content: flex-end;
}

.commercial-rule-summary-values span {
  background: #eef8f1;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 999px;
  color: #166534;
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 8px;
  white-space: nowrap;
}

.commercial-rule-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.commercial-rule-fields label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.commercial-rule-fields .commercial-rule-profile-select {
  grid-column: span 2;
}

.commercial-rule-fields .commercial-rule-profile-name {
  grid-column: span 2;
}

.commercial-rule-profile-actions {
  display: inline-flex;
  align-items: end;
  gap: 8px;
  justify-content: flex-start;
}

.commercial-rule-save-button {
  background: #10261b;
  color: #fff;
}

.commercial-rule-save-button:hover {
  background: #203328;
  color: #fff;
}

.commercial-rule-default-button {
  background: #fffaf0;
  border-color: #fde68a;
  color: #92400e;
  box-shadow: none;
}

.commercial-rule-default-button:hover,
.commercial-rule-default-button.is-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

.commercial-rule-default-button.is-active svg {
  fill: currentColor;
}

.commercial-rule-delete-button {
  background: #fff7f7;
  border-color: #ffd4d4;
  color: #b42318;
  box-shadow: none;
}

.commercial-rule-delete-button:hover {
  background: #ffeceb;
  color: #7f1d1d;
}

.commercial-rule-static {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.commercial-rule-static strong {
  align-items: center;
  background: #eef8f1;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  display: inline-flex;
  min-height: 41px;
  padding: 0 12px;
}

.commercial-rule-fields p {
  margin: 0;
}

.commercial-rule-formula,
.commercial-rule-message {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.commercial-rule-message:empty {
  display: none;
}

.commercial-rule-message[data-tone="success"] {
  color: var(--green-dark);
}

.commercial-rule-message[data-tone="error"] {
  color: #b42318;
}

.commercial-results-summary {
  margin: 0 0 12px;
}

@media (max-width: 980px) {
  .commercial-search-primary {
    grid-template-columns: 1fr;
  }

  .commercial-action-buttons {
    justify-content: flex-start;
  }

  .commercial-stock-field {
    margin-left: 0;
  }

  .commercial-rule-details summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .commercial-rule-summary-values {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .commercial-filter-row,
  .commercial-chip-field,
  .commercial-chip-group {
    align-items: stretch;
    width: 100%;
  }

  .commercial-filter-chip {
    flex: 1 1 auto;
  }

  .commercial-rule-fields .commercial-rule-profile-select,
  .commercial-rule-fields .commercial-rule-profile-name {
    grid-column: auto;
  }
}

.commercial-section-card table {
  min-width: 980px;
}

.commercial-source-cell {
  min-width: 168px;
  vertical-align: top;
}

.commercial-source {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.34rem;
  min-width: 0;
}

.commercial-source-logo,
.commercial-source-placeholder {
  width: 112px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.commercial-source-logo {
  object-fit: contain;
  padding: 0.32rem 0.42rem;
}

.commercial-source-placeholder {
  display: inline-grid;
  place-items: center;
  color: #0f7a38;
  background: #e8f6ed;
  font-weight: 900;
}

.commercial-source-name,
.commercial-source-pill,
.commercial-source-date {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.commercial-source-name {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.15;
}

.commercial-source-status {
  margin: 0;
}

.commercial-source-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  padding: 0.18rem 0.48rem;
}

.commercial-source-pill.is-aggregate {
  border-color: #d8e5dd;
  background: #f3f7f5;
  color: var(--muted);
}

.commercial-source-date {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.commercial-source-date span {
  color: #51645a;
  font-weight: 850;
}

.commercial-cost {
  color: var(--ink);
  font-weight: 850;
}

.commercial-header-tooltip {
  position: relative;
  z-index: 1;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 6px;
  cursor: help;
}

.commercial-header-tooltip > small {
  grid-column: 1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
  text-transform: none;
}

.commercial-header-tooltip:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.commercial-header-tooltip::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(250px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--dark);
  box-shadow: 0 8px 18px rgb(15 23 42 / 24%);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
}

.commercial-header-tooltip:hover::after,
.commercial-header-tooltip:focus-visible::after {
  z-index: 20;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.commercial-section-card .table-responsive thead {
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .commercial-header-tooltip::after {
    width: min(230px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}

.commercial-header-tooltip-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  cursor: help;
}

.commercial-header-tooltip-icon svg {
  display: block;
  width: 13px;
  height: 13px;
}

.commercial-price-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  vertical-align: middle;
  white-space: nowrap;
}

.commercial-price-stack {
  display: grid;
  gap: 7px;
  min-width: 148px;
}

.commercial-price-row {
  display: grid;
  gap: 3px;
}

.commercial-price-row-reference {
  align-items: center;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
}

.commercial-price-row-reference .commercial-price-badge {
  border-color: #d8e3db;
  background: #f4f7f5;
  color: #52645a;
  font-size: 10px;
}

.commercial-price-label {
  color: #51645a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.commercial-price-main,
.commercial-price-reference {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.commercial-price-reference {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.commercial-price-equivalent {
  color: #53675b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.commercial-price-equivalent.is-unavailable {
  color: #80621d;
}

.commercial-price-empty {
  color: #64756b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.badge,
.semaforo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge {
  background: #e9f9ee;
  color: #166534;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

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

.badge.success {
  background: var(--accent-soft);
  color: #166534;
}

.badge.neutral {
  background: #eef2f7;
  color: #334155;
}

.supplier-relation-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
}

.supplier-relation-page-header,
.supplier-relation-detail-header {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.supplier-relation-page-header h1,
.supplier-relation-detail-header h1 {
  margin: 0;
}

.supplier-relation-page-header .muted,
.supplier-relation-detail-header .muted {
  margin: 6px 0 0;
}

.supplier-relation-page-actions,
.supplier-relation-detail-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.supplier-relation-page-actions > a:not(.button),
.supplier-relation-detail-actions > a:not(.button) {
  font-weight: 850;
}

.supplier-relation-detail-header {
  align-items: center;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.supplier-relation-detail-actions svg,
.supplier-relation-decision-actions svg,
.supplier-relation-external-link svg,
.supplier-relation-advanced-filters summary svg {
  height: 17px;
  width: 17px;
}

.supplier-relation-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.supplier-relation-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.supplier-relation-tabs a {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  padding: 7px 11px;
  text-decoration: none;
}

.supplier-relation-tab-count {
  display: inline-grid;
  min-width: 1.65em;
  place-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(23, 48, 35, 0.08);
  color: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.supplier-relation-tabs a.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.supplier-relation-tabs a.active .supplier-relation-tab-count {
  background: rgba(255, 255, 255, 0.18);
}

.supplier-relation-filter-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.supplier-relation-filter-main {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(280px, 1.8fr) minmax(190px, 0.8fr) minmax(210px, 1fr) auto;
}

.supplier-relation-filter-main label,
.supplier-relation-advanced-grid label {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.supplier-relation-filter-main label > span,
.supplier-relation-advanced-grid label > span {
  color: #526359;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.supplier-relation-filter-main input,
.supplier-relation-filter-main select,
.supplier-relation-advanced-grid input {
  min-width: 0;
  width: 100%;
}

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

.supplier-relation-search-button {
  background: var(--ink);
  color: #fff;
  position: relative;
}

.supplier-relation-search-button:hover {
  background: #203328;
  color: #fff;
}

.supplier-relation-search-button.is-loading svg {
  opacity: 0;
}

.supplier-relation-search-button.is-loading::after {
  animation: supplier-relation-spin 0.75s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #fff;
  content: "";
  height: 16px;
  position: absolute;
  width: 16px;
}

@keyframes supplier-relation-spin {
  to { transform: rotate(360deg); }
}

.supplier-relation-advanced-filters {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.supplier-relation-advanced-filters summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 850;
  gap: 7px;
  list-style: none;
  width: fit-content;
}

.supplier-relation-advanced-filters summary .badge {
  font-size: 10px;
  white-space: nowrap;
}

.supplier-relation-advanced-filters summary::-webkit-details-marker {
  display: none;
}

.supplier-relation-advanced-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-top: 12px;
}

.supplier-relation-results-heading {
  align-items: center;
}

.supplier-relation-results-heading h2 {
  font-size: 20px;
}

.supplier-relation-results-heading .button svg {
  height: 17px;
  width: 17px;
}

.supplier-relation-table-scroll {
  background: #fff;
  border: 1px solid #d9e7dd;
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #9cb8a5 #f3f7f4;
  scrollbar-gutter: auto;
  -webkit-overflow-scrolling: touch;
}

.supplier-relation-table-scroll:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.supplier-relation-table {
  min-width: 1060px;
  table-layout: fixed;
}

.supplier-relation-table th {
  background: #f3f8f4;
  border-bottom: 1px solid #cfe0d4;
  color: #40554a;
  font-size: 10px;
  letter-spacing: 0.045em;
  line-height: 1.25;
  padding: 10px 14px;
  text-transform: uppercase;
}

.supplier-relation-table td {
  color: #2f4137;
  font-size: 13px;
  line-height: 1.4;
  padding: 12px 14px;
  vertical-align: top;
}

.supplier-relation-table th:nth-child(1),
.supplier-relation-table td:nth-child(1) {
  width: 31%;
}

.supplier-relation-table th:nth-child(2),
.supplier-relation-table td:nth-child(2) {
  width: 27%;
}

.supplier-relation-table th:nth-child(3),
.supplier-relation-table td:nth-child(3) {
  width: 16%;
}

.supplier-relation-table th:nth-child(4),
.supplier-relation-table td:nth-child(4) {
  width: 18%;
}

.supplier-relation-table th:nth-child(5),
.supplier-relation-table td:nth-child(5) {
  width: 8%;
}

.supplier-relation-table .table-action-cell {
  min-width: 88px;
}

.supplier-relation-table thead th:last-child {
  box-shadow: -10px 0 12px -14px rgba(22, 52, 34, 0.5);
  z-index: 3;
}

/* La acción se fija solo cuando todo el ancho de la tabla cabe junto al panel lateral.
 * En escritorios comunes, mantenerla fija cubría Estado y Última decisión. */
@media (min-width: 1760px) {
  .supplier-relation-table thead th:last-child,
  .supplier-relation-product-row > td:last-child {
    position: sticky;
    right: 0;
  }
}

.supplier-relation-side {
  align-items: flex-start;
  display: grid;
  gap: 9px;
  grid-template-columns: 56px minmax(0, 1fr);
}

.supplier-relation-side img,
.source-logo-fallback {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #eef8f1;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent-strong);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  max-width: 56px;
  object-fit: contain;
  padding: 5px;
  width: 56px;
}

.supplier-relation-product-copy,
.supplier-relation-status,
.supplier-relation-decision-summary,
.supplier-relation-unlinked {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.supplier-relation-product-copy > strong,
.supplier-relation-product-copy > a {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.supplier-relation-source,
.supplier-relation-panel-kicker {
  color: #526359;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-transform: uppercase;
}

.supplier-relation-metadata {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 4px 12px;
  line-height: 1.35;
}

.supplier-relation-metadata b {
  color: #37483e;
  font-weight: 800;
}

.supplier-relation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.supplier-relation-chips .badge {
  border: 1px solid #d6e0d9;
  font-size: 10px;
  padding: 3px 7px;
}

.supplier-relation-product-row > td {
  background: #fff;
  border-bottom: 0;
  border-top: 1px solid #d9e7dd;
  padding: 12px 14px 8px;
}

.supplier-relation-product-row > td:first-child {
  border-left: 3px solid #76bd8d;
}

.supplier-relation-product-row > td:last-child {
  background: #fff;
  border-right: 1px solid #d9e7dd;
  box-shadow: -10px 0 12px -14px rgba(22, 52, 34, 0.45);
  z-index: 1;
}

.supplier-relation-product-row:hover > td {
  background: #f8fcf9;
}

.supplier-relation-product-row:hover > td:last-child {
  background: #f8fcf9;
}

.supplier-relation-group-detail-row > td {
  background: #f2f8f4;
  border-bottom: 8px solid #fff;
  border-left: 3px solid #76bd8d;
  border-right: 1px solid #d9e7dd;
  padding: 0 14px 10px;
}

.supplier-relation-group-detail-row:hover > td {
  background: #f2f8f4;
}

.supplier-relation-group-detail {
  border-top: 1px dashed #bfd5c6;
  padding: 10px 4px 2px;
}

.supplier-relation-group-detail summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 12px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  list-style: none;
}

.supplier-relation-group-detail summary:focus-visible {
  border-radius: 6px;
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.supplier-relation-group-detail summary::-webkit-details-marker {
  display: none;
}

.supplier-relation-group-detail summary::before {
  content: "+";
  align-items: center;
  background: #fff;
  border: 1px solid #b9d1c1;
  border-radius: 50%;
  color: #176c37;
  display: flex;
  font-size: 17px;
  height: 26px;
  justify-content: center;
  line-height: 1;
  width: 26px;
}

.supplier-relation-group-detail[open] summary::before {
  content: "-";
}

.supplier-relation-group-detail-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.supplier-relation-group-detail-title > span {
  color: #64746b;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.supplier-relation-group-detail-title > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-relation-offers {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.supplier-relation-offer-item {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  font-size: 12px;
  gap: 12px;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(100px, 0.7fr)) auto;
  min-height: 48px;
  padding: 7px 0;
}

.supplier-relation-offer-item:first-child {
  border-top: 0;
}

.supplier-relation-offer-item > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.supplier-relation-offer-location span,
.supplier-relation-offer-label {
  color: var(--muted);
  font-size: 10px;
}

.supplier-relation-offer-location strong,
.supplier-relation-offer-location span {
  overflow-wrap: anywhere;
}

.supplier-relation-offer-action {
  justify-items: end;
}

.supplier-relation-status {
  gap: 7px;
  padding-top: 1px;
}

.supplier-relation-status > .badge {
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  max-width: 100%;
  padding: 4px 8px;
  white-space: normal;
}

.supplier-relation-status .muted,
.supplier-relation-decision-summary .muted {
  line-height: 1.45;
}

.supplier-relation-scope {
  margin-bottom: 18px;
}

.supplier-relation-scope-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.supplier-relation-scope-note {
  background: #f0fbf3;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 8px;
  color: #31533e;
  font-size: 12px;
  margin: 0;
  padding: 9px 11px;
}

.supplier-relation-empty {
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.supplier-relation-editor {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.supplier-relation-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 233, 226, 0.88);
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
}

.supplier-relation-panel-provider {
  border-top: 3px solid #64748b;
}

.supplier-relation-panel-ecoflujo {
  border-top: 3px solid var(--accent);
}

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

.supplier-relation-panel-heading h2 {
  font-size: 20px;
  margin: 3px 0 0;
}

.supplier-relation-side-detail {
  grid-template-columns: 88px minmax(0, 1fr);
}

.supplier-relation-side-detail img,
.supplier-relation-side-detail .source-logo-fallback {
  max-width: 88px;
  width: 88px;
}

.supplier-relation-product-title {
  font-size: 16px;
}

.supplier-relation-detail-list {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 6px 0 0;
  width: 100%;
}

.supplier-relation-detail-list > div {
  border-top: 1px solid var(--line);
  padding: 7px 8px 7px 0;
}

.supplier-relation-detail-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.supplier-relation-detail-list dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.supplier-relation-external-link {
  align-items: center;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  margin-top: 4px;
}

.supplier-relation-product-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.supplier-relation-empty-product {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-height: 190px;
  padding: 20px;
  text-align: center;
}

.supplier-relation-empty-product svg {
  color: #789084;
  height: 40px;
  width: 40px;
}

.supplier-relation-empty-product strong {
  color: var(--ink);
}

.supplier-relation-empty-product span {
  font-size: 13px;
  max-width: 360px;
}

.supplier-relation-status-help {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 0;
  padding-top: 10px;
}

.form-actions-inline {
  align-self: end;
}

.supplier-relation-decision {
  max-width: none;
}

.supplier-relation-decision form {
  margin-top: 0;
}

.supplier-relation-product-search {
  max-width: 900px;
}

.supplier-relation-search-control {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.supplier-relation-search-control .icon-button {
  height: 46px;
  width: 46px;
}

.supplier-relation-product-results {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  max-height: 300px;
  max-width: 900px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .supplier-relation-product-results {
    max-height: min(55vh, 420px);
  }
}

.supplier-relation-product-option {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  font-weight: 750;
  gap: 10px;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: auto;
  padding: 10px 12px;
  box-shadow: none;
  text-align: left;
  width: 100%;
}

.supplier-relation-product-option-thumbnail {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  font-weight: 600;
  height: 64px;
  justify-content: center;
  line-height: 1.2;
  overflow: hidden;
  text-align: center;
  width: 64px;
}

.supplier-relation-product-option-thumbnail img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.supplier-relation-product-option-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.supplier-relation-product-option:hover,
.supplier-relation-product-option:focus-visible {
  background: #eef8f1;
  border-color: var(--accent);
  color: var(--text);
}

.supplier-relation-product-option-identity {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplier-relation-product-option-identity strong {
  color: var(--accent-strong);
}

.supplier-relation-product-option-identity span {
  overflow-wrap: anywhere;
}

.supplier-relation-product-option-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.supplier-relation-product-option-signal {
  background: #eef5f0;
  border: 1px solid #c9dfcf;
  border-radius: 999px;
  color: #31533c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 3px 7px;
}

.supplier-relation-product-option-signal.is-exact {
  background: #dcf7e4;
  border-color: #79bf8d;
  color: #164e29;
}

.supplier-relation-product-option-signal.is-approximate {
  background: #fff4d6;
  border-color: #e5bd67;
  color: #76500a;
}

.supplier-relation-selected-product {
  align-items: center;
  background: #f0fbf3;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 14px;
  max-width: 900px;
  padding: 10px 12px;
}

.supplier-relation-selected-product > div {
  display: grid;
  gap: 3px;
}

.supplier-relation-selected-product.is-hidden {
  display: none;
}

.supplier-relation-reason {
  display: grid;
  max-width: 900px;
}

.supplier-relation-next-pending {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 16px 0 0;
  max-width: 900px;
  padding: 10px 12px 12px;
}

.supplier-relation-next-pending legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

.supplier-relation-next-pending label {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 9px;
}

.supplier-relation-next-pending input {
  margin-top: 3px;
}

.supplier-relation-next-pending span {
  display: grid;
  gap: 2px;
}

.supplier-relation-next-pending small {
  color: var(--muted);
  line-height: 1.35;
}

.supplier-relation-decision-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
}

.supplier-relation-decision-actions button {
  box-shadow: none;
  font-size: 13px;
}

.relation-action-block {
  border-color: #f2c66d !important;
  color: #8a5200 !important;
}

.relation-action-block:hover {
  background: #fff7e6 !important;
  color: #734300 !important;
}

.relation-action-unlink {
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

.relation-action-unlink:hover {
  background: #fff1f2 !important;
  color: #991b1b !important;
}

.supplier-relation-readonly {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.supplier-relation-readonly span {
  color: var(--muted);
  font-size: 13px;
}

.supplier-relation-history {
  margin-bottom: 18px;
}

.supplier-relation-history-scope {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #385044;
  font-size: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.supplier-relation-history-scope span {
  color: var(--muted);
}

.supplier-relation-history-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.supplier-relation-history-event,
.supplier-relation-history-empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

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

.supplier-relation-history-event-heading h3 {
  font-size: 16px;
  margin: 3px 0 0;
}

.supplier-relation-history-event-heading time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
}

.supplier-relation-history-details {
  display: grid;
  gap: 0 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.supplier-relation-history-details > div {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.supplier-relation-history-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.supplier-relation-history-details dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.supplier-relation-history-details dd > span {
  display: block;
}

.supplier-relation-history-reason {
  grid-column: 1 / -1;
}

.supplier-relation-history-empty {
  color: var(--muted);
  text-align: center;
}

.supplier-relation-history-empty strong {
  color: var(--ink);
}

.supplier-relation-history-empty p {
  font-size: 13px;
  margin: 6px auto 0;
  max-width: 620px;
}

.supplier-relation-workflow {
  display: grid;
  gap: 18px;
}

.supplier-relation-step {
  display: grid;
  gap: 12px;
}

.supplier-relation-step-heading {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
}

.supplier-relation-step-heading h2,
.supplier-relation-step-heading h3 {
  margin: 2px 0 0;
}

.supplier-relation-step-heading h2 {
  font-size: 21px;
}

.supplier-relation-step-heading h3 {
  font-size: 18px;
}

.supplier-relation-step-heading .muted {
  margin: 4px 0 0;
}

.supplier-relation-step-number {
  align-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  line-height: 1;
  margin-top: 2px;
  width: 28px;
}

.supplier-relation-step-heading-compact {
  margin: 18px 0 12px;
}

.supplier-relation-step-heading-compact .supplier-relation-step-number {
  background: var(--accent-strong);
}

.supplier-relation-candidate-search {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 2px;
}

.supplier-relation-create-product {
  margin: 0 0 14px;
  width: fit-content;
}

.supplier-relation-create-product[hidden],
.supplier-relation-comparison[hidden] {
  display: none;
}

.supplier-relation-comparison {
  background: #f7fbf8;
  border: 1px solid #bfd9c6;
  border-radius: 10px;
  margin: 0 0 14px;
  padding: 14px;
}

.supplier-relation-comparison-heading,
.supplier-relation-comparison-actions {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.supplier-relation-comparison-actions {
  align-items: center;
  flex: 0 0 auto;
}

.supplier-relation-comparison-heading h3 {
  font-size: 16px;
  margin: 3px 0 0;
}

.supplier-relation-comparison-help {
  color: #476052;
  font-size: 12px;
  line-height: 1.45;
  margin: 10px 0;
}

.supplier-relation-comparison-grid {
  display: grid;
  gap: 0;
  margin: 0;
}

.supplier-relation-comparison-grid > div {
  align-items: center;
  border-top: 1px solid #d9e8dd;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(72px, 0.55fr) minmax(0, 1.5fr) minmax(0, 1.5fr) auto;
  padding: 8px 0;
}

.supplier-relation-comparison-grid dt,
.supplier-relation-comparison-grid dd {
  margin: 0;
  min-width: 0;
}

.supplier-relation-comparison-grid dt,
.supplier-relation-comparison-grid dd > span {
  color: #587063;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.supplier-relation-comparison-grid dd {
  display: grid;
  gap: 2px;
}

.supplier-relation-comparison-grid dd strong {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.supplier-relation-comparison-reference {
  background: rgba(226, 233, 226, 0.38);
}

.supplier-relation-comparison-reference-note {
  color: #526359;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.supplier-relation-comparison-signal.is-coincide {
  background: #dcf7e4;
  color: #14532d;
}

.supplier-relation-comparison-signal.is-difiere {
  background: #fff3d5;
  color: #854d0e;
}

.supplier-relation-comparison-signal.is-sin-dato {
  background: #eef2f7;
  color: #475569;
}

.supplier-relation-decision-impact {
  margin-bottom: 18px;
}

.supplier-relation-impact-details {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
}

.supplier-relation-impact-details summary,
.supplier-relation-block-decision summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  width: fit-content;
}

.supplier-relation-impact-details summary:focus-visible,
.supplier-relation-block-decision summary:focus-visible {
  border-radius: 5px;
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.supplier-relation-decision .supplier-relation-step-heading {
  margin-bottom: 16px;
}

.supplier-relation-decision-actions {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.supplier-relation-decision-actions fieldset,
.supplier-relation-block-decision {
  background: #fafcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  padding: 12px;
}

.supplier-relation-decision-actions fieldset legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 0 4px;
}

.supplier-relation-decision-actions fieldset p,
.supplier-relation-block-decision p {
  line-height: 1.4;
  margin: 0 0 10px;
}

.supplier-relation-decision-actions button {
  min-height: 42px;
}

.supplier-relation-block-decision {
  grid-column: 1 / -1;
}

.supplier-relation-block-decision[open] {
  background: #fffaf0;
  border-color: #f2c66d;
}

.supplier-relation-block-decision > div {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-width: 680px;
}

.supplier-relation-block-decision label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.supplier-relation-block-decision select,
.supplier-relation-block-decision textarea {
  max-width: 680px;
  width: 100%;
}

.supplier-relation-decision-help {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.supplier-relation-history-empty-state {
  border-top: 1px solid var(--line);
  margin: 18px 0;
  padding-top: 14px;
}

.supplier-relation-history-empty-state .section-heading {
  margin-bottom: 0;
}

.supplier-relation-history-empty-state .supplier-relation-history-list {
  margin-top: 8px;
}

.supplier-relation-history-empty-state .supplier-relation-history-empty {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}

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

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

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

  .supplier-relation-editor {
    grid-template-columns: 1fr;
  }

  .supplier-relation-comparison-grid > div {
    grid-template-columns: minmax(72px, 0.55fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  .supplier-relation-offer-item {
    grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(90px, 0.7fr)) auto;
  }
}

@media (max-width: 720px) {
  .supplier-relation-page-header,
  .supplier-relation-detail-header {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
  }

  .supplier-relation-page-actions,
  .supplier-relation-detail-actions {
    justify-content: flex-start;
  }

  .supplier-relation-filter-main,
  .supplier-relation-advanced-grid {
    grid-template-columns: 1fr;
  }

  .supplier-relation-filter-actions {
    justify-content: flex-start;
  }

  .supplier-relation-table-scroll {
    border-radius: 10px;
  }

  .supplier-relation-table {
    min-width: 940px;
  }

  .supplier-relation-table th {
    padding: 9px 11px;
  }

  .supplier-relation-table td,
  .supplier-relation-product-row > td {
    padding: 10px 11px 8px;
  }

  .supplier-relation-table .table-action-cell {
    min-width: 76px;
  }

  .supplier-relation-side {
    gap: 8px;
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .supplier-relation-side img,
  .supplier-relation-side .source-logo-fallback {
    max-width: 50px;
    width: 50px;
  }

  .supplier-relation-side-detail {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .supplier-relation-side-detail img,
  .supplier-relation-side-detail .source-logo-fallback {
    max-width: 64px;
    width: 64px;
  }

  .supplier-relation-detail-list {
    grid-template-columns: 1fr;
  }

  .supplier-relation-offer-item {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supplier-relation-offer-location {
    grid-column: 1 / -1;
  }

  .supplier-relation-offer-action {
    justify-items: start;
  }

  .supplier-relation-scope-counts {
    justify-content: flex-start;
  }

  .supplier-relation-decision-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .supplier-relation-comparison-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .supplier-relation-comparison-actions {
    width: 100%;
  }

  .supplier-relation-comparison-grid > div {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supplier-relation-comparison-grid dt {
    grid-column: 1 / -1;
  }

  .supplier-relation-comparison-grid > div > dd:last-child {
    grid-column: 1 / -1;
  }

  .supplier-relation-impact-details summary,
  .supplier-relation-block-decision summary {
    line-height: 1.4;
  }

  .supplier-relation-decision-actions button {
    width: 100%;
  }

  .supplier-relation-history-event-heading {
    flex-direction: column;
  }

  .supplier-relation-history-details {
    grid-template-columns: 1fr;
  }
}

.sales-line-quantity-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
  max-width: 320px;
  align-items: center;
}

.sales-order-quantity-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
}

.sales-line-partialities-row td {
  background: #f8fbf9;
  border-top: 0;
  padding-top: 0;
}

.sales-line-partialities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}

.sales-line-partiality-chip {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-alert {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff7ed;
  color: #92400e;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.quantity-action-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.quantity-decision-list {
  display: grid;
  gap: 6px;
  flex-basis: 100%;
  min-width: 220px;
}

.quantity-decision-item {
  border-left: 3px solid var(--accent);
  padding: 6px 8px;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.supplier-branch-count-badge {
  display: inline-flex;
  margin-top: 6px;
}

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

.table-actions form {
  margin: 0;
}

.price-list-actions {
  flex-wrap: nowrap;
  gap: 7px;
}

.price-list-actions-cell {
  min-width: 148px;
  width: 148px;
}

.product-row-action-cell {
  min-width: 248px;
  width: 248px;
}

.product-row-actions-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.product-row-actions-menu > summary {
  list-style: none;
}

.product-row-actions-menu > summary::-webkit-details-marker,
.product-detail-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.product-row-actions-trigger {
  min-height: 40px;
  padding: 0 0.7rem;
  border: 1px solid rgba(13, 30, 21, 0.10);
  border-radius: 13px;
  background: #f5f8f6;
  color: #385143;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
}

.product-row-actions-trigger:hover,
.product-row-actions-menu[open] > .product-row-actions-trigger {
  border-color: #b8d8c1;
  background: #eaf5ed;
  color: #163222;
}

.product-row-actions-trigger:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.product-row-actions-popover,
.product-detail-actions-popover {
  position: absolute;
  z-index: 45;
  display: grid;
  min-width: 210px;
  gap: 0.2rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(17, 27, 22, 0.18);
  text-align: left;
}

.product-row-actions-popover {
  top: calc(100% + 0.4rem);
  right: 0;
}

.product-row-actions-popover form {
  margin: 0;
}

/* Tercera columna exclusiva del catálogo. La reserva de espacio usa el estado
 * ARIA que ya administra catalog_panel.js, sin acoplarse al quick panel global. */
.catalog-panel[hidden] {
  display: none;
}

.catalog-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--quick-panel-width);
  z-index: 60;
  padding: 24px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 15rem),
    var(--surface);
  box-shadow: -18px 0 50px rgba(17, 27, 22, 0.12);
}

.catalog-panel-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.catalog-panel-dialog:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: -3px;
}

.catalog-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 22px;
}

.catalog-panel-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.catalog-panel-close {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbf8;
  color: var(--ink);
  cursor: pointer;
  font: 400 24px/1 Arial, sans-serif;
  place-items: center;
}

.catalog-panel-close:hover {
  background: var(--accent-soft);
}

.catalog-panel-close:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.catalog-panel-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.catalog-panel-content[aria-busy="true"] {
  cursor: progress;
}

.catalog-panel-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 6rem;
  color: #385143;
  font-weight: 750;
}

.catalog-panel-loading span {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid #d8e9dc;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: catalog-panel-spin 0.8s linear infinite;
}

.catalog-panel-message {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #bad8c1;
  border-radius: 12px;
  background: #f4fbf5;
  color: #173322;
}

.catalog-panel-message.is-error {
  border-color: #e8b8b8;
  background: #fff6f6;
  color: #7e1f1f;
}

.catalog-panel-message h3,
.catalog-panel-message p {
  margin: 0;
}

.catalog-panel-message .button {
  justify-self: start;
}

/* El panel se abre desde catálogo sin tocar el quick panel. :has() refleja el
 * atributo aria-hidden que el contrato existente alterna al abrir y cerrar. */
body:has(.catalog-panel-shell[aria-hidden="false"]) .workspace {
  padding-right: var(--quick-panel-width);
}

body:has(.catalog-panel-shell[aria-hidden="false"]) .topbar {
  padding-right: 18px;
}

body:has(.catalog-panel-shell[aria-hidden="false"]) .container {
  max-width: 100%;
}

body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-table-scroll {
  max-width: 100%;
  overscroll-behavior-inline: contain;
}

body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-label-selection-bar,
body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-pagination {
  min-width: 0;
}

@media (max-width: 1440px) {
  body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-list-summary,
  body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
  }

  body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-list-controls {
    height: auto;
    margin-left: 0;
    width: 100%;
  }

  body:has(.catalog-panel-shell[aria-hidden="false"]) .catalog-list-controls p {
    text-align: left;
  }
}

@keyframes catalog-panel-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .catalog-panel {
    inset: 0;
    width: 100vw;
    padding: 0;
    border-left: 0;
    box-shadow: none;
  }

  .catalog-panel-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
  }

  .catalog-panel-header {
    padding: 20px 20px 18px;
  }

  .catalog-panel-content {
    padding: 0 20px 20px;
  }

  body:has(.catalog-panel-shell[aria-hidden="false"]) .workspace {
    padding-right: 0;
  }

  body:has(.catalog-panel-shell[aria-hidden="false"]) .topbar {
    padding-right: 16px;
  }
}

.product-row-action-menu-item,
.product-detail-actions-popover a {
  display: block;
  width: 100%;
  padding: 0.62rem 0.68rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #173322;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
}

.product-row-action-menu-item:hover,
.product-row-action-menu-item:focus-visible,
.product-detail-actions-popover a:hover,
.product-detail-actions-popover a:focus-visible {
  background: #eef7f1;
  color: #123f26;
  outline: none;
}

.product-row-action-menu-item.is-secondary {
  color: #52675a;
}

.product-detail-actions-menu {
  position: relative;
  display: inline-flex;
}

.product-detail-actions-trigger {
  list-style: none;
}

.product-detail-actions-popover {
  top: calc(100% + 0.45rem);
  left: 0;
}

.product-detail-actions-popover a.is-critical {
  margin-top: 0.15rem;
  border-top: 1px solid #f1d1d1;
  border-radius: 0 0 8px 8px;
  color: #9d2424;
}

.product-detail-actions-popover a.is-critical:hover,
.product-detail-actions-popover a.is-critical:focus-visible {
  background: #fff1f1;
  color: #8b1e1e;
}

.catalog-label-selection-form {
  margin: 0 0 12px;
}

.catalog-label-selection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf9;
}

.catalog-label-selection-form.has-product-label-selection .catalog-label-selection-bar {
  border-color: #b8d8c1;
  background: #eef7f1;
}

.catalog-label-selection-bar .muted {
  margin: 0;
}

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

.product-label-selection-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.product-label-selection-input,
.product-label-selection-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.product-row-actions-popover .product-row-action-menu-item.is-disabled,
.product-detail-actions-popover .is-disabled {
  display: block;
  width: 100%;
  padding: 0.62rem 0.68rem;
  border-radius: 8px;
  color: var(--muted);
  cursor: not-allowed;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
}

.product-row-actions-popover .product-row-action-menu-item.is-disabled small,
.product-detail-actions-popover .is-disabled small {
  display: block;
  margin-top: 0.2rem;
  font-weight: 650;
}

.product-label-print-menu-item,
.product-label-mobile-menu {
  display: none;
}

@media (max-width: 640px) {
  .catalog-label-selection-bar,
  .catalog-label-selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-label-selection-actions .button {
    justify-content: center;
    width: 100%;
  }

  .product-label-print-icon {
    display: none;
  }

  .product-row-actions-popover .product-label-print-menu-item,
  .product-label-mobile-menu {
    display: inline-flex;
  }

  .product-row-action-cell {
    min-width: 208px;
    width: 208px;
  }
}

.quote-lines-table td {
  vertical-align: top;
}

.quote-product-summary {
  display: grid;
  gap: 4px;
  min-width: 280px;
}

.quote-product-code {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.quote-product-code:hover {
  color: #047857;
  text-decoration: underline;
}

.quote-product-name {
  color: var(--ink);
  font-weight: 850;
  line-height: 1.32;
  text-decoration: none;
}

.quote-product-name:hover {
  color: #047857;
  text-decoration: underline;
}

.quote-product-identifiers {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
  gap: 2px 0;
  line-height: 1.42;
}

.quote-product-identifiers span:not(:last-child)::after {
  content: "·";
  color: #9aa8a0;
  margin: 0 7px;
}

.quote-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.quote-product-meta span {
  background: #eef8f1;
  border: 1px solid rgba(34, 197, 94, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.quote-line-description {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 300px;
}

.quote-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quote-line-actions .inline-form {
  margin: 0;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(13, 30, 21, 0.10);
  border-radius: 13px;
  background: #eef7f1;
  color: var(--ink);
  box-shadow: none;
  text-decoration: none;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-button:hover {
  background: #dff0e3;
  color: var(--ink);
}

.icon-button.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: #f3f7f4;
}

.button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-button.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

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

.table-action-cell {
  width: 96px;
  text-align: center;
  white-space: nowrap;
}

.table-action-cell .quote-line-actions {
  justify-content: center;
}

.v25-state-table {
  table-layout: fixed;
}

.v25-state-table th,
.v25-state-table td {
  vertical-align: top;
}

.v25-state-name,
.v25-state-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.v25-state-note {
  max-width: 220px;
}

.v25-state-history {
  margin-top: 14px;
}

.table-action-cell .table-actions {
  justify-content: center;
}

.saas-actions-heading,
.saas-actions-cell {
  width: 198px;
  min-width: 198px;
  text-align: center;
  white-space: nowrap;
}

.saas-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.saas-row-actions form {
  margin: 0;
}

.saas-row-actions .icon-button {
  border-radius: 10px;
}

.offer-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.offer-insight-button.is-active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

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

.provider-offer-panel-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.provider-offer-panel-header .muted {
  margin: 0;
  font-size: 13px;
}

.offer-insight-product {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf7;
}

.offer-insight-product span,
.offer-insight-metric span,
.offer-insight-section-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.offer-insight-product strong {
  overflow-wrap: anywhere;
}

.offer-insight-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.offer-insight-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.offer-insight-metric strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.offer-insight-section {
  margin-top: 16px;
}

.offer-insight-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0;
}

.offer-insight-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.offer-chart-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfb;
}

.offer-chart-summary,
.offer-chart-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.offer-chart-summary strong {
  color: var(--ink);
  font-size: 12px;
  text-align: center;
}

.offer-line-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 150px;
}

.offer-line-chart line {
  stroke: #dce7df;
  stroke-width: 1;
}

.offer-line-chart polygon {
  fill: rgba(20, 184, 166, 0.12);
}

.offer-line-chart polyline {
  fill: none;
  stroke: #0f766e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.offer-line-chart circle {
  fill: #ffffff;
  stroke: #0f766e;
  stroke-width: 2;
}

.offer-chart-card.is-price .offer-line-chart polygon {
  fill: rgba(37, 99, 235, 0.10);
}

.offer-chart-card.is-price .offer-line-chart polyline,
.offer-chart-card.is-price .offer-line-chart circle {
  stroke: var(--info);
}

.offer-insight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.offer-insight-list li {
  font-size: 13px;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button.compact,
button.compact {
  padding: 8px 12px;
  min-height: auto;
  font-size: 12px;
}

.semaforo {
  text-transform: capitalize;
}

.verde {
  background: #dcfce7;
  color: #166534;
}

.amarillo {
  background: #fef3c7;
  color: #92400e;
}

.rojo {
  background: #fee2e2;
  color: #991b1b;
}

.critico {
  background: #7f1d1d;
  color: white;
}

.cerrada {
  background: #e5e7eb;
  color: #374151;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.muted a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.table-secondary-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.messages {
  margin-bottom: 18px;
}

.message {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.message.success {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.saas-account-banner {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 4px solid #ea580c;
  border-radius: 8px;
  color: #7c2d12;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.saas-account-banner-proxima_vencer {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

.saas-account-banner p {
  margin: 3px 0 0;
}

.saas-account-banner .eyebrow {
  color: currentColor;
  margin: 0 0 2px;
}

.saas-account-banner-allowed {
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .saas-account-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .saas-account-banner .button {
    justify-content: center;
    width: 100%;
  }
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 3px 3px 3px 0;
}

#acciones-cotizacion .quote-send-actions-menu {
  position: relative;
  display: inline-flex;
  margin: 3px 3px 3px 0;
}

#acciones-cotizacion .quote-send-actions-menu > summary {
  list-style: none;
}

#acciones-cotizacion .quote-send-actions-menu > summary::-webkit-details-marker {
  display: none;
}

#acciones-cotizacion .quote-send-actions-trigger span {
  margin-left: 0.3rem;
  transition: transform var(--motion-fast) ease;
}

#acciones-cotizacion .quote-send-actions-menu[open] .quote-send-actions-trigger span {
  transform: rotate(180deg);
}

#acciones-cotizacion .quote-send-actions-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 0.45rem);
  left: 0;
  display: grid;
  min-width: 270px;
  gap: 0.25rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(17, 27, 22, 0.18);
}

#acciones-cotizacion .quote-send-actions-popover .muted {
  margin: 0.15rem 0.15rem 0.35rem;
  font-size: 0.82rem;
}

#acciones-cotizacion .quote-send-actions-popover form {
  margin: 0;
}

#acciones-cotizacion .quote-send-actions-popover button {
  width: 100%;
  padding: 0.64rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #173322;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: left;
}

#acciones-cotizacion .quote-send-actions-popover button:hover,
#acciones-cotizacion .quote-send-actions-popover button:focus-visible {
  background: #eef7f1;
  color: #123f26;
  outline: none;
}

.login-card {
  width: min(100%, 460px);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 38px;
}

.auth-shell .messages {
  width: min(100%, 460px);
}

.auth-body {
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 197, 94, 0.24), transparent 26rem),
    radial-gradient(circle at 80% 82%, rgba(17, 27, 22, 0.12), transparent 22rem),
    linear-gradient(135deg, #eef5ed 0%, #f8fbf8 48%, #edf4ee 100%);
}

.auth-shell {
  position: relative;
}

.auth-shell::before {
  content: "";
  position: fixed;
  inset: auto auto 7% 6%;
  width: 180px;
  height: 180px;
  border-radius: 44px;
  background: rgba(34, 197, 94, 0.16);
  transform: rotate(12deg);
  pointer-events: none;
}

code {
  background: #eef6ef;
  color: #14532d;
  border-radius: 8px;
  padding: 2px 6px;
}

ul {
  padding-left: 20px;
}

li {
  margin-bottom: 6px;
}

.quick-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: var(--quick-panel-width);
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
  display: block;
}

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

.quick-panel.open {
  display: block !important;
  pointer-events: auto;
  visibility: visible;
}

.quick-panel-backdrop {
  display: none;
}

.quick-panel.open .quick-panel-backdrop {
  display: none;
}

.quick-panel-card {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--quick-panel-width);
  height: 100vh;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.18), transparent 15rem),
    var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(17, 27, 22, 0.12);
  transform: translateX(102%);
  transition: transform 190ms ease;
  pointer-events: auto;
}

.quick-panel.open .quick-panel-card {
  transform: translateX(0);
}

.quick-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.quick-panel-heading h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.quick-panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbf8;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.quick-panel-close:hover {
  background: var(--accent-soft);
}

.quick-panel-form form p {
  margin: 0 0 14px;
}

.quick-panel-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-panel-form input,
.quick-panel-form select,
.quick-panel-form textarea {
  width: 100%;
}

.quote-description-suggestion-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.quote-description-suggestion-box textarea {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 106px;
  resize: vertical;
}

.quote-description-suggestion-box textarea:focus {
  box-shadow: none;
}

.quote-description-suggestions {
  background: #f6faf7;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
}

.quote-description-frequent-label {
  color: #385143;
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0;
  padding: 8px 10px 0;
}

.quote-description-frequent-help {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  padding: 2px 10px 8px;
}

.quote-description-chip {
  appearance: none;
  background: #ffffff;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  color: #1f3d2a;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.25;
  max-width: 100%;
  padding: 6px 10px;
  text-align: left;
  white-space: normal;
}

.quote-description-chip:hover,
.quote-description-chip.is-selected {
  background: var(--accent-soft);
  border-color: rgba(34, 197, 94, 0.44);
  color: #166534;
}

.client-document-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.client-document-action-row .client-document-lookup {
  min-height: 44px;
  white-space: nowrap;
}

.client-field-message {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.client-field-message[data-level="success"] {
  color: #008f43;
}

.client-field-message[data-level="error"] {
  color: #b91c1c;
}

.form-row.has-client-error input,
.form-row.has-client-error select {
  border-color: rgba(220, 38, 38, 0.72);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.quick-panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.quick-panel-hint {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: 16px;
  color: #1d2b23;
  font-size: 0.92rem;
  margin-top: 16px;
  padding: 12px 14px;
}

.quick-panel-hint ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.quick-panel-hint p {
  margin: 8px 0 0;
}

.inventory-import-next {
  border-color: rgba(59, 130, 246, 0.20);
  background: rgba(59, 130, 246, 0.07);
}

.product-image-error-summary {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
}

.product-import-job-runner.is-error {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.product-import-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(13, 30, 21, 0.10);
  margin-top: 12px;
}

.product-import-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.product-import-observations {
  margin-top: 12px;
}

.product-image-status {
  position: relative;
  transition: border-color 160ms ease, background 160ms ease;
}

.product-image-status-band {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: 16px;
  color: #1d2b23;
  margin: 14px 0 16px;
  padding: 14px 16px;
}

.product-image-status.is-error {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
}

.product-image-status-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.product-image-status-header p {
  margin: 6px 0 0;
}

.product-image-status-header .button {
  flex: 0 0 auto;
}

.product-image-status-dismiss {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 30, 21, 0.12);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.25rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 38px;
}

.product-image-status-dismiss:hover {
  background: #ffffff;
  border-color: rgba(34, 197, 94, 0.42);
  color: var(--success);
}

.product-image-status-progress {
  margin-top: 12px;
}

.product-image-status-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.product-image-status-metrics span {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 30, 21, 0.08);
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  min-height: 30px;
  padding: 5px 10px;
}

.product-image-status-note {
  margin-top: 10px;
}

.product-image-error-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.product-image-error-list li {
  min-width: 0;
  border: 1px solid rgba(13, 30, 21, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 11px;
}

.product-image-error-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.88rem;
}

.product-image-error-meta span {
  color: #8a5a05;
  font-weight: 800;
}

.product-image-error-name,
.product-image-error-detail,
.product-image-error-url {
  display: block;
  margin-top: 5px;
}

.product-image-error-url {
  max-width: 100%;
  color: #0d3b25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-image-error-detail {
  color: #6b4a07;
  font-weight: 700;
}

.quick-panel-option-list,
.quick-panel-action-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.quick-panel-option {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(13, 30, 21, 0.10);
  border-radius: 16px;
  background: #fff;
}

.quick-panel-option span,
.quick-panel-action-stack p {
  margin: 0;
  font-size: 0.9rem;
}

.quick-panel-action-stack .button {
  justify-content: center;
  text-align: center;
}

.quick-panel-save-status {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 14px;
  color: #14532d;
  font-size: 0.92rem;
  font-weight: 800;
  margin-top: 12px;
  padding: 11px 13px;
}

.quick-panel-save-status.is-error {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.28);
  color: #7f1d1d;
}

.quick-panel-save-status .button {
  margin-left: 10px;
}

.quick-panel-lookup-results {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.quick-panel-lookup-result {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  border: 1px solid rgba(13, 30, 21, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.quick-panel-lookup-result:hover,
.quick-panel-lookup-result:focus-visible {
  border-color: rgba(22, 163, 74, 0.62);
  background: rgba(34, 197, 94, 0.08);
  color: var(--ink);
}

.quick-panel-lookup-result .muted {
  font-size: 0.82rem;
  font-weight: 650;
}

.quick-panel-lookup-more {
  justify-self: start;
}

.quick-panel-batch-table td,
.quick-panel-batch-table th {
  vertical-align: top;
}

.quick-panel-form form.is-submitting {
  opacity: 0.92;
}

.quick-panel-form hr {
  border: 0;
  border-top: 1px solid rgba(13, 30, 21, 0.10);
  margin: 18px 0;
}

.quick-panel-loading {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.quick-panel-loading h2,
.quick-panel-loading p {
  margin: 0;
}

.quick-panel-slow-message {
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
}

.quick-panel-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(34, 197, 94, 0.16);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: quick-panel-spin 850ms linear infinite;
}

@keyframes quick-panel-spin {
  to {
    transform: rotate(360deg);
  }
}

.quick-panel-open {
  overflow: auto;
}

body.quick-panel-open .workspace {
  padding-right: var(--quick-panel-width);
}

body.quick-panel-open .topbar {
  padding-right: 18px;
}

body.quick-panel-open .container {
  max-width: 100%;
}

body.quick-panel-open .card {
  box-shadow: 0 10px 28px rgba(17, 27, 22, 0.05);
}

.saas-action-explanation,
.saas-renewal-unavailable {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.saas-renewal-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 20px;
  align-items: start;
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #f2c879;
  border-left: 4px solid #b7791f;
  border-radius: 8px;
  background: #fff8db;
}

.saas-renewal-banner h2,
.saas-renewal-workspace h2,
.saas-renewal-workspace h3,
.saas-renewal-workspace h4 {
  margin-top: 0;
}

.saas-renewal-banner p {
  max-width: 74ch;
  margin-bottom: 0;
}

.saas-renewal-banner-facts,
.saas-renewal-summary dl,
.saas-renewal-amounts dl,
.saas-renewal-result dl {
  margin: 0;
}

.saas-renewal-banner-facts {
  display: grid;
  gap: 8px;
}

.saas-renewal-banner-facts > div,
.saas-renewal-summary dl > div,
.saas-renewal-amounts dl > div,
.saas-renewal-result dl > div {
  display: grid;
  gap: 3px;
}

.saas-renewal-banner dt,
.saas-renewal-summary dt,
.saas-renewal-amounts dt,
.saas-renewal-result dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.saas-renewal-banner dd,
.saas-renewal-summary dd,
.saas-renewal-amounts dd,
.saas-renewal-result dd {
  margin: 0;
  font-weight: 800;
}

.saas-renewal-workspace {
  display: grid;
  gap: 18px;
  margin: 20px 0 26px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.saas-renewal-workspace .section-heading {
  margin: 0;
}

.saas-renewal-workspace .section-heading p {
  margin-bottom: 0;
}

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

.saas-renewal-path {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.saas-renewal-path.is-payment {
  border-top: 4px solid #16703c;
}

.saas-renewal-path.is-extension {
  border-top: 4px solid #9a6700;
  background: #fffdf5;
}

.saas-renewal-path p,
.saas-renewal-path h3 {
  margin: 0;
}

.saas-renewal-path .button {
  justify-self: start;
  margin-top: 4px;
}

.saas-renewal-path-outcome {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #24402f;
  font-size: 0.9rem;
}

.saas-renewal-amounts,
.saas-renewal-result,
.saas-renewal-reversal {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.saas-renewal-summary {
  display: grid;
  gap: 14px;
}

.saas-renewal-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.saas-renewal-summary-grid > section {
  min-width: 0;
  padding: 15px;
}

.saas-renewal-summary-grid > section + section {
  border-left: 1px solid var(--line);
}

.saas-renewal-summary-grid h4 {
  font-size: 0.94rem;
}

.saas-renewal-summary-grid dl {
  display: grid;
  gap: 12px;
}

.saas-renewal-amounts {
  display: grid;
  gap: 14px;
}

.saas-renewal-amounts > div > * {
  margin-bottom: 0;
}

.saas-renewal-amounts dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.saas-renewal-amounts dl > div {
  min-width: 0;
  padding: 13px 14px;
}

.saas-renewal-amounts dl > div + div {
  border-left: 1px solid var(--line);
}

.saas-renewal-amounts dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.saas-renewal-amounts > .muted {
  margin: 0;
}

.saas-renewal-result {
  border-color: #8dcc9d;
  border-left: 4px solid #16703c;
  background: #f0fbf3;
}

.saas-renewal-result p {
  margin-bottom: 10px;
}

.saas-renewal-result dl {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
}

.saas-renewal-reversal {
  display: grid;
  gap: 14px;
  border-color: #e3b0a9;
  background: #fff8f7;
}

.saas-renewal-reversal h3,
.saas-renewal-reversal p {
  margin-bottom: 0;
}

.saas-renewal-reversal-form {
  display: grid;
  gap: 12px;
}

.saas-renewal-reversal-form .form-row {
  display: grid;
  gap: 6px;
}

.saas-renewal-reversal-form .field-error {
  color: #b42318;
  font-size: 0.84rem;
  font-weight: 700;
}

.saas-renewal-reversal-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 14px;
  border-top: 1px solid #efd0cc;
}

@media (max-width: 640px) {
  .offer-insight-metrics {
    grid-template-columns: 1fr;
  }

  .offer-chart-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.next-action-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(13, 30, 21, 0.10);
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f3fff8 100%);
  box-shadow: 0 18px 46px rgba(15, 39, 27, 0.09);
  margin: 18px 0;
  padding: 26px 28px;
}

.next-action-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -44px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
}

.next-action-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.next-action-kicker {
  color: #009946;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.next-action-card h2 {
  color: #516157;
  font-size: 0.94rem;
  margin: 0 0 6px;
}

.next-action-card h3 {
  color: #07160e;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin: 0 0 8px;
}

.next-action-card p {
  color: #516157;
  margin: 0 0 12px;
  max-width: 850px;
}

.next-action-card ul {
  color: #1d2b23;
  margin: 0;
  padding-left: 18px;
}

.next-action-button {
  white-space: nowrap;
}

.next-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 360px;
}

.next-action-buttons .secondary {
  background: #eef6f0;
  color: #07160e;
  box-shadow: none;
}

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

.section-heading h2 {
  margin: 0;
}

.section-heading p {
  margin: 6px 0 0;
}

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

.closing-blocker-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.closing-blocker-list li {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
  color: #423524;
  font-weight: 750;
}

.next-action-ok {
  border-color: rgba(34, 197, 94, 0.32);
}

.next-action-info {
  border-color: rgba(59, 130, 246, 0.24);
}

.next-action-atencion {
  border-color: rgba(245, 158, 11, 0.38);
  background: linear-gradient(135deg, #ffffff 0%, #fff9eb 100%);
}

.next-action-bloqueo {
  border-color: rgba(239, 68, 68, 0.32);
  background: linear-gradient(135deg, #ffffff 0%, #fff3f3 100%);
}

/* Detalle de orden de compra: la interfaz sigue el orden real de trabajo. */
.purchase-page-actions {
  margin-top: 10px;
}

.purchase-back-link {
  color: var(--muted);
  font-weight: 800;
  padding: 8px 4px;
  text-decoration: none;
}

.purchase-back-link:hover,
.purchase-back-link:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.purchase-order-overview {
  overflow: visible;
}

.purchase-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.purchase-overview-item {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 116px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.purchase-overview-item + .purchase-overview-item {
  border-left: 1px solid var(--line);
}

.purchase-overview-item > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.purchase-overview-item strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.purchase-overview-item small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.purchase-observation {
  margin: 14px 0 0;
}

.purchase-control-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.purchase-flow-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.purchase-flow-nav-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  margin-right: 2px;
  text-transform: uppercase;
}

.purchase-flow-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.purchase-flow-nav a:hover,
.purchase-flow-nav a:focus-visible {
  border-color: rgba(34, 197, 94, 0.42);
  background: #effbf3;
  color: var(--brand);
  outline: none;
}

.purchase-detail-flow {
  display: flex;
  flex-direction: column;
}

.purchase-detail-flow .purchase-flow-item,
.purchase-detail-flow .purchase-reconciliation-card {
  scroll-margin-top: calc(var(--topbar-height) + 20px);
}

.purchase-flow-control { order: 5; }
.purchase-flow-products { order: 10; }
.purchase-flow-supplier { order: 20; }
.purchase-flow-import { order: 30; }
.purchase-flow-destination { order: 35; }
.purchase-flow-receipts { order: 40; }
.purchase-flow-difference { order: 50; }
.purchase-flow-finance { order: 60; }
.purchase-flow-cost { order: 65; }
.purchase-flow-exception { order: 70; }
.purchase-flow-records { order: 80; }

@media (min-width: 981px) {
  body.app-body {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  body.app-body .app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body.app-body .workspace {
    height: 100vh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-color: rgba(107, 118, 111, 0.64) rgba(226, 233, 226, 0.42);
    scrollbar-gutter: stable;
    scrollbar-width: auto;
  }

  body.app-body .workspace::-webkit-scrollbar {
    width: 14px;
  }

  body.app-body .workspace::-webkit-scrollbar-track {
    background: rgba(226, 233, 226, 0.42);
  }

  body.app-body .workspace::-webkit-scrollbar-thumb {
    background: rgba(107, 118, 111, 0.64);
    border: 3px solid rgba(226, 233, 226, 0.42);
    border-radius: 999px;
  }

  body.app-body .workspace::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 88, 81, 0.78);
  }
}

@media (max-width: 1240px) {
  .pos-terminal {
    grid-template-columns: 1fr;
  }

  .pos-checkout {
    position: static;
  }

  .pos-checkout-card {
    border-left: 1px solid #dfe8e2;
    border-top: 4px solid #f97316;
  }
}

@media (max-width: 1100px) {
  .inventory-action-bar {
    grid-template-columns: 1fr;
  }

  .inventory-action-group-links {
    justify-content: flex-start;
  }

  .inventory-status-band,
  .table-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-table-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .inventory-status-band .button,
  .table-heading-row .button {
    width: max-content;
  }
}

@media (max-width: 640px) {
  .inventory-action-group .button,
  .inventory-action-group-links a,
  .inventory-status-band .button,
  .table-heading-row .button {
    justify-content: center;
    width: 100%;
  }

  .inventory-table-actions,
  .inventory-table-actions .catalog-list-controls,
  .inventory-per-page-form,
  .inventory-per-page-form .product-per-page-control {
    width: 100%;
  }

  .inventory-per-page-form .product-per-page-control {
    justify-content: space-between;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-radius: 0 0 26px 26px;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .nav-label {
    grid-column: 1 / -1;
  }

  .topbar,
  .page-hero {
    grid-template-columns: 1fr;
  }

  .settings-anchor-nav {
    top: 0;
  }

  .settings-section-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pos-toolbar,
  .pos-register-header {
    grid-template-columns: 1fr;
  }

  .pos-register-header {
    display: grid;
  }

  .pos-register-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 22px 16px 34px;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 390px;
  }

  .pos-product-card {
    min-height: 176px;
  }

  .pos-product-visual {
    min-height: 68px;
    font-size: 20px;
  }

  .pos-two-fields,
  .pos-action-grid {
    grid-template-columns: 1fr;
  }

  .pos-filter-tools {
    justify-items: start;
  }

  .pos-section-title,
  .pos-product-footer,
  .pos-recent-item {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .pos-status {
    max-width: 100%;
  }

  .inline-field-action {
    grid-template-columns: 1fr;
  }

  .commercial-view-select,
  .commercial-section-order-wrap,
  .commercial-item-order-select,
  .commercial-stock-select,
  .commercial-rule-fields label,
  .commercial-rule-profile-actions,
  .commercial-rule-static,
  .commercial-search-form input[type="search"] {
    flex: 1 1 100%;
    width: 100%;
  }

  .commercial-action-buttons {
    flex: 0 0 auto;
    width: auto;
  }

  .commercial-search-form .commercial-icon-button {
    flex: 0 0 46px;
    width: 46px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    min-width: 100%;
  }

  .card,
  .kpi,
  .hero-panel,
  .hero-side {
    border-radius: 18px;
  }

  .quick-panel-card {
    width: calc(100vw - 12px);
    padding: 20px;
  }

  body.quick-panel-open .workspace {
    padding-right: 0;
  }

  .next-action-main {
    grid-template-columns: 1fr;
  }

  .next-action-button {
    width: max-content;
  }

  .saas-renewal-banner,
  .saas-renewal-paths,
  .saas-renewal-summary-grid,
  .saas-renewal-amounts dl {
    grid-template-columns: 1fr;
  }

  .saas-renewal-summary-grid > section + section,
  .saas-renewal-amounts dl > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .saas-renewal-path .button {
    width: 100%;
  }

  .next-action-buttons {
    justify-content: flex-start;
    max-width: 100%;
  }

  .section-heading {
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .purchase-overview-grid {
    grid-template-columns: 1fr;
  }

  .purchase-overview-item + .purchase-overview-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .purchase-flow-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-flow-nav a {
    width: 100%;
  }
}

.field-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
  background: #fff7f7;
}

.field-valid {
  border-color: #22c55e !important;
}

.field-validation-message {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 6px;
  font-weight: 700;
}

.settings-stack {
  display: grid;
  gap: 20px;
}

.settings-anchor-nav {
  position: sticky;
  top: var(--topbar-height);
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 0.55rem;
  margin: -0.25rem 0 1.2rem;
  padding: 0.7rem 1rem;
  box-sizing: border-box;
  background: rgba(244, 249, 245, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(220, 232, 222, 0.74);
}

.settings-anchor-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
}

.settings-anchor-nav a:hover {
  background: #eef7f0;
}

.settings-anchor-nav a.is-active {
  border-color: #0d7a3f;
  background: #123b27;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(18, 59, 39, 0.16);
}

.protected-config-note {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(64, 150, 96, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(110deg, #f2fbf5, #ffffff 68%);
  box-shadow: var(--shadow-soft);
}

.protected-config-note h2,
.protected-config-note strong {
  color: var(--ink);
}

.protected-config-note h2 {
  margin: 0;
}

.protected-config-note .eyebrow,
.protected-config-note .muted {
  margin: 0;
}

.config-section-field {
  display: grid;
  align-content: start;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.2rem 0;
}

.config-section-field > label,
.config-section-field > .switch-row {
  color: var(--ink);
  font-weight: 850;
}

.config-section-field > small {
  color: var(--muted);
  line-height: 1.45;
}

.config-section-field .errorlist {
  margin: 0;
}

.settings-section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.6rem 0 0.85rem;
  padding: 0.4rem 0 0.85rem;
  border-bottom: 1px solid rgba(202, 216, 205, 0.82);
  scroll-margin-top: var(--settings-anchor-scroll-offset);
}

.settings-section-intro h2 {
  margin: 0;
  letter-spacing: 0;
}

.settings-section-intro .eyebrow {
  margin-bottom: 0.35rem;
}

.settings-card {
  display: grid;
  gap: 12px;
  scroll-margin-top: var(--settings-anchor-scroll-offset);
}

.erp-logo-field-row {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.erp-logo-field {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.erp-logo-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid #d8eadf;
  border-radius: 8px;
  background: #f6fbf8;
}

.erp-logo-current-summary {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.erp-logo-current-eyebrow,
.erp-logo-upload-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.erp-logo-current-name {
  color: #078a42;
  font-size: 0.9rem;
  font-weight: 850;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.erp-logo-current-link {
  color: #057a3a;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.erp-logo-current-link:hover {
  text-decoration: underline;
}

.erp-logo-clear {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 8px;
  background: #fffafb;
  color: var(--ink);
  cursor: pointer;
}

.quick-panel-form .erp-logo-clear {
  display: flex;
  margin: 0;
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
}

.erp-logo-clear input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.08rem;
  height: 1.08rem;
  margin-top: 0.12rem;
  accent-color: #dc2626;
}

.erp-logo-clear strong {
  display: block;
  color: #7f1d1d;
  font-size: 0.88rem;
  line-height: 1.25;
}

.erp-logo-clear small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.erp-logo-upload {
  display: grid;
  gap: 0.38rem;
}

.erp-logo-field input[type="file"] {
  min-width: 0;
  min-height: 46px;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.erp-logo-field input[type="file"]::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.48rem 0.72rem;
  border: 0;
  border-radius: 8px;
  background: #e8f6ed;
  color: #123b22;
  cursor: pointer;
  font-weight: 850;
}

.erp-logo-field input[type="file"]:hover::file-selector-button {
  background: #d6f0df;
}

.supplier-detail-logo-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6fbf8;
}

.supplier-detail-logo {
  width: 110px;
  height: 62px;
  object-fit: contain;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.supplier-detail-logo-row strong,
.supplier-detail-logo-row a {
  display: block;
}

.supplier-detail-logo-row strong {
  margin-bottom: 0.15rem;
}

.settings-card:target {
  outline: 0;
}

form.settings-stack > .settings-card,
form.settings-stack > .erp-config-disclosure {
  padding: 20px;
  border: 1px solid rgba(226, 233, 226, 0.88);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.health-panel .section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.health-heading-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.health-heading-title h2 {
  margin: 0;
}

.health-panel {
  margin-bottom: 1.25rem;
}

.health-priority,
.health-groups {
  display: grid;
  gap: 0.85rem;
}

.health-filter-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(226, 233, 226, 0.9);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.health-filter-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.health-filter-heading .eyebrow {
  margin-bottom: 0.25rem;
}

.health-filter-heading h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.health-filter-form,
.health-filter-actions,
.health-filter-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.health-filter-form {
  align-items: flex-end;
  justify-content: space-between;
}

.health-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 260px));
  gap: 0.75rem;
}

.health-filter-actions {
  align-items: flex-end;
  justify-content: flex-end;
}

.health-filter-status {
  align-items: center;
  padding-top: 0.25rem;
}

.health-filter-form label {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.health-filter-form select {
  width: 100%;
}

.health-priority h3 {
  margin: 0;
}

.health-action {
  white-space: nowrap;
}

.governance-card,
.settings-final-actions {
  padding: 20px;
  border: 1px solid rgba(226, 233, 226, 0.88);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.governance-summary-card p:last-child {
  margin-bottom: 0;
}

.governance-card + .governance-card {
  margin-top: 14px;
}

.governance-card + .audit-section {
  margin-top: 24px;
}

.governance-card h2 {
  margin: 0;
}

.governance-card > .muted {
  margin: -0.2rem 0 0.35rem;
}

.governance-card table {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid rgba(211, 224, 214, 0.94);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.governance-card th,
.governance-card td {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(226, 233, 226, 0.86);
  vertical-align: top;
}

.governance-card th {
  background: #f0f7f2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.governance-card tbody tr:nth-child(even) td {
  background: rgba(248, 252, 249, 0.8);
}

.governance-card tbody tr:last-child td {
  border-bottom: 0;
}

.erp-table-card {
  overflow-x: auto;
}

.erp-table-card table {
  width: 100%;
  min-width: 680px;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0;
  background: transparent;
}

.erp-table-card th,
.erp-table-card td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.erp-table-card th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.erp-table-card tbody tr:hover td {
  background: #fbfdfb;
}

.erp-table-card tbody tr:last-child td {
  border-bottom: 0;
}

.erp-table-card td:last-child {
  white-space: normal;
}

.erp-table-card .health-action {
  white-space: nowrap;
}

.settings-disclosure.erp-table-card > table {
  width: calc(100% - 2.5rem);
  margin: 0.35rem 1.25rem 1.25rem;
  border: 1px solid rgba(226, 233, 226, 0.94);
  border-radius: 14px;
  background: #ffffff;
}

.health-priority.erp-table-card {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0;
}

.health-priority.erp-table-card h3 {
  margin: 0 0 0.15rem;
}

.health-priority.erp-table-card table {
  border: 1px solid rgba(226, 233, 226, 0.94);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.health-disclosure.erp-table-card {
  overflow: hidden;
  border-color: rgba(226, 233, 226, 0.88);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.health-disclosure.erp-table-card > summary {
  background: rgba(255, 255, 255, 0.72);
}

.health-disclosure.erp-table-card[open] > summary {
  border-bottom: 1px solid var(--line);
}

.health-disclosure.erp-table-card > table {
  width: calc(100% - 2rem);
  margin: 0 1rem 1rem;
}

.governance-card.erp-table-card table {
  margin: 0.35rem 1.25rem 1.25rem;
}

.audit-table-card {
  margin: 0;
}

.audit-table-card table {
  min-width: 760px;
}

.audit-section {
  gap: 14px;
  scroll-margin-top: var(--settings-anchor-scroll-offset);
}

.audit-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0 0.85rem;
  border-bottom: 1px solid rgba(202, 216, 205, 0.82);
}

.audit-section-heading h2 {
  margin: 0;
}

.audit-section-heading .eyebrow {
  margin-bottom: 0.35rem;
}

.audit-history-list {
  display: grid;
  gap: 14px;
}

.audit-empty-state,
.audit-disclosure {
  border: 1px solid rgba(226, 233, 226, 0.88);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.audit-empty-state {
  display: grid;
  gap: 0.25rem;
  padding: 20px;
}

.audit-empty-state strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.settings-final-actions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
  padding: 16px 18px;
  scroll-margin-top: var(--settings-anchor-scroll-offset);
}

.final-action-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  max-width: 620px;
}

.final-action-copy strong {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: 0;
}

.final-action-copy .muted {
  margin: 0;
}

.final-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.final-action-buttons .button {
  white-space: nowrap;
}

.save-all-config-button {
  white-space: nowrap;
}

.save-config-feedback {
  display: none;
  grid-column: 1 / -1;
  flex-basis: 100%;
  margin-top: 0.85rem;
  padding: 0.8rem 0.95rem;
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.save-config-feedback.info,
.save-config-feedback.success,
.save-config-feedback.error {
  display: block;
}

.save-config-feedback.info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.save-config-feedback.success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.save-config-feedback.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.save-config-feedback ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.settings-disclosure {
  padding: 0;
  overflow: hidden;
}

.settings-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  cursor: pointer;
  list-style: none;
}

.settings-disclosure > summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure > summary strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.settings-disclosure > summary::after {
  content: "Abrir";
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: #eef7f0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.settings-disclosure[open] > summary::after {
  content: "Cerrar";
}

.settings-disclosure > .form-grid,
.settings-disclosure > p {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

.settings-disclosure > p:last-child {
  padding-bottom: 1.25rem;
}

.erp-config-disclosure {
  gap: 0;
  background: rgba(255, 255, 255, 0.92);
}

.erp-config-disclosure > summary {
  min-height: 78px;
  border-bottom: 1px solid transparent;
}

.erp-config-disclosure > summary strong {
  margin-top: 0.25rem;
  letter-spacing: 0;
}

.erp-config-disclosure > summary small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.erp-config-disclosure[open] > summary {
  border-bottom-color: var(--line);
}

.erp-config-disclosure > .form-grid {
  padding-top: 1rem;
  padding-bottom: 1.25rem;
}

.audit-disclosure {
  gap: 0;
}

.audit-summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.audit-detail {
  display: grid;
  gap: 0.85rem;
  padding: 0 1.35rem 1.25rem;
}

.audit-detail p {
  margin: 0;
}

.audit-value {
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.compact-disclosure {
  margin: 0.75rem 0 1.25rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.compact-disclosure > .form-grid {
  padding-bottom: 1.25rem;
}

.inline-disclosure {
  border: 1px solid var(--line);
  box-shadow: none;
}

.inline-disclosure > summary {
  min-height: 58px;
  padding: 0.85rem 1rem;
}

.inline-disclosure > summary strong {
  display: inline;
  margin: 0;
  font-size: 1rem;
}

.inline-disclosure > summary small {
  display: inline-block;
  margin-left: 0.65rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.inline-disclosure > summary::after {
  content: "Mostrar campos";
  padding: 0.42rem 0.75rem;
  background: #eef7f0;
  white-space: nowrap;
}

.inline-disclosure[open] > summary::after {
  content: "Ocultar campos";
}

.inline-disclosure > .form-grid {
  padding-top: 0.2rem;
}

.nested-config-disclosure {
  margin: 0.85rem 1.35rem 1.25rem;
}

.nested-config-disclosure > .form-grid {
  padding-left: 1rem;
  padding-right: 1rem;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

input[type="color"] {
  min-height: 48px;
  padding: 6px;
}

form p:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(17, 27, 22, 0.04);
}

form p:has(input[type="checkbox"]) label {
  margin: 0;
  order: 2;
  cursor: pointer;
}

form p:has(input[type="checkbox"]) input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  order: 1;
}

form p:has(input[type="checkbox"]) .helptext {
  flex-basis: 100%;
  margin-left: 1.75rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.choice-grid > div,
.choice-grid label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.choice-grid label {
  min-height: 42px;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.choice-grid label:has(input:checked) {
  border-color: rgba(34, 197, 94, 0.5);
  background: linear-gradient(135deg, #f0fff5 0%, #ffffff 100%);
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.08);
}

.choice-grid input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

input[disabled],
select[disabled],
textarea[disabled],
[data-locked-field="1"] {
  color: #64746b;
  background: #f3f7f5;
  border-style: dashed;
  cursor: not-allowed;
}

p:has([data-locked-field="1"])::after {
  content: "Protegido";
  display: inline-flex;
  width: max-content;
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #edf7ef;
  color: #0f7a3a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
}

.form-row {
  display: grid;
  gap: 0.42rem;
  margin: 0 0 1rem;
}

.form-row label {
  color: var(--muted);
  font-weight: 900;
}

.form-row .errorlist {
  color: #b91c1c;
  margin: 0.1rem 0 0;
  padding-left: 1.2rem;
  font-weight: 800;
}

.switch-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.switch-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

.certificate-upload-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 1rem;
  align-items: start;
  margin: 1rem 0 1.4rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.72), rgba(255, 255, 255, 0.94));
}

.certificate-upload-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.certificate-upload-card input[type="file"] {
  padding: 0.7rem;
  border: 1px dashed var(--line-strong);
  background: #fff;
}

.sunat-step-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
}

.sunat-step {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.2rem 0.55rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.sunat-step span {
  grid-row: span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--green-dark);
  font-weight: 950;
}

.sunat-step strong {
  color: var(--ink);
  font-weight: 950;
  line-height: 1.15;
}

.sunat-step em {
  width: max-content;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
}

.sunat-step small {
  color: var(--muted);
  line-height: 1.35;
}

.sunat-step.status-configurado em,
.sunat-step.status-probado em {
  background: #dcfce7;
  color: #166534;
}

.sunat-step.status-pendiente em {
  background: #fef3c7;
  color: #92400e;
}

.sunat-step.status-bloqueado em {
  background: #fee2e2;
  color: #991b1b;
}

.sunat-mode-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.4rem;
}

.sunat-mode-guide > div,
.sunat-beta-helper,
.technical-note {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.78), rgba(255, 255, 255, 0.94));
}

.sunat-mode-guide > div {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
}

.sunat-mode-guide > div.is-active {
  border-color: rgba(34, 197, 94, 0.48);
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.08);
}

.sunat-mode-guide > div.danger.is-active {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
}

.sunat-mode-guide strong,
.technical-note strong,
.sunat-beta-helper strong {
  color: var(--ink);
  font-weight: 950;
}

.sunat-mode-guide em {
  width: max-content;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.sunat-mode-guide > div:not(.is-active) em {
  background: #f3f7f5;
  color: var(--muted);
}

.sunat-mode-guide > div.danger.is-active em {
  background: #fee2e2;
  color: #991b1b;
}

.sunat-mode-guide span,
.technical-note span,
.sunat-beta-helper span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.sunat-beta-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.4rem;
  padding: 1rem;
}

.sunat-beta-helper > div,
.technical-note {
  display: grid;
  gap: 0.35rem;
}

.technical-note {
  min-height: 100%;
  padding: 1rem;
}

.credential-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.78), rgba(255, 255, 255, 0.94));
}

.chatwoot-connection-card,
.chatwoot-template-panel,
.chatwoot-token-fields,
.chatwoot-connection-status {
  display: grid;
  gap: 0.8rem;
}

.chatwoot-config-block {
  transition: opacity 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.chatwoot-config-block.is-locked {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.78), rgba(248, 250, 252, 0.96));
  filter: grayscale(1);
  opacity: 0.58;
}

.chatwoot-config-block.is-locked input,
.chatwoot-config-block.is-locked select,
.chatwoot-config-block.is-locked textarea,
.chatwoot-config-block.is-locked button,
.chatwoot-config-block.is-locked label {
  pointer-events: none;
}

.chatwoot-connect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chatwoot-token-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chatwoot-token-actions .muted {
  margin: 0;
}

.chatwoot-connect-row .muted {
  margin: 0;
}

.chatwoot-table-card {
  overflow-x: auto;
}

.chatwoot-sync-table {
  min-width: 920px;
}

.chatwoot-sync-table td {
  vertical-align: middle;
}

.chatwoot-client-cell {
  min-width: 260px;
}

.chatwoot-client-name,
.chatwoot-client-trade,
.chatwoot-meta-line,
.chatwoot-id-label,
.chatwoot-error-label {
  display: block;
}

.chatwoot-client-name {
  color: var(--accent-2);
  font-weight: 900;
  line-height: 1.35;
  text-decoration: none;
}

.chatwoot-client-name:hover {
  color: #047857;
  text-decoration: underline;
}

.chatwoot-client-trade {
  color: var(--ink);
  font-weight: 800;
  margin-top: 3px;
}

.chatwoot-meta-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  margin-top: 4px;
}

.chatwoot-contact-cell {
  min-width: 190px;
}

.chatwoot-contact-stack,
.chatwoot-status-stack,
.chatwoot-last-send {
  display: grid;
  gap: 6px;
}

.chatwoot-contact-stack span,
.chatwoot-last-send span {
  line-height: 1.35;
}

.chatwoot-id-label {
  color: #075985;
  font-size: 12px;
  font-weight: 850;
}

.chatwoot-error-label {
  color: var(--danger);
  font-size: 12px;
  font-weight: 780;
}

.chatwoot-last-send a {
  color: var(--accent-2);
  font-weight: 900;
  text-decoration: none;
}

.chatwoot-last-send a:hover {
  color: #047857;
  text-decoration: underline;
}

.chatwoot-actions-heading,
.chatwoot-actions-cell {
  min-width: 188px;
  width: 188px;
  text-align: right;
}

.chatwoot-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.chatwoot-row-actions form {
  margin: 0;
}

.icon-button.quote-icon-button {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.icon-button.quote-icon-button:hover {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.icon-button.chatwoot-icon-button {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #075985;
}

.icon-button.chatwoot-icon-button:hover {
  background: #0ea5e9;
  border-color: #0284c7;
  color: #fff;
}

.icon-button.chatwoot-conversation-button {
  background: #ede9fe;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.icon-button.chatwoot-conversation-button:hover {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.compact-credential {
  margin-top: 0.9rem;
}

.sticky-save-card {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 1rem;
}

.save-card {
  padding: 1rem;
}

.credential-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.credential-card-header strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.form-grid.compact {
  gap: 0.65rem;
}

.form-grid.compact p {
  margin-bottom: 0;
}

.switch-row.simple {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
}

.switch-row.simple label {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
}

.technical-note code,
.sunat-beta-helper code {
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
  font-weight: 800;
}

.settings-switches .switch-row {
  display: grid;
}

.settings-switches .switch-row.is-disabled,
.settings-card .switch-row.is-disabled,
.switch-card.is-disabled {
  opacity: 0.55;
  background: #f4f7f3;
}

.settings-switches .switch-row.is-disabled label,
.settings-card .switch-row.is-disabled label,
.switch-card.is-disabled label {
  cursor: not-allowed;
}

[data-sensitive-field="1"] {
  border-style: dashed;
  background: linear-gradient(135deg, #fff 0%, #fffaf0 100%);
}

.code-block {
  max-height: 360px;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0b1712;
  color: #d9fbe8;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.sunat-diagnostic {
  border-left: 6px solid rgba(245, 158, 11, 0.85);
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 72%);
}

.sunat-diagnostic-success {
  border-left-color: rgba(34, 197, 94, 0.85);
  background: linear-gradient(135deg, #effdf5 0%, #ffffff 72%);
}

.sunat-diagnostic-danger {
  border-left-color: rgba(239, 68, 68, 0.85);
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 72%);
}

.sunat-diagnostic-info {
  border-left-color: rgba(14, 165, 233, 0.85);
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 72%);
}

.next-steps {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.next-steps h3 {
  margin-top: 0;
}

.next-steps ol {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.next-steps li + li {
  margin-top: 0.45rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
  gap: 24px;
  margin-bottom: 24px;
}

.hero-card,
.action-card,
.module-card,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.hero-card {
  min-height: 190px;
  padding: 32px;
  color: #ffffff;
  background:
    radial-gradient(circle at 90% 10%, rgba(34, 197, 94, 0.32), transparent 12rem),
    linear-gradient(135deg, #102017 0%, #14532d 100%);
}

.hero-card h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 0.95;
}

.hero-card p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
}

.action-card,
.module-card {
  padding: 24px;
}

.action-card h2,
.module-card h2 {
  margin-top: 0;
}

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

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -26px;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
}

.kpi-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  font-size: 1.45rem;
}

.content-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

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

.module-card p {
  margin: 0.45rem 0;
}

.catalog-tools {
  gap: 0.75rem;
}

.catalog-indicator-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  margin: 0 0 16px;
}

.catalog-indicator-card {
  --indicator-accent: #7a8a80;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-left: 4px solid var(--indicator-accent);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(13, 30, 21, 0.06);
  color: inherit;
  display: block;
  min-height: 118px;
  padding: 16px 15px 14px;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.catalog-indicator-card:hover,
.catalog-indicator-card:focus-visible {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--indicator-accent) 42%, var(--line));
  box-shadow: 0 16px 34px rgba(13, 30, 21, 0.1);
  transform: translateY(-1px);
}

.catalog-indicator-card:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.catalog-indicator-card.is-active {
  background: color-mix(in srgb, var(--indicator-accent) 9%, #ffffff);
  border-color: color-mix(in srgb, var(--indicator-accent) 52%, var(--line));
  box-shadow: 0 18px 34px rgba(13, 30, 21, 0.12);
}

.catalog-indicator-card.is-warning {
  --indicator-accent: #f59e0b;
}

.catalog-indicator-card.is-danger {
  --indicator-accent: #dc2626;
}

.catalog-indicator-card.is-attention {
  --indicator-accent: #2563eb;
}

.catalog-indicator-card.is-info {
  --indicator-accent: #0f766e;
}

.catalog-indicator-card.is-muted {
  --indicator-accent: #64748b;
}

.catalog-indicator-card span,
.catalog-indicator-card small {
  color: var(--muted);
  display: block;
  font-weight: 800;
}

.catalog-indicator-card span {
  font-size: 0.92rem;
}

.catalog-indicator-card strong {
  color: var(--ink);
  display: block;
  font-size: 1.85rem;
  line-height: 1;
  margin: 18px 0 8px;
}

.catalog-indicator-card small {
  font-size: 0.78rem;
  line-height: 1.25;
}

.product-per-page-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  height: 40px;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.product-per-page-control select {
  height: 40px;
  margin: 0;
  width: auto;
  min-width: 76px;
  padding: 8px 28px 8px 10px;
}

.catalog-list-summary {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 0 1rem;
}

.catalog-list-count {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  height: 40px;
  line-height: 1;
  min-width: 0;
}

.catalog-list-count strong {
  align-items: center;
  display: inline-flex;
  font-size: 1.25rem;
  height: 40px;
  line-height: 1;
}

.catalog-list-count span,
.catalog-list-controls p,
.product-per-page-control span {
  align-items: center;
  display: inline-flex;
  font-size: 0.95rem;
  height: 40px;
  line-height: 1;
  margin: 0;
}

.catalog-list-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  margin-left: auto;
  height: 40px;
  min-width: 0;
}

.catalog-list-controls p {
  text-align: right;
}

.catalog-table-scroll {
  overflow-x: auto;
  width: 100%;
}

.catalog-table-scroll:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 4px;
}

.catalog-table-scroll table {
  display: table;
  overflow: visible;
  min-width: 1220px;
}

.catalog-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 0.9rem;
  padding: 0.9rem 0 0;
}

.catalog-pagination-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.catalog-page-link,
.catalog-page-ellipsis {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  min-width: 36px;
}

.catalog-page-link {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 0 0.65rem;
  text-decoration: none;
}

.catalog-page-link:hover {
  background: #eef7f0;
  border-color: #b9dec2;
  color: var(--success);
}

.catalog-page-link.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.catalog-page-link.is-disabled {
  color: var(--muted);
  opacity: 0.45;
  pointer-events: none;
}

.catalog-page-ellipsis {
  color: var(--muted);
  padding: 0 0.25rem;
}

.provider-page-section {
  position: relative;
  transition: opacity 0.16s ease;
}

.provider-page-section.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.provider-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.provider-table-wrap table {
  min-width: 760px;
}

.provider-branch-name-cell > strong {
  display: block;
}

.provider-branch-list-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0.3rem 0;
  font-size: 0.8rem;
}

.provider-branch-list-summary .badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
}

.provider-branch-list-summary a,
.provider-list-branch-filter a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.provider-branch-unassigned-note {
  border-left: 3px solid var(--warning);
  padding: 0.6rem 0.8rem;
  background: #fff9eb;
}

.provider-branch-list-help {
  font-size: 0.8rem;
  margin-top: 0.8rem;
}

.provider-list-branch-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
}

.provider-pagination {
  margin-top: 1rem;
}

.provider-detail-section-picker {
  margin-bottom: 1rem;
}

.provider-detail-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.provider-detail-section-tabs a {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 800;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
}

.provider-detail-section-tabs a:hover {
  background: #eef7f0;
  border-color: #b9dec2;
  color: var(--success);
}

.provider-detail-section-tabs a.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.provider-detail-section-host {
  transition: opacity 0.16s ease;
}

.provider-detail-section-host.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 720px) {
  .catalog-list-controls,
  .catalog-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-list-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
  }

  .catalog-list-controls p {
    text-align: left;
  }

  .catalog-list-controls {
    height: auto;
    margin-left: 0;
    width: 100%;
  }

  .product-image-status-header {
    align-items: stretch;
    flex-direction: column;
  }

  .product-image-status-header .button {
    width: 100%;
  }

  .product-image-status-dismiss {
    align-self: flex-end;
  }
}

.catalog-helper-card h2 {
  margin-top: 0;
}

.product-form-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-top: 1rem;
  padding: 1rem;
}

.product-form-section:first-of-type {
  margin-top: 0;
}

.product-form-section-heading {
  margin-bottom: 0.85rem;
}

.product-form-section-heading .eyebrow,
.product-form-section-heading p {
  margin-bottom: 0;
}

.product-form-section-heading .muted {
  font-size: 0.86rem;
  line-height: 1.45;
  margin-top: 0.25rem;
}

.product-form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-quick-form .product-form-grid {
  grid-template-columns: 1fr;
}

.quote-form-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-top: 1rem;
  padding: 1rem;
}

.quote-form-section:first-of-type {
  margin-top: 0;
}

.quote-form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.quotation-quick-form .quote-form-grid {
  grid-template-columns: 1fr;
}

.warehouse-form-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
}

.warehouse-form-section:first-of-type {
  margin-top: 0;
}

.warehouse-form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.warehouse-section-heading {
  display: grid;
  gap: 0.25rem;
}

.warehouse-section-heading .eyebrow,
.warehouse-section-heading p {
  margin-bottom: 0;
}

.warehouse-section-heading .muted {
  font-size: 0.86rem;
  line-height: 1.45;
}

.warehouse-code-row {
  background: rgba(34, 197, 94, 0.06);
  border-radius: 14px;
  padding: 0.75rem;
}

.warehouse-active-row {
  margin-bottom: 0;
}

.warehouse-next-step-hint {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
  color: #1d2b23;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
  margin-top: 1rem;
  padding: 0.72rem 0.78rem;
}

.warehouse-quick-form .warehouse-form-grid {
  grid-template-columns: 1fr;
}

.warehouse-quick-form .warehouse-form-section {
  gap: 0.75rem;
}

.supplier-branch-quick-form .warehouse-form-section {
  gap: 0.75rem;
}

.supplier-branch-code-row {
  background: rgba(9, 30, 21, 0.035);
  border-radius: 14px;
  padding: 0.75rem;
}

.supplier-branch-form-section textarea {
  min-height: 92px;
}

.quote-form-section .form-row:last-child {
  margin-bottom: 0;
}

.product-type-row {
  background: rgba(34, 197, 94, 0.06);
  border-radius: 14px;
  padding: 0.75rem;
}

.product-media-section {
  background: #fbfefc;
}

.product-media-grid {
  align-items: start;
}

.product-media-manager {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.product-media-tile {
  background: #ffffff;
  border: 1px solid #d8eadf;
  border-radius: 10px;
  display: grid;
  gap: 0;
  min-height: 152px;
  padding: 0.5rem;
  position: relative;
}

.product-media-tile.is-primary {
  border-color: #9be1b3;
  box-shadow: inset 4px 0 0 #22c55e;
}

.product-media-tile.is-pending {
  border-color: #9be1b3;
  box-shadow: inset 4px 0 0 #22c55e;
}

.product-media-tile.is-marked-removal {
  border-color: #fecaca;
  box-shadow: inset 4px 0 0 var(--danger);
}

.product-media-tile.is-selected-primary {
  border-color: #bfdbfe;
  box-shadow: inset 4px 0 0 #2563eb;
}

.product-media-tile.is-empty {
  align-content: center;
  align-items: center;
  border: 1px dashed #cfded5;
  color: #596960;
  cursor: default;
  gap: 0.45rem;
  justify-items: center;
  min-height: 152px;
  text-align: center;
}

.product-media-tile.is-empty:has(.product-media-slot-picker:hover),
.product-media-tile.is-empty:has(.product-media-slot-picker:focus-visible) {
  background: #f4fbf6;
  border-color: #9be1b3;
  color: #123b22;
}

.product-media-slot-picker:focus-visible,
.product-media-upload-trigger:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 3px;
}

.product-media-slot-picker {
  align-content: center;
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.5rem;
  height: 100%;
  justify-items: center;
  min-height: 140px;
  padding: 0.5rem;
  width: 100%;
}

.product-media-add-icon {
  align-items: center;
  background: #e8f6ed;
  border-radius: 999px;
  color: #123b22;
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.product-media-tile-label {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
  min-width: 0;
}

.product-media-tile-label strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-media-tile.is-empty strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

.product-media-chip {
  background: #eef8f1;
  border: 1px solid rgba(34, 197, 94, 0.16);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.24rem 0.42rem;
}

.product-media-tile-label + .product-media-preview {
  margin-top: 0.55rem;
}

.product-media-preview {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #f7fbf8;
  border: 1px solid #e4f0e8;
  border-radius: 10px;
  color: #607066;
  display: flex;
  font-size: 0.78rem;
  font-weight: 850;
  justify-content: center;
  min-height: 88px;
  overflow: hidden;
  padding: 0.35rem;
  position: relative;
  text-align: center;
}

.product-media-preview-media {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.product-media-preview-media img {
  display: block;
  height: auto;
  max-height: 86%;
  max-width: 88%;
  object-fit: contain;
  width: auto;
}

.product-media-preview-media span {
  padding: 0.35rem;
}

.product-media-tile.is-marked-removal .product-media-preview-media {
  filter: grayscale(0.35);
  opacity: 0.42;
}

.product-media-tile.is-selected-primary .product-media-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.product-media-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.28rem;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  transition: opacity 0.16s ease;
  z-index: 2;
}

.product-media-tile:hover .product-media-actions,
.product-media-tile:focus-within .product-media-actions {
  opacity: 1;
  pointer-events: auto;
}

.icon-button.product-media-icon-action {
  align-items: center;
  appearance: none;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(13, 30, 21, 0.12);
  border-radius: 10px;
  box-sizing: border-box;
  box-shadow: 0 8px 18px rgba(13, 30, 21, 0.12);
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

label.icon-button.product-media-icon-action {
  display: inline-flex;
  margin: 0;
}

.icon-button.product-media-icon-action:hover,
.icon-button.product-media-icon-action:focus-visible {
  background: #e8f6ed;
}

.icon-button.product-media-icon-action.danger {
  background: rgba(254, 242, 242, 0.96);
  border-color: #fecaca;
  color: #b91c1c;
}

.icon-button.product-media-icon-action.danger:hover,
.icon-button.product-media-icon-action.danger:focus-visible {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.icon-button.product-media-icon-action svg {
  height: 15px;
  width: 15px;
}

.product-media-upload-trigger {
  cursor: pointer;
}

@media (hover: none), (max-width: 700px) {
  .product-media-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

.product-media-slot-input {
  block-size: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  inline-size: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.product-media-pending-note {
  background: rgba(236, 253, 243, 0.94);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 999px;
  bottom: 0.35rem;
  box-shadow: 0 6px 14px rgba(13, 30, 21, 0.08);
  color: #166534;
  font-size: 0.75rem;
  font-weight: 850;
  left: 0.35rem;
  line-height: 1;
  max-width: calc(100% - 0.7rem);
  overflow: hidden;
  padding: 0.28rem 0.45rem;
  position: absolute;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
}

.product-media-tile.is-marked-removal .product-media-pending-note {
  background: rgba(254, 242, 242, 0.96);
  border-color: #fecaca;
  color: #b91c1c;
}

.product-media-tile.is-selected-primary .product-media-pending-note {
  background: rgba(239, 246, 255, 0.96);
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.product-media-hidden-inputs {
  block-size: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  inline-size: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.product-media-selection-summary {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #14532d;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
}

.product-media-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
}

.product-image-primary-row {
  min-width: 0;
}

.product-image-field {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.product-current-image {
  align-items: center;
  background: #f6fbf8;
  border: 1px solid #d8eadf;
  border-radius: 12px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.72rem 0.78rem;
}

.product-current-image-summary {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.product-current-image-eyebrow,
.product-image-upload-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.product-current-image-name {
  color: #078a42;
  font-size: 0.9rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.product-current-image-link {
  color: #057a3a;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.product-current-image-link:hover {
  text-decoration: underline;
}

.product-image-clear {
  align-items: flex-start;
  background: #fffafb;
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  margin: 0;
  padding: 0.72rem 0.78rem;
}

.product-image-clear input[type="checkbox"] {
  accent-color: #dc2626;
  flex: 0 0 auto;
  height: 1.08rem;
  margin-top: 0.12rem;
  width: 1.08rem;
}

.product-image-clear strong {
  color: #7f1d1d;
  display: block;
  font-size: 0.88rem;
  line-height: 1.25;
}

.product-image-clear small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  margin-top: 0.18rem;
}

.product-image-upload {
  display: grid;
  gap: 0.38rem;
}

.product-image-primary-row > label,
.product-image-gallery-row > label {
  margin-bottom: 0.35rem;
}

.product-image-field input[type="file"],
.product-image-gallery-row input[type="file"] {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  min-height: 46px;
  padding: 0.5rem;
}

.product-image-field input[type="file"]::file-selector-button,
.product-image-gallery-row input[type="file"]::file-selector-button {
  background: #e8f6ed;
  border: 0;
  border-radius: 8px;
  color: #123b22;
  cursor: pointer;
  font-weight: 850;
  margin-right: 0.7rem;
  padding: 0.48rem 0.72rem;
}

.product-image-field input[type="file"]:hover::file-selector-button,
.product-image-gallery-row input[type="file"]:hover::file-selector-button {
  background: #d6f0df;
}

.product-quick-form .product-current-image {
  align-items: flex-start;
  grid-template-columns: 1fr;
}

.product-quick-form .product-media-manager {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form-section.is-muted-section {
  opacity: 0.48;
}

.product-form-section.is-muted-section::after {
  color: var(--muted);
  content: "Usando ruta express: estos campos se completan automáticamente.";
  display: block;
  font-size: 0.82rem;
  margin-top: 0.7rem;
}

.product-code-generate {
  min-height: 44px;
  white-space: nowrap;
}

.warehouse-code-generate {
  min-height: 44px;
  white-space: nowrap;
}

.product-code-action-row,
.warehouse-code-action-row,
.client-document-action-row,
.product-lookup-action-row {
  display: grid;
  gap: 0.65rem;
  align-items: center;
}

.product-code-action-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.warehouse-code-action-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.product-code-action-row input,
.warehouse-code-action-row input {
  min-width: 0;
}

.client-document-action-row {
  grid-template-columns: 1fr auto;
}

.product-lookup-action-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.product-lookup-action-row input {
  min-width: 0;
}

.product-lookup-inline-actions {
  align-items: center;
  display: flex;
  gap: 0.42rem;
}

.product-lookup-action-row .icon-button {
  border-radius: 12px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  width: 44px;
}

.product-lookup-action-row .icon-button:disabled {
  background: #f3f7f4;
  cursor: not-allowed;
  opacity: 0.42;
}

.product-lookup-results {
  background: #fff;
  border: 1px solid #d8eadf;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(8, 28, 17, 0.1);
  display: grid;
  gap: 0.42rem;
  margin-top: 0.5rem;
  max-height: min(54vh, 360px);
  overflow-y: auto;
  padding: 0.45rem;
  position: relative;
  z-index: 20;
}

.product-lookup-results.has-create {
  max-height: min(62vh, 440px);
}

.product-lookup-option {
  align-items: center;
  background: #fff;
  border: 1px solid #edf4ef;
  border-radius: 8px;
  box-shadow: none;
  color: #07150d;
  cursor: pointer;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 74px minmax(0, 1fr);
  justify-content: stretch;
  line-height: 1.25;
  min-height: 90px;
  min-width: 0;
  padding: 0.55rem;
  text-align: left;
  white-space: normal;
  width: 100%;
}

.product-lookup-option:hover,
.product-lookup-option:focus {
  background: #ecfdf3;
  border-color: #9be7b5;
  outline: none;
}

.product-lookup-option strong {
  color: #07150d;
  font-size: 0.86rem;
  line-height: 1.2;
}

.product-lookup-media {
  align-items: center;
  background: #f1f7f3;
  border: 1px solid #d8eadf;
  border-radius: 8px;
  color: #607066;
  display: flex;
  height: 74px;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  width: 74px;
}

.product-lookup-option > .product-lookup-media.is-empty {
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0.4rem;
  text-align: center;
}

.product-lookup-image {
  background: #fff;
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.product-lookup-selected-card {
  background: #f7fbf8;
  border: 1px solid #bdeccb;
  border-radius: 12px;
  display: grid;
  gap: 0.62rem;
  margin-top: 0.22rem;
  padding: 0.72rem;
}

.product-lookup-selected-card[hidden] {
  display: none;
}

.product-lookup-selected-heading {
  align-items: center;
  color: #607066;
  display: flex;
  font-size: 0.72rem;
  font-weight: 900;
  gap: 0.5rem;
  justify-content: space-between;
  line-height: 1.15;
}

.product-lookup-selected-chip {
  background: #e8f8ee;
  border: 1px solid #c8ecd4;
  border-radius: 999px;
  color: #607066;
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.2rem 0.48rem;
}

.product-lookup-selected-body {
  align-items: center;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 64px minmax(0, 1fr);
  min-width: 0;
}

.product-lookup-selected-body .product-lookup-media {
  height: 64px;
  width: 64px;
}

.product-lookup-selected-body .product-lookup-media.is-empty {
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0.36rem;
  text-align: center;
}

.product-lookup-selected-main {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.product-lookup-selected-title {
  color: #07150d;
  display: -webkit-box;
  font-size: 0.9rem;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-lookup-selected-actions {
  align-items: center;
  display: flex;
  gap: 0.42rem;
  justify-content: flex-end;
}

.product-lookup-selected-actions .icon-button {
  border-radius: 11px;
  height: 36px;
  min-height: 36px;
  min-width: 36px;
  width: 36px;
}

.product-lookup-main {
  display: grid;
  gap: 0.24rem;
  justify-items: stretch;
  min-width: 0;
}

.product-lookup-header {
  align-items: start;
  display: grid;
  gap: 0.24rem;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  min-width: 0;
}

.product-lookup-code {
  align-self: start;
  background: #e8f8ee;
  border-radius: 7px;
  color: #009b4e;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  padding: 0.14rem 0.42rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-lookup-title,
.product-lookup-secondary {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}

.product-lookup-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-lookup-secondary {
  color: #607066;
  display: -webkit-box;
  font-size: 0.73rem;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.25;
}

.product-lookup-meta {
  align-items: center;
  color: #44564b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  min-width: 0;
  overflow: visible;
}

.product-lookup-meta-item {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: normal;
}

.product-lookup-meta-item.is-price,
.product-lookup-meta-item.is-stock {
  color: #122018;
}

.product-lookup-meta-item.is-provider {
  color: #607066;
}

.product-lookup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.product-lookup-chip {
  background: #f1f7f3;
  border: 1px solid #d8eadf;
  border-radius: 999px;
  color: #607066;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.5rem;
}

.product-lookup-option > span,
.product-lookup-option small,
.product-lookup-empty {
  color: #607066;
  font-size: 0.8rem;
  font-weight: 700;
}

.product-lookup-empty {
  padding: 0.75rem 0.85rem;
}

.product-lookup-create-card {
  background: #f7fbf8;
  border: 1px dashed #9be7b5;
  border-radius: 8px;
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
}

.product-lookup-create-card strong {
  color: #07150d;
  font-size: 0.86rem;
  line-height: 1.2;
}

.product-lookup-create-card p {
  color: #607066;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.product-lookup-create-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.product-lookup-create-grid input,
.product-lookup-create-grid select {
  min-height: 42px;
}

.product-lookup-check {
  align-items: center;
  background: #fff;
  border: 1px solid #d8eadf;
  border-radius: 13px;
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
}

.product-lookup-create-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.product-lookup-create-message {
  color: #b42318;
  font-weight: 800;
}

/* Alta mínima dentro de una cotización: un único estado y una sola columna. */
.product-lookup-empty-quote {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
}

.product-lookup-empty-quote strong {
  color: #122018;
  font-size: 0.9rem;
}

.product-lookup-empty-quote p {
  margin: 0;
}

.quote-draft-create-card {
  background: #f7fbf8;
}

.product-lookup-type-field {
  border: 0;
  margin: 0;
  min-inline-size: 0;
  padding: 0;
}

.product-lookup-type-field legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  margin-bottom: 0.4rem;
  padding: 0;
}

.product-lookup-type-segment {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 1fr 1fr;
}

.product-lookup-type-segment input {
  block-size: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  inline-size: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.product-lookup-type-segment label {
  align-items: center;
  background: #fff;
  border: 1px solid #cfe5d6;
  border-radius: 9px;
  color: #385143;
  cursor: pointer;
  display: flex;
  font-size: 0.8rem;
  font-weight: 850;
  justify-content: center;
  margin: 0;
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  text-align: center;
}

.product-lookup-type-segment input:checked + label {
  background: #e8f8ee;
  border-color: #39965c;
  color: #123f26;
}

.product-lookup-type-segment input:focus-visible + label {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.quote-draft-create-grid,
.quote-draft-identifier-grid {
  grid-template-columns: 1fr;
}

.product-lookup-create-field {
  display: grid;
  gap: 0.28rem;
}

.product-lookup-create-field label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.field-required {
  color: #b42318;
}

.product-lookup-create-field.has-error input {
  border-color: #b42318;
}

.product-lookup-create-field-error {
  color: #b42318;
  font-size: 0.74rem;
  font-weight: 750;
}

.quote-draft-identifiers {
  background: #fff;
  border: 1px solid #d8eadf;
  border-radius: 9px;
  padding: 0.6rem 0.7rem;
}

.quote-draft-identifiers summary {
  color: #264936;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.quote-draft-identifiers > p {
  font-size: 0.72rem;
  margin: 0.45rem 0 0.6rem;
}

.quote-draft-identifiers:not([open]) > :not(summary) {
  display: none;
}

.quote-line-configuration {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.quote-line-availability {
  background: #f7fbf8;
  border: 1px solid #bdeccb;
  border-radius: 10px;
  color: #284838;
  display: grid;
  font-size: 0.8rem;
  gap: 0.2rem;
  line-height: 1.35;
  padding: 0.65rem 0.72rem;
}

.quote-line-availability strong {
  color: #163222;
  font-size: 0.8rem;
}

.quote-line-add-panel form {
  display: grid;
  gap: 0.95rem;
  min-width: 0;
}

.quote-line-search-stage,
.quote-line-stage-section,
.quote-line-configuration {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.quote-line-search-stage {
  background: #fbfdfb;
  border: 1px solid #d8eadf;
  border-radius: 14px;
  padding: 0.9rem;
}

.quote-line-search-actions {
  background: #f7fbf8;
  border: 1px solid #d8eadf;
  border-radius: 10px;
  display: grid;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding: 0.75rem;
}

.quote-line-search-actions p {
  line-height: 1.4;
  margin: 0;
}

.quote-line-search-actions .button {
  justify-self: start;
}

.quote-line-draft-stage {
  background: #f5faf6;
  border: 1px solid #bdeccb;
  border-radius: 12px;
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.75rem;
}

.quote-line-draft-stage[hidden] {
  display: none;
}

.quote-line-draft-stage .quote-draft-create-card {
  background: #fff;
  border-color: #cfe5d6;
  border-style: solid;
}

.quote-draft-create-heading {
  display: grid;
  gap: 0.35rem;
}

.quote-draft-create-heading .eyebrow,
.quote-draft-create-heading h3,
.quote-draft-create-heading p {
  margin: 0;
}

.quote-draft-create-heading p:not(.eyebrow) {
  color: #385143;
  font-size: 0.8rem;
  line-height: 1.4;
}

.quote-draft-return {
  justify-self: start;
}

.quote-draft-type-notice {
  align-items: center;
  background: #fff;
  border: 1px solid #d8eadf;
  border-radius: 10px;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  padding: 0.65rem 0.7rem;
}

.quote-draft-type-notice p {
  color: #385143;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}

.quote-draft-type-notice .button {
  flex: 0 0 auto;
}

.quote-draft-candidates {
  background: #fffdf5;
  border: 1px solid #ead9a4;
  border-inline-start: 3px solid #c99524;
  border-radius: 10px;
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
}

.quote-draft-candidates strong {
  color: #57411a;
  font-size: 0.84rem;
}

.quote-draft-candidates p {
  color: #665a3a;
  font-size: 0.78rem;
  line-height: 1.35;
  margin: 0;
}

.quote-draft-candidate-options {
  display: grid;
  gap: 0.45rem;
}

.quote-draft-candidate-options .button {
  justify-content: flex-start;
  text-align: left;
}

.quote-line-search-actions .button:focus-visible,
.quote-draft-type-notice .button:focus-visible,
.quote-draft-candidate-options .button:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.quote-line-add-panel .product-lookup-results,
.quote-line-add-panel .product-lookup-results.has-create {
  max-height: none;
  overflow: visible;
}

.quote-line-stage-heading,
.quote-line-stage-section {
  display: grid;
  gap: 0.28rem;
}

.quote-line-stage-heading h3,
.quote-line-stage-section h3 {
  color: #183827;
  font-size: 0.98rem;
  margin: 0;
}

.quote-line-stage-heading .eyebrow,
.quote-line-stage-section .eyebrow {
  margin: 0;
}

.quote-line-stage-heading .muted {
  margin: 0;
}

.quote-line-configuration {
  border-top: 1px solid #d8eadf;
  padding-top: 1rem;
}

.quote-line-configuration[hidden],
.quote-line-add-form .quick-panel-actions[hidden] {
  display: none;
}

.quote-line-availability {
  align-items: flex-start;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: 12px;
  display: grid;
  gap: 0.24rem;
  padding: 0.7rem 0.75rem;
}

.quote-line-stage-section [data-quote-price-suggestion-hint] {
  display: grid;
  gap: 0.45rem;
}

.quote-line-stage-section [data-quote-price-suggestion-hint] .button {
  justify-self: start;
}

.quote-line-stage-section input.is-locked {
  background: #f5f8f5;
  color: #385143;
  cursor: default;
}

.quote-line-source {
  color: #4d6657;
}

.quote-line-configuration h3 {
  color: #385143;
  font-size: 0.8rem;
  margin: 0;
}

.quote-line-pricing-fields,
.quote-line-quantity-fields,
.quote-line-description-section {
  display: grid;
  gap: 0.7rem;
}

.quote-line-pricing-fields input.is-locked {
  background: #f5f8f5;
  color: #385143;
  cursor: default;
}

.quote-line-pricing-fields [data-quote-price-suggestion-hint] {
  display: grid;
  gap: 0.45rem;
}

.quote-line-pricing-fields [data-quote-price-suggestion-hint] .button {
  justify-self: start;
}

.quote-line-description-section {
  border-top: 1px solid #d8eadf;
  margin-top: 0.1rem;
  padding-top: 0.9rem;
}

.quote-line-add-form .quick-panel-actions {
  background: var(--surface);
  bottom: -24px;
  position: sticky;
  z-index: 4;
  padding-bottom: 24px;
}

.quick-panel-card.quote-line-panel-card .quick-panel-heading {
  background: var(--surface);
  margin-bottom: 14px;
  padding: 14px 0 12px;
  position: sticky;
  top: -24px;
  z-index: 5;
}

.product-lookup-change-button {
  min-height: 36px;
  padding: 0.45rem 0.65rem;
}

@media (max-width: 640px) {
  .product-quick-form .product-media-manager,
  .product-media-manager {
    grid-template-columns: 1fr;
  }

  .product-lookup-option {
    gap: 0.55rem;
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 82px;
  }

  .product-lookup-media {
    height: 64px;
    width: 64px;
  }

  .product-lookup-selected-body {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .product-lookup-selected-body .product-lookup-media {
    height: 56px;
    width: 56px;
  }

  .product-lookup-selected-actions .icon-button {
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    width: 34px;
  }

  .product-lookup-header {
    gap: 0.24rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .product-lookup-code {
    justify-self: start;
    max-width: 100%;
  }

  .quote-line-add-form .quick-panel-actions {
    bottom: -20px;
    padding-bottom: 20px;
  }

  .quick-panel-card.quote-line-panel-card .quick-panel-heading {
    top: -20px;
  }

  .quote-line-search-actions .button,
  .quote-draft-type-notice .button,
  .quote-draft-candidate-options .button {
    justify-content: center;
    width: 100%;
  }

  .quote-draft-type-notice {
    align-items: stretch;
    flex-direction: column;
  }
}

.product-thumb {
  align-items: center;
  background: #ecfdf3;
  border: 1px solid #d8eadf;
  border-radius: 14px;
  color: #607066;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  height: 54px;
  justify-content: center;
  object-fit: cover;
  width: 54px;
}

.product-thumb-empty {
  line-height: 1.1;
  padding: 0.35rem;
  text-align: center;
}

.product-detail-card {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(180px, 260px) 1fr;
}

.product-detail-media {
  align-content: start;
  display: grid;
  gap: 0.9rem;
}

.product-lifecycle-card {
  display: grid;
  gap: 1rem;
}

.product-lifecycle-action {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid #dce9e0;
  border-radius: 14px;
  background: #fbfdfb;
}

.product-lifecycle-action h3,
.product-lifecycle-action p,
.product-lifecycle-action form {
  margin: 0;
}

.product-lifecycle-action h3 {
  color: #183827;
  font-size: 1rem;
}

.product-lifecycle-action.critical-action {
  border-color: #f2caca;
  background: #fffafa;
}

.product-lifecycle-action.critical-action h3 {
  color: #972828;
}

.product-lifecycle-dependencies {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
}

.product-lifecycle-action form {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.product-lifecycle-action label {
  flex: 1 0 100%;
  font-weight: 800;
}

.product-lifecycle-action input {
  max-width: 320px;
}

@media (max-width: 640px) {
  .product-detail-actions-popover {
    right: 0;
    left: auto;
  }

  .product-lifecycle-action input {
    width: 100%;
    max-width: 100%;
  }
}

.product-main-image-frame {
  background: #f8fdfa;
  border: 1px solid #d8eadf;
  border-radius: 24px;
  padding: 0.55rem;
}

.product-main-image {
  align-items: center;
  background: #ecfdf3;
  border: 1px solid #d8eadf;
  border-radius: 24px;
  display: flex;
  min-height: 220px;
  object-fit: contain;
  padding: 0.5rem;
  text-align: center;
  width: 100%;
}

.product-main-image-frame .product-main-image {
  background: transparent;
  border: 0;
  border-radius: 18px;
  padding: 0;
}

.product-main-image-empty {
  color: #607066;
  font-weight: 800;
  justify-content: center;
}

.product-gallery {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.product-gallery-item,
.product-gallery-empty {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #f7fbf8;
  border: 1px solid #e4f0e8;
  border-radius: 10px;
  color: #607066;
  display: flex;
  font-size: 0.7rem;
  font-weight: 850;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
}

.product-gallery-item img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.product-gallery-empty {
  aspect-ratio: auto;
  grid-column: 1 / -1;
  min-height: 74px;
  padding: 0.75rem;
}

.small-button {
  font-size: 0.78rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.7rem;
}

@media (max-width: 1100px) {
  .hero-grid,
  .content-grid.two-columns,
  .quote-form-grid,
  .product-detail-card {
    grid-template-columns: 1fr;
  }

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

  .certificate-upload-card,
  .sunat-mode-guide {
    grid-template-columns: 1fr;
  }

  .sunat-step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sunat-beta-helper {
    align-items: stretch;
    flex-direction: column;
  }
}

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

  .sunat-step-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .settings-final-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .final-action-buttons {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .settings-anchor-nav {
    top: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.85rem;
  }

  .health-filter-form,
  .health-filter-fields,
  .health-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .governance-card {
    overflow-x: auto;
  }

  .governance-card table {
    min-width: 680px;
  }

.final-action-buttons .button {
    width: 100%;
    justify-content: center;
  }
}

.quote-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.quote-page-header h1 {
  font-size: 2.75rem;
  letter-spacing: 0;
  line-height: 1.04;
  margin: 0;
}

.quote-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 4px;
}

.quote-page-actions .button {
  min-height: 38px;
}

.quote-summary-card {
  overflow: visible;
  padding: 22px;
}

.quote-summary-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px;
  align-items: stretch;
  border-bottom: 1px solid rgba(10, 31, 24, 0.10);
  padding-bottom: 18px;
}

.quote-summary-primary {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.quote-summary-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.quote-summary-kicker {
  color: var(--accent, #00a651);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.quote-status-badge {
  border: 1px solid transparent;
  font-size: 0.78rem;
  min-height: 28px;
  padding: 6px 12px;
}

.quote-status-borrador {
  background: #edf2f7;
  border-color: #d8e0e8;
  color: #334155;
}

.quote-status-enviada {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.quote-status-aceptada,
.quote-status-convertida_orden {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.quote-status-rechazada,
.quote-status-anulada {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.quote-summary-deadline {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 11px;
}

.quote-summary-deadline.is-warning {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.quote-summary-primary h2 {
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0;
}

.quote-summary-primary h2 a {
  color: var(--ink);
}

.quote-summary-primary h2 a:hover {
  color: var(--accent-2);
}

.quote-summary-document {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.quote-summary-total-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbf8 0%, #ecfdf3 100%);
  padding: 18px;
  text-align: right;
}

.quote-summary-total-box span {
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quote-summary-total-box strong {
  color: #071a13;
  font-size: 2.625rem;
  letter-spacing: 0;
  line-height: 1;
}

.quote-summary-total-box small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.4;
}

.quote-summary-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 2px;
}

.quote-alert-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 6px 10px;
}

.quote-alert-critical {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.quote-summary-sections {
  display: grid;
  gap: 0 30px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.quote-summary-panel {
  min-width: 0;
}

.quote-summary-panel + .quote-summary-panel {
  border-left: 1px solid rgba(10, 31, 24, 0.10);
  padding-left: 30px;
}

.quote-summary-panel h2 {
  font-size: 1.08rem;
  letter-spacing: 0;
  margin: 0 0 14px;
}

.quote-summary-list {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.quote-summary-list dt {
  color: var(--muted, #607066);
  font-size: 0.70rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quote-summary-list dd {
  color: var(--text, #071a13);
  font-size: 0.96rem;
  font-weight: 800;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.quote-summary-list dd a {
  color: var(--accent-2, #16a34a);
}

.quote-empty-value {
  color: #8a5b0a;
  font-weight: 800;
}

.quote-summary-wide {
  grid-column: 1 / -1;
}

.quote-summary-note {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(10, 31, 24, 0.10);
  margin-top: 18px;
  padding-top: 14px;
}

.quote-summary-note p {
  margin: 0;
}

.quote-summary-note p:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.quote-summary-note strong {
  color: var(--ink);
}

@media (max-width: 1100px) {
  .quote-summary-hero,
  .quote-summary-sections {
    grid-template-columns: 1fr;
  }

  .quote-summary-total-box {
    align-items: flex-start;
    text-align: left;
  }

  .quote-summary-panel + .quote-summary-panel {
    border-left: 0;
    border-top: 1px solid rgba(10, 31, 24, 0.10);
    padding-left: 0;
    padding-top: 18px;
  }
}

@media (max-width: 700px) {
  .quote-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-page-actions {
    justify-content: flex-start;
    margin-bottom: 0;
    width: 100%;
  }

  .quote-page-actions .button {
    flex: 1 1 180px;
  }

  .quote-page-header h1 {
    font-size: 2.125rem;
  }

  .quote-summary-card {
    padding: 16px;
  }

  .quote-summary-primary h2 {
    font-size: 1.5rem;
  }

  .quote-summary-total-box strong {
    font-size: 2rem;
  }

  .quote-summary-list {
    grid-template-columns: 1fr;
  }
}

/* ERP primary navigation */
.sidebar-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sidebar[data-sidebar] {
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
  overflow-x: hidden;
  transition: width 180ms ease, padding 180ms ease;
}

.sidebar[data-sidebar] .sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  margin-bottom: 14px;
}

.sidebar[data-sidebar] .brand {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 4px;
  overflow: hidden;
}

.sidebar[data-sidebar] .brand-copy {
  min-width: 0;
  white-space: nowrap;
}

.sidebar[data-sidebar] .brand-mark {
  flex: 0 0 auto;
}

.sidebar[data-sidebar] .sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.nav-section-label {
  margin: 10px 10px 5px;
  color: #84968a;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar[data-sidebar] .nav-item,
.sidebar[data-sidebar] .nav-group > summary {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  color: #dce7df;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

/* SaaS console lists reuse the catalog pagination while keeping actions reachable on narrow screens. */
.saas-list-filters {
  overflow: visible;
}

.saas-filter-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 0.8fr)) auto;
}

.saas-filter-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 5px;
  margin: 0;
  min-width: 0;
  text-transform: uppercase;
}

.saas-filter-form input,
.saas-filter-form select {
  margin: 0;
  min-width: 0;
  width: 100%;
}

.saas-per-page-control select {
  min-width: 78px;
}

.saas-filter-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
}

.saas-filter-summary {
  margin: 12px 0 0;
  color: #355341;
  font-size: 13px;
  font-weight: 700;
}

.saas-list-card {
  overflow: visible;
}

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

.saas-list-summary > .muted {
  margin: 0;
  text-align: right;
}

.saas-list-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  width: 100%;
}

.saas-list-table-scroll:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 4px;
}

.saas-list-table-scroll table {
  min-width: 920px;
}

.saas-list-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f7f4;
}

.saas-list-table-scroll .saas-actions-heading,
.saas-list-table-scroll .saas-actions-cell {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #ffffff;
  box-shadow: -8px 0 12px rgba(17, 27, 22, 0.07);
}

.saas-list-table-scroll .saas-actions-heading {
  z-index: 4;
  background: #f3f7f4;
}

.saas-cobro-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.saas-cobro-actions form {
  margin: 0;
}

.saas-list-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
}

.saas-list-pagination > .muted {
  margin: 0;
}

.saas-list-pagination-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1180px) {
  .saas-filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .saas-filter-form > :first-child {
    grid-column: span 2;
  }
}

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

  .saas-filter-form > :first-child {
    grid-column: span 2;
  }

  .saas-list-summary,
  .saas-list-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .saas-list-summary > .muted {
    text-align: left;
  }
}

@media (max-width: 440px) {
  .saas-filter-form {
    grid-template-columns: 1fr;
  }

  .saas-filter-form > :first-child {
    grid-column: auto;
  }

  .saas-filter-actions,
  .saas-filter-actions .button,
  .saas-filter-actions button {
    width: 100%;
  }

  .saas-filter-actions .button,
  .saas-filter-actions button {
    justify-content: center;
  }

  .saas-list-table-scroll table {
    min-width: 820px;
  }

  .saas-list-table-scroll .saas-actions-heading,
  .saas-list-table-scroll .saas-actions-cell {
    min-width: 170px;
    width: 170px;
  }
}

.sidebar[data-sidebar] .nav-group > summary {
  list-style: none;
  user-select: none;
}

.sidebar[data-sidebar] .nav-group > summary::-webkit-details-marker {
  display: none;
}

.sidebar[data-sidebar] .nav-item:hover,
.sidebar[data-sidebar] .nav-group > summary:hover,
.sidebar[data-sidebar] .nav-group[open] > summary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar[data-sidebar] .nav-item.active {
  color: #052e16;
  background: var(--accent);
  box-shadow: 0 9px 20px rgba(34, 197, 94, 0.2);
}

.sidebar[data-sidebar] .nav-item-label,
.sidebar[data-sidebar] .nav-group-label {
  min-width: 0;
}

.nav-icon,
.nav-group-chevron,
.sidebar-collapse-toggle svg,
.sidebar-mobile-close-toggle svg,
.sidebar-mobile-toggle svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-group-chevron {
  width: 15px;
  height: 15px;
  margin-left: auto;
  transition: transform 160ms ease;
}

.nav-group[open] > summary .nav-group-chevron {
  transform: rotate(90deg);
}

.nav-group-links {
  display: grid;
  gap: 2px;
  margin: 2px 0 6px 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.sidebar[data-sidebar] .nav-group-links .nav-item {
  min-height: 38px;
  padding-block: 8px;
  font-size: 13px;
}

.sidebar-collapse-toggle,
.sidebar-mobile-close-toggle,
.sidebar-mobile-toggle,
.sidebar-backdrop {
  border: 0;
}

.sidebar-collapse-toggle,
.sidebar-mobile-close-toggle,
.sidebar-mobile-toggle {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #dce7df;
  cursor: pointer;
}

.sidebar-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-mobile-close-toggle {
  display: none;
}

.topbar-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-mobile-toggle {
  display: none;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.sidebar-backdrop {
  display: none;
}

.app-shell.sidebar-is-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] {
  padding-inline: 10px;
}

.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .sidebar-header {
  flex-direction: column;
  min-height: auto;
}

.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .brand {
  flex: 0 0 auto;
  justify-content: center;
  padding: 0;
}

.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .brand-copy,
.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-section-label,
.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-item-label,
.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group-label,
.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group-chevron,
.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group-links {
  display: none;
}

.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .brand-mark,
.app-shell.sidebar-is-collapsed .sidebar-collapse-toggle {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.app-shell.sidebar-is-collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-item,
.app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group > summary {
  justify-content: center;
  padding-inline: 9px;
}

@media (max-width: 980px) {
  .app-shell.sidebar-is-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar[data-sidebar],
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(88vw, 310px);
    height: 100dvh;
    padding: 16px 12px;
    border-radius: 0;
    box-shadow: 24px 0 60px rgba(5, 46, 22, 0.3);
    transform: translateX(-102%);
    transition: transform 190ms ease;
  }

  body.sidebar-mobile-open .sidebar[data-sidebar] {
    transform: translateX(0);
  }

  .sidebar[data-sidebar] .sidebar-header,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .sidebar-header {
    flex-direction: row;
  }

  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .brand {
    flex: 1;
    justify-content: flex-start;
    padding: 4px;
  }

  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .brand-copy,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-section-label,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-item-label,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group-label,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group-chevron,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group-links {
    display: grid;
  }

  .sidebar[data-sidebar] .sidebar-nav {
    display: flex;
    grid-template-columns: none;
  }

  .sidebar[data-sidebar] .nav-item,
  .sidebar[data-sidebar] .nav-group > summary,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-item,
  .app-shell.sidebar-is-collapsed .sidebar[data-sidebar] .nav-group > summary {
    justify-content: flex-start;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .sidebar-mobile-close-toggle {
    display: inline-grid;
  }

  .sidebar-mobile-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(5, 18, 11, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.sidebar-mobile-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
  }

  body.sidebar-mobile-open {
    overflow: hidden;
  }

  .topbar-heading {
    width: 100%;
  }
}

/* ERP topbar: page context, company context and account actions. */
.topbar {
  min-height: var(--topbar-height);
  padding: 12px 28px;
  gap: 24px;
  background: rgba(248, 250, 248, 0.94);
  box-shadow: 0 1px 0 rgba(17, 27, 22, 0.03);
}

.topbar-heading {
  flex: 1 1 auto;
}

.topbar-heading .eyebrow {
  margin-bottom: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.topbar-heading > div > strong {
  max-width: min(42vw, 520px);
  overflow: hidden;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
}

.topbar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.environment-pill.exchange-rate-pill {
  min-height: 44px;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px;
}

.exchange-rate-pill:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.exchange-rate-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 7px;
  background: #eaf2ec;
  color: #356044;
}

.exchange-rate-pill.is-stale .exchange-rate-icon {
  background: #f8efd8;
  color: #80621d;
}

.exchange-rate-pill.is-unavailable .exchange-rate-icon {
  background: #edf1ee;
  color: #596b60;
}

.exchange-rate-icon svg {
  width: 17px;
  height: 17px;
}

.exchange-rate-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.exchange-rate-kicker {
  color: #607268;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.exchange-rate-value {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}

.exchange-rate-status {
  color: #80621d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.exchange-rate-tooltip {
  position: absolute;
  z-index: 41;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: min(330px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--dark);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
}

.exchange-rate-pill:hover .exchange-rate-tooltip,
.exchange-rate-pill:focus-visible .exchange-rate-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.topbar-menu {
  position: relative;
  flex: 0 0 auto;
}

.topbar-menu > summary::-webkit-details-marker {
  display: none;
}

.topbar-menu-trigger {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 7px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.topbar-menu-trigger:hover {
  border-color: #c9d7cc;
  background: #ffffff;
}

.topbar-menu-trigger:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.topbar-menu[open] > .topbar-menu-trigger {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.topbar-trigger-icon,
.topbar-popover-icon,
.topbar-avatar {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 7px;
  background: #eef5f0;
  color: #28543b;
}

.topbar-avatar {
  background: var(--dark);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.topbar-trigger-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: left;
}

.topbar-trigger-copy small,
.topbar-popover-heading small,
.topbar-context-status small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.topbar-trigger-copy strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-trigger-chevron {
  width: 14px !important;
  height: 14px !important;
  color: var(--muted);
  transition: transform 160ms ease;
}

.topbar-menu[open] .topbar-trigger-chevron {
  transform: rotate(90deg);
}

.topbar-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 35;
  display: grid;
  width: min(290px, calc(100vw - 24px));
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(17, 27, 22, 0.16);
}

.topbar-popover-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 10px;
  border-bottom: 1px solid var(--line);
}

.topbar-popover-heading > span:last-child,
.topbar-context-status > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.topbar-popover-heading strong,
.topbar-context-status strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.3;
}

.topbar-context-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0 3px;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
}

.topbar-context-status > svg {
  flex: 0 0 18px;
}

.topbar-menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.topbar-menu-item:hover,
.topbar-menu-item:focus-visible {
  background: #eef8f1;
  color: #14532d;
  outline: 0;
}

.topbar-menu-item svg {
  flex: 0 0 18px;
  color: #4c6354;
}

.topbar-logout-form {
  margin: 0;
}

.topbar-logout-action {
  color: #b42318;
}

.topbar-logout-action:hover,
.topbar-logout-action:focus-visible {
  background: #fff1f0;
  color: #b42318;
}

@media (max-width: 1180px) {
  .topbar-trigger-copy {
    display: none;
  }

  .topbar-menu-trigger {
    width: 44px;
    justify-content: center;
    padding: 5px;
  }

  .topbar-trigger-chevron {
    display: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    min-height: 72px;
    align-items: center;
    flex-direction: row;
    padding: 10px 18px;
  }

  .topbar-heading {
    width: auto;
  }

  .topbar-heading > div > strong {
    max-width: 38vw;
    font-size: 17px;
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 10px;
    padding-inline: 12px;
  }

  .topbar-heading {
    gap: 8px;
  }

  .topbar-heading .eyebrow,
  .exchange-rate-pill {
    display: none !important;
  }

  .topbar-heading > div > strong {
    max-width: calc(100vw - 190px);
    font-size: 15px;
  }

  .sidebar-mobile-toggle,
  .topbar-menu-trigger {
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex-basis: 42px;
  }

  .topbar-trigger-icon,
  .topbar-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
}

@media (max-width: 420px) {
  .topbar-heading > div > strong {
    max-width: calc(100vw - 172px);
  }

  .topbar-actions {
    gap: 5px;
  }
}

/* Emparejador de marcas: una cola de decisiones y una acción principal. */
.brand-matching-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.brand-matching-page-header > div {
  max-width: 760px;
}

.brand-matching-page-header h1 {
  margin-bottom: 8px;
}

.brand-matching-page-header .muted {
  margin-bottom: 0;
  line-height: 1.55;
}

.brand-matching-manage-link {
  flex: 0 0 auto;
  margin-bottom: 2px;
}

.brand-matching-workbench {
  display: grid;
  gap: 16px;
}

.brand-matching-toolbar {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dce9e0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.brand-matching-filters {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(210px, 0.8fr) auto auto;
  align-items: end;
  gap: 10px;
}

.brand-matching-filters label,
.brand-catalog-search label,
.brand-note-field,
.brand-create-catalog label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #425248;
  font-size: 12px;
  font-weight: 800;
}

.brand-matching-filters input,
.brand-matching-filters select,
.brand-catalog-search input,
.brand-create-catalog input,
.brand-note-field textarea {
  width: 100%;
  margin: 0;
}

.brand-matching-filters button {
  min-height: 42px;
  margin: 0;
  white-space: nowrap;
}

.brand-matching-clear-link {
  align-self: center;
  padding: 12px 4px;
  color: #24713d;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.brand-matching-clear-link:hover {
  text-decoration: underline;
}

.brand-matching-state-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid #e5eee7;
}

.brand-matching-state-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #dbe8df;
  border-radius: 999px;
  background: #fff;
  color: #405148;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.brand-matching-state-tabs a:hover {
  border-color: #a8cbb2;
  background: #f4faf5;
}

.brand-matching-state-tabs a.is-active {
  border-color: #143a27;
  background: #143a27;
  color: #fff;
}

.brand-matching-state-tabs strong {
  display: grid;
  min-width: 20px;
  min-height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #edf6ef;
  color: #1a6335;
  font-size: 11px;
}

.brand-matching-state-tabs .is-active strong {
  background: #34ca70;
  color: #092617;
}

.brand-matching-base-count {
  margin-left: auto;
  color: #6b7d71;
  font-size: 12px;
  font-weight: 700;
}

.brand-matching-tab-help {
  margin: 8px 0 0;
  color: #667a6d;
  font-size: 12px;
}

.brand-matching-grid {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brand-matching-source-panel,
.brand-matching-decision-panel,
.brand-matching-checkout-panel {
  min-width: 0;
  margin-bottom: 0;
  overflow: visible;
}

.brand-matching-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.brand-matching-panel-heading .eyebrow {
  margin-bottom: 5px;
}

.brand-matching-panel-heading h2 {
  margin: 0;
  font-size: 22px;
}

.brand-matching-panel-heading .muted,
.brand-decision-source {
  margin: 5px 0 0;
}

.brand-source-list {
  display: grid;
  gap: 7px;
}

.brand-source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid #dce9e0;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.brand-source-item:hover {
  border-color: #8fcaa0;
  box-shadow: 0 8px 18px rgba(23, 74, 42, 0.08);
  transform: translateY(-1px);
}

.brand-source-item.is-selected {
  border-color: #1d8a49;
  background: #edfaf0;
  box-shadow: inset 4px 0 0 #1d8a49;
}

.brand-source-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-source-item-main strong {
  overflow: hidden;
  color: #138340;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-source-item-main span,
.brand-source-item-target {
  color: #687a70;
  font-size: 12px;
  line-height: 1.35;
}

.brand-source-item-target {
  grid-column: 1 / -1;
  padding-top: 7px;
  border-top: 1px solid #dce9e0;
}

.brand-matching-decision-panel {
  position: static;
}

.brand-source-providers {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dce9e0;
}

.brand-source-providers h3 { margin: 0; font-size: 15px; }
.brand-source-providers > p { margin: 0; color: #667a6d; font-size: 12px; }
.brand-source-provider {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #dce9e0;
  border-radius: 10px;
  background: #f8fbf8;
  overflow-wrap: anywhere;
}
.brand-source-provider span { color: #607269; font-size: 12px; }

.brand-scope-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-scope-actions button { min-height: 34px; margin: 0; padding: 5px 9px; font-size: 12px; }
.brand-preview {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #c7dacd;
  border-radius: 10px;
  background: #f1f8f3;
  color: #254b32;
  font-size: 13px;
  line-height: 1.45;
}
.brand-current-link,
.brand-saved-result,
.brand-review-target {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #b9dec4;
  border-radius: 10px;
  background: #eff9f1;
  color: #244d32;
  font-size: 12px;
  line-height: 1.45;
}
.brand-current-link strong,
.brand-saved-result strong,
.brand-review-target strong { font-size: 14px; }
.brand-saved-result { margin: 0 0 12px; }
.brand-saved-result a { color: #126b36; font-weight: 750; }
.brand-review-target {
  margin: 0 0 12px;
  border-color: #dce9e0;
  background: #f8fbf8;
}
.brand-review-target > span { color: #607269; }
.brand-review-subtitle {
  margin: 18px 0 0;
  font-size: 14px;
}
.brand-preview-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}
.brand-preview-breakdown[hidden],
.brand-review-confirm .brand-confirmation[hidden] { display: none; }
.brand-preview-breakdown > div {
  padding: 10px;
  border: 1px solid #dce9e0;
  border-radius: 10px;
  background: #f8fbf8;
}
.brand-preview-breakdown dt { color: #607269; font-size: 11px; }
.brand-preview-breakdown dd { margin: 4px 0 0; color: #173b27; font-size: 20px; font-weight: 800; }
.brand-review-confirm {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #dce9e0;
}
.brand-review-confirm > button { width: 100%; min-height: 46px; margin: 0; }
.brand-history { margin-top: 18px; border-top: 1px solid #dce9e0; padding-top: 12px; }
.brand-history summary { cursor: pointer; font-weight: 750; }
.brand-history ol { padding-left: 20px; font-size: 12px; line-height: 1.5; }
.brand-history li { margin: 8px 0; }
.brand-history small { display: block; color: #64766a; overflow-wrap: anywhere; }

.brand-decision-heading {
  margin-bottom: 12px;
}

.brand-decision-source strong {
  color: #31453a;
}

.brand-decision-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.brand-decision-impact > div {
  padding: 10px;
  border: 1px solid #dce9e0;
  border-radius: 10px;
  background: #f8fbf8;
}

.brand-decision-impact dt {
  color: #718278;
  font-size: 11px;
  font-weight: 800;
}

.brand-decision-impact dd {
  margin: 3px 0 0;
  color: #173b27;
  font-size: 19px;
  font-weight: 850;
}

.brand-decision-impact small {
  display: block;
  margin-top: 2px;
  color: #607269;
  font-size: 11px;
  line-height: 1.3;
}

.brand-decision-assurance {
  margin: 10px 0 0;
  color: #477058;
  font-size: 12px;
  line-height: 1.45;
}

.brand-catalog-search {
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid #dce9e0;
  border-radius: 12px;
  background: #f8fbf8;
}

.brand-catalog-search > label {
  color: #25392d;
  font-size: 13px;
}

.brand-catalog-search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 7px;
}

.brand-catalog-search-controls button {
  min-height: 42px;
  margin: 0;
}

.brand-catalog-search p,
.brand-create-catalog p {
  margin: 7px 0 0;
  color: #687a70;
  font-size: 12px;
  line-height: 1.4;
}

.brand-decision-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.brand-catalog-choice-set,
.brand-provider-scope {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.brand-catalog-choice-set legend,
.brand-provider-scope legend {
  margin-bottom: 8px;
  color: #21372a;
  font-size: 14px;
  font-weight: 850;
}

.brand-catalog-results {
  display: grid;
  gap: 7px;
}

.brand-catalog-choice,
.brand-provider-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #dce9e0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.brand-catalog-choice > input[type="radio"],
.brand-provider-choice > input[type="checkbox"],
.brand-confirmation > input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: #247443;
}

.brand-catalog-choice:has(input:checked),
.brand-provider-choice:has(input:checked) {
  border-color: #299855;
  background: #eaf8ee;
}

.brand-catalog-choice span,
.brand-provider-choice span {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.brand-catalog-choice small,
.brand-provider-choice small {
  color: #667a6d;
  font-size: 12px;
}

.brand-catalog-guidance,
.brand-catalog-no-result {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px dashed #c4d8c9;
  border-radius: 10px;
  background: #fbfdfb;
  color: #607369;
  font-size: 13px;
}

.brand-catalog-guidance strong,
.brand-catalog-no-result strong {
  color: #354a3c;
}

.brand-create-catalog {
  margin-top: 10px;
  padding: 10px 0 0;
  border-top: 1px solid #e1ebe3;
}

.brand-create-catalog summary,
.brand-no-link-panel summary {
  color: #287344;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.brand-create-catalog[open] summary {
  margin-bottom: 10px;
}

.brand-provider-scope {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid #ecd39f;
  border-radius: 11px;
  background: #fffaf0;
}

.brand-provider-scope p {
  margin: -2px 0 3px;
  color: #7a6637;
  font-size: 12px;
}

.brand-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: #fff8e8;
  color: #685221;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.brand-confirmation > span {
  min-width: 0;
}

.brand-note-title {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.brand-note-field .brand-note-optional {
  color: #75867b;
  font-weight: 600;
}

.brand-note-field textarea {
  resize: vertical;
}

.brand-decision-readiness {
  min-height: 18px;
  margin: -5px 0 0;
  color: #75867b;
  font-size: 12px;
}

.brand-decision-readiness.is-ready {
  color: #247443;
}

.brand-no-link-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5ebe6;
}

.brand-no-link-panel[open] {
  padding: 14px;
  border: 1px solid #f0c7c7;
  border-radius: 12px;
  background: #fffafa;
}

.brand-no-link-panel[open] > summary {
  color: #9b3636;
}

.brand-reopen-panel[open] {
  border-color: #c9d9cd;
  background: #f8fbf8;
}
.brand-reopen-panel[open] > summary { color: #247443; }

.brand-no-link-panel p {
  margin: 10px 0;
  color: #745858;
  font-size: 12px;
  line-height: 1.45;
}

.brand-no-link-form,
.brand-reopen-form {
  display: grid;
  gap: 12px;
}

.brand-no-link-action {
  width: 100%;
  margin: 0;
  border: 1px solid #d99a9a;
  background: #fff;
  color: #9d3030;
  box-shadow: none;
}

.brand-no-link-action:hover {
  border-color: #bd5c5c;
  background: #fff2f2;
}

.brand-decision-empty {
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 36px;
  border: 1px dashed #c9d9cd;
  border-radius: 14px;
  background: #fbfdfb;
  color: #607369;
  text-align: center;
}

.brand-decision-empty > span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 50%;
  background: #dff5e5;
  color: #197142;
  font-weight: 900;
}

.brand-decision-empty strong {
  color: #263d2e;
}

.brand-decision-empty p {
  max-width: 280px;
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1400px) {
  .brand-matching-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr);
  }
  .brand-matching-source-panel { grid-row: 1 / span 2; }
  .brand-matching-decision-panel,
  .brand-matching-checkout-panel { grid-column: 2; }
}

@media (max-width: 900px) {
  .brand-matching-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-matching-grid {
    grid-template-columns: 1fr;
  }
  .brand-matching-source-panel { grid-row: auto; }
  .brand-matching-decision-panel,
  .brand-matching-checkout-panel { grid-column: auto; }

  .brand-matching-decision-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .brand-matching-toolbar,
  .brand-matching-source-panel,
  .brand-matching-decision-panel,
  .brand-matching-checkout-panel {
    padding: 14px;
  }

  .brand-matching-filters {
    grid-template-columns: 1fr;
  }

  .brand-matching-filters button {
    width: 100%;
  }

  .brand-matching-base-count {
    width: 100%;
    margin-left: 0;
  }

  .brand-source-item {
    grid-template-columns: 1fr;
  }

  .brand-source-item .badge {
    justify-self: start;
  }

  .brand-decision-impact {
    grid-template-columns: 1fr;
  }

  .brand-catalog-search-controls {
    grid-template-columns: 1fr;
  }

  .brand-catalog-search-controls button,
  .brand-matching-manage-link {
    width: 100%;
  }
}

/* Expediente de compra: el avance operativo precede al detalle de auditoría. */
.purchase-expedient-stages {
  display: grid;
  gap: 16px;
}

.purchase-stage-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.purchase-stage a {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #d9e8dc;
  border-radius: 12px;
  color: inherit;
  display: flex;
  gap: 9px;
  min-height: 78px;
  padding: 11px;
  text-decoration: none;
}

.purchase-stage a:hover,
.purchase-stage a:focus-visible {
  border-color: #197a43;
  box-shadow: 0 0 0 3px rgba(25, 122, 67, .13);
}

.purchase-stage-number {
  align-items: center;
  background: #edf8ef;
  border-radius: 8px;
  color: #087639;
  display: inline-flex;
  flex: 0 0 30px;
  font-size: 12px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
}

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

.purchase-stage strong {
  font-size: 13px;
  line-height: 1.2;
}

.purchase-stage small {
  color: #65746b;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 4px;
}

.purchase-stage-warning a { border-color: #edd49a; }
.purchase-stage-warning .purchase-stage-number { background: #fff5db; color: #9d6100; }
.purchase-stage-success a { border-color: #bce2c6; }
.purchase-currency-summary { color: #52665a; font-size: 13px; margin: 0; }

@media (max-width: 1050px) {
  .purchase-stage-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .purchase-stage-list { grid-template-columns: 1fr; }
}
