/* ==========================================================================
   FAITH & FIRE PREPAREDNESS PLATFORM - UNIVERSAL REPORTING ENGINE CSS
   ========================================================================== */

/* Main Reporting Section Container */
.reporting-engine-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  color: #f3f4f6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reporting Navigation Header & Template Selector Bar */
.report-engine-topbar {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.report-topbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.report-engine-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-engine-icon {
  font-size: 1.8rem;
  background: rgba(194, 94, 46, 0.2);
  border: 1px solid #c25e2e;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-engine-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f9fafb;
  margin: 0;
}

.report-engine-subheading {
  font-size: 0.85rem;
  color: #9ca3af;
  margin: 2px 0 0 0;
}

/* Template Selector Dropdown / Grid */
.report-template-selector-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.report-template-select {
  flex: 1;
  min-width: 260px;
  background: #1f2937;
  color: #f9fafb;
  border: 1px solid #4b5563;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.report-template-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

/* Quick Category Badges for Templates */
.report-quick-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
}

.report-pill-btn {
  background: #1f2937;
  color: #9ca3af;
  border: 1px solid #374151;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.report-pill-btn:hover {
  background: #374151;
  color: #f9fafb;
}

.report-pill-btn.active {
  background: rgba(194, 94, 46, 0.25);
  color: #f97316;
  border-color: #c25e2e;
}

/* Report Action Toolbar */
.report-action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #1a2332;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.report-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.report-search-input {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f1f5f9;
  padding: 8px 12px;
  font-size: 0.88rem;
  min-width: 200px;
}

.report-filter-select {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f1f5f9;
  padding: 8px 12px;
  font-size: 0.88rem;
  cursor: pointer;
}

.report-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.report-btn-primary {
  background: #c25e2e;
  color: #ffffff;
  border-color: #d97706;
}

.report-btn-primary:hover {
  background: #b85428;
}

.report-btn-secondary {
  background: #1f2937;
  color: #e5e7eb;
  border-color: #4b5563;
}

.report-btn-secondary:hover {
  background: #374151;
  color: #ffffff;
}

.report-btn-accent {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: #10b981;
}

.report-btn-accent:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* Main Printable Report Canvas Wrapper */
.report-paper-canvas {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Report Standard Header Block */
.report-paper-header {
  border: 2px solid #c25e2e;
  background: linear-gradient(135deg, rgba(30, 24, 20, 0.95), rgba(17, 24, 39, 0.98));
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.report-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(194, 94, 46, 0.3);
  padding-bottom: 14px;
}

.report-brand-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f97316;
  text-transform: uppercase;
}

.report-title-main {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f9fafb;
  margin: 4px 0 2px 0;
}

.report-meta-timestamp {
  font-size: 0.85rem;
  color: #9ca3af;
}

.report-household-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.report-info-item {
  display: flex;
  flex-direction: column;
}

.report-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-info-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f3f4f6;
  margin-top: 2px;
}

/* KPI Summary Cards Grid */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-kpi-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-kpi-card.highlight {
  border-color: #c25e2e;
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(194, 94, 46, 0.15));
}

.report-kpi-label {
  font-size: 0.8rem;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: 6px;
}

.report-kpi-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f9fafb;
}

.report-kpi-sub {
  font-size: 0.78rem;
  color: #60a5fa;
  margin-top: 4px;
}

/* Report Section Blocks */
.report-section {
  margin-bottom: 28px;
}

.report-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3f4f6;
  border-bottom: 2px solid #c25e2e;
  padding-bottom: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Universal Table Styles */
.report-table-wrapper {
  overflow-x: auto;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.report-table th {
  background: #111827;
  color: #9ca3af;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid #374151;
  font-weight: 700;
}

.report-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #2d3748;
  color: #e5e7eb;
}

.report-table tr:last-child td {
  border-bottom: none;
}

.report-table tr:hover td {
  background: rgba(55, 65, 81, 0.4);
}

/* Badges & Tags */
.report-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.badge-critical { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid #ef4444; }
.badge-high { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid #f59e0b; }
.badge-medium { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid #3b82f6; }
.badge-low { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid #10b981; }
.badge-good { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid #f59e0b; }

/* Recommendations & Next Actions List */
.report-recs-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-rec-card {
  background: #1f2937;
  border-left: 4px solid #f59e0b;
  border-top: 1px solid #374151;
  border-right: 1px solid #374151;
  border-bottom: 1px solid #374151;
  border-radius: 6px;
  padding: 14px 18px;
}

.report-rec-card.high {
  border-left-color: #ef4444;
}

.report-rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.report-rec-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f3f4f6;
}

.report-rec-desc {
  font-size: 0.88rem;
  color: #d1d5db;
  margin: 4px 0;
}

.report-rec-action {
  font-size: 0.84rem;
  color: #f59e0b;
  font-weight: 600;
  margin-top: 6px;
}

/* Next Actions Checklist */
.report-actions-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 16px;
}

.report-action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  background: #1f2937;
  border-radius: 6px;
  border: 1px solid #2d3748;
}

.report-action-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #c25e2e;
  margin-top: 2px;
}

.report-action-label {
  font-size: 0.88rem;
  color: #e5e7eb;
  line-height: 1.4;
  cursor: pointer;
}

/* Snapshot Comparison Modal */
.report-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.report-modal-box {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.report-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #374151;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

/* ==========================================================================
   PRINT STYLES (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 12pt;
  }

  .top-bar-container,
  .app-header,
  .report-engine-topbar,
  .report-action-toolbar,
  .no-print,
  .report-modal-backdrop {
    display: none !important;
  }

  .reporting-engine-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-paper-canvas {
    background: #ffffff !important;
    color: #111827 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .report-paper-header {
    background: #f8fafc !important;
    border: 2px solid #000000 !important;
    color: #111827 !important;
  }

  .report-title-main {
    color: #000000 !important;
  }

  .report-household-info-grid {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
  }

  .report-info-label {
    color: #475569 !important;
  }

  .report-info-val {
    color: #0f172a !important;
  }

  .report-kpi-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
  }

  .report-kpi-val {
    color: #000000 !important;
  }

  .report-section-title {
    color: #000000 !important;
    border-bottom: 2px solid #000000 !important;
  }

  .report-table-wrapper {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
  }

  .report-table th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-bottom: 1px solid #94a3b8 !important;
  }

  .report-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .report-rec-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
  }

  .report-rec-title {
    color: #0f172a !important;
  }

  .report-rec-desc {
    color: #334155 !important;
  }

  .report-actions-checklist,
  .report-action-item {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
  }

  .report-action-label {
    color: #0f172a !important;
  }
}
