.insurance-report-view {
  display: grid;
  min-width: 0;
  gap: 18px;
  margin-top: 20px;
}

.insurance-report-view[hidden],
.insurance-report-result[hidden] {
  display: none !important;
}

.insurance-report-heading,
.insurance-report-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.insurance-report-heading span,
.insurance-report-result-head span {
  color: #3472df;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.insurance-report-heading h3,
.insurance-report-result-head h4 {
  margin: 5px 0 4px;
  color: #122845;
  font-size: 22px;
}

.insurance-report-heading p,
.insurance-report-result-head p {
  margin: 0;
  color: #6c7d92;
  line-height: 1.55;
}

.insurance-report-heading em {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #cfe0fb;
  border-radius: 999px;
  background: #edf4ff;
  color: #245fbf;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.insurance-report-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(150px, .7fr) auto;
  align-items: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dce6f3;
  border-radius: 18px;
  background: #f7faff;
}

.insurance-report-controls label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #2a405e;
  font-size: 12px;
  font-weight: 800;
}

.insurance-report-controls > button {
  min-height: 46px;
  margin: 25px 0 0;
}

.insurance-report-controls label small {
  color: #74869d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.insurance-report-rider-picker {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.insurance-report-rider-picker > small {
  color: #617792;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.insurance-report-rider-matches {
  display: grid;
  gap: 5px;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #ccd9e9;
  border-radius: 12px;
  background: #fff;
}

.insurance-report-rider-matches[hidden] {
  display: none;
}

.insurance-report-rider-matches button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #172d4b;
  text-align: left;
  cursor: pointer;
}

.insurance-report-rider-matches button:hover,
.insurance-report-rider-matches button:focus-visible {
  outline: 2px solid #b8d1f7;
  background: #edf4ff;
}

.insurance-report-rider-matches button strong {
  font-size: 12px;
}

.insurance-report-rider-matches button small {
  color: #647992;
  font-size: 10px;
  line-height: 1.4;
}

.insurance-report-controls select,
.insurance-report-controls input {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid #ccd9e9;
  border-radius: 12px;
  background: #fff;
  color: #172d4b;
  font: inherit;
}

.insurance-report-controls :disabled,
.insurance-report-actions :disabled {
  cursor: not-allowed;
  opacity: .58;
}

.insurance-report-safety {
  margin: -4px 2px 0;
  color: #75859a;
  font-size: 12px;
  line-height: 1.6;
}

.insurance-report-result {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 20px;
  border: 1px solid #dce5f1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(22, 48, 82, .06);
}

.insurance-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.insurance-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.insurance-report-summary article {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  background: #f3f7fc;
}

.insurance-report-summary span {
  color: #73839a;
  font-size: 11px;
  font-weight: 700;
}

.insurance-report-summary strong {
  overflow-wrap: anywhere;
  color: #16365f;
  font-size: 18px;
}

.insurance-report-table-wrap {
  overflow: auto;
  border: 1px solid #e0e8f2;
  border-radius: 14px;
}

.insurance-report-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  color: #253c59;
  font-size: 12px;
}

.insurance-report-table th,
.insurance-report-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e7edf5;
  text-align: right;
  white-space: nowrap;
}

.insurance-report-table th {
  background: #f3f7fc;
  color: #526985;
  font-weight: 800;
}

.insurance-report-table th:first-child,
.insurance-report-table td:first-child,
.insurance-report-table th:nth-child(2),
.insurance-report-table td:nth-child(2),
.insurance-report-table th:nth-child(3),
.insurance-report-table td:nth-child(3) {
  text-align: left;
}

.insurance-report-table tfoot td {
  background: #eef4fd;
  color: #123b76;
  font-weight: 900;
}

.insurance-report-activity {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.insurance-report-basis,
.insurance-report-notices p {
  margin: 0;
  color: #637892;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.insurance-report-notices {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #efd6a9;
  border-radius: 12px;
  background: #fff9ef;
}

.insurance-report-notices p {
  color: #866121;
}

.insurance-report-month-section {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.insurance-report-month-section h5 {
  margin: 0;
  color: #1c3d66;
  font-size: 15px;
}

.insurance-report-month-table {
  min-width: 540px;
}

.insurance-report-reference {
  min-width: 0;
  border-top: 1px solid #e3eaf4;
  padding-top: 14px;
}

.insurance-report-reference > summary {
  margin-bottom: 12px;
  color: #596f8c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* The desktop sidebar leaves a narrow content column on tablet screens. */
@media (max-width: 1100px) {
  .insurance-report-controls {
    grid-template-columns: 1fr;
  }

  .insurance-report-controls > button {
    margin-top: 0;
  }

  .insurance-report-heading,
  .insurance-report-result-head {
    display: grid;
  }

  .insurance-report-heading em {
    justify-self: start;
  }

  .insurance-report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #admin .settlement-history-view-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .insurance-report-heading,
  .insurance-report-result-head {
    display: grid;
  }

  .insurance-report-heading em {
    justify-self: start;
  }

  .insurance-report-controls {
    grid-template-columns: 1fr;
  }

  .insurance-report-controls > button {
    margin-top: 0;
  }

  .insurance-report-controls button,
  .insurance-report-actions button {
    width: 100%;
  }

  .insurance-report-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  #download-insurance-pdf {
    grid-column: 1 / -1;
  }

  .insurance-report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .insurance-report-actions,
  .insurance-report-summary {
    grid-template-columns: 1fr;
  }

  #download-insurance-pdf {
    grid-column: auto;
  }
}

/* Compact monthly summary; the underlying operation and payment dates differ. */
.monthly-tax-summary {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dce5f1;
  border-radius: 14px;
  background: #fff;
  scrollbar-color: #bccde3 #f0f5fb;
  scrollbar-width: thin;
}
.monthly-tax-summary table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  color: #253c59;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.monthly-tax-summary th,
.monthly-tax-summary td {
  padding: 12px;
  border-bottom: 1px solid #e8eef5;
  text-align: right;
  white-space: nowrap;
}
.monthly-tax-summary th {background: #f3f7fc;color: #60738d;font-size: 11px;font-weight: 800;}
.monthly-tax-summary th:first-child,
.monthly-tax-summary td:first-child {text-align: left;}
.monthly-tax-summary tbody tr:last-child td {border-bottom: 0;}
.monthly-tax-summary td:last-child {color: #1f5caa;font-weight: 850;}
.monthly-tax-summary tr.is-total td {border-top: 1px solid #dce5f1;background: #f5f8fd;font-weight: 850;}
.monthly-tax-summary .insurance-report-table th:not(:first-child),
.monthly-tax-summary .insurance-report-table td:not(:first-child) {text-align: right;}
.insurance-report-summary.is-financial strong {line-height: 1.4;overflow-wrap: anywhere;}
.monthly-tax-breakdown {
  display: block;
  margin-top: 5px;
  color: #72829a;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: normal;
}
.monthly-tax-status {color: #986b27;font-size: 11px;font-weight: 750;}
.monthly-report-fold {
  min-width: 0;
  padding: 0 14px;
  border: 1px solid #e0e8f2;
  border-radius: 13px;
  background: #fff;
}
.monthly-report-fold > summary {
  padding: 13px 0;
  color: #415d7d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  cursor: pointer;
}
.monthly-report-fold > summary:focus-visible {outline: 2px solid #a6c5ee;outline-offset: 3px;border-radius: 5px;}
.monthly-report-fold[open] {border-color: #cbdbee;}
.monthly-tax-detail {display: grid;min-width: 0;gap: 12px;padding-bottom: 14px;}
.monthly-tax-detail > p {margin: 0;color: #73839a;font-size: 11px;line-height: 1.65;overflow-wrap: anywhere;}
@media (max-width: 620px) {
  .monthly-tax-summary {overflow: visible;border: 0;border-radius: 0;background: transparent;}
  .monthly-tax-summary table {display: block;min-width: 0;width: 100%;}
  .monthly-tax-summary thead {position: absolute;width: 1px;height: 1px;overflow: hidden;clip-path: inset(50%);white-space: nowrap;}
  .monthly-tax-summary tbody {display: grid;gap: 9px;}
  .monthly-tax-summary tbody tr {display: grid;grid-template-columns: repeat(2,minmax(0,1fr));padding: 2px 12px 8px;border: 1px solid #e0e8f2;border-radius: 12px;background: #fff;}
  .monthly-tax-summary td {min-width: 0;padding: 8px 0;border: 0;text-align: left;white-space: normal;overflow-wrap: anywhere;}
  .monthly-tax-summary td:first-child {grid-column: 1 / -1;margin-bottom: 2px;padding: 11px 0 10px;border-bottom: 1px solid #edf1f7;color: #36577f;font-size: 12px;font-weight: 850;}
  .monthly-tax-summary td::before {display: block;margin-bottom: 4px;color: #8191a7;font-size: 9px;font-weight: 600;content: attr(data-label);}
  .monthly-tax-summary td:first-child::before {display: none;}
  .monthly-tax-summary td:last-child {color: #1f5caa;}
  .monthly-tax-summary .insurance-report-table th:not(:first-child),
  .monthly-tax-summary .insurance-report-table td:not(:first-child) {text-align: left;}
}
