/* ═══════════════════════════════════════════════════════════════
   PUBDAY ADMIN — Styles supplémentaires (étend styles.css)
   ═══════════════════════════════════════════════════════════════ */

.admin-body {
  background: #F4F5F8;
}

/* ─── TABS ─── */
.admin-tabs {
  display: flex;
  gap: 6px;
  background: #fff;
  padding: 8px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 14px;
  position: sticky;
  top: calc(60px + env(safe-area-inset-top, 0));
  z-index: 5;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 16px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--ink);
  color: #fff;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── KPI grid (stats globales) ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.kpi {
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.kpi-value.kpi-mrr { color: var(--brand); }
.kpi-value.kpi-pending { color: var(--gold); }
.kpi-value.kpi-paid { color: var(--green); }
.kpi-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

@media (min-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Table finances Pubday ─── */
.finance-table {
  width: 100%;
  border-collapse: collapse;
}
.finance-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.finance-table td.num {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.finance-table tr.total-row td {
  border-bottom: 0;
  padding-top: 18px;
  font-size: 16px;
  color: var(--brand-dark);
}
.finance-table tr.total-row td.num {
  font-size: 22px;
  color: var(--brand);
}

/* ─── Table affiliés ─── */
.affiliates-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -10px;
  padding: 0 10px;
}
.affiliates-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.affiliates-table th, .affiliates-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
.affiliates-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.4px;
}
.affiliates-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.aff-name {
  font-weight: 700;
  color: var(--ink);
}
.aff-email {
  font-size: 11px;
  color: var(--muted);
}
.aff-grade-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.aff-grade-pill.starter { background: #DBEAFE; color: #1D4ED8; }
.aff-grade-pill.partner { background: #DCFCE7; color: #166534; }
.aff-grade-pill.leader { background: #FEF3C7; color: #92400E; }
.aff-grade-pill.senior_leader { background: #F3E8FF; color: #6B21A8; }
.aff-grade-pill.top_leader { background: #FEE2E2; color: #991B1B; }

/* ─── Payouts pending ─── */
.payouts-pending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.payout-pending-card {
  background: linear-gradient(135deg, #FFF8E6, #fff);
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.payout-pending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.payout-pending-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}
.payout-pending-amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -1px;
}
.payout-pending-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}
.payout-iban {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: rgba(0,0,0,0.04);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  word-break: break-all;
}
.payout-pending-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-mark-paid {
  flex: 1;
  background: var(--green);
  color: #fff;
  border: 0;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn-copy-iban {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

/* ─── Action blocks (tab Actions) ─── */
.action-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-block h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ─── ARBRE GLOBAL ADMIN (réutilise .tree-* mais avec spacing différent) ─── */
#admin-tree-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#admin-tree-view > .tree-node > .tree-node-row {
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border-color: var(--brand);
  border-width: 1.5px;
}
