@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/Manrope.woff2") format("woff2");
}

:root {
  --bg: #111219;
  --surface: #161821;
  --surface-2: #1a1c25;
  --border: rgba(255, 255, 255, 0.08);
  --lime: #cbf078;
  --lime-hover: #b8e05f;
  --purple: #8b5cf6;
  --text: #f0f2f5;
  --text-muted: rgba(240, 242, 245, 0.45);
  --success: #22c55e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --glow-lime: 0 0 20px rgba(203, 240, 120, 0.25);

  --tile-size: 240px;
  --tile-size-root: 260px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   LOGIN PAGE — Dark Premium, Glassmorphism
═══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Градиентные сферы на фоне */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  pointer-events: none;
  animation: orb-float 8s ease-in-out infinite alternate;
}

.orb-purple {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: -200px;
  left: -200px;
}

.orb-lime {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #b8e05f 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
  animation-delay: -4s;
}

@keyframes orb-float {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(30px, 20px) scale(1.08);
  }
}

/* Стеклянная карточка */
.login-glass {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: rgba(22, 24, 33, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-logo {
  display: block;
  width: 180px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto 32px;
}

.login-glass h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin: 0 0 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
}

.input-group input {
  background: #eef2f6;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: #111219;
  font-weight: 600;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.input-group input::placeholder {
  color: rgba(17, 18, 25, 0.4);
}

.input-group input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 4px rgba(184, 224, 95, 0.2);
}

.login-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 0;
}

.btn--login {
  width: 100%;
  padding: 15px;
  background: var(--lime);
  color: #000;
  border: none;
  border-radius: 60px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 0 24px rgba(184, 224, 95, 0.3);
}

.btn--login:hover {
  background: var(--lime-hover);
  box-shadow: 0 0 32px rgba(184, 224, 95, 0.5);
}

.btn--login:active {
  transform: scale(0.98);
}

.btn--login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Переключатель Войти / Зарегистрироваться */
.login-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.login-toggle a {
  color: var(--lime);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.login-toggle a:hover {
  opacity: 0.8;
}

/* Сообщение об ошибке под формой */
.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #f87171;
  text-align: center;
}

/* APP LAYOUT */

.app {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 40px 0;
  padding: 0;
}

.sidebar__brand img {
  width: 140px;
}

.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3e3e5c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  transition: transform 0.2s, border-color 0.2s;
}
.profile-avatar:hover {
  transform: scale(1.05);
  border-color: var(--lime);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name {
  font-size: 15px;
  font-weight: 600;
}

.profile-badge {
  font-size: 11px;
  background: var(--lime);
  color: #000;
  padding: 2px 8px;
  border-radius: 60px;
  font-weight: 700;
  display: inline-block;
  width: fit-content;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.active {
  background: var(--lime);
  color: #000;
  box-shadow: var(--glow-lime);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  color: #000;
}

.nav-item--disabled {
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  cursor: default;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--text-muted);
}

.nav-status {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 60px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn--primary {
  background: var(--lime);
  color: #000;
  box-shadow: var(--glow-lime);
}
.btn--primary:hover {
  background: var(--lime-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 10px);
  color: var(--text-muted, rgba(240, 242, 245, 0.45));
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--logout:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-x: auto;
}

/* TOP BAR (Search & Filters) */
.top-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: none;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 12px 16px 12px 44px;
  font-family: inherit;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.search:focus {
  border-color: var(--lime);
}

.toolbar__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-filter {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 60px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.btn-filter.active {
  background: var(--lime);
  color: #000;
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
}

/* STATS CARDS */
.stats {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  width: 100%;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 180px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  cursor: default;
}

.stat-card:hover,
.stat-card.active-stat {
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
}

.stat-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #111219;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  width: max-content;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.success-text {
  color: var(--success);
}

/* TREE RENDERING (Org Chart Style) */
.panel {
  background: transparent;
  padding-top: 20px;
}

.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pyramid--sub {
  padding-top: 32px;
  position: relative;
}

/* Connecting Lines */
.level-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  padding: 24px 0;
}

.level-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 24px;
  background: var(--border);
}

.level-row[data-line="0"]::before,
.level-row[data-line="1"]::before {
  display: none;
}

/* Handle root lines via app logic if needed, simplify here */

.level-row__cards {
  display: flex;
  justify-content: center;
  gap: 32px;
  row-gap: 48px;
  position: relative;
  flex-wrap: wrap;
}

/* Horizontal line connecting children */
.level-row__cards::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  height: 1px;
  background: var(--border);
}

/* The length of horizontal line depends on children... we use a trick: first and last child */
.level-row__cards>.tile:first-child::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  width: 50%;
  height: 1px;
  background: var(--bg);
  /* Mask out */
}

.level-row__cards>.tile:last-child::before {
  content: '';
  position: absolute;
  top: -24px;
  right: 50%;
  width: 50%;
  height: 1px;
  background: var(--bg);
  /* Mask out */
}

/* Vertical line down to each child */
.level-row__cards>.tile::after {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  width: 1px;
  height: 24px;
  background: var(--border);
}

.level-row__head {
  display: none;
}

/* Hide the text "1 линия" from the original app.js */

/* TILE (Partner Card) */
.tile {
  width: var(--tile-size);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 10;
}

.tile--selected {
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
}

/* Tile Header (Avatar + Name + ID) */
.tile--root {
  width: 380px;
  min-height: auto;
  height: auto;
  border-radius: 4px;
}

.tile__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.tile__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  color: #111219;
  box-shadow: 0 2px 8px rgba(203, 240, 120, 0.3);
}

.tile__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tile__info {
  display: flex;
  flex-direction: column;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.tile__name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.tile__id {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.tile__status-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--lime);
  margin-top: 2px;
}

.tile__qual-badge {
  background: #685a3c;
  color: #f0d588;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tile--purple-glow .tile__qual-badge {
  background: var(--purple);
  color: #fff;
}

/* Special case from mockup */
.tile__qual-badge--header {
  margin-left: auto;
}

.tile__qual-img {
  margin-left: auto;
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Имя наставника в карточке */
.tile__mentor-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  margin: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile__mentor-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.tile__mentor-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.tile__mentor-name {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Контакты — раскрываются при наведении */
.tile__contacts-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.tile:hover .tile__contacts-wrapper,
.tile--selected .tile__contacts-wrapper {
  grid-template-rows: 1fr;
}

.tile__contacts {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.tile:hover .tile__contacts,
.tile--selected .tile__contacts {
  max-height: 200px;
  padding: 8px 4px 4px;
  opacity: 1;
}

.tile__contact-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.tile__contact-icon {
  font-size: 13px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

/* Карточки счетов наставника */
.tile__accounts-block {
  display: flex;
  gap: 8px;
  padding: 2px 4px;
  margin: 0;
}

.tile__account-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tile__account-card:hover {
  transform: translateY(-1px);
}

.tile__account-card--money {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.06));
  border-color: rgba(34, 197, 94, 0.3);
}

.tile__account-card--gift {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.06));
  border-color: rgba(251, 191, 36, 0.3);
}

.tile__account-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.tile__account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tile__account-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
}

.tile__account-card--money .tile__account-label {
  color: rgba(34, 197, 94, 0.7);
}

.tile__account-card--gift .tile__account-label {
  color: rgba(251, 191, 36, 0.7);
}

.tile__account-value {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tile__account-card--money .tile__account-value {
  color: #4ade80;
}

.tile__account-card--gift .tile__account-value {
  color: #fbbf24;
}

/* Tile Metrics Bubbles */
.tile__metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 4px 4px;
}

.tile__metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tile__metric-label {
  font-size: 10px;
  color: var(--lime);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tile__metric-value {
  font-size: 14px;
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════
   TILE V2 — Дизайн как на мокапе
   Скруглённые углы, фон=qual image, лайм аватар
═══════════════════════════════════════════ */
.tile--v2 {
  width: var(--tile-size);
  min-height: 220px;
  border-radius: 16px !important;
  padding: 0 !important;
  background: #1a1d27;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: default;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
  overflow: visible;
  /* Clip фон карточки к скруглённым углам */
  background-clip: padding-box;
}

/* Внутренний контейнер для клипинга фона */
.tile--v2::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: inherit;
  background-image: inherit;
  background-size: cover;
  background-position: center top;
  z-index: 0;
  pointer-events: none;
}

.tile--v2 > * {
  position: relative;
  z-index: 1;
}

.tile--v2:hover,
.tile--v2.tile--selected {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px var(--lime), 0 0 30px rgba(203,240,120,0.35), 0 16px 48px rgba(0,0,0,0.6);
  transform: translateY(-4px);
  z-index: 20;
}

.tile--v2.tile--clickable { cursor: pointer; }

/* ── Бейдж квалификации — золотой правый верхний угол ── */
.tile-v2__qual-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: #fffde0;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.tile--v2.tile--purple-glow .tile-v2__qual-badge {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
}

/* ── Аватар — ЛАЙМ-КРУЖОК с тёмными инициалами ── */
.tile-v2__avatar-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}

.tile-v2__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--lime); /* #cbf078 лайм-зелёный */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(203,240,120,0.25), 0 8px 24px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.tile-v2__initials {
  font-size: 26px;
  font-weight: 900;
  color: #111219; /* тёмный на лайме как на мокапе */
  line-height: 1;
  letter-spacing: -0.5px;
}

/* ── Тело: имя крупно, ID мелко, наставник-пилюля ── */
.tile-v2__body {
  padding: 6px 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.tile-v2__name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.tile-v2__id {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

/* Наставник — пилюля как на мокапе */
.tile-v2__mentor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Метрики ЛО / ГО — как на мокапе ── */
.tile-v2__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 14px;
  margin-top: auto;
}

.tile-v2__metric {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.tile-v2__metric-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #111219;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tile-v2__metric-value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}


/* ═════════════════════════════════════════════
   TILE ROOT — Увеличенная ширина для карточки наставника
═════════════════════════════════════════════ */
.tile--root {
  width: 280px !important;
}

.tile-root__acc-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.tile-root__acc-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 3px;
}

.tile-root__account--money .tile-root__acc-label { color: rgba(74,222,128,0.8); }
.tile-root__account--gift  .tile-root__acc-label { color: rgba(251,191,36,0.8); }

.tile-root__acc-value {
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tile-root__account--money .tile-root__acc-value { color: #4ade80; }
.tile-root__account--gift  .tile-root__acc-value { color: #fbbf24; }

/* Метрики ЛО / ГО — так же как tile-v2 */
.tile-root__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 14px;
}

.tile-root__metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Кнопка "Избранное" */
.tile-v2__fav-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.2;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 5;
  color: #fff;
  padding: 0;
  line-height: 1;
}

.tile-v2__fav-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.tile-v2__fav-btn--active {
  opacity: 1;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Лайм-пилюля ЛО / ГО */
.tile-root__metric-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #111219;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

/* Огромная цифра */
.tile-root__metric-value {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Override app.js default layout for tiles */
.tile__name-row,
.tile__status,
.tile__city,
.tile__metrics {
  display: none;
}

.pyramid__more {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: 16px 0;
}

/* PARTNER STRUCTURE HEADER */
.partner-structure {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 32px;
  overflow: hidden;
}

.partner-structure__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.action-icon {
  display: none;
}

.partner-structure__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.partner-structure__depth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #111219;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.partner-structure__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.partner-structure__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Movements Modal List */
.movements-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.movement-item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.movement-item:last-child {
  border-bottom: none;
}

.movement-item__date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.movement-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.movement-item__path {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.movement-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
.movement-badge--alert {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.hidden {
  display: none !important;
}

/* ПАНЕЛЬ КВАЛИФИКАЦИИ И НАСТАВНИК */

.hidden {
  display: none !important;
}

/* ПАНЕЛЬ КВАЛИФИКАЦИИ И НАСТАВНИК */
.mentor-slot {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.qual-panel {
  width: 360px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.qual-panel__title-block {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.qual-panel__label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.qual-panel__next,
.qual-panel__current {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.qual-panel__current-note,
.qual-panel__done {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.qual-panel__bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qual-panel__bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.qual-panel__bar-title {
  color: var(--text);
}

.qual-panel__bar-value {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.qual-panel__track {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 60px;
  overflow: hidden;
}

.qual-panel__fill {
  height: 100%;
  background: var(--lime);
  transition: width 0.4s ease;
  box-shadow: var(--glow-lime);
}

.qual-panel__bar--partner {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 8px;
}



/* ═══════════════════════════════════════════
   REFRESH PROGRESS BAR
═══════════════════════════════════════════ */
.refresh-progress {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.refresh-progress__track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 60px;
  overflow: hidden;
}

.refresh-progress__fill {
  height: 100%;
  background: var(--lime);
  border-radius: 60px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(203, 240, 120, 0.5);
}

/* Анимация для неопределённого прогресса */
.progress--indeterminate .refresh-progress__fill {
  width: 35% !important;
  animation: progress-slide 1.6s ease-in-out infinite;
}

@keyframes progress-slide {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(400%); }
}

.refresh-progress__text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
/* ──────────────────────────────────────────────
   Табличный список новых участников (Grid Table)
   ────────────────────────────────────────────── */
.table-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-header, .list-row {
  display: grid;
  grid-template-columns: 40px 3fr 1fr 1.5fr 2fr 1fr;
  align-items: center;
  gap: 16px;
}

.table-header {
  padding: 0 20px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.list-row {
  padding: 12px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.list-row:hover {
  transform: translateY(-2px);
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
}

.td-avatar {
  display: flex;
  justify-content: center;
}


.list-row__avatar {
  width: 40px;
  height: 40px;
  background: var(--lime);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111219;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(203, 240, 120, 0.3);
}

.td-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-id {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.td-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.td-mentor {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-level {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 992px) {
  .table-header {
    display: none;
  }
  .list-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas: 
      "avatar name"
      "avatar id"
      "avatar status"
      "avatar mentor"
      "avatar level";
    gap: 8px 16px;
  }
  .td-avatar { grid-area: avatar; align-self: flex-start; }
  .td-name { grid-area: name; }
  .td-id { grid-area: id; }
  .td-status { grid-area: status; }
  .td-mentor { grid-area: mentor; }
  .td-level { grid-area: level; }
}


/* MOBILE ADAPTATION */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 60px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
}
.mobile-header__brand img {
  height: 24px;
}
.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
}
.sidebar-overlay {
  display: none;
}

@media (max-width: 992px) {
  .mobile-header {
    display: flex;
  }
  
  .app {
    display: block;
  }
  
  .main-content {
    padding-top: 80px; /* 60px header + 20px padding */
    padding-left: 16px;
    padding-right: 16px;
    height: auto;
    overflow-y: visible;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    background-color: var(--surface);
  }
  
  .sidebar.sidebar--open {
    transform: translateX(280px);
  }
  
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 950;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .sidebar-overlay.sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Stats (Fit in one row) */
  .stats {
    display: flex;
    flex-direction: row;
    gap: 8px;
    /* Разрешаем скролл, если экран слишком узкий */
    overflow-x: auto;
    padding-bottom: 4px;
  }
  
  .stat-card {
    min-width: 0;
    padding: 10px 8px;
    gap: 6px;
    flex: 1;
    border-radius: 12px;
  }
  
  .stat-label {
    font-size: 9px;
    padding: 2px 6px;
    white-space: normal;
    text-align: center;
    line-height: 1.1;
    width: min-content;
    margin: 0 auto;
  }
  
  .stat-value {
    font-size: 18px;
    justify-content: center;
  }
  
  /* Controls */
  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .controls-left, .controls-right {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .search-box {
    width: 100%;
    max-width: none;
  }
  .search-box input {
    width: 100%;
  }
  
  .toolbar__actions {
    justify-content: center;
  }
  
  /* Cards Grid */
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  /* Compact non-root cards */
  .tile--v2:not(.tile--root) {
    min-height: 120px;
  }
  .tile--v2:not(.tile--root) .tile-v2__avatar-wrap:not(.has-avatar) {
    display: none;
  }
  .tile--v2:not(.tile--root) .tile-v2__body {
    padding-top: 24px;
  }
  .tile--v2:not(.tile--root) .tile-v2__name {
    padding: 0 32px;
    word-break: break-word;
  }
  
  /* Icon buttons for mobile */
  .action-text {
    display: none;
  }
  .action-icon {
    display: block;
  }
  .action-icon-btn {
    width: 44px;
    height: 44px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff;
  }
}
