/* Phase 2D: revenue report presentation only. */
.revenue-report-page {
  --lucky-ui-bg: var(--lucky-surface-muted);
  --report-active-soft: color-mix(in srgb, var(--lucky-yellow) 18%, var(--lucky-surface));
  --report-hover-soft: color-mix(in srgb, var(--lucky-pink-soft) 34%, var(--lucky-white));
  --report-line-soft: color-mix(in srgb, var(--lucky-border) 68%, var(--lucky-white));
  --report-gold-soft: color-mix(in srgb, var(--lucky-yellow) 13%, var(--lucky-white));
}

.revenue-report-page .main-panel {
  gap: 0;
}

.revenue-report-page .sidebar .sidebar-link.is-active,
.revenue-report-page .sidebar .sidebar-link.active,
.revenue-report-page .sidebar .sidebar-link[aria-current="page"] {
  --lucky-ui-component-bg: color-mix(in srgb, var(--lucky-yellow) 12%, var(--lucky-brown-hover));
  --lucky-ui-component-border: 1px solid color-mix(in srgb, var(--lucky-yellow) 58%, var(--lucky-brown));
  --lucky-ui-component-color: var(--lucky-yellow);
  margin-inline: var(--space-2);
  color: var(--lucky-yellow) !important;
  background: color-mix(in srgb, var(--lucky-yellow) 12%, var(--lucky-brown-hover)) !important;
  box-shadow: inset 3px 0 0 var(--lucky-yellow);
}

.revenue-report-page .report-page-header {
  --lucky-ui-component-bg: color-mix(in srgb, var(--lucky-pink-soft) 34%, var(--lucky-surface));
  --lucky-ui-component-shadow: none;
  min-height: 0;
  margin-bottom: var(--space-3);
  padding: 18px 20px;
}

.revenue-report-page .report-page-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
}

.revenue-report-page #reportRefreshBtn {
  --lucky-ui-component-bg: var(--lucky-surface);
  --lucky-ui-component-border: 1px solid var(--lucky-brown-soft);
  --lucky-ui-component-color: var(--lucky-brown-deep);
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 700;
}

.revenue-report-page #reportRefreshBtn:hover {
  --lucky-ui-component-bg: var(--lucky-surface-muted);
  --lucky-ui-component-border: 1px solid var(--lucky-brown);
}

.revenue-report-page .report-explainer {
  --lucky-ui-component-bg: var(--lucky-warning-soft);
  --lucky-ui-component-border: 1px solid var(--lucky-warning-border);
  margin-bottom: var(--space-3);
  padding: 13px 16px 13px 20px;
}

.revenue-report-page .report-explainer::before {
  width: 3px;
  background: var(--lucky-gold);
}

.revenue-report-page .report-explainer h2 {
  margin-bottom: 3px;
  font-size: 16px;
}

.revenue-report-page .report-explainer p {
  font-size: 13px;
  line-height: 1.55;
}

.revenue-report-page .report-filter-card {
  --lucky-ui-component-bg: var(--lucky-white);
  --lucky-ui-component-shadow: none;
  margin-bottom: var(--space-3);
  padding: 0;
}

.revenue-report-page .report-filter-card > .card-header {
  min-height: 46px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--report-line-soft);
}

.revenue-report-page .report-filter-card > .card-header h3 {
  font-size: 16px;
}

.revenue-report-page .report-date-range {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, 190px);
  gap: 10px;
  align-items: end;
  padding: 12px 16px 10px;
}

.revenue-report-page .report-date-range label {
  display: block;
  margin-bottom: 5px;
  color: var(--lucky-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.revenue-report-page .report-date-range input {
  min-height: 42px;
  background: var(--lucky-white) !important;
}

.revenue-report-page #loadReportBtn {
  --lucky-ui-component-bg: var(--lucky-yellow);
  --lucky-ui-component-border: 1px solid var(--lucky-gold);
  --lucky-ui-component-color: var(--lucky-brown-deep);
  width: 100%;
  min-height: 42px;
  padding: 9px 16px;
  font-weight: 700;
}

.revenue-report-page #loadReportBtn:hover {
  --lucky-ui-component-bg: var(--lucky-yellow-hover);
  --lucky-ui-component-border: 1px solid var(--lucky-yellow-hover);
}

.revenue-report-page #reportMessage {
  min-height: 18px;
  margin: 0;
  padding: 0 16px 8px;
  color: var(--lucky-danger);
  font-size: 13px;
}

.revenue-report-page .report-metrics {
  gap: 10px;
  margin-bottom: 10px;
}

.revenue-report-page .profit-loss-card {
  margin-bottom: var(--space-3);
}

.revenue-report-page .profit-loss-card .card-header p {
  margin: 4px 0 0;
  font-size: 13px;
}

.revenue-report-page .profit-loss-table th:last-child,
.revenue-report-page .profit-loss-table td:last-child {
  width: 190px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.revenue-report-page .profit-loss-total-row th {
  background: var(--report-gold-soft);
  color: var(--lucky-brown-deep);
  font-weight: 800;
}

.revenue-report-page .profit-loss-net-row th {
  border-top: 3px double var(--lucky-brown-soft);
  background: color-mix(in srgb, var(--lucky-yellow) 24%, var(--lucky-white));
  color: var(--lucky-brown-deep);
  font-size: 17px;
  font-weight: 900;
}

.revenue-report-page #profitLossNet.is-loss {
  color: var(--lucky-danger);
}

.revenue-report-page .balance-sheet-card {
  margin-bottom: var(--space-3);
}

.revenue-report-page .balance-sheet-card .card-header p {
  margin: 4px 0 0;
  font-size: 13px;
}

.revenue-report-page .balance-sheet-table th:last-child,
.revenue-report-page .balance-sheet-table td:last-child {
  width: 190px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.revenue-report-page .balance-sheet-detail-row td {
  color: var(--lucky-text-muted);
  font-size: 13px;
}

.revenue-report-page .balance-sheet-total-row th,
.revenue-report-page .balance-sheet-total-row td {
  background: var(--report-gold-soft);
  color: var(--lucky-brown-deep);
  font-weight: 800;
}

.revenue-report-page .balance-sheet-check-row th {
  border-top: 3px double var(--lucky-brown-soft);
  background: color-mix(in srgb, var(--lucky-yellow) 18%, var(--lucky-white));
  color: var(--lucky-success);
  font-weight: 900;
}

.revenue-report-page #balanceSheetDifference.is-unbalanced {
  color: var(--lucky-danger);
}

.revenue-report-page .report-metrics .metric {
  --lucky-ui-component-bg: var(--lucky-white);
  --lucky-ui-component-border: 1px solid var(--report-line-soft);
  --lucky-ui-component-radius: var(--radius-surface);
  --lucky-ui-component-shadow: none;
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 15px 16px;
  overflow: hidden;
}

.revenue-report-page .report-metrics .metric::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--lucky-border);
}

.revenue-report-page .report-metrics .metric > .muted {
  color: var(--lucky-text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.revenue-report-page .report-metrics .metric strong {
  margin-top: 8px;
  color: var(--lucky-brown-deep);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.revenue-report-page .report-metrics-primary .metric {
  min-height: 116px;
  background: var(--report-gold-soft) !important;
}

.revenue-report-page .report-metrics-primary .metric strong {
  font-size: 30px;
}

.revenue-report-page .report-metrics-primary .metric:nth-child(1)::before,
.revenue-report-page .report-metrics-primary .metric:nth-child(2)::before {
  background: var(--lucky-gold);
}

.revenue-report-page .report-metrics-primary .metric:nth-child(3)::before {
  background: var(--lucky-pink);
}

.revenue-report-page .report-metrics-primary .metric:nth-child(4)::before,
.revenue-report-page .report-metrics-finance .metric:nth-child(4)::before {
  background: var(--lucky-danger);
}

.revenue-report-page .report-metrics-services .metric::before {
  background: var(--lucky-gold);
}

.revenue-report-page .report-metrics-members .metric::before {
  background: var(--lucky-pink);
}

.revenue-report-page .report-chart-grid,
.revenue-report-page .report-analytics-grid {
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.revenue-report-page .report-chart-card,
.revenue-report-page .report-table-card {
  --lucky-ui-component-bg: var(--lucky-white);
  --lucky-ui-component-shadow: none;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.revenue-report-page :is(.report-chart-card, .report-table-card) > .card-header {
  min-height: 50px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--report-line-soft);
}

.revenue-report-page :is(.report-chart-card, .report-table-card) > .card-header h3 {
  font-size: 16px;
}

.revenue-report-page .report-chart-card > :not(.card-header) {
  margin-right: 14px;
  margin-left: 14px;
}

.revenue-report-page .report-chart-card > :last-child {
  margin-bottom: 14px;
}

.revenue-report-page .chart-legend {
  margin-top: 12px;
  margin-bottom: 8px;
  color: var(--lucky-text-muted);
}

.revenue-report-page .legend-dot {
  border-radius: var(--radius-sm);
}

.revenue-report-page :is(.legend-dot.income, .bar-fill.income, .horizontal-bar-fill.income) {
  background: var(--lucky-brown);
}

.revenue-report-page :is(.legend-dot.refund, .bar-fill.refund, .horizontal-bar-fill.refund) {
  background: var(--lucky-danger);
}

.revenue-report-page :is(.legend-dot.net, .bar-fill.net, .horizontal-bar-fill.net) {
  background: var(--lucky-gold);
}

.revenue-report-page .horizontal-bar-fill.grooming {
  background: var(--lucky-pink);
}

.revenue-report-page .horizontal-bar-fill.member {
  background: var(--lucky-warning-accent);
}

.revenue-report-page .bar-stack {
  border-radius: var(--radius-surface);
  background: var(--lucky-surface-muted);
}

.revenue-report-page :is(.bar-fill, .horizontal-bar-fill, .horizontal-bar-track) {
  border-radius: var(--radius-sm);
}

.revenue-report-page .report-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.revenue-report-page .report-table-card .table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  background: var(--lucky-white);
}

.revenue-report-page .report-daily-card .table {
  min-width: 1120px;
}

.revenue-report-page .report-analytics-card .table {
  min-width: 420px;
}

.revenue-report-page .report-table-card .table :is(th, td) {
  padding: 11px 12px;
  border-bottom: 1px solid var(--report-line-soft);
}

.revenue-report-page .report-table-card .table th {
  color: var(--lucky-brown-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--lucky-surface-muted);
}

.revenue-report-page .report-table-card .table td {
  color: var(--lucky-text);
  font-size: 13px;
}

.revenue-report-page .report-table-card .table tbody tr:hover td {
  --lucky-ui-component-bg: var(--report-hover-soft);
}

.revenue-report-page .report-analytics-card > .muted {
  min-height: 62px;
  margin: 0;
  padding: 10px 12px 12px;
  color: var(--lucky-text-muted);
  font-size: 12px;
  line-height: 1.55;
  border-top: 1px solid var(--report-line-soft);
}

@media (max-width: 1100px) {
  .revenue-report-page .report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .revenue-report-page .report-page-header {
    align-items: stretch;
    padding: 16px;
  }

  .revenue-report-page .report-page-header h1 {
    font-size: 23px;
  }

  .revenue-report-page .report-page-header .topbar-actions,
  .revenue-report-page #reportRefreshBtn {
    width: 100%;
  }

  .revenue-report-page .report-explainer {
    padding: 12px 13px 12px 17px;
  }

  .revenue-report-page .report-date-range {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .revenue-report-page .report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .revenue-report-page .report-metrics .metric,
  .revenue-report-page .report-metrics-primary .metric {
    min-height: 96px;
    padding: 12px;
  }

  .revenue-report-page .report-metrics .metric strong,
  .revenue-report-page .report-metrics-primary .metric strong {
    font-size: 22px;
  }

  .revenue-report-page .report-chart-grid,
  .revenue-report-page .report-analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .revenue-report-page .report-metrics .metric > .muted {
    min-height: 35px;
  }

  .revenue-report-page .report-metrics .metric strong,
  .revenue-report-page .report-metrics-primary .metric strong {
    font-size: 20px;
  }
}
