/* =============================================================
   TradeRail — PR233b: Prevailing Wage + Certified Payroll
   Namespace : .pw-*
   ============================================================= */

/* ── Module shell ─────────────────────────────────────────── */
.pw-module {
  padding: 24px 28px;
  max-width: 1100px;
}

.pw-module-header {
  margin-bottom: 20px;
}

.pw-module-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 4px;
}

.pw-module-sub {
  font-size: 13px;
  color: #666;
  margin: 0;
}

/* ── Tab bar ─────────────────────────────────────────────── */
.pw-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
}

.pw-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 4px 4px 0 0;
  transition: color 0.15s, border-color 0.15s;
}

.pw-tab:hover {
  color: #FF6B00;
}

.pw-tab-active {
  color: #FF6B00;
  border-bottom-color: #FF6B00;
}

.pw-tab-content {
  min-height: 300px;
}

/* ── Disclaimer banner ───────────────────────────────────── */
.pw-disclaimer-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e8;
  border: 1px solid #f5c842;
  border-left: 4px solid #FF6B00;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #5a4000;
  line-height: 1.5;
}

.pw-disclaimer-icon {
  font-size: 18px;
  color: #FF6B00;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Lily banner ─────────────────────────────────────────── */
.pw-lily-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f4ff;
  border: 1px solid #c7d7fc;
  border-left: 4px solid #4a6cf7;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #1e3a8a;
}

.pw-lily-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4a6cf7;
  flex-shrink: 0;
}

.pw-lily-flag {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Section header ──────────────────────────────────────── */
.pw-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pw-section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A2E;
  margin: 0;
}

.pw-mt { margin-top: 32px; }
.pw-ml { margin-left: 10px; }
.pw-mr { margin-right: 8px; }

/* ── Helper text ─────────────────────────────────────────── */
.pw-helper-text {
  font-size: 13px;
  color: #666;
  margin: 0 0 14px;
  line-height: 1.5;
}

.pw-muted {
  color: #999;
  font-size: 13px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.pw-btn-primary {
  background: #FF6B00;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.pw-btn-primary:hover {
  background: #e05e00;
}

.pw-btn-ghost {
  background: transparent;
  color: #FF6B00;
  border: 1.5px solid #FF6B00;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.pw-btn-ghost:hover {
  background: #fff3e8;
}

.pw-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  border: none;
}

.pw-btn-sm.pw-btn-primary {
  background: #FF6B00;
  color: #fff;
  border: none;
}

.pw-btn-sm.pw-btn-ghost {
  background: transparent;
  color: #FF6B00;
  border: 1.5px solid #FF6B00;
}

/* ── Table ───────────────────────────────────────────────── */
.pw-table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
}

.pw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pw-table th {
  background: #1A1A2E;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.pw-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.pw-table tr:nth-child(even) td {
  background: #fafafa;
}

.pw-table tr:hover td {
  background: #fff3e8;
}

.pw-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pw-total {
  font-weight: 700;
  color: #1A1A2E;
}

/* ── Badges ──────────────────────────────────────────────── */
.pw-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pw-badge-unverified {
  background: #fff3e8;
  color: #c45000;
}

.pw-badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.pw-badge-due {
  background: #fee2e2;
  color: #991b1b;
}

.pw-badge-ack {
  background: #dbeafe;
  color: #1e40af;
}

.pw-badge-type {
  background: #f3f4f6;
  color: #374151;
}

/* ── Ratio box ───────────────────────────────────────────── */
.pw-ratio-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 20px;
}

.pw-ratio-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A2E;
  margin: 0 0 14px;
}

.pw-ratio-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pw-ratio-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}

.pw-ratio-count {
  font-size: 32px;
  font-weight: 700;
  color: #1A1A2E;
  line-height: 1;
}

.pw-ratio-label {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  text-align: center;
}

.pw-ratio-apprentice .pw-ratio-count {
  color: #FF6B00;
}

.pw-ratio-note {
  font-size: 12px;
  color: #888;
  margin: 0;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
}

/* ── Acknowledgment block ────────────────────────────────── */
.pw-ack-block {
  background: #fff8e8;
  border: 1.5px solid #FF6B00;
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 20px;
}

.pw-ack-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
  cursor: pointer;
}

.pw-ack-check {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #FF6B00;
}

.pw-ack-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.pw-ack-done {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 20px;
  font-size: 13px;
  color: #065f46;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Report builder ──────────────────────────────────────── */
.pw-report-builder {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px 24px;
  max-width: 600px;
  margin-bottom: 24px;
}

.pw-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.pw-form-row.pw-form-actions {
  flex-direction: row;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 0;
}

.pw-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.pw-select {
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #1A1A2E;
  background: #fff;
  outline: none;
}

.pw-select:focus {
  border-color: #FF6B00;
}

/* ── Report preview ──────────────────────────────────────── */
.pw-report-preview {
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px 28px;
  background: #fff;
  margin-top: 4px;
}

.pw-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 2px solid #1A1A2E;
}

.pw-report-logo {
  font-size: 18px;
  font-weight: 700;
  color: #FF6B00;
}

.pw-report-title h2 {
  font-size: 17px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 4px;
  text-align: right;
}

.pw-report-title p {
  font-size: 12px;
  color: #666;
  margin: 0;
  text-align: right;
}

.pw-report-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #333;
}

.pw-report-table th {
  background: #1A1A2E;
  font-size: 12px;
}

/* ── Subsection ──────────────────────────────────────────── */
.pw-subsection {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px solid #e5e7eb;
}

/* ── No access ───────────────────────────────────────────── */
.pw-no-access {
  padding: 48px 24px;
  text-align: center;
}

.pw-no-access h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 10px;
}

.pw-no-access p {
  font-size: 14px;
  color: #666;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Print styles ────────────────────────────────────────── */
@media print {
  .pw-tab-bar,
  .pw-btn-primary,
  .pw-btn-ghost,
  .pw-btn-sm,
  .pw-report-builder,
  .pw-ack-block,
  .pw-lily-banner,
  .pw-section-header button {
    display: none !important;
  }

  .pw-report-preview {
    border: none;
    padding: 0;
  }

  .pw-module {
    padding: 0;
  }
}

/* ── Mobile: hide entirely below 768px (desktop-only module) */
@media (max-width: 767px) {
  .pw-module {
    padding: 16px;
  }

  .pw-report-meta {
    grid-template-columns: 1fr;
  }

  .pw-ratio-grid {
    gap: 16px;
  }

  .pw-report-header {
    flex-direction: column;
    gap: 8px;
  }

  .pw-report-title h2,
  .pw-report-title p {
    text-align: left;
  }
}
