.safetychex-reports {
  --reports-navy: #013369;
  --reports-orange: #ffa500;
  --reports-bg: #f3f5f8;
  --reports-card: #ffffff;
  --reports-border: #d7dee8;
  --reports-text: #18314d;
  --reports-muted: #6f7f92;
  --reports-green: #1f9d55;
  --reports-yellow: #d59b12;
  --reports-red: #d93025;
  --reports-gray: #b0b9c6;
  color: var(--reports-text);
}

.safetychex-reports .reports-shell {
  display: grid;
  gap: 18px;
  padding: 20px 0 32px;
}

.safetychex-reports .reports-panel,
.safetychex-reports .reports-card {
  background: var(--reports-card);
  border: 1px solid var(--reports-border);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(1, 51, 105, 0.08);
}

.safetychex-reports .reports-filter-panel {
  background: linear-gradient(180deg, #f7f8fa 0%, #eef2f6 100%);
  padding: 18px;
}

.safetychex-reports .reports-filter-row,
.safetychex-reports .reports-filter-actions,
.safetychex-reports .reports-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.safetychex-reports .reports-filter-group {
  flex: 1 1 180px;
}

.safetychex-reports label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--reports-muted);
  margin-bottom: 6px;
}

.safetychex-reports select,
.safetychex-reports input[type="date"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d3df;
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
  color: var(--reports-text);
  font: inherit;
}

.safetychex-reports select:focus,
.safetychex-reports input[type="date"]:focus {
  outline: none;
  border-color: var(--reports-orange);
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.18);
}

.safetychex-reports .reports-custom-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-right: auto;
}

.safetychex-reports .reports-custom-dates[hidden] {
  display: none;
}

.safetychex-reports .reports-btn {
  min-height: 44px;
  border: 1px solid var(--reports-border);
  border-radius: 999px;
  padding: 0 18px;
  background: #fff;
  color: var(--reports-navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.safetychex-reports .reports-btn:hover,
.safetychex-reports .reports-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(1, 51, 105, 0.12);
}

.safetychex-reports .reports-btn-primary {
  border-color: var(--reports-navy);
  background: var(--reports-navy);
  color: #fff;
}

.safetychex-reports .reports-summary-grid,
.safetychex-reports .reports-chart-grid {
  display: grid;
  gap: 16px;
}

.safetychex-reports .reports-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.safetychex-reports .reports-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.safetychex-reports .reports-card {
  padding: 18px;
  border-top: 6px solid var(--reports-gray);
}

.safetychex-reports .reports-card-good {
  border-top-color: var(--reports-green);
}

.safetychex-reports .reports-card-warn {
  border-top-color: var(--reports-yellow);
}

.safetychex-reports .reports-card-bad {
  border-top-color: var(--reports-red);
}

.safetychex-reports .reports-card h3 {
  font-size: 13px;
  color: var(--reports-muted);
  margin-bottom: 10px;
}

.safetychex-reports .reports-card-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--reports-navy);
  line-height: 1;
  margin-bottom: 10px;
}

.safetychex-reports .reports-card p,
.safetychex-reports .reports-section-head p,
.safetychex-reports .reports-inspection-note {
  color: var(--reports-muted);
  font-size: 14px;
  line-height: 1.5;
}

.safetychex-reports .reports-table-panel,
.safetychex-reports .reports-heatmap-panel,
.safetychex-reports .reports-chart-grid > .reports-panel {
  padding: 18px;
}

.safetychex-reports .reports-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.safetychex-reports .reports-section-head h2 {
  font-size: 20px;
  color: var(--reports-navy);
  margin: 0 0 4px;
}

.safetychex-reports .reports-table-wrap {
  overflow: auto;
  max-height: 540px;
  border: 1px solid var(--reports-border);
  border-radius: 14px;
}

.safetychex-reports .reports-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.safetychex-reports .reports-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e9f0f8;
  color: var(--reports-navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.safetychex-reports .reports-table th,
.safetychex-reports .reports-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e4ebf3;
}

.safetychex-reports .reports-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.safetychex-reports .reports-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.safetychex-reports .reports-status-pill.is-complete {
  background: rgba(31, 157, 85, 0.12);
  color: #176b3d;
}

.safetychex-reports .reports-status-pill.is-progress {
  background: rgba(213, 155, 18, 0.16);
  color: #8e6a0d;
}

.safetychex-reports .reports-status-pill.is-not-started {
  background: rgba(176, 185, 198, 0.18);
  color: #58697c;
}

.safetychex-reports .reports-status-pill.is-overdue {
  background: rgba(217, 48, 37, 0.12);
  color: #a31f16;
}

.safetychex-reports .reports-link-btn {
  border: none;
  background: none;
  color: var(--reports-navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.safetychex-reports .reports-muted {
  color: var(--reports-muted);
}

.safetychex-reports .reports-heatmap-scroll {
  overflow: auto;
  border: 1px solid var(--reports-border);
  border-radius: 14px;
}

.safetychex-reports .reports-heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

.safetychex-reports .reports-heatmap-table th,
.safetychex-reports .reports-heatmap-table td {
  padding: 10px;
  border-bottom: 1px solid #e8eef5;
  text-align: center;
}

.safetychex-reports .reports-heatmap-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fb;
  color: var(--reports-navy);
  font-size: 11px;
  text-transform: uppercase;
}

.safetychex-reports .reports-heatmap-table tbody th {
  text-align: left;
  color: var(--reports-text);
  background: #fff;
  white-space: nowrap;
}

.safetychex-reports .reports-heatmap-cell {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(1, 51, 105, 0.08);
}

.safetychex-reports .reports-heatmap-complete {
  background: #34c759;
}

.safetychex-reports .reports-heatmap-in-progress {
  background: #ffd24d;
}

.safetychex-reports .reports-heatmap-overdue {
  background: #ff5b5b;
}

.safetychex-reports .reports-heatmap-unassigned,
.safetychex-reports .reports-heatmap-not-started {
  background: #d2d8e0;
}

.safetychex-reports .reports-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--reports-muted);
  font-size: 13px;
}

.safetychex-reports .reports-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.safetychex-reports .reports-bar-chart {
  display: grid;
  gap: 12px;
}

.safetychex-reports .reports-bar-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
}

.safetychex-reports .reports-bar-label,
.safetychex-reports .reports-bar-value {
  font-size: 13px;
  font-weight: 700;
}

.safetychex-reports .reports-bar-track {
  height: 14px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
}

.safetychex-reports .reports-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--reports-orange), #ffbf47);
  animation: reports-bar-grow 0.7s ease;
}

@keyframes reports-bar-grow {
  from { width: 0; }
}

.safetychex-reports .reports-line-chart {
  display: grid;
  gap: 14px;
}

.safetychex-reports .reports-line-canvas {
  position: relative;
  min-height: 220px;
  border-radius: 16px;
  background:
    linear-gradient(to top, rgba(1, 51, 105, 0.04) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, #fcfdff 0%, #f2f6fb 100%);
  border: 1px solid var(--reports-border);
}

.safetychex-reports .reports-line-segment {
  position: absolute;
  height: 3px;
  transform-origin: left center;
  background: var(--reports-orange);
  border-radius: 999px;
}

.safetychex-reports .reports-line-point {
  position: absolute;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--reports-navy);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(1, 51, 105, 0.18);
}

.safetychex-reports .reports-line-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
  color: var(--reports-muted);
  font-size: 12px;
  text-align: center;
}

.safetychex-reports .reports-empty {
  padding: 28px;
  border: 1px dashed var(--reports-border);
  border-radius: 16px;
  text-align: center;
  color: var(--reports-muted);
  background: #fff;
}

@media (max-width: 1024px) {
  .safetychex-reports .reports-summary-grid,
  .safetychex-reports .reports-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .safetychex-reports .reports-summary-grid,
  .safetychex-reports .reports-chart-grid {
    grid-template-columns: 1fr;
  }

  .safetychex-reports .reports-filter-actions,
  .safetychex-reports .reports-button-row,
  .safetychex-reports .reports-custom-dates {
    align-items: stretch;
  }

  .safetychex-reports .reports-btn {
    width: 100%;
  }

  .safetychex-reports .reports-table,
  .safetychex-reports .reports-table thead,
  .safetychex-reports .reports-table tbody,
  .safetychex-reports .reports-table th,
  .safetychex-reports .reports-table td,
  .safetychex-reports .reports-table tr {
    display: block;
  }

  .safetychex-reports .reports-table {
    min-width: 0;
  }

  .safetychex-reports .reports-table thead {
    display: none;
  }

  .safetychex-reports .reports-table tbody tr {
    padding: 14px;
    border-bottom: 1px solid #e4ebf3;
  }

  .safetychex-reports .reports-table td {
    padding: 8px 0;
    border: none;
  }

  .safetychex-reports .reports-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--reports-muted);
    margin-bottom: 4px;
  }

  .safetychex-reports .reports-bar-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  .safetychex-reports .reports-filter-panel,
  .safetychex-reports .reports-btn,
  .safetychex-reports .reports-link-btn {
    display: none !important;
  }

  .safetychex-reports .reports-table-wrap,
  .safetychex-reports .reports-heatmap-scroll {
    max-height: none;
    overflow: visible;
  }

  .safetychex-reports .reports-panel,
  .safetychex-reports .reports-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
