/* ============================================================
 * Worxphere AI Tracker — Team Dashboard Styles
 * Team-specific styles; common.css provides base layout/colors.
 * ============================================================ */

/* --- Team container override --- */
.container.team-container { max-width: 1200px; }

/* === Tab bar === */
.team-tabs { display: flex; gap: 6px; margin: 20px 0 16px; flex-wrap: wrap; }
.team-tab {
  padding: 8px 18px;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-500);
  transition: all .15s;
}
.team-tab:hover { border-color: var(--purple); color: var(--purple); }
.team-tab.active { background: var(--purple); color: white; border-color: var(--purple); }

/* Activity analysis tab (special styling) */
.team-tab.activity-tab {
  background: transparent;
  border: 1px solid var(--purple);
  color: var(--purple);
  font-weight: 600;
}
.team-tab.activity-tab:hover { background: var(--purple-50, #f5f0ff); }
.team-tab.activity-tab.active { background: var(--purple); color: white; }

/* === Team filter chips === */
.team-filter-chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.team-chip {
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-600);
  transition: all .15s;
}
.team-chip:hover { border-color: var(--purple); color: var(--purple); }
.team-chip.active { background: var(--purple); color: white; border-color: var(--purple); }
.chip-count {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: .8;
}

/* === Org selector === */
.team-header { margin-bottom: 24px; }
.team-header-title { font-size: 28px; font-weight: 700; color: var(--gray-800); margin: 0 0 4px; }
.team-header-sub { font-size: 15px; color: var(--gray-400); margin: 0; }

/* === Team KPI grid (4-column target) === */
.team-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.team-kpi-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 18px;
}
.team-kpi-card.kpi-alert { border-color: var(--red); }
.team-kpi-label { font-size: 12px; color: var(--gray-400); margin-bottom: 4px; }
.team-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}
.team-kpi-unit { font-size: 14px; color: var(--gray-400); }
.team-kpi-sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* === Alert panel === */
.team-alert-panel {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.team-alert-title {
  padding: 14px 18px 10px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--gray-100);
}
.alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--gray-50);
  font-size: 13px;
}
.alert-item:last-child { border-bottom: none; }
.alert-item.al-danger { background: #fef2f2; }
.alert-item.al-warn { background: #fffbeb; }
.alert-item.al-info { background: #eff6ff; }
.alert-icon { font-size: 15px; flex-shrink: 0; }
.alert-msg { flex: 1; }

/* === Health dot === */
.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.hd-green { background: #22c55e; }
.hd-yellow { background: #eab308; }
.hd-red { background: #ef4444; }
.hd-gray { background: var(--gray-300); }

/* === Member card === */
.member-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 20px 24px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.member-card:hover {
  border-color: var(--purple);
  box-shadow: 0 2px 8px rgba(124,58,237,0.1);
}
.member-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.member-info { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  flex-shrink: 0;
}
.member-name { font-size: 14px; font-weight: 600; }
.member-email { font-size: 11px; color: var(--gray-400); }
.member-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.member-plan { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.member-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.member-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.member-metric { text-align: center; }
.member-metric-label { font-size: 10px; color: var(--gray-400); }
.member-metric-val { font-size: 15px; font-weight: 700; }
.member-rec { font-size: 11px; color: var(--gray-500); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-100); }

/* Color modifiers for metric values */
.tm-green { color: var(--green); }
.tm-yellow { color: var(--yellow); }
.tm-red { color: var(--red); }
.tm-gray { color: var(--gray-400); }

/* === Members card grid === */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* === Gauge (compact) === */
.gauge-wrap-sm {
  position: relative;
  width: 100%;
  height: 14px;
  background: var(--gray-100);
  border-radius: 7px;
  overflow: hidden;
  margin-top: 4px;
}
.gauge-fill-sm { height: 100%; border-radius: 7px; transition: width .5s ease; }

/* === Period toggle === */
.period-toggle { display: flex; gap: 6px; margin-bottom: 16px; }
.period-btn {
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-500);
}
.period-btn.active { background: var(--purple); color: white; border-color: var(--purple); }

/* === Date navigation === */
.date-nav { display: flex; align-items: center; gap: 6px; margin: 8px 0 12px; }
.date-nav-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--gray-200); border-radius: 6px;
  background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); font-size: 14px; transition: all .15s;
}
.date-nav-btn:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-300); }
.date-nav-btn:disabled { opacity: .3; cursor: default; }
.date-nav-label { font-size: 13px; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; }
.date-nav-tz { font-size: 10px; font-weight: 500; color: var(--gray-400); background: var(--gray-100); padding: 1px 5px; border-radius: 3px; }

/* === Recommendation badges === */
.rec-upgrade { background: #fee2e2; color: #991b1b; }
.rec-burst { background: #ffedd5; color: #9a3412; }
.rec-downgrade { background: #dbeafe; color: #1e40af; }
.rec-optimal { background: #dcfce7; color: #166534; }
.rec-watch { background: #fef9c3; color: #854d0e; }

/* === Button styles === */
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 6px; cursor: pointer; }
.btn-outline { background: white; border: 1px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--gray-400); }

/* === Search bar === */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.search-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
}

/* === Plan filter chips === */
.plan-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.plan-filter-btn {
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-500);
  transition: all .15s;
}
.plan-filter-btn:hover { border-color: var(--purple); color: var(--purple); }
.plan-filter-btn.active { background: var(--purple); color: white; border-color: var(--purple); }

/* === Plan distribution section === */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.plan-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.pc-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pc-count { font-size: 28px; font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.pc-unit { font-size: 12px; color: var(--gray-400); }
.pc-util { font-size: 12px; margin-top: 6px; }

/* === Section title === */
.section-title { font-size: 16px; font-weight: 700; color: var(--gray-900); margin: 24px 0 12px; }

/* === Settings panel === */
.settings-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.settings-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.admin-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple);
  background: #F5F3FF;
  border: 1px solid #DDD6FE;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.settings-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.settings-label { font-size: 13px; color: var(--gray-500); min-width: 80px; }
.settings-value { font-size: 14px; font-weight: 500; }
.invite-form { display: flex; gap: 8px; margin-bottom: 16px; }
.invite-form input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
}
.invite-form select {
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
}

/* === Buttons (team-specific) === */
.btn { padding: 8px 18px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-primary { background: var(--purple); color: white; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-outline { background: white; border: 1px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--gray-400); }

/* === Member list (settings) === */
.member-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.member-list-item:last-child { border-bottom: none; }
.ml-info { display: flex; align-items: center; gap: 8px; }
.ml-name-wrap { display: flex; flex-direction: column; line-height: 1.3; }
.ml-email { font-size: 11px; color: var(--gray-400); }
.ml-role { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 500; }
.ml-role.admin { background: #fce7f3; color: #9d174d; }
.ml-role.member { background: var(--gray-100); color: var(--gray-500); }

/* === Team management tags (legacy) === */
.team-manage-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.team-manage-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  font-size: 12px;
  background: white;
}
.team-manage-tag .tm-name { font-weight: 500; }
.team-manage-tag .tm-count { color: var(--gray-400); font-size: 11px; }

/* === Settings panel (enhanced) === */
.settings-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; line-height: 1.5; }
.settings-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.settings-sub-info { font-size: 11px; color: var(--gray-400); margin-top: 6px; }
.settings-sub-text { font-size: 11px; color: var(--gray-400); }
.settings-sub-text.grove-warn { color: var(--red); font-weight: 500; }
.settings-warn-text { font-size: 11px; color: var(--yellow); margin-top: 8px; }
.settings-empty-text { color: var(--gray-400); font-size: 13px; }
.settings-select {
  padding: 6px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}
.settings-select-sm {
  padding: 4px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 12px;
  background: white;
  cursor: pointer;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 22px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--purple); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Status dot */
.settings-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  margin-right: 6px;
  vertical-align: middle;
}
.settings-status-dot.active { background: var(--green); }

/* Invite link row */
.invite-link-row { display: flex; gap: 8px; align-items: center; }
.invite-link-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: var(--gray-50);
  color: var(--gray-700);
}

/* Icon button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-400);
  cursor: pointer;
  transition: all .15s;
}
.btn-icon:hover { color: var(--gray-700); border-color: var(--gray-400); background: var(--gray-50); }
.btn-icon-danger:hover { color: var(--red); border-color: #fca5a5; background: #fef2f2; }

/* Team manage list (settings) */
.team-manage-list { display: flex; flex-direction: column; gap: 0; }
.team-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.team-manage-item:last-child { border-bottom: none; }
.team-manage-item-info { display: flex; align-items: center; gap: 8px; }
.team-manage-item-info .tm-name { font-size: 13px; font-weight: 600; }
.tm-count-badge {
  font-size: 11px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 1px 8px;
  border-radius: 10px;
}
.team-manage-item-actions { display: flex; gap: 4px; }

/* Member list (settings enhanced) */
.member-list-item { flex-wrap: wrap; gap: 8px; }
.ml-name { font-size: 13px; font-weight: 600; }
.ml-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ml-team-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 10px;
  background: #ede9fe;
  color: var(--purple);
}
.ml-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}
.ml-status.active { background: #dcfce7; color: #166534; }
.ml-status.pending { background: #fef9c3; color: #854d0e; }
.ml-status.requested { background: #dbeafe; color: #1e40af; }
.ml-last-seen { font-size: 11px; color: var(--gray-400); }
.ml-actions { display: flex; align-items: center; gap: 6px; }

/* Grove section */
.grove-violators { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.grove-violators-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.grove-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: var(--red);
  border-radius: 10px;
  padding: 0 6px;
  margin-left: 4px;
}
.grove-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.grove-badge.on { background: #fee2e2; color: #991b1b; }
.grove-badge.off { background: #dcfce7; color: #166534; }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-900);
  color: white;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Email report compact layout */
.email-report-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.email-report-info { flex: 1; }
.email-report-recipient { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.email-report-details { font-size: 13px; color: var(--gray-400); }
.email-report-toggle { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.toggle-label { font-size: 13px; color: var(--green); font-weight: 500; }

/* Grove policy toggle */
.grove-policy-toggle { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.grove-policy-label { font-size: 14px; font-weight: 500; }
.grove-policy-label.grove-deny { color: var(--red); }

/* Settings card danger variant */
.settings-card-danger { border-color: #fca5a5; }
.settings-card-danger h3 { color: var(--red); }

/* Settings input */
.settings-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: white;
}
.settings-input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 2px rgba(124,58,237,.1); }
.settings-hint { display: block; font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* Org edit form */
.org-edit-field { margin-bottom: 16px; }
.org-edit-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.org-edit-input { width: 100%; max-width: 400px; }
.org-tip-box {
  background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: #8b6914; margin: 16px 0;
  line-height: 1.5;
}
.org-preview-wrap { margin: 16px 0; }
.org-preview-card {
  border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 16px; max-width: 360px; background: var(--gray-50);
}
.org-preview-name { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.org-preview-meta { display: flex; gap: 12px; font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.org-preview-join { pointer-events: none; opacity: 0.7; }
.org-edit-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-top: 1px solid var(--gray-100);
}
.org-edit-toggle-info { flex: 1; }
.org-edit-toggle-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.org-edit-toggle-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.org-edit-toggle-warn { font-size: 12px; color: var(--orange, #d97706); margin-bottom: 4px; padding-left: 2px; }
.org-status-on { color: var(--green, #059669); font-weight: 500; }

/* Mobile: hide AG-Grid, show list fallback */
/* Settings member toolbar */
.settings-member-toolbar { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.settings-member-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.settings-member-count { font-size: 12px; color: var(--gray-400); margin-top: 8px; }
.sm-name { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.sm-chart-icon { opacity: 0.6; cursor: pointer; }
.sm-chart-icon:hover { opacity: 1; }

.settings-members-mobile { display: none; }
@media (max-width: 640px) {
  #settings-members-grid { display: none !important; }
  .settings-members-mobile { display: block; }
  .settings-member-toolbar { flex-direction: column; }
}

/* === Recommendation badges === */
.rec-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.rec-upgrade { background: #fee2e2; color: #991b1b; }
.rec-burst { background: #ffedd5; color: #9a3412; }
.rec-downgrade { background: #dbeafe; color: #1e40af; }
.rec-optimal { background: #dcfce7; color: #166534; }
.rec-watch { background: #fef9c3; color: #854d0e; }
.rec-nodata { background: var(--gray-100); color: var(--gray-400); }
.rec-collecting { background: #f0f9ff; color: #0369a1; }

/* === Leaderboard rank badges === */
.lb-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.lb-rank.rank-1 { background: #fef3c7; color: #b45309; }
.lb-rank.rank-2 { background: #e5e7eb; color: #4b5563; }
.lb-rank.rank-3 { background: #fed7aa; color: #c2410c; }

/* === Race toggle === */
.race-toggle-wrap { margin-bottom: 4px; }
.race-toggle-btn {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.race-toggle-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.race-toggle-icon { font-size: 10px; display: inline-block; transition: transform .2s; }

/* === Leaderboard-grid specific overrides === */
#leaderboard-grid { border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; }
#leaderboard-grid .ag-root-wrapper { border: none; border-radius: 12px; }
#leaderboard-grid .ag-header { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
#leaderboard-grid .ag-header-cell-label { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .3px; }
#leaderboard-grid .ag-cell { font-size: 12px; padding: 0 8px; }
#leaderboard-grid .ag-row { cursor: pointer; border-color: var(--gray-100); }
#leaderboard-grid .ag-row:hover { background: rgba(124,58,237,.04) !important; }
#leaderboard-grid .ag-paging-panel { border-top: 1px solid var(--gray-200); font-size: 12px; }

/* === AG-Grid custom overrides (shared across all team grids) === */
.ag-grid-team {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}
.ag-grid-team .ag-root-wrapper { border: none; border-radius: 12px; }
.ag-grid-team .ag-header { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.ag-grid-team .ag-header-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ag-grid-team .ag-cell { font-size: 12px; padding: 0 8px; }
.ag-grid-team .ag-row { cursor: pointer; border-color: var(--gray-100); }
.ag-grid-team .ag-row:hover { background: rgba(124,58,237,.04) !important; }
.ag-grid-team .ag-paging-panel { border-top: 1px solid var(--gray-200); font-size: 12px; }

/* AG-Grid custom cell renderer: name with avatar */
.og-name { display: flex; align-items: center; gap: 6px; height: 100%; }
.og-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.og-dot-green { background: #22c55e; }
.og-dot-yellow { background: #eab308; }
.og-dot-red { background: #ef4444; }
.og-dot-gray { background: #d1d5db; }
.og-name-text { font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* AG-Grid custom cell: plan badge (compact) */
.og-plan { font-size: 11px; font-weight: 600; }

/* AG-Grid custom cell: utilization bar */
.og-util { display: flex; align-items: center; gap: 4px; height: 100%; font-variant-numeric: tabular-nums; }
.og-util-num { font-size: 12px; font-weight: 600; min-width: 28px; text-align: right; }
.og-bar { height: 6px; border-radius: 3px; background: var(--gray-100); flex: 1; min-width: 30px; overflow: hidden; }
.og-bar-fill { height: 100%; border-radius: 3px; }

/* AG-Grid custom cell: tags */
.og-tag { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.og-time { font-size: 11px; }

/* === Chart card (team) === */
.chart-card-team { background: white; border: 1px solid var(--gray-200); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.chart-card-team h3 { font-size: 15px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }

/* === Table wrap (breaches/leaderboard fallback) === */
.table-wrap { overflow-x: auto; margin-bottom: 20px; background: white; border: 1px solid var(--gray-200); border-radius: 12px; }
.user-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.user-table th { background: var(--gray-50); padding: 8px 10px; text-align: left; font-weight: 600; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); }
.user-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); }
.user-table tr:last-child td { border-bottom: none; }
.user-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.user-table tr.clickable { cursor: pointer; transition: background .1s; }
.user-table tr.clickable:hover { background: rgba(124,58,237,.05); }

/* === Modal (member detail) === */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.member-modal { background: white; border-radius: 16px; padding: 0; max-width: 1100px; width: 95%; max-height: 90vh; overflow-y: auto; }
.member-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  z-index: 1;
}
.member-modal-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.member-modal-close { background: none; border: none; font-size: 24px; color: var(--gray-400); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.member-modal-close:hover { color: var(--gray-900); background: var(--gray-100); }
.member-modal-body { padding: 20px 24px 24px; }

/* === Tab content visibility === */
.team-tab-content { display: none; }
.team-tab-content.active { display: block; }

/* === Responsive breakpoints === */
@media (max-width: 960px) {
  .team-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .members-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .team-kpi-grid { grid-template-columns: 1fr 1fr; }
  .team-tabs { gap: 4px; }
  .team-tab { padding: 6px 12px; font-size: 12px; }
  .member-card { padding: 14px 16px; }
  .member-metrics { grid-template-columns: repeat(3, 1fr); }
  .settings-card { padding: 16px; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
  .member-list-item { flex-direction: column; align-items: flex-start; }
  .ml-meta { margin-top: 4px; }
  .ml-actions { margin-top: 6px; width: 100%; }
  .invite-form { flex-direction: column; }
  .invite-form input, .invite-form select { width: 100%; }
  .invite-link-row { flex-direction: column; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (max-width: 420px) {
  .team-kpi-grid { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}
