/* SCOP — operatör performans puanı (chip, toast, modal) */

.perf-points-chip {
  display: inline-flex;
  align-items: stretch;
  gap: 0.55rem;
  max-width: min(100%, 320px);
  padding: 0.45rem 0.75rem 0.45rem 0.55rem;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
  color: #1e3a8a;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.perf-points-chip:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.perf-points-chip:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.perf-points-chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  flex-shrink: 0;
  align-self: center;
}

.perf-points-chip-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.perf-points-chip-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.perf-points-chip-line--primary {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}

.perf-points-chip-line--secondary {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.2;
}

.perf-points-chip-sep {
  opacity: 0.45;
}

.perf-points-chip-progress {
  display: inline-block;
  width: 3.5rem;
  height: 4px;
  margin-left: 0.15rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
  vertical-align: middle;
}

.perf-points-chip-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.dashboard-page-header-actions,
.workspace-page-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.perf-points-toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 12050;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.perf-points-toast {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 220px;
  max-width: 320px;
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.perf-points-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.perf-points-toast-points {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #2563eb;
}

.perf-points-toast-label {
  font-size: 0.8125rem;
  color: #334155;
}

.perf-points-toast-ref {
  font-size: 0.75rem;
  color: #64748b;
}

.perf-modal-backdrop {
  z-index: 12040;
}

.perf-modal {
  width: min(880px, calc(100vw - 2.5rem));
  max-width: min(880px, calc(100vw - 2.5rem));
  max-height: min(94vh, 900px);
  display: flex;
  flex-direction: column;
}

.perf-modal .new-case-modal-body {
  padding: 1.25rem 2rem 2rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.perf-modal-header {
  align-items: flex-start;
  padding: 1.5rem 2rem 0;
}

.perf-modal-heading {
  min-width: 0;
}

.perf-modal-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.perf-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.perf-modal-hero {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: stretch;
}

.perf-modal-level-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.15rem;
  border-radius: 14px;
  background: linear-gradient(160deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
}

.perf-modal-level-label {
  font-size: 0.75rem;
  opacity: 0.85;
}

.perf-modal-level-value {
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.perf-modal-level-total {
  font-size: 0.75rem;
  opacity: 0.9;
}

.perf-modal-progress-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.15rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}

.perf-modal-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #475569;
}

.perf-modal-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.perf-modal-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.perf-modal-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.perf-modal-kpi {
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.perf-modal-kpi span {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.perf-modal-kpi strong {
  font-size: 1.2rem;
  color: #0f172a;
}

.perf-modal-section-title {
  margin: 0 0 0.625rem;
  font-size: 0.9375rem;
  color: #0f172a;
}

.perf-modal-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(42vh, 420px);
  overflow: auto;
  padding-right: 0.25rem;
}

.perf-modal-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fafbfc;
}

.perf-modal-event-points {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.perf-modal-event-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.perf-modal-event-label {
  font-size: 0.8125rem;
  color: #334155;
}

.perf-modal-event-ref {
  font-size: 0.75rem;
  color: #64748b;
}

.perf-modal-event-time {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

.perf-modal-rules-wrap {
  overflow: auto;
}

.perf-modal-rules {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.perf-modal-rules th,
.perf-modal-rules td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
}

.perf-modal-rules-points {
  width: 4.5rem;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.perf-modal-note {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
}

.perf-modal-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.perf-modal-team-wrap {
  overflow-x: auto;
}

.perf-modal-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.perf-modal-team-table th,
.perf-modal-team-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.9rem;
}

.perf-modal-team-live,
.perf-modal-team-mock {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.perf-modal-team-live {
  color: #047857;
}

.perf-modal-team-mock {
  color: #64748b;
}

.perf-points-chip--corporate .perf-points-chip-badge {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

#corp-team-points-popover-root {
  position: fixed;
  inset: 0;
  z-index: 12050;
  pointer-events: none;
}

.corp-points-popover-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: transparent;
}

.corp-points-popover {
  position: fixed;
  width: min(320px, calc(100vw - 1.5rem));
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.14),
    0 4px 12px rgba(37, 99, 235, 0.08);
  overflow: hidden;
  pointer-events: auto;
}

.corp-points-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.55rem;
  border-bottom: 1px solid #eff6ff;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.corp-points-popover-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e3a8a;
}

.corp-points-popover-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.corp-points-popover-close:hover {
  background: #eff6ff;
  color: #1e3a8a;
}

.corp-points-popover-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: min(280px, 50vh);
  overflow-y: auto;
}

.corp-points-popover-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
}

.corp-points-popover-row + .corp-points-popover-row {
  border-top: 1px solid #f1f5f9;
}

.corp-points-popover-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.6875rem;
  font-weight: 700;
}

.corp-points-popover-row--live .corp-points-popover-avatar {
  background: #dbeafe;
  color: #1d4ed8;
}

.corp-points-popover-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.corp-points-popover-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.corp-points-popover-role {
  font-size: 0.6875rem;
  color: #64748b;
}

.corp-points-popover-badge {
  display: inline-block;
  margin-left: 0.15rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #047857;
}

.corp-points-popover-badge--mock {
  color: #94a3b8;
}

.corp-points-popover-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
}

.corp-points-popover-total {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1d4ed8;
}

.corp-points-popover-week {
  font-size: 0.625rem;
  color: #64748b;
  white-space: nowrap;
}

.corp-points-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem 0.75rem;
  border-top: 1px solid #eff6ff;
  background: #f8fbff;
  font-size: 0.6875rem;
  color: #475569;
}

.corp-points-popover-footer strong {
  color: #1e3a8a;
}

.corp-points-popover-empty {
  padding: 1rem 0.85rem;
  font-size: 0.8125rem;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .perf-modal-hero {
    grid-template-columns: 1fr;
  }

  .perf-modal-kpis {
    grid-template-columns: 1fr;
  }

  .perf-points-chip {
    max-width: 100%;
  }
}
