/* ═══════════════════════════════════════════════════════
   RAPORLAR — full styling (.rp-* prefix)
═══════════════════════════════════════════════════════ */

.rp-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  color: var(--text);
}

/* ── Header ──────────────────────────────────────── */
.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.rp-title { font-size: 16px; font-weight: 700; color: var(--text); }

.rp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--muted2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.rp-btn:hover { color: var(--text); background: var(--surface); border-color: var(--accent); }

/* ── Body grid ──────────────────────────────────── */
.rp-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
}
.rp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.rp-section-wide { grid-column: span 2; }
.rp-section-full { grid-column: 1 / -1; }

/* ── Section card ───────────────────────────────── */
.rp-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.rp-section-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface3);
}
.rp-section-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.rp-section-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.rp-section-body {
  padding: 18px;
  min-height: 100px;
}

/* ── KPI stat row (section başı) ────────────────── */
.rp-stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.rp-stat {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rp-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rp-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rp-stat.positive .rp-stat-num { color: #22c55e; }
.rp-stat.negative .rp-stat-num { color: #ef4444; }

/* ── Chart container ────────────────────────────── */
.rp-chart { width: 100%; }

/* ── Donut + legend ─────────────────────────────── */
.rp-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.rp-donut-chart { flex-shrink: 0; }
.rp-legend {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rp-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.rp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rp-legend-name { flex: 1; }
.rp-legend-val {
  font-weight: 700;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}

/* ── Profitability table ────────────────────────── */
.rp-prof-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.rp-prof-head, .rp-prof-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.6fr;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.rp-prof-head {
  background: var(--surface3);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rp-prof-row {
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  transition: background .12s;
}
.rp-prof-row:last-child { border-bottom: none; }
.rp-prof-row:hover { background: var(--surface3); }
.rp-prof-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-prof-cell { color: var(--muted2); }
.rp-prof-cell.positive { color: #22c55e; }
.rp-prof-cell.negative { color: #ef4444; }

/* ── Empty / placeholder ────────────────────────── */
.rp-placeholder,
.rp-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* ── App switcher button rengi (violet) ──────────── */
.app-sw-reports.app-sw-active {
  background: rgba(139, 92, 246, .1);
  border-color: rgba(139, 92, 246, .35);
  color: #a78bfa;
}

/* Mobil dar ekranlarda 1 sütun */
@media (max-width: 900px) {
  .rp-grid { grid-template-columns: 1fr; }
  .rp-section-wide { grid-column: span 1; }
}
