/* ============================================================
   Precifika — Team / Equipe Module CSS
   ============================================================ */

/* ── Sidebar badge ─────────────────────────────────────────── */
.nav-item--team .nav-team-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 2px 6px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Gate FREE ─────────────────────────────────────────────── */
.team-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 32px 16px;
}
.team-gate-inner {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 40px rgba(99,102,241,.10);
  max-width: 520px;
  width: 100%;
  padding: 48px 40px;
  text-align: center;
}
.team-gate-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}
.team-gate-title {
  font-size: 22px; font-weight: 800;
  color: #111827; margin-bottom: 10px;
}
.team-gate-sub {
  font-size: 14px; color: #6b7280;
  line-height: 1.6; margin-bottom: 28px;
}
.team-gate-features {
  display: flex; flex-direction: column; gap: 8px;
  text-align: left; margin-bottom: 32px;
}
.team-gate-feat {
  font-size: 13px; color: #374151;
  display: flex; align-items: center; gap: 8px;
}
.team-gate-feat i { color: #6366f1; font-size: 14px; }
.team-gate-btn {
  width: 100%; max-width: 280px;
  padding: 14px 24px;
  font-size: 15px; font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(99,102,241,.35);
  transition: transform .15s, box-shadow .15s;
}
.team-gate-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99,102,241,.45); }

/* ── Page header ───────────────────────────────────────────── */
.team-page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.team-page-title {
  font-size: 22px; font-weight: 800;
  color: #111827;
  display: flex; align-items: center; gap: 10px;
}
.team-page-title i { color: #6366f1; }
.team-page-subtitle { font-size: 13px; color: #6b7280; margin-top: 3px; }

/* ── Tabs ──────────────────────────────────────────────────── */
.team-tabs {
  display: flex; gap: 4px;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
}
.team-tab-btn {
  padding: 8px 18px;
  border-radius: 9px;
  border: none; background: transparent;
  font-size: 13px; font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.team-tab-btn:hover { color: #374151; background: rgba(255,255,255,.6); }
.team-tab-btn.active {
  background: #fff;
  color: #6366f1;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.team-tab-content { display: none; }
.team-tab-content.active { display: block; }

/* ── Stats row ─────────────────────────────────────────────── */
.team-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.team-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: box-shadow .2s;
}
.team-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); }
.team-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.tsc-blue   { background: #eff6ff; color: #3b82f6; }
.tsc-green  { background: #f0fdf4; color: #22c55e; }
.tsc-amber  { background: #fffbeb; color: #f59e0b; }
.tsc-purple { background: #f5f3ff; color: #8b5cf6; }
.team-stat-val  { font-size: 20px; font-weight: 800; color: #111827; line-height: 1; }
.team-stat-lbl  { font-size: 11px; color: #9ca3af; margin-top: 3px; }

/* ── Members header (search + filter) ─────────────────────── */
.team-members-header,
.team-activity-header {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.team-search-wrap {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 0 14px;
  height: 40px;
}
.team-search-wrap i { color: #9ca3af; font-size: 13px; }
.team-search-wrap input {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: #374151; width: 100%;
}
.team-filter-wrap select {
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px; color: #374151;
  background: #fff;
  outline: none; cursor: pointer;
}

/* ── Members list ──────────────────────────────────────────── */
.team-members-list { display: flex; flex-direction: column; gap: 10px; }

.team-member-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  transition: box-shadow .2s, border-color .2s;
}
.team-member-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  border-color: #d1d5db;
}
.team-member-card.status-inativo { opacity: .7; }
.team-member-card.status-bloqueado { border-left: 3px solid #ef4444; }

.team-member-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  flex-shrink: 0; letter-spacing: .5px;
}
.team-member-avatar.av-green  { background: linear-gradient(135deg,#22c55e,#16a34a); }
.team-member-avatar.av-blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.team-member-avatar.av-amber  { background: linear-gradient(135deg,#f59e0b,#d97706); }
.team-member-avatar.av-rose   { background: linear-gradient(135deg,#f43f5e,#e11d48); }
.team-member-avatar.av-teal   { background: linear-gradient(135deg,#14b8a6,#0d9488); }

.team-member-info { flex: 1; min-width: 0; }
.team-member-name {
  font-size: 14px; font-weight: 700;
  color: #111827; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.team-member-role {
  font-size: 12px; color: #6b7280; margin-top: 1px;
}
.team-member-meta {
  font-size: 11px; color: #9ca3af; margin-top: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.team-member-meta i { font-size: 10px; }

.team-member-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.badge-ativo     { background: #f0fdf4; color: #16a34a; }
.badge-inativo   { background: #f9fafb; color: #6b7280; }
.badge-bloqueado { background: #fef2f2; color: #dc2626; }

.team-member-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.team-action-btn {
  width: 34px; height: 34px;
  border-radius: 8px; border: 1px solid #e5e7eb;
  background: #fff; color: #6b7280;
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.team-action-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.team-action-btn.danger:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.team-action-btn.warn:hover { border-color: #f59e0b; color: #f59e0b; background: #fffbeb; }

/* ── Empty state ───────────────────────────────────────────── */
.team-empty-state {
  text-align: center;
  padding: 56px 24px;
  color: #9ca3af;
}
.team-empty-state i { font-size: 40px; margin-bottom: 14px; display: block; }
.team-empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ── Activity list ─────────────────────────────────────────── */
.team-activity-list {
  display: flex; flex-direction: column; gap: 2px;
}
.team-activity-list--modal {
  max-height: 420px; overflow-y: auto;
  padding: 8px 0;
}

.team-activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  transition: background .15s;
}
.team-activity-item:hover { background: #f9fafb; }

.team-act-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-top: 1px;
}
.act-create   { background: #f0fdf4; color: #22c55e; }
.act-edit     { background: #eff6ff; color: #3b82f6; }
.act-delete   { background: #fef2f2; color: #ef4444; }
.act-approve  { background: #f0fdf4; color: #16a34a; }
.act-send     { background: #f0f9ff; color: #0ea5e9; }
.act-login    { background: #f5f3ff; color: #8b5cf6; }
.act-default  { background: #f9fafb; color: #6b7280; }

.team-act-body { flex: 1; min-width: 0; }
.team-act-desc {
  font-size: 13px; color: #374151;
  line-height: 1.4;
}
.team-act-desc strong { color: #111827; }
.team-act-meta {
  font-size: 11px; color: #9ca3af; margin-top: 3px;
  display: flex; gap: 8px; align-items: center;
}

/* ── Analytics / Charts ────────────────────────────────────── */
.team-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.team-chart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.team-chart-card--wide {
  grid-column: 1 / -1;
}
.team-chart-card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.team-chart-card-header h3 {
  font-size: 14px; font-weight: 700;
  color: #111827;
  display: flex; align-items: center; gap: 7px;
}
.team-chart-card-header h3 i { color: #6366f1; }
.team-chart-period {
  font-size: 11px; color: #9ca3af; background: #f3f4f6;
  padding: 3px 10px; border-radius: 20px;
}
.team-chart-wrap { position: relative; }

/* ── Ranking ───────────────────────────────────────────────── */
.team-ranking-list {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0;
}
.team-ranking-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #f3f4f6;
}
.team-rank-pos {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #fff; }
.rank-2 { background: linear-gradient(135deg,#9ca3af,#6b7280); color: #fff; }
.rank-3 { background: linear-gradient(135deg,#cd7f32,#b45309); color: #fff; }
.rank-other { background: #f3f4f6; color: #6b7280; }
.team-rank-name { flex: 1; font-size: 13px; font-weight: 600; color: #374151; }
.team-rank-role { font-size: 11px; color: #9ca3af; }
.team-rank-score {
  text-align: right;
}
.team-rank-val { font-size: 15px; font-weight: 800; color: #6366f1; }
.team-rank-lbl { font-size: 10px; color: #9ca3af; }
.team-rank-bar-wrap {
  width: 80px; height: 6px;
  background: #e5e7eb; border-radius: 3px;
  overflow: hidden;
}
.team-rank-bar {
  height: 100%;
  background: linear-gradient(90deg,#6366f1,#8b5cf6);
  border-radius: 3px;
  transition: width .6s ease;
}

/* ── Modal ─────────────────────────────────────────────────── */
.team-modal-box {
  max-width: 620px !important;
  width: 96vw !important;
  border-radius: 20px !important;
  padding: 0 !important;
  overflow: hidden;
  max-height: 92vh;
  display: flex; flex-direction: column;
}
.team-modal-box--lg { max-width: 700px !important; }
.team-modal-box--sm { max-width: 420px !important; }

.team-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}
.team-modal-header h2 {
  font-size: 17px; font-weight: 800; color: #111827;
  display: flex; align-items: center; gap: 8px;
}
.team-modal-header h2 i { color: #6366f1; }

.team-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.team-modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
  flex-shrink: 0;
}

/* ── Modal tabs ────────────────────────────────────────────── */
.team-modal-tabs {
  display: flex; gap: 4px;
  background: #f3f4f6;
  border-radius: 10px; padding: 4px;
  margin-bottom: 20px; width: fit-content;
}
.tmtab-btn {
  padding: 7px 16px;
  border-radius: 7px; border: none;
  background: transparent;
  font-size: 12px; font-weight: 600;
  color: #6b7280; cursor: pointer;
  transition: all .18s;
  display: flex; align-items: center; gap: 5px;
}
.tmtab-btn:hover { color: #374151; }
.tmtab-btn.active { background: #fff; color: #6366f1; box-shadow: 0 2px 6px rgba(0,0,0,.07); }
.tmtab-content { display: none; }
.tmtab-content.active { display: block; }

/* ── Form grid in modal ────────────────────────────────────── */
.team-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tm-pwd-group,
.tm-notes-group { grid-column: 1 / -1; }

/* ── Password field with buttons ───────────────────────────── */
.tm-pwd-wrap {
  display: flex; gap: 6px; align-items: center;
}
.tm-pwd-wrap .form-input { flex: 1; }
.tm-pwd-toggle,
.tm-pwd-gen {
  width: 36px; height: 36px;
  border-radius: 8px; border: 1px solid #e5e7eb;
  background: #fff; color: #6b7280;
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.tm-pwd-toggle:hover { color: #6366f1; border-color: #6366f1; }
.tm-pwd-gen:hover    { color: #8b5cf6; border-color: #8b5cf6; }
.tm-pwd-hint { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ── Permissions toggles ───────────────────────────────────── */
.team-perms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.team-perms-group {
  background: #fafafa;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.team-perms-group-title {
  font-size: 12px; font-weight: 700;
  color: #374151; text-transform: uppercase;
  letter-spacing: .5px;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px; padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.team-perms-group-title i { color: #6366f1; }

/* Toggle switch */
.team-perm-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; cursor: pointer;
  padding: 4px 0;
}
.team-perm-toggle span:first-child {
  font-size: 12px; color: #374151; flex: 1; line-height: 1.3;
}
.team-perm-cb { display: none; }
.team-perm-slider {
  width: 36px; height: 20px;
  background: #d1d5db; border-radius: 20px;
  position: relative; flex-shrink: 0;
  transition: background .2s;
}
.team-perm-slider::after {
  content: '';
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.team-perm-cb:checked + .team-perm-slider { background: #6366f1; }
.team-perm-cb:checked + .team-perm-slider::after { transform: translateX(16px); }
.team-perm-toggle:hover .team-perm-slider { background: #9ca3af; }
.team-perm-cb:checked ~ * .team-perm-slider,
.team-perm-toggle:has(.team-perm-cb:checked):hover .team-perm-slider { background: #4f46e5; }

/* Preset buttons */
.team-perms-presets {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; flex-wrap: wrap;
}
.team-perms-presets-label {
  font-size: 12px; color: #6b7280; font-weight: 600;
}
.team-preset-btn {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: #fff; color: #374151;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.team-preset-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.team-preset-btn--all  { border-color: #22c55e; color: #16a34a; }
.team-preset-btn--all:hover  { background: #f0fdf4; }
.team-preset-btn--none { border-color: #ef4444; color: #dc2626; }
.team-preset-btn--none:hover { background: #fef2f2; }

/* ── Modal close button ────────────────────────────────────── */
.modal-close-btn {
  width: 32px; height: 32px;
  border-radius: 8px; border: 1px solid #e5e7eb;
  background: #f9fafb; color: #6b7280;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.modal-close-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }

/* ── Reset pwd info ────────────────────────────────────────── */
.team-reset-pwd-info {
  font-size: 13px; color: #6b7280;
  background: #f9fafb; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid #f3f4f6;
}

/* ── Inline activity in member card ────────────────────────── */
.team-member-activity-count {
  display: inline-flex; align-items: center;
  gap: 4px; font-size: 11px;
  color: #8b5cf6; background: #f5f3ff;
  padding: 2px 8px; border-radius: 20px;
  font-weight: 600;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .team-stats-row { grid-template-columns: repeat(2, 1fr); }
  .team-analytics-grid { grid-template-columns: 1fr; }
  .team-chart-card--wide { grid-column: 1; }
  .team-perms-grid { grid-template-columns: 1fr; }
  .team-form-grid  { grid-template-columns: 1fr; }
  .tm-pwd-group,
  .tm-notes-group { grid-column: 1; }
  .team-tabs { width: 100%; overflow-x: auto; }
  .team-member-actions { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .team-stats-row { grid-template-columns: 1fr 1fr; }
  .team-gate-inner { padding: 32px 20px; }
  .team-page-header { flex-direction: column; }
  .team-page-header .btn { width: 100%; justify-content: center; }
  .team-modal-box { border-radius: 16px !important; }
  .team-member-card { flex-wrap: wrap; }
  .team-member-actions { width: 100%; justify-content: flex-end; }
}
