/* Listados de órdenes: lectura rápida, decisiones claras y uso consistente. */
.order-list-page {
  --order-list-ink: #132118;
  --order-list-green: #166534;
  --order-list-soft: #f3faf5;
}

.order-list-hero {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.72fr);
  gap: 16px;
  margin-bottom: 18px;
}

.order-list-hero-main {
  min-height: 206px;
  padding: 28px 30px;
}

.order-list-action-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid #dce9df;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(34, 63, 43, 0.08);
}

.order-list-action-rail h2 {
  margin: 4px 0 0;
  color: var(--order-list-ink);
  font-size: 1.18rem;
}

.order-list-action-stack {
  display: grid;
  gap: 9px;
}

.order-list-action-stack .button {
  width: 100%;
  justify-content: center;
}

.order-list-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4a6250;
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.order-list-back-link:hover {
  color: #166534;
  text-decoration: underline;
}

.order-list-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.order-list-kpi {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #dce9df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(34, 63, 43, 0.05);
  color: var(--order-list-ink);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.order-list-kpi::after {
  position: absolute;
  top: -38px;
  right: -28px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #eaf7ed;
  content: "";
}

.order-list-kpi:hover,
.order-list-kpi:focus-visible {
  transform: translateY(-2px);
  border-color: #83b996;
  box-shadow: 0 10px 20px rgba(34, 63, 43, 0.12);
}

.order-list-kpi.is-active {
  border-color: #178242;
  background: #f4fbf6;
  box-shadow: inset 0 0 0 1px #178242, 0 8px 18px rgba(34, 63, 43, 0.09);
}

.order-list-kpi-attention::after {
  background: #fff4cd;
}

.order-list-kpi-warning::after {
  background: #ffe6d8;
}

.order-list-kpi strong,
.order-list-kpi span,
.order-list-kpi small {
  position: relative;
  z-index: 1;
}

.order-list-kpi strong {
  color: var(--order-list-green);
  font-size: 1.72rem;
  line-height: 1;
}

.order-list-kpi span {
  font-size: 0.92rem;
  font-weight: 800;
}

.order-list-kpi small {
  color: #627067;
  font-size: 0.78rem;
}

.order-list-filter-card {
  overflow: visible;
}

.order-list-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.order-list-clear {
  color: #4d6252;
  font-size: 0.86rem;
  font-weight: 750;
}

.order-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.order-list-filters label {
  flex: 1 1 155px;
  min-width: 0;
}

.order-list-filters .order-list-query {
  flex: 2 1 300px;
}

.order-list-filters label > span {
  display: block;
  margin: 0 0 6px;
  color: #405247;
  font-size: 0.78rem;
  font-weight: 800;
}

.order-list-filters input[type="search"],
.order-list-filters select {
  width: 100%;
  min-height: 44px;
  border-color: #cbd9cf;
  background: #fff;
}

.order-list-check {
  display: inline-flex;
  flex: 0 1 242px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 2px;
  color: #33483a;
  font-size: 0.88rem;
  font-weight: 700;
}

.order-list-check input {
  width: 18px;
  height: 18px;
  accent-color: #16803e;
}

.order-list-apply {
  min-height: 44px;
  padding-inline: 18px;
}

.order-list-results {
  overflow: visible;
}

.order-list-results-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 14px;
}

.order-list-results-heading h2 {
  margin: 0;
  color: var(--order-list-ink);
  font-size: 1.06rem;
}

.order-list-results-heading p {
  margin: 0;
  color: #627067;
  font-size: 0.84rem;
}

.order-list-table th,
.order-list-table td {
  vertical-align: middle;
}

.order-list-table td {
  padding: 15px 12px;
}

.order-list-code {
  color: #145f31;
  font-weight: 850;
}

.order-list-subtext {
  display: block;
  margin-top: 4px;
  color: #6a786f;
  font-size: 0.79rem;
}

.order-list-number {
  white-space: nowrap;
  text-align: right;
}

.order-list-action-cell {
  min-width: 112px;
  text-align: right;
}

.order-list-action-cell .button {
  white-space: nowrap;
}

.order-list-mobile {
  display: none;
}

.order-list-mobile-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dce9df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(34, 63, 43, 0.05);
}

.order-list-mobile-card-head,
.order-list-mobile-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-list-mobile-card-head > div {
  display: grid;
  gap: 3px;
}

.order-list-mobile-card-head > div > span {
  color: #68766e;
  font-size: 0.8rem;
}

.order-list-mobile-card-head strong {
  color: #145f31;
  font-size: 1rem;
}

.order-list-mobile-party {
  display: grid;
  gap: 3px;
}

.order-list-mobile-party > span,
.order-list-mobile-meta dt {
  color: #506055;
  font-size: 0.72rem;
  font-weight: 750;
}

.order-list-mobile-party strong {
  color: var(--order-list-ink);
}

.order-list-mobile-party small,
.order-list-mobile-card footer small {
  color: #68766e;
  font-size: 0.8rem;
}

.order-list-mobile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.order-list-mobile-meta > div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--order-list-soft);
}

.order-list-mobile-meta dd {
  margin: 3px 0 0;
  color: #223229;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.order-list-mobile-card footer {
  padding-top: 2px;
}

.order-list-amount {
  color: #1d5530;
  white-space: nowrap;
}

.order-list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
}

.order-list-pagination span {
  color: #536159;
  font-size: 0.86rem;
  font-weight: 700;
}

@media (max-width: 980px) {
  .order-list-hero {
    grid-template-columns: 1fr;
  }

  .order-list-action-rail {
    flex-direction: row;
    align-items: center;
  }

  .order-list-action-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(460px, 100%);
  }

  .order-list-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .order-list-hero-main {
    min-height: auto;
    padding: 24px 22px;
  }

  .order-list-action-rail,
  .order-list-filter-heading,
  .order-list-results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-list-action-stack {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .order-list-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .order-list-filters label,
  .order-list-filters .order-list-query,
  .order-list-check,
  .order-list-apply {
    width: 100%;
  }

  .order-list-desktop {
    display: none;
  }

  .order-list-mobile {
    display: grid;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .order-list-kpis,
  .order-list-mobile-meta {
    grid-template-columns: 1fr;
  }

  .order-list-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .order-list-pagination .button {
    width: 100%;
  }
}

/* Cotización: comparte la lectura principal de la orden de venta. */
.quote-detail-page {
  --sales-order-green: #166534;
  --sales-order-ink: #132118;
  --sales-order-soft: #f3faf5;
}

.quote-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quote-detail-hero .quote-summary-deadline {
  border-color: rgba(220, 252, 231, .26);
  color: #d7e9dd;
}

.quote-detail-hero .quote-summary-deadline.is-warning {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.quote-detail-hero .quote-status-badge {
  box-shadow: none;
}

.quote-progress .sales-order-progress-item.is-blocked .sales-order-progress-dot {
  border-color: #f3aaaa;
  background: #fff1f1;
  color: #b42318;
}

.quote-progress .sales-order-progress-item.is-blocked strong,
.quote-progress .sales-order-progress-item.is-blocked small {
  color: #b42318;
}

.quote-summary-card {
  scroll-margin-top: 24px;
}

.quote-summary-details {
  margin-bottom: 16px;
}

.quote-next-step {
  scroll-margin-top: 24px;
}

@media (max-width: 720px) {
  .quote-detail-meta {
    margin-top: 10px;
  }

  .quote-detail-meta .quote-summary-deadline {
    font-size: 11px;
  }
}
