/* ============================================================
   PR320 — Retainage Release Engine
   Class prefix: .pr320-
   TradeRail brand: Primary Orange #FF6B00, Dark #1A1A2E
   ============================================================ */

/* ── Accordion section ───────────────────────────────────────── */
.pr320-retainage-section {
  width: 100%;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  margin-top: 24px;
  background: #FFFFFF;
  overflow: hidden;
}

.pr320-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  user-select: none;
  transition: background 0.15s ease;
}

.pr320-accordion-header:hover {
  background: #F3F4F6;
}

.pr320-accordion-label {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A2E;
  flex: 1;
}

.pr320-header-amount {
  font-size: 13px;
  font-weight: 600;
  color: #FF6B00;
  margin-right: 12px;
}

.pr320-chevron {
  font-size: 12px;
  color: #6B7280;
  transition: transform 0.2s ease;
}

.pr320-accordion-header.pr320-expanded .pr320-chevron {
  transform: rotate(180deg);
}

/* ── Accordion body ──────────────────────────────────────────── */
.pr320-accordion-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.pr320-accordion-closed {
  max-height: 0;
  opacity: 0;
}

.pr320-accordion-open {
  max-height: 9999px;
  opacity: 1;
}

/* ── Lily bar ────────────────────────────────────────────────── */
.pr320-lily-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #FFF7ED;
  border-bottom: 1px solid #FECACA;
  font-size: 13px;
  color: #92400E;
}

.pr320-lily-icon {
  font-weight: 700;
  color: #FF6B00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.pr320-lily-subtitle {
  color: #78350F;
  font-size: 13px;
}

/* ── Summary row ─────────────────────────────────────────────── */
.pr320-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 16px 20px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
}

.pr320-summary-cell {
  flex: 1 1 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 16px 8px 0;
  min-width: 100px;
}

.pr320-summary-net {
  border-left: 2px solid #FF6B00;
  padding-left: 16px;
  margin-left: 4px;
}

.pr320-summary-label {
  font-size: 11px;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pr320-summary-value {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A2E;
}

.pr320-net-value {
  color: #FF6B00;
}

.pr320-field-tech-summary {
  padding: 12px 20px;
}

.pr320-summary-note {
  font-size: 13px;
  color: #6B7280;
  font-style: italic;
}

/* ── Gates panel ─────────────────────────────────────────────── */
.pr320-gates-panel {
  padding: 16px 20px;
  border-bottom: 1px solid #E5E7EB;
  background: #FAFAFA;
}

.pr320-gates-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #374151;
  margin-bottom: 12px;
}

.pr320-gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #F3F4F6;
}

.pr320-gate-row:last-child {
  border-bottom: none;
}

.pr320-gate-name {
  font-size: 13px;
  color: #374151;
}

.pr320-gate-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pr320-gate-pass {
  background: #DCFCE7;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

.pr320-gate-fail {
  background: #FEE2E2;
  color: #CC0000;
  border: 1px solid #FECACA;
}

.pr320-gate-pending {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

/* ── Releases section ────────────────────────────────────────── */
.pr320-releases-section {
  padding: 20px;
}

.pr320-releases-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.pr320-releases-title {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A2E;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.pr320-empty-msg {
  font-size: 13px;
  color: #9CA3AF;
  padding: 16px 0;
  text-align: center;
}

/* ── Table ───────────────────────────────────────────────────── */
.pr320-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pr320-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
  background: #F9FAFB;
  border-bottom: 2px solid #E5E7EB;
}

.pr320-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F3F4F6;
  color: #1A1A2E;
  vertical-align: middle;
}

.pr320-release-row:hover td {
  background: #F9FAFB;
}

.pr320-amount-cell {
  font-weight: 600;
  color: #1A1A2E;
}

.pr320-notes-cell {
  color: #6B7280;
  font-size: 12px;
  max-width: 200px;
}

.pr320-actions-cell {
  white-space: nowrap;
}

/* ── Status badges ───────────────────────────────────────────── */
.pr320-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.pr320-badge-draft {
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #D1D5DB;
}

.pr320-badge-pending-gc {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.pr320-badge-gc-approved {
  background: #DBEAFE;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.pr320-badge-released {
  background: #DCFCE7;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

.pr320-badge-voided {
  background: #F9FAFB;
  color: #9CA3AF;
  border: 1px solid #E5E7EB;
}

.pr320-badge-approved {
  background: #DBEAFE;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

/* ── Form panel ──────────────────────────────────────────────── */
.pr320-form-panel {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.pr320-form-title {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 16px;
}

.pr320-form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.pr320-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pr320-input,
.pr320-select,
.pr320-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  background: #FFFFFF;
  color: #1A1A2E;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.pr320-input:focus,
.pr320-select:focus,
.pr320-textarea:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.15);
}

.pr320-textarea {
  resize: vertical;
  min-height: 72px;
}

.pr320-form-error {
  font-size: 13px;
  color: #CC0000;
  padding: 8px 12px;
  border-radius: 4px;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  margin-bottom: 12px;
}

.pr320-form-error-hidden {
  display: none;
}

.pr320-form-error-visible {
  display: block;
}

.pr320-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Confirm / Two-tap panels ────────────────────────────────── */
.pr320-confirm-pending {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pr320-confirm-hidden {
  display: none;
}

.pr320-confirm-visible {
  display: flex;
}

.pr320-confirm-void {
  background: #FEE2E2;
  border-color: #FECACA;
}

.pr320-confirm-msg {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  flex: 1;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.pr320-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.pr320-btn-primary {
  background: #FF6B00;
  color: #FFFFFF;
  border-color: #FF6B00;
}

.pr320-btn-primary:hover {
  background: #E05E00;
  border-color: #E05E00;
}

.pr320-btn-secondary {
  background: #1A1A2E;
  color: #FFFFFF;
  border-color: #1A1A2E;
}

.pr320-btn-secondary:hover {
  background: #2D2D4A;
}

.pr320-btn-success {
  background: #16A34A;
  color: #FFFFFF;
  border-color: #16A34A;
}

.pr320-btn-success:hover {
  background: #15803D;
}

.pr320-btn-danger {
  background: #CC0000;
  color: #FFFFFF;
  border-color: #CC0000;
}

.pr320-btn-danger:hover {
  background: #B30000;
}

.pr320-btn-warning {
  background: #D97706;
  color: #FFFFFF;
  border-color: #D97706;
}

.pr320-btn-warning:hover {
  background: #B45309;
}

.pr320-btn-ghost {
  background: transparent;
  color: #374151;
  border-color: #D1D5DB;
}

.pr320-btn-ghost:hover {
  background: #F3F4F6;
}

.pr320-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
  .pr320-summary-row {
    flex-direction: column;
    gap: 8px;
  }

  .pr320-summary-cell {
    padding: 4px 0;
    min-width: auto;
    flex: none;
  }

  .pr320-summary-net {
    border-left: none;
    border-top: 2px solid #FF6B00;
    padding-left: 0;
    padding-top: 8px;
    margin-left: 0;
  }

  .pr320-table {
    font-size: 12px;
  }

  .pr320-table th,
  .pr320-table td {
    padding: 8px 6px;
  }

  .pr320-releases-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pr320-accordion-header {
    padding: 12px 14px;
  }

  .pr320-releases-section {
    padding: 14px;
  }

  .pr320-form-panel {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .pr320-table .pr320-notes-cell,
  .pr320-table th:nth-child(6),
  .pr320-table td:nth-child(6) {
    display: none;
  }
}
