/* ================================================================== */
/* Management dashboard surfaces — additive to dialer.css.              */
/* Most layout (.dialer-shell, .dialer-kpis, .dialer-pane) is reused.   */
/* This file only adds management-specific bits.                        */
/* ================================================================== */

/* ── Stale-data banner ───────────────────────────────────────────── */
.mgmt-stale-banner {
  background: rgba(246,193,75,.12);
  border: 1px solid rgba(246,193,75,.45);
  color: #f6c14b;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.mgmt-stale-banner::before {
  content: "";
  width: 8px; height: 8px; border-radius: 999px;
  background: #f6c14b;
  box-shadow: 0 0 0 4px rgba(246,193,75,.18);
}

/* ── Branch performance table ────────────────────────────────────── */
.mgmt-branch-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; color: var(--text, #e6edfa);
}
.mgmt-branch-table thead th {
  text-align: left;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--text-muted, #8aa0c0);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.mgmt-branch-table thead th:hover { color: var(--text, #e6edfa); }
.mgmt-branch-table thead th[data-sort]::after { content: " \2195"; opacity: .35; font-size: 10px; }
.mgmt-branch-table thead th.is-sorted-asc::after  { content: " \2191"; opacity: 1; color: #5a7dff; }
.mgmt-branch-table thead th.is-sorted-desc::after { content: " \2193"; opacity: 1; color: #5a7dff; }
.mgmt-branch-table tbody td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); }
.mgmt-branch-table tbody td.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.mgmt-branch-row { transition: background .12s ease; border-left: 3px solid transparent; }
.mgmt-branch-row:hover { background: rgba(255,255,255,.04); }
.mgmt-branch-row.is-top     { border-left-color: #74e3a9; }
.mgmt-branch-row.is-laggard { border-left-color: #ff8896; }

@media (max-width: 760px) {
  .mgmt-branch-table thead { display: none; }
  .mgmt-branch-table, .mgmt-branch-table tbody, .mgmt-branch-table tr, .mgmt-branch-table td { display: block; width: 100%; }
  .mgmt-branch-row {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; margin-bottom: 8px; padding: 8px 4px;
  }
  .mgmt-branch-row.is-top     { border-left: 3px solid #74e3a9; }
  .mgmt-branch-row.is-laggard { border-left: 3px solid #ff8896; }
  .mgmt-branch-table tbody td {
    display: flex; justify-content: space-between; gap: 12px;
    border-bottom: 1px dashed rgba(255,255,255,.05);
    padding: 6px 10px;
  }
  .mgmt-branch-table tbody td:last-child { border-bottom: none; }
  .mgmt-branch-table tbody td::before {
    content: attr(data-label);
    font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-muted, #8aa0c0); font-weight: 700;
  }
  .mgmt-branch-table tbody td.is-numeric { text-align: right; }
}

/* ── Leaderboard ─────────────────────────────────────────────────── */
.mgmt-leaderboard {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  counter-reset: lb;
}
.mgmt-leaderboard li {
  counter-increment: lb;
  display: grid; grid-template-columns: 22px 32px minmax(0,1fr) auto;
  gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,.03);
}
.mgmt-leaderboard li::before {
  content: counter(lb);
  font-size: 12px; font-weight: 700; color: var(--text-muted, #8aa0c0);
  text-align: center; font-variant-numeric: tabular-nums;
}
.mgmt-leaderboard li:nth-child(1)::before { color: #f6c14b; }
.mgmt-leaderboard li:nth-child(2)::before { color: #cdd6e6; }
.mgmt-leaderboard li:nth-child(3)::before { color: #d39a6a; }
.mgmt-leaderboard-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  background: linear-gradient(135deg,#5a7dff,#3454e0);
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.mgmt-leaderboard-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mgmt-leaderboard-name {
  font-weight: 600; color: var(--text, #e6edfa); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mgmt-leaderboard-bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.mgmt-leaderboard-bar > span { display: block; height: 100%; background: linear-gradient(90deg,#5a7dff,#74e3a9); }
.mgmt-leaderboard-value {
  font-weight: 700; font-size: 13px; color: var(--text, #e6edfa);
  font-variant-numeric: tabular-nums;
}

/* ── Daily trend sparkline ───────────────────────────────────────── */
.mgmt-trend-svg { width: 100%; display: block; }
.mgmt-trend-svg svg { width: 100%; height: auto; display: block; }
.mgmt-trend-svg text { font-size: 10px; fill: var(--text-muted, #8aa0c0); letter-spacing: .05em; }
.mgmt-trend-svg .grid-line { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.mgmt-trend-svg .trend-line { stroke: #5a7dff; stroke-width: 2; fill: none; }
.mgmt-trend-svg .trend-fill { fill: rgba(90,125,255,.14); }
.mgmt-trend-svg .trend-dot  { fill: #9ec1ff; }
.mgmt-trend-svg .trend-tooltip { fill: var(--text, #e6edfa); font-weight: 700; font-size: 11px; }

/* ── Activity feed (vertical timeline) ───────────────────────────── */
.mgmt-activity-feed { position: relative; padding-left: 18px; display: flex; flex-direction: column; }
.mgmt-activity-feed::before {
  content: ""; position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px; background: rgba(255,255,255,.08);
}
.mgmt-activity-row {
  position: relative;
  padding: 8px 4px 8px 6px;
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 10px; align-items: baseline;
}
.mgmt-activity-row::before {
  content: ""; position: absolute;
  left: -16px; top: 14px;
  width: 9px; height: 9px; border-radius: 999px;
  background: #5a7dff; box-shadow: 0 0 0 3px rgba(90,125,255,.18);
}
.mgmt-activity-row[data-tone="good"]::before   { background: #74e3a9; box-shadow: 0 0 0 3px rgba(116,227,169,.18); }
.mgmt-activity-row[data-tone="urgent"]::before { background: #ff8896; box-shadow: 0 0 0 3px rgba(255,136,150,.18); }
.mgmt-activity-row[data-tone="amber"]::before  { background: #f6c14b; box-shadow: 0 0 0 3px rgba(246,193,75,.18); }
.mgmt-activity-text { font-size: 13px; color: var(--text, #e6edfa); line-height: 1.4; }
.mgmt-activity-text strong { font-weight: 700; }
.mgmt-activity-time {
  font-size: 11px; color: var(--text-muted, #8aa0c0);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* ── Wider platform bar (contact-rate + close-rate) ──────────────── */
.mgmt-platform-bar {
  display: grid; grid-template-columns: 110px 1fr auto auto;
  gap: 12px; align-items: center;
  font-size: 12px; padding: 6px 0;
}
.mgmt-platform-bar-label { color: var(--text, #e6edfa); font-weight: 600; }
.mgmt-platform-bar-track {
  position: relative; height: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 999px; overflow: hidden;
}
.mgmt-platform-bar-track .contact-fill,
.mgmt-platform-bar-track .close-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
}
.mgmt-platform-bar-track .contact-fill { background: linear-gradient(90deg,#5a7dff,#9ec1ff); }
.mgmt-platform-bar-track .close-fill   { background: linear-gradient(90deg,#74e3a9,#3fc787); opacity: .9; }
.mgmt-platform-bar-pct {
  font-variant-numeric: tabular-nums; font-weight: 700;
  color: var(--text, #e6edfa); min-width: 44px; text-align: right;
}
.mgmt-platform-bar-pct.is-close { color: #74e3a9; }

@media (max-width: 980px) {
  .mgmt-platform-bar { grid-template-columns: 90px 1fr auto; }
  .mgmt-platform-bar-pct.is-close { display: none; }
}
