.po-receipts-page[hidden],
#po-dashboard[hidden] {
  display: none !important;
}

.po-receipts-page {
  width: 100%;
  min-width: 0;
  padding: 24px;
}

.po-receipts-head,
.po-receipts-toolbar,
.po-receipts-pagination,
.po-receipts-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.po-receipts-head {
  margin-bottom: 20px;
}

.po-receipts-head h2 {
  margin: 6px 0;
}

.po-receipts-eyebrow,
.po-receipts-product-name {
  font-size: 0.82rem;
  opacity: 0.75;
}

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

.po-receipts-metric {
  padding: 16px;
  border: 1px solid var(--border-color, #64748b66);
  border-radius: 10px;
  font-weight: 600;
}

.po-receipts-toolbar {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.po-receipts-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 200px;
}

.po-receipts-toolbar input,
.po-receipts-toolbar select,
.po-receipts-quantity,
.po-receipts-locator {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #8792a0;
  background: var(--input-bg, #fff);
  color: var(--input-color, #17212f);
}

.po-receipts-table-wrap {
  overflow-x: auto;
  max-height: 65vh;
}

.po-receipts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.po-receipts-table th,
.po-receipts-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color, #64748b55);
  vertical-align: top;
}

.po-receipts-table th {
  position: sticky;
  top: 0;
  background: var(--input-bg, #fff);
  color: var(--input-color, #17212f);
  z-index: 1;
}

.po-receipts-quantity {
  width: 115px;
}

.po-receipts-locator {
  min-width: 200px;
  max-width: 300px;
}

.po-receipts-invalid {
  border-color: #c62828 !important;
}

.po-receipts-error {
  color: #c62828;
}

.po-receipts-pagination,
.po-receipts-footer {
  margin-top: 20px;
}

.po-receipts-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-color, #64748b55);
}

.po-receipts-page button {
  cursor: pointer;
  padding: 9px 13px;
}

.po-receipts-page button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 900px) {
  .po-receipts-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .po-receipts-page {
    padding: 12px;
  }
}

/* Resultado operativo debajo de la tabla */
#po-receipts-status {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  font-weight: 600;
  line-height: 1.5;
}

#po-receipts-status.po-receipts-success {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.14);
}

#po-receipts-status.po-receipts-error {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.14);
}

#po-receipts-status {
  white-space: pre-line;
}

/* Comentarios de recepción */
.po-receipts-comment {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.po-receipts-comment label {
  font-weight: 600;
}

#po-receipts-comment {
  width: 100%;
  box-sizing: border-box;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  font: inherit;
  resize: vertical;
}

#po-receipts-comment-hint {
  color: #94a3b8;
}

#po-receipts-comment:required + #po-receipts-comment-hint {
  color: #fbbf24;
}

/* Tarjetas de órdenes de compra */
.po-receipts-order-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.po-receipts-order-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 15px;
  min-height: 110px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #111d2d;
  color: #f8fafc;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.po-receipts-order-card:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #17283d;
}

.po-receipts-order-card.is-active {
  border: 2px solid #60a5fa;
  padding: 14px;
  background: #172c45;
}

.po-receipts-order-card:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.po-receipts-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.po-receipts-card-badge {
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #334155;
  color: #cbd5e1;
}

.po-receipts-card-badge.is-complete {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.po-receipts-card-badge.is-partial {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.po-receipts-card-badge.is-invalid {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.po-receipts-card-description,
.po-receipts-card-progress {
  color: #a8b6ca;
  font-size: 0.82rem;
}

.po-receipts-original-select-hidden {
  display: none !important;
}

.po-receipts-page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.82rem;
}

#po-receipts-page-size {
  padding: 6px 9px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #182638;
  color: #f8fafc;
}

@media (max-width: 640px) {
  .po-receipts-order-cards {
    grid-template-columns: 1fr;
  }
}
