:root {
  --bg: #0B0F14;
  --card: #141A22;
  --border: #243041;
  --text: #E8EEF5;
  --muted: #8B9BB0;
  --accent: #3DDC97;
  --quiet: #4A5568;
  --warn: #F0B429;
  --ori: #7C9CFF;
  --yarden: #E879A9;
  --hover: #1A2330;
  --radius: 14px;
  --max: 1120px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  font-family: Heebo, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Heebo, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: var(--accent); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Hero */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-meta {
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}
.hero-meta .count {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.chip-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(61,220,151,.12);
  color: var(--accent);
  border: 1px solid rgba(61,220,151,.28);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
}
.chip-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,220,151,.2);
}

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (min-width: 720px) {
  .kpi-row { grid-template-columns: minmax(280px, 340px) 1fr; }
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: visible;
  min-width: 0;
}
.kpi-row > .kpi-card:first-child {
  flex-wrap: wrap;
}
.donut-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center .n {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.donut-center .l {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}
.kpi-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  min-width: 0;
  flex: 1;
  overflow: visible;
}
.kpi-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: visible;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-active { background: var(--accent); }
.dot-quiet { background: var(--quiet); }
.dot-ori { background: var(--ori); }
.dot-yarden { background: var(--yarden); }
.dot-other { background: var(--warn); }

.bar-card { flex-direction: column; align-items: stretch; gap: 12px; }
.bar-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}
.bar-stack {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #0E131A;
}
.bar-seg { height: 100%; transition: width .3s ease; min-width: 0; }
.bar-seg.ori { background: var(--ori); }
.bar-seg.yarden { background: var(--yarden); }
.bar-seg.other { background: var(--warn); }
.bar-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Filters */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.filter-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover { border-color: #3a4d66; color: var(--text); }
.filter-chip.active {
  background: rgba(61,220,151,.16);
  border-color: rgba(61,220,151,.45);
  color: var(--accent);
}
.search-wrap {
  position: relative;
  min-width: min(100%, 220px);
}
.search-wrap input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 8px 14px 8px 36px;
  outline: none;
}
.search-wrap input::placeholder { color: var(--quiet); }
.search-wrap input:focus {
  border-color: rgba(61,220,151,.5);
  box-shadow: 0 0 0 3px rgba(61,220,151,.12);
}
.search-wrap .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--quiet);
  pointer-events: none;
  font-size: 0.875rem;
}

/* Sections */
.section { margin-bottom: 28px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.section-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid;
}
.tag-ori {
  color: var(--ori);
  border-color: rgba(124,156,255,.4);
  background: rgba(124,156,255,.1);
}
.tag-yarden {
  color: var(--yarden);
  border-color: rgba(232,121,169,.4);
  background: rgba(232,121,169,.1);
}
.section-count {
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  margin-inline-start: auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* Cards */
.bot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  text-align: start;
  color: inherit;
  width: 100%;
  transition: border-color .2s, transform .2s, box-shadow .2s, background .2s;
  animation: cardIn .22s ease both;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bot-card:hover, .bot-card:focus-visible {
  border-color: rgba(61,220,151,.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: var(--hover);
  outline: none;
}
.bot-card.featured {
  border-color: rgba(124,156,255,.45);
  background: linear-gradient(145deg, #161d2a 0%, var(--card) 60%);
  grid-column: 1 / -1;
}
.bot-card.featured:hover {
  border-color: rgba(124,156,255,.7);
}
.bot-card.yarden-card {
  border-color: rgba(232,121,169,.28);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.avatar.dark-text { color: #E8EEF5; }
.avatar.circle { border-radius: 50%; }
.avatar.tablet { clip-path: inset(0 round 10px); border-radius: 10px; }
.avatar.teardrop { clip-path: path('M24 2 C38 2 46 14 46 26 C46 40 32 48 24 48 C16 48 2 40 2 26 C2 14 10 2 24 2 Z'); }
.avatar.blob { border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%; }
.avatar.wedge { clip-path: polygon(50% 4%, 96% 88%, 4% 88%); }
.avatar.star { clip-path: polygon(50% 2%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

.card-id { flex: 1; min-width: 0; }
.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.name-row h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-inline-start: auto;
}
.status .sdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--quiet);
}
.status.on .sdot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,220,151,.18);
}
.status.on { color: var(--accent); }

.role {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.reports {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.reports strong { color: var(--text); font-weight: 500; }
.reports.ori-r strong { color: var(--ori); }
.reports.yarden-r strong { color: var(--yarden); }

.card-div {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.activity-line, .routines-line {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}
.activity-line strong, .routines-line strong {
  color: var(--text);
  font-weight: 500;
}
.activity-line .val {
  color: var(--muted);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 32px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* Skills */
.skills-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 8px;
}
.skills-section h2 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
}
.skill-chip {
  background: #0E131A;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.skill-chip .sn {
  font-weight: 500;
  font-size: 0.875rem;
}
.skill-chip .sd {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 4px;
}

.footer-note {
  margin-top: 28px;
  color: var(--quiet);
  font-size: 0.75rem;
  text-align: center;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5,8,12,.72);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 20px 22px 24px;
  box-shadow: var(--shadow);
  transform: translateY(12px);
  transition: transform .2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.modal-head .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}
.modal-close {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  margin-inline-start: auto;
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: #3a4d66; }
.modal-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.modal-block h3 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
}
.modal-block p {
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
  color: var(--text);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
