/* Invoice detail: icon rows, side-by-side cards, payment tiles. No see-through overlap. */

.pcs-invoice-detail .space-y-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}

.pcs-invoice-detail .space-y-3 > * {
  margin-top: 0 !important;
  min-width: 0;
}

@media (min-width: 840px) {
  .pcs-invoice-detail .space-y-3 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .pcs-invoice-detail .space-y-3 > .pcs-panel:nth-of-type(n + 3),
  .pcs-invoice-detail .space-y-3 > :not(.pcs-panel) {
    grid-column: 1 / -1;
  }
}

.pcs-invoice-detail .pcs-panel:has(.pcs-invoice-detail__prose) {
  display: none;
}

.pcs-invoice-detail .pcs-panel .text-sm.leading-relaxed {
  display: none;
}

.pcs-app .pcs-invoice-detail .pcs-field,
.pcs-app .pcs-quote-detail .pcs-field {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0;
  min-width: 0;
}

.pcs-app .pcs-invoice-detail .pcs-field__label,
.pcs-app .pcs-quote-detail .pcs-field__label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.12rem;
  overflow: hidden;
  font-size: 0 !important;
  line-height: 0 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap;
  color: transparent !important;
  -webkit-text-size-adjust: 100%;
}

.pcs-app .pcs-invoice-detail .pcs-field__icon,
.pcs-app .pcs-quote-detail .pcs-field__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  color: #6b6ce0 !important;
}

.pcs-app .pcs-invoice-detail .pcs-field__value,
.pcs-app .pcs-quote-detail .pcs-field__value,
.pcs-app .pcs-invoice-detail .pcs-field__value--link,
.pcs-app .pcs-quote-detail .pcs-field__value--link {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 1rem !important;
  line-height: 1.4 !important;
  font-weight: 600;
  color: #122241;
}

.pcs-invoice-detail .grid.grid-cols-2 {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .pcs-invoice-detail .grid.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pcs-invoice-detail .pcs-metric {
  min-width: 0;
}

.pcs-invoice-detail .pcs-metric__value {
  overflow-wrap: anywhere;
}

.pcs-modal:has(#record-payment-title),
.pcs-modal:has(#mark-paid-title),
.pcs-modal:has(#record-deposit-title),
.pcs-modal:has(#edit-payment-method-title) {
  background: rgba(18, 34, 65, 0.78);
}

.pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-option__meta,
.pcs-modal:has(#mark-paid-title) .pcs-invoice-detail__payment-note {
  display: none;
}

.pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  min-height: 6.75rem;
  padding: 0.7rem 0.35rem;
  overflow: visible;
}

.pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-option__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
}

.pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-option__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-option__title {
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.pcs-modal:has(#mark-paid-title) .pcs-modal__body,
.pcs-modal:has(#record-deposit-title) .pcs-modal__body,
.pcs-modal:has(#edit-payment-method-title) .pcs-modal__body {
  min-width: 0;
}

.pcs-modal:has(#mark-paid-title) .pcs-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 0.55rem;
}

.pcs-modal:has(#mark-paid-title) .pcs-invoice-detail__payment-summary {
  margin: 0;
  min-width: 0;
}

.pcs-modal:has(#mark-paid-title) .pcs-invoice-detail__method-list {
  grid-column: 1 / -1;
}

.pcs-invoice-detail__method-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.pcs-invoice-detail__method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 5.5rem;
  text-align: center;
  padding: 0.65rem 0.3rem;
}

.pcs-invoice-detail__method-btn::before {
  content: "";
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background-color: #f3f2f3;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.25rem 1.25rem;
}

.pcs-invoice-detail__method-list .pcs-invoice-detail__method-btn:nth-child(1)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122241' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E");
}

.pcs-invoice-detail__method-list .pcs-invoice-detail__method-btn:nth-child(2)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122241' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E");
}

.pcs-invoice-detail__method-list .pcs-invoice-detail__method-btn:nth-child(3)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122241' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M12 3l9 7H3z'/%3E%3Cpath d='M5 10v11'/%3E%3Cpath d='M19 10v11'/%3E%3Cpath d='M9 21v-6h6v6'/%3E%3C/svg%3E");
}

.pcs-invoice-detail__method-btn.is-selected {
  border-color: #6b6ce0;
  background: rgba(107, 108, 224, 0.08);
}

@media (max-width: 420px) {
  .pcs-modal:has(#record-payment-title) .pcs-invoice-detail__payment-options,
  .pcs-invoice-detail__method-list,
  .pcs-modal:has(#mark-paid-title) .pcs-modal__body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pcs-invoice-detail .pcs-form__hint[role="status"] {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid #122241;
  border-left: 4px solid #6b6ce0;
  border-radius: 10px;
  background: #fff;
  color: #122241;
  font-weight: 700;
  line-height: 1.35;
}
.pcs-invoice-detail .pcs-form__hint[role="status"]::before {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border: 2px solid #cdc9cd;
  border-top-color: #6b6ce0;
  border-radius: 50%;
  animation: pcs-invoice-send-spin 0.75s linear infinite;
}
@keyframes pcs-invoice-send-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .pcs-invoice-detail .pcs-form__hint[role="status"]::before {
    animation: none;
  }
}
