/* ── Global font for this block ─────────────────────────────────────────── */
.previous-reports,
.previous-reports .modal-report {
  font-family: "sofia-pro", sans-serif;
}

/*
 * Header (breadcrumbs + heading + description) is reused from the Upload page:
 * the markup uses .report-tool > .upload-as-page > .upload-page-head /
 * .upload-breadcrumbs / .upload-intro, so the styles come straight from the
 * report-tool plugin stylesheet (css/style.css). Nothing to duplicate here.
 */

/* Sticky breadcrumb bar: force an opaque background so the heading/description
 * can never bleed through it while scrolling (the CSS var can be unset here). */
.previous-reports .upload-page-head {
  background: var(--sme-body-background, #f1f3f4) !important;
}

/* A touch more breathing room above the "Hello, …" heading. */
.previous-reports .upload-intro {
  padding-top: 10px;
}

/* ── Card wrapper ────────────────────────────────────────────────────────── *
 * Transparent spacing wrapper — the bordered light table is the visual
 * container (matching the dashboard summary table), so no white card here. */
.previous-reports .prev-reports-card {
  margin-bottom: 40px;
}

/* ── Table ───────────────────────────────────────────────────────────────── *
 * Reuses the Corporate Journey admin dashboard summary-table style
 * (.cj-admin-dashboard__summary-table): clean white/gray, borders only,
 * no teal header. */
.previous-reports .table-reports {
  margin-top: 40px;
  border: 1px solid #e4e4e4;
  border-radius: 17px;
  /* No `overflow: hidden` here — it clipped the header info tooltip (and any
     other popover) at the wrapper edge. The corner cells round themselves
     instead (see `border-collapse: separate` below), so the cell backgrounds
     still follow the rounded border without a clipping context. */
}

/* The `table` in the selectors below matches the compiled (dist) specificity
   so these win over the older built styles even before a rebuild. */
.previous-reports .table-reports table {
  width: 100%;
  /* `separate` (not `collapse`) so the corner cells can carry a border-radius;
     every cell only draws a bottom border, so nothing doubles up. This
     replaces the wrapper's old `overflow: hidden`. */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.previous-reports .table-reports table th,
.previous-reports .table-reports table td {
  padding: 12px 16px;
  text-align: center;
  border-right: 0;
  border-bottom: 1px solid #e4e4e4;
  vertical-align: middle;
}

.previous-reports .table-reports table thead th {
  background: #f9fafb;
  color: #344054;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

/* Header info icon + hover tooltip (opens downward so the table's overflow:hidden
   doesn't clip it). */
.previous-reports .table-reports th .th-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.previous-reports .table-reports th .th-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #298187;
  cursor: help;
}
.previous-reports .table-reports th .th-info > svg {
  width: 16px;
  height: 16px;
  margin-bottom: -2px;
}
.previous-reports .table-reports th .th-info__tip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 260px;
  max-width: 70vw;
  background: #298187;
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  z-index: 30;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.previous-reports .table-reports th .th-info__tip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 10px;
  transform: rotate(45deg);
  width: 14px;
  height: 14px;
  background: #298187;
  border-radius: 3px;
  margin-bottom: -7px;
}
.previous-reports .table-reports th .th-info:hover .th-info__tip,
.previous-reports .table-reports th .th-info:focus .th-info__tip,
.previous-reports .table-reports th .th-info:focus-within .th-info__tip {
  visibility: visible;
  opacity: 1;
}

.previous-reports .table-reports table tbody td {
  color: #344054;
  font-weight: 500;
  background: #fff;
}

.previous-reports .table-reports table tbody tr:last-child td {
  border-bottom: 0;
}

/* Round the four corner cells so their backgrounds follow the wrapper's 17px
   border-radius. Inset by 1px to sit inside the wrapper's border. */
.previous-reports .table-reports table thead tr:first-child th:first-child {
  border-top-left-radius: 16px;
}

.previous-reports .table-reports table thead tr:first-child th:last-child {
  border-top-right-radius: 16px;
}

.previous-reports .table-reports table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 16px;
}

.previous-reports .table-reports table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

.previous-reports .table-reports table td b {
  font-weight: 600;
  color: #062d2f;
}

.previous-reports .table-reports table td p {
  font-size: 13px;
  color: #667085;
  margin: 4px 0 0;
}

/* ── Action buttons in the table (compact icon buttons) ──────────────────── */
.previous-reports .report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* `.report-actions` raises specificity above the compiled (dist) button rules. */
.previous-reports .table-reports .report-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

.previous-reports .table-reports .report-actions .button svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Primary (filled teal) — Edit report */
.previous-reports .table-reports .report-actions .button:not(.second) {
  background: #125b60;
  border: 1.5px solid #125b60;
  color: #fff;
}

.previous-reports .table-reports .report-actions .button:not(.second):hover {
  background: #0e4a4e;
  border-color: #0e4a4e;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(18, 91, 96, 0.22);
}

/* Secondary (outline) — View / PDF */
.previous-reports .table-reports .report-actions .button.second {
  background: transparent;
  border: 1.5px solid #298187;
  color: #125b60;
}

.previous-reports .table-reports .report-actions .button.second:hover {
  background: rgba(18, 91, 96, 0.06);
  border-color: #125b60;
  transform: translateY(-1px);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.previous-reports .bottom {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.previous-reports .bottom .pagination {
  display: flex;
  gap: 4px;
}

.previous-reports a.page-numbers {
  display: flex;
  background: #298187;
  color: #fff;
  border-radius: 20px;
  width: 35px;
  height: 35px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}

.previous-reports a.page-numbers:hover {
  background: #facf32;
  color: #333;
}

.previous-reports .page-numbers.current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #facf32;
  color: #333;
  border-radius: 20px;
  width: 35px;
  height: 35px;
  font-weight: 700;
  font-size: 14px;
}

.previous-reports .page-numbers.dots {
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  color: #667085;
}

/* ── Status badge ────────────────────────────────────────────────────────── */
.status {
  border-radius: 6px;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  padding: 4px 12px;
  text-align: center;
  display: inline-block;
}

.reported {
  background: #006600;
}

/* ── Legacy .reportLink (public summary page) ────────────────────────────── */
.reportLink {
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  text-decoration: underline;
  text-transform: capitalize;
  color: #000;
}

/* ── Report summary page ─────────────────────────────────────────────────── */
.report-summary .first-info {
  display: flex;
  flex-direction: column;
  min-width: 25%;
  margin-right: 20px;
}
.report-summary .second-info {
  display: flex;
  flex-direction: column;
}
.report-summary .header {
  font-size: 18px;
  font-weight: 800;
  line-height: 28px;
  color: #000;
  display: flex;
}
.report-summary .header a {
  font-size: 18px;
  font-weight: 800;
  line-height: 28px;
  color: #000;
}
.report-summary .header a:hover {
  text-decoration: underline;
}
.report-summary .top-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 40px;
}
.report-summary .info-wrapper {
  display: flex;
  margin-top: 20px;
}
.report-summary .report {
  padding-bottom: 60px;
}
.info-wrapper span {
  font-size: 18px;
}
.info-wrapper span b {
  font-size: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
  .previous-reports .table-reports {
    margin-top: 24px;
    /* Let the table scroll sideways instead of squashing the columns (dates
       were wrapping and the "View report" column was clipped off-screen). */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .previous-reports .table-reports table {
    min-width: 480px;
  }
  /* Keep each date on one line; allow note paragraphs (e.g. extension text)
     to still wrap normally. */
  .previous-reports .table-reports table td {
    white-space: nowrap;
  }
  .previous-reports .table-reports table td p {
    white-space: normal;
  }
}

@media (max-width: 576px) {
  .info-wrapper {
    flex-direction: column;
    margin-top: 0 !important;
  }
  .info-wrapper span {
    padding-top: 20px;
  }
  .report-summary .report {
    padding-bottom: 30px;
  }
  .report-summary {
    padding: 30px 0;
  }
}
.report-summary .first-info {
  display: flex;
  flex-direction: column;
  min-width: 25%;
  margin-right: 20px;
}
.report-summary .second-info {
  display: flex;
  flex-direction: column;
}
.report-summary .header {
  display: flex;
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
  line-height: 28px; /* 155.556% */

  color: #000;
}
.report-summary .header a {
  display: flex;
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
  line-height: 28px; /* 155.556% */

  color: #000;
}
.report-summary .header a:hover {
  text-decoration: underline;
}
.report-summary .top-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 40px;
}
.report-summary .info-wrapper {
  display: flex;
  margin-top: 20px;
}
.report-summary .report {
  padding-bottom: 60px;
}
.info-wrapper span {
  font-size: 18px;
}
.info-wrapper span b {
  font-size: 16px;
}
/* ── Edit-report modal ───────────────────────────────────────────────────── */
.previous-reports .modal-report {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}
.previous-reports .modal-report.show {
  display: flex;
}
.previous-reports .modal-report.fade {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.previous-reports .modal-report.fade.show {
  opacity: 1;
}

.previous-reports .modal-report .popup-wrapper {
  background: #fff;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.previous-reports .modal-report .title-modal {
  position: relative;
  text-align: center;
}
.previous-reports .modal-report .title-modal h3:before {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  background: #125b60;
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.previous-reports .modal-report .under-title {
  text-align: center;
  margin-bottom: 25px;
  position: relative;
  font-size: 16px;
  font-weight: 400;
  color: #125b60;
}
.previous-reports .modal-report .under-title a {
  font-size: 16px;
  font-weight: 700;
  text-decoration: underline;
}

.previous-reports .modal-report .report-data .loading {
  text-align: center;
  color: #125b60;
  padding: 20px;
}

.previous-reports .modal-report .hide-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 9999;
}

.previous-reports .modal-report button[type="submit"] {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  background: #facf32;
  border-radius: 31px;
  text-transform: uppercase;
  width: 100%;
  padding: 16px 0;
  text-align: center;
  margin-top: 6px;
  outline: 0;
  border: 1px solid #facf32;
  cursor: pointer;
}
.previous-reports .modal-report button[type="submit"]:hover {
  background: transparent;
  border: 1px solid #facf32;
  color: #125b60;
}

/* ── Edit-report inline form ─────────────────────────────────────────────── */
.previous-reports .report-edit .format {
  font-size: small;
  text-align: right;
  margin-bottom: 10px;
  margin-top: 5px;
}
.previous-reports .report-edit select {
  background-color: #125b60;
  padding: 12px 38px 11px 19px;
  font-size: 16px;
  border-radius: 32px;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  width: 180px;
  margin-right: 10px;
}
.previous-reports .report-edit .form-field {
  margin-bottom: 32px;
}
.previous-reports .report-edit .form-field .label {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
}
.previous-reports .report-edit .form-field .label label {
  font-size: 16px;
  line-height: 22px;
  color: #125b60;
  display: inline;
  margin-bottom: 0;
  font-weight: 500;
}
.previous-reports .report-edit .form-field .label .red {
  font-weight: 700;
  font-size: 20px;
  color: #ff0000;
  margin-top: -5px;
}
.previous-reports .report-edit .form-field .select-div {
  display: flex;
  align-items: center;
}
.previous-reports .report-edit .form-field input {
  font-size: 16px;
  color: #02363d;
  line-height: 22px;
  border: 1px solid #125b60;
  border-radius: 50px;
  padding: 10px;
  margin: 0;
}
.previous-reports .report-edit .form-field.default-input.symbol .field {
  position: relative;
}
.previous-reports .report-edit .form-field.default-input.symbol .field input {
  padding-right: 20px;
}
.previous-reports .report-edit .form-field.default-input.symbol .field:after {
  content: attr(data-symbol);
  color: rgba(2, 54, 61, 0.65);
  position: absolute;
  font-size: 16px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.previous-reports .report-edit .form-field .error {
  display: block;
  width: 100%;
  text-align: center;
  color: red;
  font-size: 16px;
}
.previous-reports .report-edit .upload-textarea {
  margin-bottom: 24px;
}
.previous-reports .report-edit .upload-textarea textarea {
  border-radius: 20px;
  border: 1px solid #02363d;
  height: 91px;
  margin-bottom: 0;
  outline: 0;
  color: #02363d;
}
.previous-reports .report-edit .upload-textarea label {
  font-size: 16px;
  line-height: 22px;
  color: #125b60;
  display: inline;
  margin-bottom: 0;
  font-weight: 500;
}
.previous-reports .report-edit .upload-textarea .error {
  display: block;
  width: 100%;
  text-align: center;
  color: red;
  font-size: 16px;
}

/* ── Attached files ──────────────────────────────────────────────────────── */
.previous-reports .attached-files {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.previous-reports .attached-files .title legend {
  font-size: 18px;
  color: #125b60;
}
.previous-reports .attached-files .title .note {
  font-size: small;
  color: #125b60;
}
.previous-reports .attached-files .attached-file {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dotted #125b60;
  padding: 10px 0;
}
.previous-reports .attached-files .attached-file a {
  font-size: 16px;
}
.previous-reports .attached-files .attached-file .delete-success {
  font-size: small;
  color: red;
}

/* ── Popup extension link ────────────────────────────────────────────────── */
.previous-reports .table-reports .popup-extension {
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  color: #125b60;
}
.previous-reports .table-reports p {
  margin-bottom: 0;
}

@media (max-width: 576px) {
  .info-wrapper {
    flex-direction: column;
    margin-top: 0 !important;
  }
  .info-wrapper span {
    padding-top: 20px;
  }
  .report-summary .report {
    padding-bottom: 30px;
  }
  .report-summary {
    padding: 30px 0;
  }
}
