/* IP Billing — Enterprise Reports Center */
.ipb-reports.eu-page {
  min-width: 0;
  max-width: 100%;
  gap: 0.65rem;
  padding-bottom: 1rem;
}

.ipb-reports .eu-page-header {
  margin-bottom: 0.35rem;
}

.ipb-reports__kpis .eu-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0;
}

.ipb-reports__kpis .eu-kpi {
  padding: 0.55rem 0.65rem;
  min-height: 5.25rem;
}

.ipb-reports__kpis .eu-kpi__value {
  font-size: 1.25rem;
}

.ipb-reports__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  background: var(--eu-surface, #fff);
}

.ipb-reports__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ipb-reports__tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--eu-text-muted, #64748b);
  cursor: pointer;
}

.ipb-reports__tab.is-active,
.ipb-reports__tab:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.ipb-reports__search {
  flex: 1;
  min-width: 14rem;
  max-width: 22rem;
}

.ipb-reports__search .eu-input {
  width: 100%;
  min-height: 2rem;
  font-size: 0.8125rem;
}

.ipb-reports__section-head {
  margin-bottom: 0.35rem;
}

.ipb-reports__section-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.ipb-reports__frequent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ipb-reports__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--eu-border, #e2e8f0);
  background: #fff;
  text-decoration: none;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.ipb-reports__chip:hover {
  transform: translateY(-1px);
  border-color: var(--eu-primary, #2563eb);
  box-shadow: var(--eu-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.ipb-reports__split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.65rem;
}

.ipb-reports__recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ipb-reports__recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  background: var(--eu-surface-muted, #f8fafc);
}

.ipb-reports__recent-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.78rem;
}

.ipb-reports__recent-meta span {
  color: var(--eu-text-muted, #64748b);
}

.ipb-reports__sched-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.ipb-reports__sched-grid div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: var(--eu-surface-muted, #f8fafc);
  font-size: 0.78rem;
}

.ipb-reports__accordion {
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.ipb-reports__accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  list-style: none;
  background: var(--eu-surface-muted, #f8fafc);
  font-weight: 700;
  font-size: 0.85rem;
}

.ipb-reports__accordion-head::-webkit-details-marker {
  display: none;
}

.ipb-reports__accordion-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.72rem;
}

.ipb-reports__accordion .ipb-reports__grid {
  padding: 0.65rem;
}

.ipb-reports__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}

.ipb-reports__card {
  display: flex;
  flex-direction: column;
  min-height: 11.5rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--eu-border, #e2e8f0);
  background: var(--eu-surface, #fff);
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.ipb-reports__card:hover {
  transform: translateY(-2px);
  border-color: var(--eu-primary, #2563eb);
  box-shadow: var(--eu-shadow-md, 0 6px 16px rgba(37, 99, 235, 0.12));
}

.ipb-reports__card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.ipb-reports__card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.ipb-reports__fav {
  border: none;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem;
}

.ipb-reports__fav.is-active,
.ipb-reports__fav:hover {
  color: #f59e0b;
}

.ipb-reports__card-desc {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.78rem;
  color: var(--eu-text-muted, #64748b);
  line-height: 1.35;
  flex: 1;
}

.ipb-reports__card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.55rem;
  font-size: 0.7rem;
  color: var(--eu-text-muted, #64748b);
}

.ipb-reports__card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.ipb-reports__more {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ipb-reports-async {
  display: block;
  margin-top: 0.35rem;
  min-height: 6rem;
}

.ipb-reports-skeleton {
  padding: 0.75rem;
  border: 1px dashed var(--eu-border, #e2e8f0);
  border-radius: 8px;
  color: var(--eu-text-muted, #64748b);
  background: #f8fafc;
  font-size: 0.85rem;
}

.ipb-reports__charts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.ipb-reports-chart {
  border: 1px solid var(--eu-border, #e5e7eb);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  background: #fff;
}

.ipb-reports-chart__header {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.ipb-reports-chart__title {
  font-size: 0.72rem;
  font-weight: 600;
}

.ipb-reports-chart__total {
  font-size: 0.78rem;
  font-weight: 700;
}

.ipb-reports-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 48px;
}

.ipb-reports-chart__bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.ipb-reports-chart__bar {
  width: 100%;
  min-height: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--chart-color, #2563eb);
}

.ipb-reports-chart--success { --chart-color: #16a34a; }
.ipb-reports-chart--info { --chart-color: #2563eb; }
.ipb-reports-chart--warning { --chart-color: #d97706; }

.ipb-reports-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
}

.ipb-reports-insights__card {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--eu-border, #e2e8f0);
  background: #fff;
}

.ipb-reports-insights__card--warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.ipb-reports-insights__card--info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ipb-reports-insights__heading {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 650;
}

.ipb-reports-insights__body {
  margin: 0;
  font-size: 0.78rem;
  color: var(--eu-text-muted, #475569);
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .ipb-reports__kpis .eu-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ipb-reports__charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ipb-reports__split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ipb-reports__kpis .eu-kpi-grid,
  .ipb-reports__charts {
    grid-template-columns: 1fr;
  }
}

/* Report show — first-viewport density (filters → KPIs → results) */
.ipb-reports--show {
  gap: 1rem; /* 16px section rhythm */
}

.ipb-reports--show.eu-page {
  gap: 1rem;
}

.ipb-reports--show .eu-page-header {
  margin-bottom: 0;
  gap: 0.5rem;
}

/* Single-row filter bar — target ≤ 80–120px total height */
.ipb-reports__filter-bar {
  display: flex;
  align-items: flex-end;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  background: var(--eu-surface, #fff);
  max-height: 5.5rem;
}

.ipb-reports__filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  width: 100%;
  margin: 0;
}

.ipb-reports__filter-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

.ipb-reports__filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 9.5rem;
  max-width: 12rem;
}

.ipb-reports__filter-field .eu-label {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.2;
}

.ipb-reports__filter-field .eu-input,
.ipb-reports__filter-field .eu-input--sm {
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8125rem;
}

.ipb-reports__filter-form .eu-btn {
  flex: 0 0 auto;
  align-self: flex-end;
}

.ipb-reports__show-kpis .eu-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0;
}

.ipb-reports__show-kpis .eu-kpi {
  padding: 0.45rem 0.55rem;
  min-height: 0;
}

.ipb-reports__show-kpis .eu-kpi__value {
  font-size: 1.05rem;
  line-height: 1.2;
}

.ipb-reports__show-kpis .eu-kpi__hint {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  line-height: 1.25;
}

.ipb-reports--show .eu-card--compact .eu-card__body {
  padding: 0.65rem 0.75rem;
}

.ipb-reports--show .eu-card--compact .eu-card__header {
  padding: 0.45rem 0.75rem;
}

.ipb-reports__table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.ipb-reports__table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.ipb-reports__table th,
.ipb-reports__table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
  vertical-align: middle;
}

.ipb-reports__table th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--eu-text-muted, #64748b);
  background: var(--eu-surface-muted, #f8fafc);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ipb-reports__table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ipb-reports__aging {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}

.ipb-reports__aging--current { background: #ecfdf5; color: #047857; }
.ipb-reports__aging--d1-30 { background: #eff6ff; color: #1d4ed8; }
.ipb-reports__aging--d31-60 { background: #fffbeb; color: #b45309; }
.ipb-reports__aging--d61-90 { background: #fff7ed; color: #c2410c; }
.ipb-reports__aging--d90-plus { background: #fef2f2; color: #b91c1c; }

@media (max-width: 640px) {
  .ipb-reports__filter-field {
    max-width: none;
    flex: 1 1 8rem;
  }

  .ipb-reports__filter-form .eu-btn {
    width: 100%;
  }
}
