/* ═══════════════════════════════════════════════════════
   BÜTÇELEME — full styling (.bg-* prefix)
═══════════════════════════════════════════════════════ */

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

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

.bg-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.bg-tab {
  background: transparent;
  border: none;
  color: var(--muted2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.bg-tab:hover { color: var(--text); }
.bg-tab.active {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
}

.bg-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;
}
.bg-btn:hover { color: var(--text); background: var(--surface); border-color: var(--accent); }

/* ── KPI bar ────────────────────────────────────── */
.bg-kpis {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.bg-kpi {
  flex: 1;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bg-kpi-lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.8px;
}
.bg-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bg-kpi-val small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.bg-kpi.negative .bg-kpi-val { color: #ef4444; }

/* ── Views ──────────────────────────────────────── */
.bg-views {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.bg-view {
  padding: 20px;
  min-height: 100%;
}

/* ── Project cards (overview) ──────────────────── */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.bg-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s, transform .1s;
}
.bg-card:hover { border-color: #22c55e; transform: translateY(-1px); }

.bg-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bg-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bg-card-pct {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bg-card-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bg-amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bg-amount-lbl {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bg-amount-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bg-amount.negative .bg-amount-val { color: #ef4444; }

.bg-progress {
  height: 6px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
}
.bg-progress-bar {
  height: 100%;
  transition: width .3s ease-out;
}

.bg-bar-stack {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface3);
}
.bg-bar-seg { height: 100%; }

.bg-card-foot {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted2);
  margin-top: -4px;
}
.bg-foot-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bg-foot-item i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.bg-foot-empty {
  color: var(--muted);
  font-style: italic;
}

.bg-card-time {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* ── Team summary table ────────────────────────── */
.bg-team-head, .bg-team-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.7fr 2fr;
  gap: 12px;
  padding: 10px 16px;
  align-items: center;
}
.bg-team-head {
  background: var(--surface3);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}
.bg-team-th-right { text-align: right; }
.bg-team-row {
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  transition: background .12s;
}
.bg-team-row:hover { background: var(--surface3); }
.bg-team-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bg-team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.bg-team-name { font-weight: 600; color: var(--text); font-size: 12px; }
.bg-team-sub  { font-size: 10px; color: var(--muted); margin-top: 1px; }
.bg-team-cell { font-variant-numeric: tabular-nums; color: var(--muted2); }
.bg-team-cell-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.bg-team-cost-bar {
  flex: 1;
  max-width: 120px;
  height: 6px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
}
.bg-team-cost-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #15803d);
}
.bg-team-cost-val {
  font-weight: 700;
  color: var(--text);
  min-width: 80px;
  text-align: right;
}

/* ── Empty / error / placeholder ───────────────── */
.bg-placeholder,
.bg-empty,
.bg-error {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.bg-empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.bg-empty-sub   { font-size: 13px; color: var(--muted); max-width: 420px; margin: 0 auto; line-height: 1.5; }
.bg-error       { color: var(--red); }

/* ── App switcher button rengi (green) ──────────── */
.app-sw-budget.app-sw-active {
  background: rgba(34, 197, 94, .1);
  border-color: rgba(34, 197, 94, .35);
  color: #4ade80;
}
