/* ==========================================================================
   ISLAMI COMICS - EARNINGS ROOM STYLESHEET
   Matching Mockup Image 6 Pixel-Perfect Design
   ========================================================================== */

.earnings-page-body {
  background-color: #f5f8f6;
}

.earnings-main-stage {
  padding-bottom: 40px;
}

/* Header Action Buttons */
.earnings-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-earnings-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.btn-earnings-action:hover {
  border-color: var(--emerald);
  color: var(--emerald-dark);
  background: #f8faf9;
}

/* ==========================================================================
   1. TOP 6 METRIC SUMMARY CARDS (6-GRID)
   ========================================================================== */
.earnings-metrics-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.icon-blue-cart {
  background: #eff6ff;
  color: #2563eb;
}

.icon-amber-rotate {
  background: #fffbeb;
  color: #d97706;
}

.icon-red-purse {
  background: #fef2f2;
  color: #dc2626;
}

/* ==========================================================================
   2. MAIN 2-COLUMN LAYOUT
   ========================================================================== */
.earnings-layout-2col {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.earnings-left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.earnings-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ==========================================================================
   3. TOOLBAR PILLS & DATE RANGE PICKER
   ========================================================================== */
.earnings-toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.earnings-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eef3f0;
  padding: 4px;
  border-radius: 10px;
}

.pill-filter-btn {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill-filter-btn:hover {
  color: var(--text-main);
}

.pill-filter-btn.active {
  background: #0d5f43;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 95, 67, 0.25);
}

.btn-earnings-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s;
}

.btn-earnings-date-range:hover {
  border-color: var(--emerald);
}

/* ==========================================================================
   4. EARNINGS OVERVIEW CHART CARD
   ========================================================================== */
.earnings-chart-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.chart-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.chart-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-gross { background: #10b981; }
.dot-net { background: #064e3b; }
.dot-fees { background: #8b5cf6; }
.dot-refunds { background: #ef4444; }

.select-chart-granularity {
  background: #f8faf9;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 270px;
  margin-bottom: 18px;
}

/* 4-Column Bottom Metric Stats */
.chart-bottom-metrics-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f3;
}

.chart-metric-item {
  min-width: 0;
}

.chart-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 2px;
}

.chart-metric-val {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 2px;
}

.chart-metric-growth {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.growth-up {
  color: #10b981;
}

.growth-down {
  color: #ef4444;
}

/* ==========================================================================
   5. TOP PERFORMING COMICS TABLE CARD
   ========================================================================== */
.top-comics-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.top-comics-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.top-comics-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.link-view-all-comics {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}

.link-view-all-comics:hover {
  color: var(--emerald);
}

.top-comics-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 820px;
}

.top-comics-table thead tr {
  background: #fbfdfc;
  border-bottom: 1px solid var(--card-border);
}

.top-comics-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #64748b;
  text-transform: uppercase;
  white-space: nowrap;
}

.top-comics-table th.th-comic {
  min-width: 220px;
}

.top-comics-table tbody tr {
  border-bottom: 1px solid #f1f5f3;
  transition: background 0.15s ease;
}

.top-comics-table tbody tr:hover {
  background: #f9fbf9;
}

.top-comics-table td {
  padding: 12px 14px;
  vertical-align: middle;
  font-size: 12px;
}

.td-rank {
  font-weight: 800;
  color: #64748b;
  width: 30px;
}

.comic-cell-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-comic-thumb {
  width: 34px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.top-comic-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.top-comic-genre {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.td-sales,
.td-gross,
.td-net,
.td-refunds,
.td-conv {
  font-weight: 800;
  white-space: nowrap;
}

.net-green { color: var(--emerald-dark); }
.refund-red { color: #ef4444; }

/* ==========================================================================
   6. RIGHT COLUMN CARDS
   ========================================================================== */

/* Card 1: Balance & Payout Card (Dark Emerald) */
.balance-payout-card {
  background: linear-gradient(135deg, #053b2a 0%, #03251a 100%);
  border: 1px solid #095039;
  border-radius: 14px;
  padding: 20px;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(5, 59, 42, 0.2);
}

.balance-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #a7f3d0;
  margin-bottom: 14px;
}

.balance-stats-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.balance-stat-item {
  min-width: 0;
}

.balance-stat-label {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.balance-stat-val {
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.balance-stat-note {
  font-size: 10px;
  color: #6ee7b7;
}

.btn-withdraw-now {
  width: 100%;
  background: #ffffff;
  color: #064e3b;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
}

.btn-withdraw-now:hover {
  background: #f0fdf4;
  transform: translateY(-1px);
}

.next-payout-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
}

.next-payout-row strong {
  color: #a7f3d0;
}

/* Card 2: Earnings Breakdown Card */
.earnings-breakdown-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
}

.breakdown-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.breakdown-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.breakdown-time-select,
.summary-time-select {
  background: #f8faf9;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.breakdown-chart-flex {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut-canvas-wrap {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  position: relative;
}

.breakdown-legend-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.breakdown-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
}

.legend-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-comic-sales { background: #10b981; }
.dot-tips { background: #8b5cf6; }
.dot-promotions { background: #f59e0b; }
.dot-others { background: #ef4444; }

.legend-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-right strong {
  color: var(--text-main);
  font-size: 11.5px;
}

.percent-tag {
  font-size: 10px;
  color: var(--text-muted);
}

/* Card 3: Earnings Summary Card */
.earnings-summary-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
}

.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.summary-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.summary-rows-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
}

.summary-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-sub);
}

.summary-data-row strong {
  color: var(--text-main);
  font-weight: 800;
}

.summary-data-row.val-red strong {
  color: #ef4444;
}

.summary-divider-line {
  height: 1px;
  background: #f1f5f3;
  margin: 4px 0;
}

.summary-data-row.bold-row {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 800;
}

.net-bold-green {
  color: var(--emerald-dark) !important;
  font-size: 14px;
}

.pending-green {
  color: var(--emerald-dark) !important;
}

.btn-view-payout-history {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 8px;
  padding: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-view-payout-history:hover {
  background: #f8faf9;
  border-color: #cbd5e1;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1240px) {
  .earnings-metrics-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .earnings-layout-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .earnings-metrics-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-bottom-metrics-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .earnings-toolbar-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 540px) {
  .earnings-metrics-grid-6 {
    grid-template-columns: 1fr;
  }

  .chart-bottom-metrics-4 {
    grid-template-columns: 1fr;
  }
}
