/**
 * GovTender PRO - Automated DOL Wage Determination & Form WH-347 Certified Payroll Assistant Stylesheet
 * High-performance, modern GovTech aesthetic honoring design tokens:
 * #0F172A Navy, #2563EB Blue, #059669 Emerald, #DC2626 Crimson, #D97706 Amber
 */

:root {
  --navy-950: #020617;
  --navy-900: #0F172A;
  --navy-850: #131E35;
  --navy-800: #1E293B;
  --navy-700: #334155;
  --navy-600: #475569;

  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-500: #3B82F6;
  --blue-100: #DBEAFE;
  --blue-50: #EFF6FF;

  --emerald-600: #059669;
  --emerald-500: #10B981;
  --emerald-100: #D1FAE5;
  --emerald-50: #ECFDF5;

  --crimson-600: #DC2626;
  --crimson-500: #EF4444;
  --crimson-100: #FEE2E2;
  --crimson-50: #FEF2F2;

  --amber-600: #D97706;
  --amber-500: #F59E0B;
  --amber-100: #FEF3C7;
  --amber-50: #FFFBEB;

  --purple-600: #7C3AED;
  --purple-100: #EDE9FE;

  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;

  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-dark: #94A3B8;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.payroll-body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
}

.font-bold {
  font-weight: 700;
}

.text-emerald {
  color: var(--emerald-600) !important;
}

.text-crimson {
  color: var(--crimson-600) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-center {
  text-align: center;
}

/* Sticky Operational Header */
.calc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--navy-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.calc-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calc-brand {
  display: flex;
  align-items: center;
}

.calc-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.calc-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--blue-600), #1e40af);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.calc-brand-text {
  display: flex;
  flex-direction: column;
}

.calc-brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.calc-brand-pro {
  background-color: var(--amber-500);
  color: var(--navy-950);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
  vertical-align: middle;
}

.calc-brand-sub {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

/* Header Live Opportunity Chip */
.calc-sol-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 6px 14px;
}

.chip-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-500);
}

.chip-details {
  display: flex;
  flex-direction: column;
}

.chip-id {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--amber-400, #fbbf24);
  letter-spacing: 0.02em;
}

.chip-title {
  font-size: 12px;
  color: #e2e8f0;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-value {
  background-color: rgba(37, 99, 235, 0.3);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(147, 197, 253, 0.3);
}

/* Header Actions */
.calc-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.btn-back-portal:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-action-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-tool:hover {
  background-color: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-print-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--emerald-600), #047857);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
  transition: all 0.15s ease;
}

.btn-print-pdf:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
}

/* Main Container */
.payroll-main-content {
  flex: 1;
  padding: 24px 0 60px;
}

.payroll-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Breadcrumbs */
.payroll-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.payroll-breadcrumbs a {
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}

.payroll-breadcrumbs a:hover {
  text-decoration: underline;
}

.crumb-sep {
  color: var(--border-medium);
}

.crumb-active {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Hero Card */
.payroll-hero-card {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.statute-badge {
  background-color: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(147, 197, 253, 0.3);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.omb-badge {
  background-color: rgba(217, 119, 6, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.payroll-hero-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.payroll-hero-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 1200px;
  margin-bottom: 18px;
}

/* Presets Toolbar */
.presets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.presets-label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin-right: 4px;
}

.preset-btn {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background-color: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.preset-btn.active {
  background-color: var(--blue-600);
  border-color: var(--blue-500);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

.preset-btn.warning {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.preset-btn.warning:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

.preset-btn.outline {
  color: #94a3b8;
}

/* Card Panels */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-help {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-text-toggle {
  background: none;
  border: none;
  color: var(--blue-600);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-toggle:hover {
  text-decoration: underline;
}

/* Section 1: Meta Grid */
.meta-form-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  background-color: var(--bg-surface);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group .req {
  color: var(--crimson-600);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
  padding: 8px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background-color: #fff;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.checkbox-group {
  justify-content: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Section 2: Audit Summary Card */
.audit-summary-card {
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.audit-summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.audit-status-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-indicator-pill.pass {
  background-color: var(--emerald-50);
  border: 1.5px solid var(--emerald-500);
  color: var(--emerald-600);
}

.status-indicator-pill.pass .status-dot {
  width: 10px;
  height: 10px;
  background-color: var(--emerald-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-500);
}

.status-indicator-pill.deficit {
  background-color: var(--crimson-50);
  border: 1.5px solid var(--crimson-500);
  color: var(--crimson-600);
}

.status-indicator-pill.deficit .status-dot {
  width: 10px;
  height: 10px;
  background-color: var(--crimson-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--crimson-500);
}

.status-indicator-pill.pending {
  background-color: var(--bg-subtle);
  border: 1.5px solid var(--border-medium);
  color: var(--text-muted);
}

.status-indicator-pill.pending .status-dot {
  width: 10px;
  height: 10px;
  background-color: var(--text-muted);
  border-radius: 50%;
}

.audit-citation-note {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.audit-metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-900);
}

/* Deficit Warning Banner */
.deficit-warning-banner {
  background-color: var(--crimson-50);
  border: 1px solid var(--crimson-500);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.deficit-banner-icon {
  font-size: 24px;
  line-height: 1;
}

.deficit-banner-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deficit-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--crimson-600);
}

.deficit-text {
  font-size: 12.5px;
  color: #7f1d1d;
  line-height: 1.5;
}

.deficit-shortfall-chip {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #fee2e2;
  border: 1px solid #f87171;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--crimson-600);
}

/* Section 3: Payroll Table */
.btn-add-worker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--blue-600);
  color: #fff;
  border: none;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-worker:hover {
  background-color: var(--blue-700);
}

.payroll-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.payroll-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.payroll-grid-table th {
  background-color: #f1f5f9;
  color: var(--navy-800);
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  text-align: left;
}

.table-super-header th {
  background-color: #e2e8f0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
}

.th-day {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center !important;
  font-size: 11px;
  padding: 6px 2px !important;
}

.th-num {
  text-align: right !important;
}

.payroll-grid-table td {
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  vertical-align: middle;
  background-color: #fff;
}

.payroll-grid-table tr:hover td {
  background-color: #f8fafc;
}

.table-totals-row td {
  background-color: #f1f5f9 !important;
  font-size: 12.5px;
  border-top: 2px solid var(--border-dark);
  padding: 10px 8px;
}

/* Worker Table Form Inputs */
.tbl-input {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
  background-color: #fff;
}

.tbl-input:focus {
  outline: none;
  border-color: var(--blue-600);
}

.tbl-input.num {
  text-align: right;
  font-family: var(--font-mono);
}

.tbl-input.day-hour {
  width: 42px;
  padding: 4px 2px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.tbl-input.day-hour.ot {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 700;
}

.tbl-select {
  padding: 5px 6px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  background-color: #fff;
}

/* Dual Day Cell (Straight / Overtime Stack) */
.dual-day-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.sub-label-hour {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
}

/* Benchmark pill in table */
.benchmark-pill {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.benchmark-pill strong {
  color: var(--text-secondary);
}

/* Status Badges */
.badge-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.badge-status-pill.pass {
  background-color: var(--emerald-100);
  color: var(--emerald-600);
}

.badge-status-pill.deficit {
  background-color: var(--crimson-100);
  color: var(--crimson-600);
}

.btn-remove-row {
  background: none;
  border: none;
  color: var(--crimson-500);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}

.btn-remove-row:hover {
  color: var(--crimson-600);
  transform: scale(1.15);
}

/* Section 4: Statement of Compliance */
.soc-body-wrap {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.soc-preamble p {
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.6;
}

.inline-input {
  border: none;
  border-bottom: 2px solid var(--blue-600);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-900);
  padding: 2px 6px;
  background-color: rgba(37, 99, 235, 0.05);
}

.inline-input:focus {
  outline: none;
  background-color: rgba(37, 99, 235, 0.12);
}

.soc-numbered-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.soc-fringe-election-card {
  background-color: #f8fafc;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fringe-election-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-900);
}

.fringe-election-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.fringe-radio-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fringe-radio-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: #fff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fringe-radio-box:hover {
  border-color: var(--blue-500);
}

.fringe-radio-box.active {
  border-color: var(--blue-600);
  background-color: #eff6ff;
}

.fringe-radio-box input[type="radio"] {
  margin-top: 3px;
}

.badge-fringe-box {
  background-color: var(--blue-600);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-right: 6px;
}

.fringe-radio-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.soc-exceptions-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.soc-exceptions-wrap label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.soc-exceptions-wrap textarea {
  padding: 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-primary);
}

.soc-sign-block {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.soc-sign-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  background-color: var(--bg-subtle);
  padding: 14px 18px;
  border-radius: var(--radius-md);
}

.sign-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sign-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.sign-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-900);
}

.sign-ink {
  font-family: "Brush Script MT", cursive, sans-serif;
  font-size: 18px;
  color: #1e3a8a;
}

.statutory-penalty-alert {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: #991b1b;
  line-height: 1.5;
}

/* Section 5: Narrative Block */
.narrative-content-wrap {
  padding: 20px;
}

.narrative-text {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--navy-900);
  background-color: #f8fafc;
  resize: vertical;
}

.btn-copy-narrative {
  background-color: #eff6ff;
  border: 1px solid var(--blue-500);
  color: var(--blue-600);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-copy-narrative:hover {
  background-color: var(--blue-600);
  color: #fff;
}

/* ========================================================================= */
/* Print-Only Document Rules (Form WH-347 2-Page Government Layout)          */
/* ========================================================================= */
.wh347-print-document {
  display: none;
}

@media print {
  /* Hide all Web UI */
  .calc-header,
  .payroll-breadcrumbs,
  .payroll-hero-card,
  #section-project-meta,
  #section-compliance-summary,
  #section-payroll-grid,
  #section-statement-compliance,
  #section-narrative-block {
    display: none !important;
  }

  body.payroll-body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt;
    padding: 0;
    margin: 0;
  }

  .payroll-main-content,
  .payroll-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* Show Official Print Document */
  .wh347-print-document {
    display: block !important;
    width: 100%;
  }

  .wh347-print-page {
    width: 100%;
    padding: 0.25in;
    box-sizing: border-box;
    page-break-inside: avoid;
  }

  .wh347-page-break {
    page-break-before: always;
    break-before: page;
    height: 0;
  }

  /* Page 1 Header */
  .wh347-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
    margin-bottom: 6px;
  }

  .wh347-dol-title {
    font-size: 8pt;
    display: flex;
    flex-direction: column;
  }

  .wh347-form-title {
    text-align: center;
  }

  .wh347-form-title h1 {
    font-size: 16pt;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin: 0;
  }

  .wh347-form-title span {
    font-size: 7pt;
  }

  .wh347-omb-info {
    font-size: 7.5pt;
    text-align: right;
    display: flex;
    flex-direction: column;
  }

  .wh347-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-gap: 4px;
    border: 1px solid #000;
    padding: 6px;
    margin-bottom: 8px;
    font-size: 8pt;
  }

  .wh347-meta-cell {
    display: flex;
    flex-direction: column;
  }

  .meta-label {
    font-size: 6.5pt;
    font-weight: 700;
    color: #333;
  }

  .meta-data {
    font-size: 8.5pt;
  }

  /* Print Table */
  .wh347-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7pt;
  }

  .wh347-print-table th,
  .wh347-print-table td {
    border: 1px solid #000;
    padding: 3px 2px;
    text-align: center;
  }

  .wh347-print-table th {
    background-color: #eee !important;
    font-weight: 800;
    font-size: 6.5pt;
  }

  .p-totals-row td {
    font-weight: 800;
    background-color: #f5f5f5 !important;
    border-top: 2px solid #000;
  }

  /* Page 2 Styles */
  .p2-header-block {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-bottom: 12px;
  }

  .p2-header-block h2 {
    font-size: 14pt;
    font-weight: 900;
    margin: 0;
  }

  .p2-meta-line {
    display: flex;
    justify-content: space-around;
    font-size: 9pt;
    margin-top: 4px;
  }

  .p2-body-text {
    font-size: 8.5pt;
    line-height: 1.45;
  }

  .p2-body-text p {
    margin-bottom: 8px;
    text-align: justify;
  }

  .p2-checkbox-section {
    border: 1px solid #000;
    padding: 8px;
    margin: 8px 0;
  }

  .p2-check-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }

  .p2-box {
    font-weight: 900;
    font-family: monospace;
  }

  .p2-exceptions-box {
    border-top: 1px dashed #000;
    padding-top: 6px;
    margin-top: 6px;
  }

  .p2-remarks-box {
    border: 1px solid #000;
    padding: 6px;
    margin: 8px 0;
    min-height: 35px;
  }

  .p2-signature-block {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 12px;
  }

  .p2-sig-col {
    width: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .sig-line {
    width: 100%;
    border-bottom: 1px solid #000;
    margin-bottom: 4px;
    height: 20px;
  }

  .sig-title-label {
    font-size: 7pt;
    font-weight: 700;
  }

  .p2-penalty-warning {
    margin-top: 20px;
    border: 1.5px solid #000;
    padding: 6px;
    font-size: 7.5pt;
    font-weight: 800;
    text-align: center;
  }

  .wh347-page-footer {
    display: flex;
    justify-content: space-between;
    font-size: 7pt;
    margin-top: 12px;
    border-top: 1px solid #999;
    padding-top: 4px;
  }
}
