.aging-report-preview {
  overflow: hidden;
}

.aging-report-document {
  background: #ffffff;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  color: #17212b;
  margin-top: 16px;
  padding: 28px;
}

.aging-report-cover {
  align-items: flex-start;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .98) 0 42%, rgba(255, 255, 255, .72) 58%, rgba(255, 255, 255, .12) 100%),
    var(--report-cover-image, none) center / cover no-repeat;
  border-bottom: 0;
  border-radius: 8px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 340px;
  padding: 28px;
}

.aging-report-cover span {
  color: #0f766e;
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.aging-report-logo {
  background: #ffffff;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
  display: block;
  height: 64px;
  margin-bottom: 14px;
  object-fit: contain;
  padding: 8px 12px;
  width: auto;
}

.aging-report-cover h1 {
  color: #0f172a;
  font-size: 1.8rem;
  line-height: 1.15;
  margin: 6px 0 10px;
}

.aging-report-cover p {
  color: #334155;
  margin: 0;
  max-width: 680px;
}

.aging-report-cover aside {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(203, 220, 230, .82);
  border-radius: 8px;
  min-width: 220px;
  padding: 14px;
}

.aging-report-cover aside strong,
.aging-report-cover aside small {
  display: block;
}

.aging-report-cover aside span {
  color: #4b5563;
  margin: 6px 0;
  text-transform: none;
}

.aging-report-summary,
.aging-report-plan {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 20px 0;
}

.aging-report-summary article,
.aging-report-plan article {
  background: #f8fafc;
  border: 1px solid #dde7ee;
  border-radius: 8px;
  padding: 12px;
}

.aging-report-summary span,
.aging-report-plan span,
.aging-report-plan small {
  color: #64748b;
  display: block;
  font-size: 0.78rem;
}

.aging-report-summary strong,
.aging-report-plan strong {
  color: #0f172a;
  display: block;
  font-size: 1.35rem;
  margin-top: 4px;
}

.aging-report-section {
  margin-top: 22px;
}

.aging-report-section h2 {
  color: #0f172a;
  font-size: 1rem;
  margin: 0 0 10px;
}

.aging-report-section h3 {
  color: #334155;
  font-size: 0.92rem;
  margin: 0 0 8px;
}

.aging-report-legacy-distribution,
.aging-report-legacy-age-family {
  display: grid !important;
}

.aging-report-decision-grid {
  display: grid !important;
}

.aging-report-chart-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aging-report-chart-card {
  background: #f8fafc;
  border: 1px solid #dce7ef;
  border-radius: 8px;
  padding: 14px;
}

.aging-report-pie-wrap {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 180px minmax(0, 1fr);
}

.aging-report-pie {
  aspect-ratio: 1;
  background: conic-gradient(var(--pie));
  border: 8px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
  display: block;
  width: 180px;
  position: relative;
}

.aging-report-pie::after {
  display: none;
}

.aging-report-legend {
  display: grid;
  gap: 7px;
}

.aging-report-legend span {
  align-items: center;
  color: #334155;
  display: grid;
  font-size: .74rem;
  gap: 6px;
  grid-template-columns: 9px minmax(0, 1fr);
  line-height: 1.25;
}

.aging-report-legend i {
  background: var(--dot-color, #64748b);
  border-radius: 50%;
  display: block;
  height: 10px;
  width: 10px;
}

.aging-report-legend strong {
  color: #0f172a;
  font-weight: 800;
}

.aging-report-card-reading {
  background: #ffffff;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  color: #475569 !important;
  font-size: .82rem;
  margin: 12px 0 0;
  padding: 8px 10px;
}

.aging-report-family-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.aging-report-family-cards article {
  background: #eef6f5;
  border: 1px solid #cfe5e2;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.aging-report-family-cards span {
  color: #0f766e;
  font-size: .78rem;
  font-weight: 800;
}

.aging-report-family-cards strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.aging-report-family-cards small {
  color: #475569;
  line-height: 1.35;
}

.aging-report-age-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.aging-report-age-cards article {
  background: #f8fafc;
  border: 1px solid #dce7ef;
  border-radius: 8px;
  padding: 12px;
}

.aging-report-age-cards span,
.aging-report-age-cards small {
  color: #64748b;
  display: block;
  font-size: .78rem;
}

.aging-report-age-cards strong {
  color: #0f172a;
  display: block;
  font-size: 1.04rem;
  margin: 4px 0;
}

.aging-report-strategy-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aging-report-strategy-grid article {
  background: linear-gradient(180deg, #ffffff, #f5fafc);
  border: 1px solid #dce7ef;
  border-radius: 8px;
  padding: 12px;
}

.aging-report-strategy-grid span {
  color: #0f766e;
  display: block;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.aging-report-strategy-grid strong {
  color: #0f172a;
  display: block;
  font-size: 1rem;
  margin: 5px 0;
}

.aging-report-strategy-grid p {
  color: #475569;
  font-size: .82rem;
  line-height: 1.45;
  margin: 0;
}

.aging-report-section p,
.aging-report-recommendations {
  color: #374151;
  line-height: 1.55;
}

.aging-report-note {
  color: #64748b !important;
  font-size: 0.82rem;
  margin: -3px 0 10px;
}

.aging-report-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412 !important;
  font-size: 0.82rem;
  margin: 10px 0 0;
  padding: 9px 10px;
}

.aging-report-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aging-report-bars {
  display: grid;
  gap: 9px;
}

.aging-report-bars article {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(130px, 1fr) 2fr auto;
  min-height: 24px;
}

.aging-report-bars span,
.aging-report-bars small {
  color: #475569;
  font-size: 0.82rem;
}

.aging-report-bars strong {
  background: #e5edf2;
  border-radius: 999px;
  display: block;
  height: 10px;
  margin-top: 5px;
  overflow: hidden;
  position: relative;
}

.aging-report-bars strong::after {
  background: linear-gradient(90deg, #0f766e, #2563eb);
  border-radius: inherit;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: var(--value);
}

.aging-report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aging-report-tags span {
  background: #eef6f5;
  border: 1px solid #cfe5e2;
  border-radius: 999px;
  color: #164e63;
  font-size: 0.82rem;
  padding: 7px 10px;
}

.aging-report-tags strong {
  color: #0f172a;
  margin-left: 4px;
}

.aging-report-table {
  border-collapse: collapse;
  font-size: 0.86rem;
  width: 100%;
}

.aging-report-table th,
.aging-report-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 8px;
  text-align: left;
}

.aging-report-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
}

.aging-report-recommendations {
  margin: 0;
  padding-left: 20px;
}

.aging-report-recommendations li + li {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .aging-report-cover,
  .aging-report-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .aging-report-bars article {
    grid-template-columns: 1fr;
  }

  .aging-report-chart-grid,
  .aging-report-family-cards,
  .aging-report-age-cards,
  .aging-report-strategy-grid,
  .aging-report-pie-wrap {
    grid-template-columns: 1fr;
  }

  .aging-report-pie {
    width: 150px;
  }
}

@media print {
  @page {
    margin: 14mm;
    size: A4;
  }

  body.printing-aging-report {
    background: #ffffff !important;
    overflow: visible !important;
  }

  body.printing-aging-report * {
    visibility: hidden !important;
  }

  body.printing-aging-report #agingBioPartnerReport,
  body.printing-aging-report #agingBioPartnerReport * {
    visibility: visible !important;
  }

  body.printing-aging-report .sidebar,
  body.printing-aging-report .topbar,
  body.printing-aging-report .inbox-wrapper,
  body.printing-aging-report .inbox-panel,
  body.printing-aging-report .inbox-button,
  body.printing-aging-report .nav-list,
  body.printing-aging-report .brand,
  body.printing-aging-report .bp-live-product,
  body.printing-aging-report .bp-live-status,
  body.printing-aging-report .bp-live-brand,
  body.printing-aging-report .bp-live-kpis,
  body.printing-aging-report .bp-live-flow,
  body.printing-aging-report [class*="live"],
  body.printing-aging-report [id*="live"],
  body.printing-aging-report [class*="Live"],
  body.printing-aging-report [id*="Live"],
  body.printing-aging-report #equipment-aging > :not(.aging-report-preview),
  body.printing-aging-report .aging-report-preview > .panel-header,
  body.printing-aging-report .view:not(#equipment-aging) {
    display: none !important;
  }

  body.printing-aging-report #agingBioPartnerReport {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: block !important;
    margin: 0;
    padding: 0;
    position: static !important;
    width: 100% !important;
  }

  body.printing-aging-report .app-shell,
  body.printing-aging-report .main,
  body.printing-aging-report #equipment-aging,
  body.printing-aging-report .aging-report-preview {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  body.printing-aging-report .aging-report-cover,
  body.printing-aging-report .aging-report-summary,
  body.printing-aging-report .aging-report-plan {
    break-inside: avoid;
  }

  body.printing-aging-report .aging-report-section {
    break-inside: auto;
    page-break-inside: auto;
    orphans: 3;
    widows: 3;
  }

  body.printing-aging-report .aging-report-section h2,
  body.printing-aging-report .aging-report-section h3,
  body.printing-aging-report .aging-report-note {
    break-after: avoid;
    page-break-after: avoid;
  }

  body.printing-aging-report .aging-report-chart-card,
  body.printing-aging-report .aging-report-family-cards article,
  body.printing-aging-report .aging-report-summary article,
  body.printing-aging-report .aging-report-plan article {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-aging-report .aging-report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-aging-report .aging-report-summary,
  body.printing-aging-report .aging-report-plan {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.printing-aging-report .aging-report-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.printing-aging-report .aging-report-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.printing-aging-report .aging-report-chart-card {
    padding: 10px;
  }

  body.printing-aging-report .aging-report-pie-wrap {
    align-items: center;
    grid-template-columns: 150px minmax(0, 1fr) !important;
  }

  body.printing-aging-report .aging-report-pie {
    border-width: 6px;
    width: 150px !important;
  }

  body.printing-aging-report .aging-report-legend {
    gap: 5px;
  }

  body.printing-aging-report .aging-report-legend span {
    font-size: .68rem;
  }

  body.printing-aging-report .aging-report-family-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.printing-aging-report .aging-report-age-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.printing-aging-report .aging-report-strategy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.printing-aging-report .aging-report-pie {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
