/* ============================================================
   PR334 — Certified Payroll Auto-Draft Styles
   TradeRail Field Portal
   Build marker: pr334-certified-payroll:2026-06-19
   ============================================================ */

/* ─── Page Header ─────────────────────────────────────────────────────────── */
.pr334-page-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 16px;
}

.pr334-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px;
  line-height: 1.2;
}

.pr334-page-subtitle {
  font-size: 13px;
  color: #6B7280;
  margin: 0;
}

/* ─── Demo root ───────────────────────────────────────────────────────────── */
.pr334-demo-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #111827;
  background: #F9FAFB;
  min-height: 100vh;
}

/* ─── Weekly Status Cards ─────────────────────────────────────────────────── */
.pr334-week-cards {
  padding: 0 24px 16px;
}

.pr334-week-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pr334-week-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.pr334-week-range {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.pr334-week-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pr334-meta-item {
  font-size: 13px;
  color: #6B7280;
}

.pr334-week-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Status Badges ───────────────────────────────────────────────────────── */
.pr334-status-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
}

.pr334-status--draft {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.pr334-status--pending {
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #C4B5FD;
}

.pr334-status--approved {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.pr334-status--submitted {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.pr334-status--not-started {
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #D1D5DB;
}

/* ─── Discrepancy / Info Badges ───────────────────────────────────────────── */
.pr334-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.pr334-badge--warn {
  background: #FEF3C7;
  color: #92400E;
}

.pr334-badge--ok {
  background: #D1FAE5;
  color: #065F46;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.pr334-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
}

.pr334-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pr334-btn--primary {
  background: #1D4ED8;
  color: #FFFFFF;
  border-color: #1D4ED8;
}

.pr334-btn--primary:hover:not(:disabled) {
  background: #1E40AF;
  border-color: #1E40AF;
}

.pr334-btn--secondary {
  background: #FFFFFF;
  color: #374151;
  border-color: #D1D5DB;
}

.pr334-btn--secondary:hover:not(:disabled) {
  background: #F9FAFB;
  border-color: #9CA3AF;
}

/* ─── Review Panel (overlay) ──────────────────────────────────────────────── */
.pr334-review-panel {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  margin: 0 24px 24px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pr334-panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #6B7280;
}

.pr334-panel-close:hover {
  background: #F3F4F6;
}

.pr334-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px;
}

.pr334-panel-meta-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0;
}

.pr334-panel-meta-grid dt {
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pr334-panel-meta-grid dd {
  font-size: 13px;
  color: #111827;
  margin: 0;
}

/* ─── Worker Table ────────────────────────────────────────────────────────── */
.pr334-table-wrap {
  overflow-x: auto;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
}

.pr334-worker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.pr334-worker-table thead {
  background: #F9FAFB;
}

.pr334-worker-table th {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.pr334-worker-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F3F4F6;
  color: #111827;
  white-space: nowrap;
}

.pr334-worker-table tbody tr:last-child td {
  border-bottom: none;
}

.pr334-worker-table tbody tr:hover td {
  background: #F9FAFB;
}

/* Flagged row — orange left border */
.pr334-row--flagged td:first-child {
  border-left: 4px solid #FF6B00;
  padding-left: 8px;
}

.pr334-flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #FF6B00;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  line-height: 1;
}

/* ─── Subcontractor Section ───────────────────────────────────────────────── */
.pr334-sub-section {
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  overflow: hidden;
}

.pr334-sub-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: #F9FAFB;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #E5E7EB;
}

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

.pr334-sub-table th {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
}

.pr334-sub-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #F3F4F6;
  color: #111827;
}

.pr334-sub-table tbody tr:last-child td {
  border-bottom: none;
}

.pr334-sub-cpr--ok {
  color: #065F46;
  font-weight: 600;
}

.pr334-sub-cpr--missing {
  color: #B91C1C;
  font-weight: 700;
}

/* ─── Discrepancy Section ─────────────────────────────────────────────────── */
.pr334-discrepancy-section {
  border: 1px solid #FCD34D;
  border-radius: 6px;
  background: #FFFBEB;
  padding: 14px 16px;
}

.pr334-disc-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400E;
  margin: 0 0 8px;
}

.pr334-disc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pr334-disc-list li {
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #FDE68A;
}

.pr334-disc-list li:last-child {
  border-bottom: none;
}

.pr334-disc--blocking {
  color: #B91C1C;
}

.pr334-disc--warning {
  color: #92400E;
}

/* ─── Statement of Compliance ─────────────────────────────────────────────── */
.pr334-compliance-section {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 6px;
  padding: 14px 16px;
}

.pr334-compliance-label {
  font-size: 13px;
  color: #166534;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.pr334-compliance-check {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ─── Action Bar ──────────────────────────────────────────────────────────── */
.pr334-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid #E5E7EB;
}

/* ─── Lily Advisory Bar ───────────────────────────────────────────────────── */
.pr334-lily-bar {
  border-left: 4px solid #7C3AED;
  background: #F5F3FF;
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
}

.pr334-lily-bar-header {
  margin-bottom: 6px;
}

.pr334-lily-label {
  font-size: 12px;
  font-weight: 700;
  color: #7C3AED;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pr334-lily-insights {
  margin-bottom: 8px;
}

.pr334-lily-insight {
  font-size: 13px;
  color: #4B5563;
  margin: 0 0 4px;
  line-height: 1.5;
}

.pr334-lily-insight:last-child {
  margin-bottom: 0;
}

.pr334-lily-disclaimer {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.4;
  border-top: 1px solid #E9D5FF;
  padding-top: 6px;
  margin-top: 6px;
}

/* ─── Panel empty state ───────────────────────────────────────────────────── */
.pr334-panel-empty {
  padding: 32px 24px;
  text-align: center;
  color: #9CA3AF;
  font-size: 14px;
}

/* ─── Sidebar guard (desktop only) ───────────────────────────────────────── */
@media (max-width: 767px) {
  .pr334-sidebar {
    display: none;
  }

  .pr334-review-panel {
    margin: 0 8px 16px;
    padding: 16px;
  }

  .pr334-week-cards {
    padding: 0 8px 12px;
  }

  .pr334-page-header {
    padding: 16px 12px 10px;
  }
}

/* ─── Sidebar visible on desktop ──────────────────────────────────────────── */
@media (min-width: 768px) {
  .pr334-sidebar {
    display: block;
  }
}
