@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 var(--bg-glass-5);
  --glow-lime: 0 0 20px rgba(203, 240, 120, 0.25);

  --text-bright: #ffffff;
  --surface-glass: rgba(20, 20, 25, 0.4);
  --border-light: rgba(255, 255, 255, 0.08);
  --bg-glass-1: rgba(255, 255, 255, 0.1);
  --bg-glass-2: rgba(255, 255, 255, 0.2);
  --bg-glass-3: rgba(255, 255, 255, 0.03);
  --bg-glass-4: rgba(255, 255, 255, 0.05);
  --bg-glass-5: rgba(0, 0, 0, 0.3);
  --text-glass-1: rgba(255, 255, 255, 0.6);
  --text-glass-2: rgba(255, 255, 255, 0.5);
  --text-glass-3: rgba(255, 255, 255, 0.4);
  --text-glass-4: rgba(255, 255, 255, 0.45);
  --text-glass-5: rgba(255, 255, 255, 0.2);
  --dropdown-bg: #2a2a2a;
  --modal-bg: #141419;
  --text-shadow-strong: 0 1px 8px rgba(0, 0, 0, 0.9);
  --text-shadow-light: 0 1px 4px rgba(0, 0, 0, 0.5);
  --card-bg: rgba(20, 20, 25, 0.6);
  --card-bg-hover: rgba(30, 30, 38, 0.8);
  --card-detail-bg: rgba(15, 15, 20, 0.4);
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 80px;

  --tile-overlay-color: 15, 17, 23;
  --tile-text: #ffffff;
  --tile-text-muted: rgba(255, 255, 255, 0.65);
  --tile-metric-bg: rgba(0, 0, 0, 0.55);

  --kanban-card-w: 280px;
  --tile-size: 260px;
  --tile-size-root: 260px;
  --mobile-gutter: 16px;
  --mobile-page-gap: 16px;
  --mobile-safe-top: env(safe-area-inset-top, 0px);
  --mobile-safe-left: env(safe-area-inset-left, 0px);
  --mobile-safe-right: env(safe-area-inset-right, 0px);
  --mobile-header-height: 50px;
  --mobile-page-inline: calc(var(--mobile-gutter) + var(--mobile-safe-left));
  --mobile-page-inline-end: calc(var(--mobile-gutter) + var(--mobile-safe-right));
  --mobile-page-top: calc(var(--mobile-header-height) + var(--mobile-safe-top) + 14px);
  --tap-size: 44px;
  --button-size: 24px;
  --mobile-button-size: 36px;
  --desktop-control-size: 40px;
  --icon-control-size: var(--button-size);
  --icon-control-radius: 10px;
  --modal-close-size: var(--desktop-control-size);
  --structure-view-btn-size: var(--desktop-control-size);
  --kanban-scroll-btn-size: var(--mobile-button-size);
  --scrollbar-thumb: rgba(203, 240, 120, 0.32);
  --scrollbar-thumb-hover: rgba(203, 240, 120, 0.56);
  --scrollbar-track: transparent;
}

[data-theme="light"] {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --lime: #b8e05f;
  --lime-hover: #e5fb9e;
  --purple: #f555a8;
  --text: #252526;
  --text-muted: rgba(37, 37, 38, 0.6);
  --success: #16a34a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --glow-lime: 0 0 20px rgba(132, 204, 22, 0.25);

  --tile-overlay-color: 255, 255, 255;
  --tile-text: #252526;
  --tile-text-muted: rgba(37, 37, 38, 0.7);
  --tile-metric-bg: rgba(255, 255, 255, 0.75);

  --text-bright: #252526;
  --surface-glass: rgba(255, 255, 255, 0.8);
  --border-light: rgba(0, 0, 0, 0.08);
  --bg-glass-1: rgba(0, 0, 0, 0.05);
  --bg-glass-2: rgba(0, 0, 0, 0.1);
  --bg-glass-3: rgba(0, 0, 0, 0.02);
  --bg-glass-4: rgba(0, 0, 0, 0.03);
  --bg-glass-5: #ffffff;
  --text-glass-1: rgba(37, 37, 38, 0.7);
  --text-glass-2: rgba(37, 37, 38, 0.6);
  --text-glass-3: rgba(37, 37, 38, 0.5);
  --text-glass-4: rgba(37, 37, 38, 0.55);
  --text-glass-5: rgba(37, 37, 38, 0.3);
  --dropdown-bg: #ffffff;
  --modal-bg: #ffffff;
  --text-shadow-strong: none;
  --text-shadow-light: none;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-bg-hover: rgba(255, 255, 255, 1);
  --card-detail-bg: rgba(255, 255, 255, 0.6);
  --badge-lime-text: #4d7c0f;
  --danger-text: #dc2626;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  overflow-y: scroll;
}

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

html,
.modal-scroll-body,
.events-detail,
.event-bottom-sheet__content,
.kanban-board {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

html::-webkit-scrollbar,
.modal-scroll-body::-webkit-scrollbar,
.events-detail::-webkit-scrollbar,
.event-bottom-sheet__content::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html::-webkit-scrollbar-track,
.modal-scroll-body::-webkit-scrollbar-track,
.events-detail::-webkit-scrollbar-track,
.event-bottom-sheet__content::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

html::-webkit-scrollbar-thumb,
.modal-scroll-body::-webkit-scrollbar-thumb,
.events-detail::-webkit-scrollbar-thumb,
.event-bottom-sheet__content::-webkit-scrollbar-thumb,
.kanban-board::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
.modal-scroll-body::-webkit-scrollbar-thumb:hover,
.events-detail::-webkit-scrollbar-thumb:hover,
.event-bottom-sheet__content::-webkit-scrollbar-thumb:hover,
.kanban-board::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

/* ═══════════════════════════════════════════
   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: var(--modal-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 8px 48px var(--bg-glass-5);
}

.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,
.qual-panel__bars,
.qualification-stats-shell,
.mentor-assistant-shell {
  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: var(--text-glass-4);
}

.input-group input {
  background: var(--bg-glass-5);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-bright);
  font-weight: 600;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

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

.login-hint {
  max-width: 250px;
  margin: 24px auto 0;
  color: var(--text-glass-3);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.login-shared-device {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 9px;
  min-height: 44px;
  margin: -6px 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.login-shared-device input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--lime);
}

.initial-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.initial-loader__spinner {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border: 3px solid rgba(203, 240, 120, 0.1);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.initial-loader__title {
  max-width: min(320px, calc(100vw - 40px));
  color: var(--text-bright);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.initial-loader__message {
  max-width: min(340px, calc(100vw - 40px));
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.initial-loader__retry {
  min-height: var(--button-size);
  margin-top: 18px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: #111219;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn--login {
  width: 100%;
  padding: 15px;
  background: var(--lime);
  color: #000;
  border: none;
  border-radius: 10px;
  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-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;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

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

.sidebar::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: -1;
}

.sidebar__brand {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  margin: 0 0 28px 0;
  padding: 0;
  flex-shrink: 0;
}

.sidebar__brand img {
  width: 130px;
}

.sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.sidebar__profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-bottom: 20px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.sidebar__profile-main {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
}

.sidebar__avatar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.profile-avatar-edit-icon {
  position: absolute;
  right: -4px;
  bottom: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #111219;
  cursor: pointer;
}

.sidebar-qual-badge {
  display: none;
  padding: 2px 8px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-glass-2);
  color: var(--text-bright);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.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;
  box-shadow: 0 0 0 2px var(--bg-glass-1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px 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;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-icon {
  display: flex;
  align-items: center;
  color: var(--lime);
  cursor: pointer;
}

.profile-period {
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--lime);
  color: #111219;
  font-size: 10px;
  font-weight: 800;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.sidebar__nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
  background: var(--bg-glass-1);
  border-radius: 2px;
}

.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-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--text-muted);
}

.sidebar__footer {
  flex-shrink: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar__footer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

@media (min-width: 993px) {
  .sidebar,
  .sidebar::before {
    transition: width 0.2s ease, padding 0.2s ease;
  }

  .sidebar-collapse-btn {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-w) - 13px);
    z-index: 1001;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    box-shadow: 0 3px 10px var(--bg-glass-5);
    transform: translateY(-50%);
  }

  .sidebar-collapse-btn:hover {
    border-color: var(--lime);
    color: var(--lime);
    background: var(--surface-2);
  }

  html.sidebar-compact .sidebar {
    width: var(--sidebar-w-collapsed);
    padding: 16px 12px 14px;
  }

  html.sidebar-compact .sidebar::before {
    width: var(--sidebar-w-collapsed);
  }

  html.sidebar-compact .sidebar__brand {
    height: 0;
    min-height: 0;
    margin: 0;
    overflow: visible;
  }

  html.sidebar-compact .sidebar__brand > a,
  html.sidebar-compact .profile-info,
  html.sidebar-compact .profile-avatar-edit-icon,
  html.sidebar-compact .admin-icon,
  html.sidebar-compact .sidebar__footer .meta {
    display: none !important;
  }

  html.sidebar-compact .sidebar-collapse-btn {
    left: calc(var(--sidebar-w-collapsed) - 13px);
    transform: translateY(-50%) rotate(180deg);
  }

  html.sidebar-compact .sidebar__profile,
  html.sidebar-compact .sidebar__profile-main {
    justify-content: center;
  }

  html.sidebar-compact .sidebar__profile {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  html.sidebar-compact .sidebar__profile-main {
    flex: 0 0 auto;
  }

  html.sidebar-compact .sidebar-qual-badge {
    display: block !important;
    max-width: 56px;
    padding-inline: 5px;
  }

  html.sidebar-compact .sidebar__nav {
    align-items: center;
    gap: 8px;
  }

  html.sidebar-compact .nav-item {
    width: var(--mobile-button-size);
    min-height: var(--mobile-button-size);
    padding: 0;
    justify-content: center;
    gap: 0;
    font-size: 0;
  }

  html.sidebar-compact .nav-icon {
    width: 20px;
  }

  html.sidebar-compact .sidebar__footer {
    align-items: center;
    padding-top: 12px;
  }

  html.sidebar-compact .sidebar__footer-actions {
    width: auto;
    flex-direction: column;
    align-items: center;
  }

  html.sidebar-compact #logoutBtn {
    width: var(--desktop-control-size);
    min-width: var(--desktop-control-size);
    height: var(--desktop-control-size);
    min-height: var(--desktop-control-size);
    flex: 0 0 var(--desktop-control-size);
    padding: 0;
    gap: 0;
    font-size: 0;
  }

  html.sidebar-compact #logoutBtn svg {
    width: 16px;
    height: 16px;
  }

  html.sidebar-compact #funnelBoard {
    gap: 16px;
  }

  html.sidebar-compact #funnelBoard .kanban-col {
    flex: 1 1 0;
    min-width: 250px;
    padding: 14px;
  }

  html.sidebar-compact #funnelBoard .kanban-col__header {
    margin-bottom: 12px;
  }

  html.sidebar-compact #funnelBoard .kanban-col__cards {
    gap: 10px;
    margin-bottom: 12px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--button-size);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--control {
  min-height: var(--desktop-control-size);
}

.btn--control.icon-control {
  width: var(--desktop-control-size);
  min-width: var(--desktop-control-size);
  height: var(--desktop-control-size);
}

.btn:hover {
  background: var(--bg-glass-4);
  border-color: var(--text-glass-5);
}

.icon-control {
  width: var(--icon-control-size);
  min-width: var(--icon-control-size);
  height: var(--icon-control-size);
  min-height: var(--icon-control-size);
  padding: 0;
  border-radius: var(--icon-control-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.icon-control--control {
  --icon-control-size: var(--desktop-control-size);
}

.icon-control svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

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

.btn--primary:hover,
.btn--secondary:hover {
  background: var(--lime-hover);
}

.btn--danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn--telegram {
  border-color: #2aabee;
  background: #2aabee;
  color: #fff;
}

.btn--telegram:hover {
  border-color: #229edc;
  background: #229edc;
}

.btn--logout {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border-light);
  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;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 30px;
  overflow-x: hidden;
  min-width: 0;
}

.view-shell {
  max-width: 1400px;
  margin: 0 auto;
}

.empty-state {
  padding: 40px;
  color: var(--text-muted);
  text-align: center;
}

.activity-view {
  max-width: none;
  padding: 10px 32px 32px;
}

.activity-back-btn {
  margin-bottom: 16px;
}

.activity-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.activity-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.activity-heading .activity-title {
  margin-bottom: 0;
}

.activity-note {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.settings-card {
  max-width: 800px;
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-glass-3);
}

.settings-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 500;
}

.settings-card__text {
  margin: 0;
  color: var(--text-glass-1);
  font-size: 14px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.settings-card--security {
  margin-top: 16px;
}

.settings-actions--security {
  flex-wrap: wrap;
}

.telegram-settings {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.telegram-settings__title {
  margin-bottom: 12px;
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 600;
}

.telegram-settings__list,
.modal-button-stack,
.mobile-today-hub__body,
.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.telegram-settings__option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.telegram-settings__checkbox {
  width: 18px;
  height: 18px;
  accent-color: #2aabee;
}

.telegram-settings__label {
  color: var(--text-glass-1);
  font-size: 14px;
}

.btn__label {
  font-size: 14px;
}

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

.structure-toolbar {
  display: grid;
  grid-template-columns: max-content auto minmax(220px, 1fr);
  grid-template-areas: "filters view search";
  align-items: center;
  gap: 12px;
}

.structure-filter-list {
  grid-area: filters;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.structure-filter-list::-webkit-scrollbar {
  display: none;
}

.structure-toolbar__search {
  grid-area: search;
  min-width: 0;
  position: relative;
  width: 100%;
}

.structure-view-switch {
  grid-area: view;
  display: inline-flex;
  gap: 6px;
}

.structure-view-switch__btn {
  width: var(--structure-view-btn-size);
  min-width: var(--structure-view-btn-size);
  height: var(--structure-view-btn-size);
  min-height: var(--structure-view-btn-size);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}

.structure-view-switch__btn:hover {
  color: var(--text);
  background: var(--bg-glass-3);
}

.structure-view-switch__btn.active {
  color: #111219;
  background: var(--lime);
  box-shadow: 0 8px 20px rgba(203, 240, 120, 0.22);
}

#addLeadBtn,
#addTaskBtn {
  margin: 0;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

@media (min-width: 993px) {
  .main-content {
    padding: 28px 30px;
  }

  .page-section-header {
    min-height: var(--desktop-control-size);
  }

  .tasks-page-title {
    margin: 0;
    gap: 10px;
    font-size: 28px;
    line-height: 1.15;
  }

  .tasks-page-title svg {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
  }

  .tabs-nav,
  .crm-primary-nav,
  .admin-tabs {
    margin-bottom: 22px !important;
  }

  .top-controls,
  .task-scope-nav,
  .events-tags-container {
    margin-bottom: 18px;
  }

  .notif-btn {
    width: var(--desktop-control-size);
    min-width: var(--desktop-control-size);
    height: var(--desktop-control-size);
    min-height: var(--desktop-control-size);
    padding: 0;
  }

}

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

.structure-search {
  width: 100%;
  height: var(--desktop-control-size);
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 16px 0 44px;
  font-family: inherit;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

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

.filter-chip,
.filter-chip-2 {
  min-height: var(--desktop-control-size);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}

.filter-chip:hover {
  border-color: var(--text-glass-5);
  color: var(--text);
}

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

.filter-chip-2 {
  justify-content: center;
  border: 1px solid #414148;
  background: #28282b;
  color: #f8fafc;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.filter-chip-2:hover {
  border-color: #5a5a63;
  background: #333338;
  color: #fff;
}

.filter-chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--bg-glass-4);
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.filter-chip.active .filter-chip__count {
  background: rgba(17, 18, 25, 0.16);
  color: #111219;
}

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

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

.stat-card:hover {
  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: 10px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  width: max-content;
}

.stat-value {
  font-size: 25px;
  font-weight: 900;
  color: var(--text-bright);
  text-shadow: var(--text-shadow-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-heading__count {
  display: inline-flex;
  align-items: center;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--lime);
  text-shadow: var(--text-shadow-light);
  font-variant-numeric: tabular-nums;
}

.qualification-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 12px;
  width: 100%;
  margin: -6px 0 20px;
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}

.qualification-summary::-webkit-scrollbar {
  display: none;
}

.qualification-summary__meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--desktop-control-size);
  min-width: 88px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.qualification-summary__meta span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 850;
}

.qualification-summary__meta strong {
  color: var(--lime);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.qualification-summary__chips {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.qualification-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--desktop-control-size);
  min-width: 72px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-bright);
  white-space: nowrap;
}

.qualification-chip__code {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.qualification-chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--bg-glass-4);
  border: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--lime);
  line-height: 1;
}

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

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

.branch-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.branch-list--empty {
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.branch-list__head,
.branch-list__row {
  display: grid;
  grid-template-columns: 34px minmax(260px, 1.7fr) 76px minmax(86px, 0.6fr) minmax(96px, 0.7fr) minmax(98px, 0.6fr);
  align-items: center;
  gap: 12px;
}

.branch-list__head {
  padding: 0 16px 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.branch-list__row {
  min-height: 58px;
  padding: 10px 16px 10px calc(16px + var(--branch-indent, 0px));
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(203, 240, 120, 0.08), transparent 34%),
    var(--surface-2);
  box-shadow: var(--shadow);
}

.branch-list__row:hover {
  border-color: rgba(203, 240, 120, 0.36);
  transform: translateY(-1px);
}

.branch-list__row--context {
  border-style: dashed;
  border-color: var(--bg-glass-2);
  background: var(--bg-glass-3);
  box-shadow: none;
  opacity: 0.72;
}

.branch-list__toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass-3);
  color: var(--text);
  cursor: pointer;
}

.branch-list__toggle:hover {
  border-color: rgba(203, 240, 120, 0.45);
  color: var(--lime);
}

.branch-list__toggle--empty {
  opacity: 0;
  cursor: default;
}

.branch-list__person {
  min-width: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.branch-list__name {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-list__name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-list__status-qualification {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--lime);
  filter: drop-shadow(0 0 5px rgba(203, 240, 120, 0.34));
}

.branch-list__status-qualification .status-qualification-icon {
  width: 15px;
  height: 15px;
}

.branch-list__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.branch-list__level {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: var(--bg-glass-4);
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.branch-list__qual {
  width: fit-content;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(203, 240, 120, 0.14);
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.branch-list__metrics {
  display: contents;
}

.branch-list__metric {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.branch-list__metric span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.branch-list__metric strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.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__cards {
  display: flex;
  justify-content: center;
  gap: 32px;
  row-gap: 48px;
  position: relative;
  flex-wrap: wrap;
}

.level-row__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.level-row__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.level-row__count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bg-glass-4);
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.level-row__toggle {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
}

.pyramid-row-toggle {
  width: min(100%, 300px);
}

.partner-structure__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.partner-structure__close {
  flex: 0 0 auto;
}

/* 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;
}

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

.tile:active {
  transform: scale(0.98);
}

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

/* ═══════════════════════════════════════════
   TILE V2 — Дизайн как на мокапе
   Скруглённые углы, фон=qual image, лайм аватар
═══════════════════════════════════════════ */
.tile--v2 {
  width: var(--tile-size);
  flex: 0 0 var(--tile-size);
  --tile-bg-image: url('/static/img/part.png');
  --tile-bg-height: 520px;
  box-sizing: border-box;
  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 var(--border-light);
  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-image:
    linear-gradient(180deg, rgba(var(--tile-overlay-color), 0.15) 0%, rgba(var(--tile-overlay-color), 0.55) 55%, rgba(var(--tile-overlay-color), 0.90) 100%),
    var(--tile-bg-image);
  background-size: 100% 100%, auto var(--tile-bg-height);
  background-position: center top, center top;
  background-repeat: no-repeat, no-repeat;
  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: var(--text-bright);
}

.tile-v2__status-qualification {
  position: absolute;
  top: 42px;
  right: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--lime) 62%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-1) 84%, transparent);
  color: var(--lime);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 12px rgba(203, 240, 120, 0.14);
  z-index: 5;
}

.tile-v2__status-qualification .status-qualification-icon {
  width: 14px;
  height: 14px;
}

/* ── Аватар — ЛАЙМ-КРУЖОК с тёмными инициалами ── */
.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__avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tile-v2__initials {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  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 {
  display: -webkit-box;
  min-height: 43px;
  overflow: hidden;
  font-size: 17px;
  font-weight: 800;
  color: var(--tile-text);
  text-shadow: var(--text-shadow-strong);
  line-height: 1.25;
  letter-spacing: -0.2px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

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

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

#partnerDetailModal .modal-content {
  scrollbar-width: thin;
}

.partner-detail-modal {
  background: rgba(0, 0, 0, 0.62) !important;
}

.partner-detail-modal__content {
  width: 400px;
  max-width: 95%;
  max-height: calc(100vh - 32px);
  padding: 20px 24px;
  position: relative;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  box-sizing: border-box;
}

.partner-detail-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.partner-detail-modal__header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-right: 42px;
  margin-bottom: 16px;
}

.partner-detail-modal__avatar {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-glass-1);
  background-size: cover;
  background-position: center;
  color: var(--text);
  font-size: 20px;
}

.partner-detail-modal__avatar--fallback {
  background: var(--lime);
  border: 1px solid color-mix(in srgb, var(--lime) 75%, transparent);
  box-shadow: 0 0 0 3px rgba(203, 240, 120, 0.16), 0 4px 12px rgba(203, 240, 120, 0.2);
  color: #111219;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.partner-detail-modal__identity {
  min-width: 0;
}

.partner-detail-modal__name {
  color: var(--text-bright);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.partner-detail-modal__subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-glass-1);
  font-size: 12px;
}

.partner-detail-modal__status-qualification {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--lime) 42%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--lime) 9%, transparent);
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
}

.partner-detail-modal__status-qualification .status-qualification-icon {
  width: 16px;
  height: 16px;
}

.partner-detail-modal__id {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-glass-1);
  color: var(--text-glass-1);
  font-variant-numeric: tabular-nums;
}

.partner-detail-modal__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.partner-detail-modal__metric,
.partner-detail-modal__details {
  border: 1px solid var(--bg-glass-4);
  border-radius: 12px;
  background: var(--bg-glass-3);
}

.partner-detail-modal__metric {
  min-height: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.partner-detail-modal__metric > div,
.partner-detail-modal__row > span,
.partner-detail-modal__links-label {
  color: var(--text-glass-2);
  font-size: 12px;
  font-weight: 400;
}

.partner-detail-modal__metric strong {
  color: var(--text-bright);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.partner-detail-modal__metric--lime {
  color: var(--lime) !important;
}

.partner-detail-modal__details {
  margin-bottom: 16px;
  padding: 12px 16px;
}

.partner-detail-modal__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 0;
  margin-bottom: 10px;
  border-bottom: 0;
}

.partner-detail-modal__row strong,
.partner-detail-modal__registration {
  min-width: 0;
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.partner-detail-modal__phone {
  min-width: 0;
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.partner-detail-modal__phone[href] {
  color: var(--lime);
}

.partner-detail-modal__phone[href]:hover {
  text-decoration: underline;
}

.partner-detail-modal__registration {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.partner-detail-modal__registration small {
  color: var(--lime);
  font-size: 11px;
  font-weight: 400;
}

.partner-detail-modal__links {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
}

.partner-detail-modal__ref-actions {
  display: flex;
  gap: 6px;
}

.partner-gender-icon {
  display: inline-block;
  margin-bottom: 2px;
  margin-left: 6px;
  vertical-align: middle;
}

.partner-detail-modal__ref-actions .partner-detail-modal__ref-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 14px;
}

.partner-detail-modal__ref-actions .partner-detail-modal__ref-btn:hover {
  border-color: var(--text-glass-5);
  background: var(--bg-glass-2);
  color: var(--text-bright);
}

.partner-detail-modal__actions {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.partner-detail-modal__action-btn,
.partner-detail-modal__structure-btn {
  width: 100%;
  min-height: var(--desktop-control-size);
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#modalPartnerName,
#modalPartnerMentor,
#modalPartnerCity,
#modalPartnerPhone,
#modalPartnerEmail {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tile-v2__id {
  font-size: 11px;
  color: var(--text-glass-4);
  font-weight: 500;
}

/* Наставник — пилюля как на мокапе */
.tile-v2__mentor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--tile-text-muted);
  font-weight: 500;
  background: var(--tile-metric-bg);
  backdrop-filter: blur(6px);
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  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: var(--tile-metric-bg);
  border: 1px solid var(--border-light);
  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__account-refresh {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: var(--lime);
  cursor: pointer;
}

.tile-v2__account-refresh:hover {
  background: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .tile-v2__account-refresh {
  background: rgba(17, 18, 25, 0.1);
  color: #111219;
}

[data-theme="light"] .tile-v2__account-refresh:hover {
  background: rgba(17, 18, 25, 0.2);
}

.tile-v2__accounts-status {
  min-height: 22px;
  margin: -6px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--tile-text-muted);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.tile-v2__accounts-status > span {
  min-width: 0;
}

.tile-v2__accounts-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.account-refresh-modal {
  width: min(380px, calc(100vw - 32px));
  padding: 24px;
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.account-refresh-modal h3 {
  margin: 0 40px 6px 0;
  color: var(--text-bright);
  font-size: 18px;
}

.account-refresh-modal p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.account-refresh-modal label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.account-refresh-modal input {
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}

.account-refresh-modal__close,
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: var(--modal-close-size);
  height: var(--modal-close-size);
  min-width: var(--modal-close-size);
  padding: 0;
}

.account-refresh-modal__close {
  border-radius: 50%;
}

.modal-close-btn {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass-3);
  color: var(--text-muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-bright);
  background: var(--bg-glass-4);
}

.modal-backdrop--standard,
.modal-backdrop--plain,
.modal-backdrop--crop,
.modal-backdrop--soft,
.modal-backdrop--calendar-detail,
.modal-backdrop--confirm {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop--standard {
  z-index: 2000;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.modal-backdrop--plain {
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
}

.modal-backdrop--crop {
  z-index: 2050;
  background: rgba(0, 0, 0, 0.8);
}

.modal-backdrop--soft {
  z-index: 1050;
  background: rgba(0, 0, 0, 0.7);
}

.crm-modal-card {
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--modal-bg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
}

.modal-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-info-section,
.modal-grid-2col--spaced,
.modal-field-group--spaced {
  margin-bottom: 24px;
}

.modal-info-label {
  margin-bottom: 8px;
  color: var(--text-glass-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.modal-info-value {
  color: var(--text-bright);
  font-size: 15px;
  line-height: 1.6;
}

.modal-info-value--small {
  font-size: 14px;
  line-height: 1.4;
}

.modal-info-value--prewrap {
  font-family: inherit;
  white-space: pre-wrap;
}

.modal-info-value--column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-grid-span-2 {
  grid-column: span 2;
}

.modal-field-group {
  margin-bottom: 16px;
}

.modal-field-group--hidden {
  display: none;
}

.modal-action-btn {
  padding: 10px 20px;
  border-radius: 10px;
}

.modal-action-btn--primary {
  padding-inline: 24px;
  font-weight: 600;
}

.modal-action-btn--wide {
  padding: 12px 24px;
}

.avatar-action-card,
.crop-action-card {
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--modal-bg);
  text-align: center;
}

.avatar-action-card {
  width: 300px;
  max-width: 90%;
}

.modal-card-title {
  margin-top: 0;
  margin-bottom: 20px;
  font-weight: 500;
}

.modal-card-title--compact {
  margin-bottom: 16px;
}

.modal-button-row,
.modal-actions-end,
.confirm-modal-actions,
.modal-action-footer {
  display: flex;
  gap: 12px;
}

.modal-button-full,
.modal-button-flex {
  padding: 12px;
  border-radius: 12px;
}

.modal-button-full {
  width: 100%;
}

.modal-button-flex {
  flex: 1;
}

.modal-button-offset {
  margin-top: 8px;
}

.modal-button-danger-soft {
  border: 1px solid rgba(255, 59, 48, 0.2);
  background: rgba(255, 59, 48, 0.1);
  color: #ff453a;
}

.file-input-hidden {
  display: none;
}

.crop-action-card {
  width: 400px;
  max-width: 95%;
}

.crop-frame {
  position: relative;
  width: 100%;
  height: 300px;
  margin-bottom: 20px;
  background: #000;
}

.crop-image {
  display: block;
  max-width: 100%;
}

.modal-choice-card,
.goal-modal-card,
.confirm-modal-card {
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--modal-bg);
  backdrop-filter: blur(20px);
}

.modal-choice-card {
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.modal-choice-title {
  margin-bottom: 20px;
}

.modal-backdrop--calendar-detail {
  z-index: 2100;
  padding: 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
}

.modal-backdrop--confirm {
  z-index: 9999;
}

.cal-event-detail-modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  background: var(--modal-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
}

.cal-event-detail-modal__header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-light);
}

.cal-event-detail-modal__type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-event-detail-modal__dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--lime);
}

.cal-event-detail-modal__label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cal-event-detail-modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
  scrollbar-width: thin;
}

.cal-event-detail-modal__footer {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
}

.goal-modal-card {
  width: 100%;
  max-width: 400px;
}

.goal-modal-title {
  margin-top: 0;
  margin-bottom: 20px;
}

.goal-modal-title--icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-field {
  margin-bottom: 12px;
}

.goal-field--spaced {
  margin-bottom: 20px;
}

.goal-field-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-glass-5);
  color: var(--text-bright);
}

.goal-field-textarea {
  resize: none;
  overflow: hidden;
}

.modal-actions-end {
  justify-content: flex-end;
}

.confirm-modal-card {
  width: 90%;
  max-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.confirm-modal-icon {
  margin-bottom: 16px;
  font-size: 32px;
}

.confirm-modal-text {
  margin-bottom: 24px;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.confirm-modal-actions {
  justify-content: center;
}

.confirm-modal-action {
  flex: 1;
}

.confirm-modal-action--danger {
  border-color: transparent;
  background: var(--red);
  color: white;
}

.modal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--bg-glass-4);
}

.modal-section-header--start {
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.modal-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-bright);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.modal-section-title--large {
  font-size: 22px;
  line-height: 1.3;
}

.modal-icon-close {
  width: var(--modal-close-size);
  min-width: var(--modal-close-size);
  height: var(--modal-close-size);
  min-height: var(--modal-close-size);
  padding: 0;
  border: 0;
  border-radius: var(--icon-control-radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background 0.2s, color 0.2s;
}

.modal-icon-close:hover {
  color: var(--text-bright);
  background: var(--bg-glass-3);
}

.modal-icon-close--soft {
  border-radius: 10px;
  background: var(--bg-glass-3);
}

.modal-icon-close--soft:hover {
  background: var(--bg-glass-4);
}

.modal-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-action-footer {
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-glass-4);
}

.modal-action-footer--compact {
  margin-top: 0;
  padding-top: 15px;
}

.modal-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-glass-1);
  font-size: 13px;
  font-weight: 500;
}

.modal-field-input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-glass-5);
  color: var(--text-bright);
  padding: 12px;
}

.modal-field-input--interactive {
  font-size: 15px;
  transition: all 0.2s;
}

.modal-field-input--date {
  color-scheme: dark;
}

.modal-field-input--textarea {
  font-family: inherit;
  resize: vertical;
}

.modal-field-input--lead-note {
  min-height: 80px;
  font-size: 14px;
  line-height: 1.5;
}

.modal-combobox {
  position: relative;
}

.modal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-chip-row--single {
  flex-wrap: nowrap;
}

.modal-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--dropdown-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.modal-dropdown--top {
  top: 100%;
  margin-top: 4px;
}

.modal-dropdown--bottom {
  top: auto;
  bottom: 100%;
  margin-bottom: 4px;
}

#avatarActionModal .modal-content,
#personalGoalModal .modal-content,
#teamFocusModal .modal-content,
.admin-user-modal__content {
  position: relative;
}

.account-refresh-modal__error {
  margin-bottom: 12px;
  color: var(--danger-text, #f87171);
  font-size: 13px;
}

.account-refresh-modal > .btn--primary {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
}

.tile-v2__metric-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--tile-text);
  text-shadow: var(--text-shadow-light);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tile-v2__metric-value--blurred {
  filter: blur(7px);
  user-select: none;
}


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

/* Кнопка "Избранное" */
.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: var(--text-bright);
  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);
}

.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: var(--bg-glass-5);
}

.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;
  min-height: 66px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: transparent;
}

.movement-item:last-child {
  margin-bottom: 0;
}

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

.movement-item__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.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;
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
}

.movement-badge--alert {
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.movement-badge--family {
  border-color: rgba(184, 224, 95, 0.45);
  color: var(--lime);
}

.movement-list-state,
.home-task-empty {
  padding: 20px;
  color: var(--text-muted);
  text-align: center;
}

.movement-list-state--error,
.family-contract-state--error,
.activity-empty--error {
  color: #ef4444;
}

.family-contract-state {
  padding: 14px;
  color: var(--text-muted);
  text-align: center;
}

.family-contract-card {
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  background: transparent;
}

.family-contract-card:last-child {
  border-bottom: 0;
}

.family-contract-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.family-contract-card__title {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 700;
}

.family-contract-card__meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.family-contract-card__current {
  margin-top: 4px;
  color: var(--text-bright);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.family-contract-card__side {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.family-contract-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.family-contract-card__input {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-glass-3);
  color: var(--text-bright);
}

.family-contract-card__btn {
  min-height: var(--desktop-control-size);
  padding: 0 12px !important;
  border-radius: 10px !important;
}

.family-contract-card__note {
  padding-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.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__bar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

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

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

.qual-panel__bar-hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.qual-panel__track {
  height: 6px;
  background: var(--bg-glass-4);
  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--done .qual-panel__bar-title,
.qual-panel__bar--done .qual-panel__bar-value,
.qual-panel__bar--done .qual-panel__bar-hint {
  color: var(--text-muted);
}

.qual-panel__bar--done .qual-panel__track {
  background: rgba(148, 163, 184, 0.18);
}

.qual-panel__bar--done .qual-panel__fill {
  background: rgba(148, 163, 184, 0.72);
  box-shadow: none;
}

.qual-panel__bar--partner {
  background: var(--bg-glass-3);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 8px;
}



/* ═══════════════════════════════════════════
   REFRESH PROGRESS BAR
═══════════════════════════════════════════ */
.refresh-progress {
  position: relative;
  margin-top: 20px;
  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;
}

/* ──────────────────────────────────────────────
   События структуры за сегодня
   ────────────────────────────────────────────── */
.activity-results {
  display: grid;
  gap: 10px;
  width: 100%;
}

.activity-list {
  display: grid;
  gap: 6px;
}

.activity-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.activity-card__avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #111219;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(203, 240, 120, 0.3);
  font-size: 14px;
  font-weight: 800;
}

.activity-card--activation .activity-card__avatar {
  background: var(--success);
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.25);
}

.activity-card__main {
  min-width: 0;
}

.activity-card__title-row,
.activity-card__side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-card__title-row {
  min-width: 0;
}

.activity-card__name {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card__meta,
.activity-card__mentor {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card__side {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.activity-card__qual,
.activity-card__status {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.activity-card__qual {
  color: var(--lime);
  border-color: color-mix(in srgb, var(--lime) 40%, var(--border));
}

.today-activity-badge {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 5px;
  color: #111219;
  background: var(--lime);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.today-activity-badge--activation {
  background: #34d399;
}

.today-activity-empty {
  padding: 40px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

@media (max-width: 900px) {
  .activity-view {
    padding: 12px 16px 24px;
  }

  .activity-card {
    grid-template-columns: 40px 1fr;
    align-items: start;
  }

  .activity-card__side {
    grid-column: 2;
    justify-content: flex-start;
  }
}


/* MOBILE ADAPTATION */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: var(--mobile-safe-top) calc(14px + var(--mobile-safe-right)) 0 calc(14px + var(--mobile-safe-left));
  height: calc(var(--mobile-header-height) + var(--mobile-safe-top));
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 900;
}

.mobile-header__brand {
  display: flex;
  align-items: center;
}

.mobile-header__brand a {
  display: flex;
  align-items: center;
  min-height: var(--tap-size);
}

.mobile-header__brand img {
  height: 30px;
  display: block;
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
  min-width: var(--tap-size);
  min-height: var(--tap-size);
}

.sidebar-overlay {
  display: none;
}

body.sidebar-lock,
body.modal-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 992px) {
  :root {
    --structure-view-btn-size: var(--mobile-button-size);
  }

  .sidebar-collapse-btn {
    display: none;
  }

  /* ── Мобильный хедер ── */
  .mobile-header {
    display: flex;
  }

  /* ── Layout ── */
  .app {
    display: block;
  }

  .main-content {
    padding-top: var(--mobile-page-top);
    padding-left: var(--mobile-page-inline);
    padding-right: var(--mobile-page-inline-end);
    padding-bottom: 24px;
    min-height: 100vh;
    overflow-x: hidden;
  }

  .main-content > [id^="view"] {
    width: 100%;
  }

  #viewHome,
  #viewTasks,
  #viewStructure,
  #viewEvents,
  #viewAnalytics,
  #viewSettings,
  #viewNewToday {
    padding-inline: 0 !important;
  }

  #viewTasks,
  #viewStructure,
  #viewEvents,
  #viewAnalytics,
  #viewSettings,
  #viewNewToday {
    margin-right: auto !important;
    margin-left: auto !important;
  }

  #viewNewToday {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .tasks-page-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.12;
  }

  .tasks-page-title svg {
    flex: 0 0 auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    background-color: var(--surface);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: calc(24px + var(--mobile-safe-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  /* Убираем псевдо-фон который блокировал экран */
  .sidebar::before {
    display: none;
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    touch-action: none;
    overscroll-behavior: none;
  }

  .sidebar-overlay.sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── Stats ── */
  .stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
    max-width: 100%;
    width: 100%;
  }

  .stats::-webkit-scrollbar {
    display: none;
  }

  .stat-card {
    min-width: 0;
    min-height: 70px;
    padding: 6px 4px;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    display: grid;
    grid-template-rows: minmax(28px, auto) auto;
    align-items: center;
    overflow: hidden;
  }

  .stat-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    min-height: 28px;
    padding: 3px 4px;
    border-radius: 6px;
    background: var(--lime);
    color: #111219;
    font-size: clamp(8px, 2.1vw, 10px);
    font-weight: 900;
    white-space: normal;
    text-align: center;
    line-height: 1.1;
    letter-spacing: 0.1px;
    align-self: stretch;
  }

  .stat-value {
    font-size: clamp(14px, 4.2vw, 18px);
    justify-content: center;
    line-height: 1.1;
    align-self: center;
  }

  .qualification-summary {
    width: 100%;
    margin: -2px 0 14px;
    padding: 4px 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .qualification-summary__meta {
    min-height: var(--tap-size);
    min-width: 88px;
    padding: 0 10px;
    font-size: 14px;
  }

  .qualification-summary__meta span,
  .qualification-summary__meta strong {
    font-size: 13px;
  }

  .qualification-chip {
    min-height: var(--tap-size);
    min-width: 76px;
    padding: 0 9px;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  .qualification-chip__code {
    font-size: 14px;
  }

  .qualification-chip__count {
    min-width: 26px;
    min-height: 26px;
    font-size: 13px;
  }

  .qualification-summary__chips {
    flex: 0 0 auto;
  }

  /* ── Структура ── */
  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .structure-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "view search"
      "filters filters";
    gap: 10px;
  }

  .structure-view-switch {
    width: fit-content;
  }

  .structure-filter-list {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-padding-inline: 12px;
    padding-bottom: 0;
    gap: 6px;
  }

  .structure-filter {
    flex: 0 0 auto;
    min-height: var(--desktop-control-size);
    padding-inline: 12px;
    font-size: 13px;
    scroll-margin-inline: 12px;
  }

  .branch-list {
    gap: 10px;
  }

  .branch-list__head {
    display: none;
  }

  .branch-list__row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px 10px;
    min-height: 112px;
    padding: 12px 12px 14px calc(12px + var(--branch-indent, 0px));
  }

  .branch-list__toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .branch-list__person {
    grid-column: 2 / -1;
    padding-right: 46px;
  }

  .branch-list__name {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
  }

  .branch-list__meta {
    font-size: 12px;
  }

  .branch-list__qual {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .branch-list__metrics {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.045);
  }

  .branch-list__metric {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-left: 0;
    border-left: 0;
  }

  .branch-list__metric span {
    font-size: 9px;
    line-height: 1;
    opacity: 0.78;
  }

  .branch-list__metric strong {
    font-size: 14px;
    font-weight: 750;
    line-height: 1.1;
  }

  .branch-list__metric--team {
    align-items: flex-end;
    text-align: right;
  }

  .tile--v2:not(.tile--root) {
    width: min(100%, var(--tile-size));
    flex-basis: min(100%, var(--tile-size));
    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 24px;
  }

  #partnerDetailModal:not(.hidden) .modal-content {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .tabs-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none;
  }

  /* ── Мероприятия ── */
  .events-page-header {
    flex-direction: column;
  }

  .events-page-actions {
    width: 100%;
    justify-content: space-between;
  }

  .events-list {
    max-height: 400px;
  }

  .hamburger-btn,
  .notif-btn,
  .my-link-btn__icon-btn,
  #addLeadBtn,
  #addTaskBtn {
    width: var(--mobile-button-size) !important;
    min-width: var(--mobile-button-size) !important;
    height: var(--mobile-button-size) !important;
    min-height: var(--mobile-button-size) !important;
    padding: 0 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
  }

  .hamburger-btn {
    margin-left: -10px;
  }

  .my-link-btn__actions {
    gap: 8px;
  }

  .tasks-page-title svg,
  .events-create-btn svg,
  .structure-view-switch__btn svg,
  .my-link-btn__icon-btn svg,
  #addLeadBtn svg,
  #addTaskBtn svg {
    width: 20px;
    height: 20px;
  }

  /* ── Модалки ── */
  .modal-content,
  .event-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden !important;
    border-radius: 20px 20px 0 0 !important;
    margin-top: auto;
  }

  .modal-body {
    overflow-x: hidden;
  }

  /* Модалки — снизу экрана на мобиле по умолчанию */
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* Формы создания и карточки — по центру, как «Новый лид». */
  #teamFocusModal,
  #personalGoalModal,
  #accountRefreshModal,
  #taskViewModal,
  #leadViewModal,
  #taskModal,
  #leadModal,
  #eventModal,
  #adminUserModal {
    align-items: center !important;
    padding: 20px !important;
  }

  #teamFocusModal .modal-content,
  #personalGoalModal .modal-content,
  #accountRefreshModal .modal-content,
  #taskViewModal .modal-content,
  #leadViewModal .modal-content,
  #taskModal .modal-content,
  #leadModal .modal-content,
  #eventModal .modal-content,
  #adminUserModal .modal-content {
    margin: auto !important;
    border-radius: 20px !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* ── Кнопки-иконки ── */
  .action-text {
    display: none;
  }

  .action-icon {
    display: block;
  }

  .action-icon-btn {
    width: var(--mobile-button-size);
    height: var(--mobile-button-size);
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-light) !important;
    color: var(--text-bright);
  }

}

/* ── Очень маленькие экраны (iPhone SE, 375px) ── */
@media (max-width: 430px) {
  :root {
    --mobile-gutter: 12px;
    --mobile-page-gap: 14px;
    --mobile-page-top: calc(var(--mobile-header-height) + var(--mobile-safe-top) + 10px);
  }

  .mobile-header {
    padding: var(--mobile-safe-top) calc(12px + var(--mobile-safe-right)) 0 calc(12px + var(--mobile-safe-left));
  }

}

/* Notifications */
.notif-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notif-btn:hover {
  color: var(--text);
  background: var(--bg-glass-4);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ff453a;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 1;
}

.notif-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  /* Align left edge with the bell so it expands into main content */
  width: 320px;
  background: #1a1d27;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  margin-top: 8px;
  overflow: hidden;
}

.notif-dropdown-body {
  max-height: 350px;
  overflow-y: auto;
}

.notif-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background 0.2s;
}

.notif-item:hover {
  background: var(--bg-glass-3);
}

.notif-item.unread {
  background: rgba(16, 185, 129, 0.05);
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notif-icon.qual_root,
.notif-icon.qual_partner {
  background: rgba(255, 215, 0, 0.1);
}

.notif-icon.registration {
  background: rgba(42, 171, 238, 0.1);
}

.notif-icon.activation {
  background: rgba(16, 185, 129, 0.1);
}

.notif-icon.system {
  background: var(--bg-glass-1);
}

.notif-content {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════
   АНАЛИТИКА — Вариант 1: Pill-group tabs,
   карточки наставника, заголовки рейтинга
═══════════════════════════════════════════ */

/* Группа вкладок */
.tabs-nav {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 4px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-radius: 10px !important;
  width: fit-content !important;
  margin-bottom: 28px !important;
  border-bottom: none !important;
}

.tab-btn {
  min-height: var(--desktop-control-size);
  border-radius: 10px !important;
  padding: 9px 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tab-btn:hover {
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.tab-btn.active {
  background: var(--lime) !important;
  color: #000 !important;
  box-shadow: var(--glow-lime) !important;
  font-weight: 700 !important;
}

.admin-shell {
  max-width: 1280px;
  margin: 0 auto;
}

.admin-header.page-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header__status {
  min-height: var(--desktop-control-size);
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.admin-summary-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.admin-summary-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--lime);
  color: #10130d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.admin-summary-card strong {
  display: block;
  color: var(--text-bright);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.admin-tabs {
  margin-bottom: 18px !important;
}

.admin-panel {
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.admin-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-users-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 420px);
}

.admin-users-search {
  flex: 1 1 260px;
}

.admin-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 800;
}

.admin-panel__title--spaced {
  margin-bottom: 16px;
}

.admin-panel__note {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.admin-sync-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-action-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: transparent;
}

.admin-action-panel--metrics {
  grid-column: 1 / -1;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-sync-btn {
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.admin-metrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 10px;
}

.admin-inline-state {
  color: var(--text-muted);
  font-size: 13px;
}

.admin-inline-state--center {
  padding: 20px;
  text-align: center;
}

.admin-inline-state--grid {
  grid-column: 1 / -1;
  padding: 12px;
}

.admin-inline-state--error {
  color: var(--red);
}

.admin-status-card {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid var(--bg-glass-4);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--text-bright);
  font-size: 13px;
}

.admin-status-card--running {
  background: rgba(59, 130, 246, 0.16);
}

.admin-status-card--error {
  background: rgba(255, 59, 48, 0.14);
}

.admin-status-card--warning {
  border-color: rgba(255, 204, 0, 0.35);
  background: rgba(255, 204, 0, 0.08);
}

.admin-status-card--ok {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
}

.admin-backup-card {
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  background: transparent;
}

.admin-backup-card:last-child {
  border-bottom: 0;
}

.admin-backup-card__title {
  margin-bottom: 12px;
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 700;
}

.admin-backup-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-backup-card__label {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.admin-backup-card__value {
  color: var(--text-bright);
  font-size: 13px;
  white-space: pre-line;
  word-break: break-word;
}

.admin-metric-value {
  min-width: 0;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.admin-metric-value__label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.admin-metric-value__value {
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-muted-placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.admin-section-split {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-glass-4);
}

.admin-section-split--flush {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.admin-stack,
.admin-users-list,
.mentor-focus {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-stack--loose {
  gap: 12px;
}

.admin-small-btn {
  min-height: var(--desktop-control-size);
  padding: 0 12px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

.admin-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-refresh-btn svg {
  flex: 0 0 auto;
}

.admin-add-user-btn {
  min-height: var(--desktop-control-size);
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
}

.admin-select-full {
  width: 100%;
}

.admin-empty-state {
  grid-column: 1 / -1;
  padding: 16px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.admin-empty-state--compact {
  padding: 14px;
}

.admin-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.admin-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: transparent;
}

.admin-card__main {
  min-width: 0;
}

.admin-card__title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-card__id {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-glass-3);
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.admin-card__name {
  min-width: 0;
  color: var(--text-bright);
  font-weight: 800;
}

.admin-card__sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-presence {
  display: inline-flex;
  align-items: center;
  align-self: center;
  color: var(--text-muted);
  font-weight: 700;
}

.admin-presence__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-muted);
  opacity: 0.5;
}

.admin-presence--online {
  color: var(--lime);
}

.admin-presence--online .admin-presence__dot {
  background: var(--lime);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
  opacity: 1;
}

.admin-card__muted {
  opacity: 0.55;
}

.admin-card__status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.admin-last-login {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-subscription {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.admin-subscription--active {
  color: var(--lime);
  background: rgba(34, 197, 94, 0.12);
}

.admin-subscription--expired {
  color: var(--red);
  background: rgba(255, 59, 48, 0.12);
}

.admin-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-badge--white {
  color: var(--lime);
  background: rgba(34, 197, 94, 0.14);
}

.admin-badge--black {
  color: var(--red);
  background: rgba(255, 59, 48, 0.14);
}

.admin-badge--owner {
  color: #111219;
  background: var(--lime);
}

.admin-badge--partner {
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
}

.admin-card__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  justify-content: end;
  margin-top: 0;
}

.admin-card__permissions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bg-glass-4);
}

.admin-card__permissions-title {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-card__permissions--admin {
  margin-top: 10px;
  padding-top: 10px;
}

.admin-card__permissions .admin-permission-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.admin-card__permissions .admin-check:hover {
  color: var(--text-bright);
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-glass-1);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  transition: color 0.2s, opacity 0.2s;
}

.admin-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--lime);
}

.admin-check:has(input:focus-visible) {
  outline: 2px solid rgba(184, 224, 95, 0.5);
  outline-offset: 2px;
}

.admin-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-check--muted {
  color: var(--text-glass-1);
  opacity: 0.68;
}

.admin-check--disabled {
  cursor: not-allowed;
}

.admin-user-modal {
  z-index: 2500;
}

.admin-user-modal__content {
  max-height: min(760px, 90vh);
}

.admin-user-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 12px;
}

.admin-user-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-field {
  min-width: 0;
}

.admin-permission-group__title {
  margin-bottom: 6px;
}

.admin-user-search {
  position: relative;
}

.admin-user-search__dropdown {
  display: none;
  position: absolute;
  z-index: 100;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--dropdown-bg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

.admin-user-search__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--bg-glass-4);
  background: transparent;
  color: var(--text-bright);
  cursor: pointer;
  text-align: left;
}

.admin-user-search__option:hover {
  background: var(--bg-glass-4);
}

.admin-user-search__option span {
  font-size: 13px;
  font-weight: 650;
}

.admin-user-search__option small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.admin-permission-group {
  min-width: 0;
}

.admin-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

#adminUserModal .admin-permission-grid {
  gap: 4px 8px;
}

.admin-user-modal__footer {
  justify-content: space-between;
}

.admin-user-modal__danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-user-modal__block,
.admin-user-modal__delete {
  display: none;
}

.admin-user-modal__block {
  color: var(--red) !important;
  border-color: rgba(255, 59, 48, 0.3) !important;
}

.admin-user-modal__block--unblock {
  color: var(--lime) !important;
  border-color: rgba(184, 224, 95, 0.35) !important;
}

.admin-user-modal__delete {
  color: var(--red) !important;
  border-color: rgba(255, 59, 48, 0.3) !important;
  font-size: 20px;
  font-weight: 400;
}

.admin-user-modal__block:hover,
.admin-user-modal__delete:hover {
  background: rgba(255, 59, 48, 0.1) !important;
  border-color: rgba(255, 59, 48, 0.5) !important;
}

.admin-user-modal__block--unblock:hover {
  background: rgba(184, 224, 95, 0.1) !important;
  border-color: rgba(184, 224, 95, 0.55) !important;
}

.admin-user-modal__actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.top-partners-state {
  padding: 10px 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.top-partners-state--error {
  color: #ff4d4d;
}

/* ─── LO month race (home) ─────────────────────────────── */
.lo-race-card {
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.lo-race-card__header {
  margin-bottom: 14px;
  gap: 12px;
}

.lo-race-card__header .dashboard-card__tag {
  max-width: min(52vw, 320px);
  padding: 7px 12px;
  border: 1px solid rgba(203, 240, 120, 0.24);
  background: rgba(203, 240, 120, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.lo-race-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) max-content;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.lo-race-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  overflow: hidden;
  text-align: center;
}

.lo-race-stat--goal {
  border-color: rgba(203, 240, 120, 0.35);
  background:
    radial-gradient(circle at 50% 30%, rgba(203, 240, 120, 0.28) 0%, transparent 55%),
    linear-gradient(160deg, rgba(203, 240, 120, 0.16) 0%, rgba(139, 92, 246, 0.12) 100%);
  box-shadow: 0 0 28px rgba(203, 240, 120, 0.12);
}

.lo-race-stat--mine {
  border-color: rgba(139, 92, 246, 0.28);
  background:
    radial-gradient(circle at 50% 20%, rgba(139, 92, 246, 0.2) 0%, transparent 55%),
    var(--surface-2);
}

.lo-race-stat--need {
  border-color: rgba(245, 197, 66, 0.28);
  background:
    radial-gradient(circle at 50% 20%, rgba(245, 197, 66, 0.16) 0%, transparent 55%),
    var(--surface-2);
}

.lo-race-stat--need.lo-race-stat--done {
  border-color: rgba(34, 197, 94, 0.35);
  background:
    radial-gradient(circle at 50% 20%, rgba(34, 197, 94, 0.18) 0%, transparent 55%),
    var(--surface-2);
}

.lo-race-stat__glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(203, 240, 120, 0.18) 0%, transparent 60%);
  pointer-events: none;
  animation: lo-race-pulse 3.2s ease-in-out infinite;
}

.lo-race-stat__badge {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.lo-race-stat--goal .lo-race-stat__badge {
  color: var(--lime);
}

.lo-race-stat__value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 4px;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}

.lo-race-stat--goal .lo-race-stat__value {
  font-size: 42px;
  text-shadow: 0 0 24px rgba(203, 240, 120, 0.35);
}

.lo-race-stat--mine .lo-race-stat__value {
  color: #c4b5fd;
}

.lo-race-stat--need .lo-race-stat__value {
  color: #f5c542;
}

.lo-race-stat--need.lo-race-stat--done .lo-race-stat__value {
  color: var(--success);
}

.lo-race-stat__unit {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 15px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.lo-race-stat--goal .lo-race-stat__unit {
  color: var(--lime);
}

@keyframes lo-race-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.lo-race-timer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  min-height: 126px;
  justify-self: end;
}

.lo-race-timer__digits {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.lo-race-timer__unit {
  width: 96px;
  min-width: 96px;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(203, 240, 120, 0.09), rgba(139, 92, 246, 0.07)),
    var(--surface-2);
  border: 1px solid rgba(203, 240, 120, 0.2);
}

.lo-race-timer__value {
  font-size: 50px;
  font-weight: 900;
  line-height: 1.05;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}

.lo-race-timer__unit-label {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.lo-race-timer__sep {
  padding-bottom: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--lime);
  opacity: 0.9;
}

.lo-race-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}

.lo-race-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 7px;
  min-width: 620px;
  font-size: 15px;
}

.lo-race-table thead th {
  padding: 4px 14px 7px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.lo-race-table tbody td {
  padding: 13px 14px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  color: var(--text);
  vertical-align: middle;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.lo-race-table tbody td:first-child {
  border-left: 1px solid var(--border-light);
  border-radius: 13px 0 0 13px;
}

.lo-race-table tbody td:last-child {
  border-right: 1px solid var(--border-light);
  border-radius: 0 13px 13px 0;
}

.lo-race-table tbody tr:hover td {
  border-color: color-mix(in srgb, var(--lime) 28%, var(--border-light));
  background: color-mix(in srgb, var(--surface-2) 82%, var(--lime) 5%);
}

.lo-race-table__place {
  width: 58px;
  text-align: center !important;
}

.lo-race-table__place-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-glass-4);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
}

.lo-race-table__place--gold .lo-race-table__place-badge {
  border-color: rgba(245, 197, 66, 0.45);
  background: rgba(245, 197, 66, 0.12);
  color: #f5c542;
}

.lo-race-table__place--silver .lo-race-table__place-badge {
  border-color: rgba(184, 192, 204, 0.4);
  background: rgba(184, 192, 204, 0.1);
  color: #cbd2dc;
}

.lo-race-table__place--bronze .lo-race-table__place-badge {
  border-color: rgba(208, 139, 76, 0.42);
  background: rgba(208, 139, 76, 0.11);
  color: #d99a61;
}

.lo-race-table__name {
  max-width: 220px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
}

.lo-race-table__num {
  text-align: right !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lo-race-table__lo {
  color: var(--lime);
  font-size: 17px;
  font-weight: 900;
}

.lo-race-table__need {
  color: var(--text-muted);
}

.lo-race-table tbody td.lo-race-table__need--done {
  color: var(--success);
  font-size: 18px;
}

.lo-race-table__row--done td {
  background: color-mix(in srgb, var(--surface-2) 86%, var(--success) 7%);
}

.lo-race-table__mentor {
  min-width: 140px;
  white-space: nowrap;
}

.lo-race-table__mentor-name {
  display: inline-block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.lo-race-table__empty {
  text-align: center !important;
  padding: 18px 12px !important;
  color: var(--text-muted);
  font-weight: 600;
}

.lo-race-table__empty--error {
  color: #ff4d4d;
}

[data-theme="light"] .lo-race-stat--goal {
  border-color: rgba(184, 224, 95, 0.5);
  background:
    radial-gradient(circle at 50% 30%, rgba(184, 224, 95, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, rgba(184, 224, 95, 0.22) 0%, rgba(245, 85, 168, 0.08) 100%);
  box-shadow: 0 8px 24px rgba(184, 224, 95, 0.15);
}

[data-theme="light"] .lo-race-stat--mine .lo-race-stat__value {
  color: #7c3aed;
}

[data-theme="light"] .lo-race-timer__unit {
  border-color: rgba(184, 224, 95, 0.35);
  background:
    linear-gradient(160deg, rgba(184, 224, 95, 0.18), rgba(245, 85, 168, 0.06)),
    #fff;
}

[data-theme="light"] .lo-race-table__row--done td {
  background: rgba(22, 163, 74, 0.08);
}

@media (max-width: 1100px) {
  .lo-race-hero {
    grid-template-columns: repeat(3, minmax(104px, 1fr)) max-content;
  }

  .lo-race-timer__unit {
    width: 84px;
    min-width: 84px;
  }
}

@media (max-width: 1024px) {
  .lo-race-card {
    margin-bottom: 12px;
    order: 0;
  }

  .lo-race-hero {
    grid-template-columns: repeat(3, minmax(96px, 1fr)) max-content;
    gap: 10px;
    margin-bottom: 12px;
  }

  .lo-race-timer {
    min-height: 108px;
  }

  .lo-race-stat {
    min-height: 96px;
    padding: 12px 10px;
  }

  .lo-race-stat__value {
    min-height: 36px;
    font-size: 28px;
  }

  .lo-race-stat--goal .lo-race-stat__value {
    font-size: 32px;
  }

  .lo-race-timer__value {
    font-size: 26px;
  }

  .lo-race-timer__unit {
    width: 76px;
    min-width: 76px;
    min-height: 108px;
    padding: 10px;
  }

  .lo-race-timer__sep {
    padding-bottom: 0;
    font-size: 22px;
  }

  .lo-race-table {
    min-width: 570px;
    font-size: 14px;
  }

  .lo-race-table thead th,
  .lo-race-table tbody td {
    padding: 9px 10px;
  }

  .lo-race-table__name {
    max-width: 180px;
  }
}

@media (max-width: 520px) {
  .lo-race-hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: visible;
  }

  .lo-race-stat {
    min-height: 88px;
    padding: 10px 8px;
  }

  .lo-race-stat__badge {
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .lo-race-stat__value {
    margin-top: 4px;
    min-height: 31px;
    font-size: 25px;
  }

  .lo-race-stat--goal .lo-race-stat__value {
    font-size: 27px;
  }

  .lo-race-stat__unit {
    margin-top: 3px;
    font-size: 10px;
  }

  .lo-race-timer {
    grid-column: 1 / -1;
    grid-row: 1;
    align-items: stretch;
    min-height: 82px;
    justify-self: stretch;
  }

  .lo-race-timer__digits {
    gap: 5px;
    justify-content: space-between;
    width: 100%;
  }

  .lo-race-timer__unit {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    min-height: 82px;
    padding: 6px 5px;
  }

  .lo-race-timer__value {
    font-size: 36px;
  }

  .lo-race-timer__sep {
    padding-bottom: 0;
    font-size: 18px;
  }
}

.top-partner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-glass-4);
}

.top-partner-card__main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-partner-card__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lime) 0%, #10b981 100%);
  color: #111;
  font-size: 14px;
  font-weight: 800;
}

.top-partner-card__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.top-partner-card__emoji {
  position: absolute;
  right: -4px;
  bottom: -4px;
  font-size: 14px;
}

.top-partner-card__label {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 6px;
  border: 1px solid var(--lime);
  border-radius: 4px;
  background: var(--lime);
  color: #111;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.top-partner-card__name {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 700;
}

.top-partner-card__value {
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

.crm-view-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--crm-badge-border, rgba(96, 165, 250, 0.2));
  border-radius: 7px;
  background: var(--crm-badge-bg, rgba(96, 165, 250, 0.1));
  color: var(--crm-badge-color, #60a5fa);
  font-size: 11px;
  font-weight: 600;
}

.crm-view-badge--compact {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.crm-view-badge--status {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.crm-view-badge--high {
  --crm-badge-bg: rgba(251, 191, 36, 0.1);
  --crm-badge-border: rgba(251, 191, 36, 0.2);
  --crm-badge-color: #fbbf24;
}

.crm-view-badge--critical {
  --crm-badge-bg: rgba(239, 68, 68, 0.1);
  --crm-badge-border: rgba(239, 68, 68, 0.2);
  --crm-badge-color: #ef4444;
}

.crm-view-badge--todo {
  --crm-badge-bg: rgba(59, 130, 246, 0.1);
  --crm-badge-border: rgba(59, 130, 246, 0.2);
  --crm-badge-color: #3b82f6;
}

.crm-view-badge--progress {
  --crm-badge-bg: rgba(234, 179, 8, 0.1);
  --crm-badge-border: rgba(234, 179, 8, 0.2);
  --crm-badge-color: #eab308;
}

.crm-view-badge--task {
  --crm-badge-bg: rgba(192, 132, 252, 0.07);
  --crm-badge-border: rgba(192, 132, 252, 0.2);
  --crm-badge-color: #c084fc;
}

.crm-view-badge--call {
  --crm-badge-bg: rgba(203, 240, 120, 0.07);
  --crm-badge-border: rgba(203, 240, 120, 0.2);
  --crm-badge-color: var(--badge-lime-text);
}

.crm-view-badge--meeting {
  --crm-badge-bg: rgba(250, 204, 21, 0.07);
  --crm-badge-border: rgba(250, 204, 21, 0.2);
  --crm-badge-color: #facc15;
}

.crm-view-badge--message {
  --crm-badge-bg: rgba(96, 165, 250, 0.07);
  --crm-badge-border: rgba(96, 165, 250, 0.2);
  --crm-badge-color: #60a5fa;
}

.crm-view-badge--private {
  --crm-badge-bg: rgba(161, 161, 170, 0.1);
  --crm-badge-border: rgba(161, 161, 170, 0.2);
  --crm-badge-color: #a1a1aa;
}

.crm-view-badge--all {
  --crm-badge-bg: rgba(96, 165, 250, 0.1);
  --crm-badge-border: rgba(96, 165, 250, 0.2);
  --crm-badge-color: #60a5fa;
}

.crm-view-badge--favorites {
  --crm-badge-bg: rgba(250, 204, 21, 0.1);
  --crm-badge-border: rgba(250, 204, 21, 0.2);
  --crm-badge-color: #facc15;
}

.crm-inline-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(203, 240, 120, 0.2);
  border-radius: 6px;
  background: rgba(203, 240, 120, 0.05);
  color: var(--lime);
  font-size: 12px;
  font-weight: 500;
}

.crm-inline-badge--assignee {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
  font-weight: 600;
}

.crm-inline-badge__remove {
  cursor: pointer;
  opacity: 0.7;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.user-badge--named {
  gap: 6px;
  padding: 2px 8px 2px 2px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--bg-glass-3);
}

.user-badge--avatar-only {
  cursor: help;
}

.user-badge--avatar-only:hover {
  transform: scale(1.1);
}

.user-badge__avatar {
  width: var(--user-badge-size, 20px);
  height: var(--user-badge-size, 20px);
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.user-badge__avatar-img {
  object-fit: cover;
}

.user-badge__avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--user-badge-bg, linear-gradient(135deg, #3b82f6, #1d4ed8));
  color: #fff;
  font-size: var(--user-badge-font-size, 9px);
  font-weight: 700;
}

.user-badge__name {
  color: var(--text-bright);
  font-size: var(--user-badge-text-size, 11px);
  font-weight: 500;
  white-space: nowrap;
}

.user-badge--small {
  --user-badge-size: 20px;
  --user-badge-font-size: 9px;
  --user-badge-text-size: 11px;
}

.user-badge--medium {
  --user-badge-size: 28px;
  --user-badge-font-size: 12px;
  --user-badge-text-size: 14px;
}

.user-badge--large {
  --user-badge-size: 40px;
  --user-badge-font-size: 16px;
  --user-badge-text-size: 16px;
}

.crm-empty-note {
  color: var(--text-glass-3);
  font-size: 13px;
}

.crm-empty-note--block {
  font-size: inherit;
}

#taskViewModal .modal-content {
  background: var(--modal-bg);
  border-color: var(--border-light);
}

#taskViewModal .modal-content.task-view-priority--high {
  background: linear-gradient(rgba(250, 204, 21, 0.08), rgba(250, 204, 21, 0.08)), var(--modal-bg);
  border-color: rgba(250, 204, 21, 0.3);
}

#taskViewModal .modal-content.task-view-priority--critical {
  background: linear-gradient(rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.08)), var(--modal-bg);
  border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 992px) {
  #taskViewModal .modal-content.task-view-priority--high {
    background: #393015 !important;
  }

  #taskViewModal .modal-content.task-view-priority--critical {
    background: #3b161b !important;
  }

  [data-theme="light"] #taskViewModal .modal-content.task-view-priority--high {
    background: linear-gradient(rgba(250, 204, 21, 0.08), rgba(250, 204, 21, 0.08)), var(--modal-bg) !important;
  }

  [data-theme="light"] #taskViewModal .modal-content.task-view-priority--critical {
    background: linear-gradient(rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.08)), var(--modal-bg) !important;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header__status {
    width: 100%;
  }

  .admin-summary-grid,
  .admin-permission-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sync-layout,
  .admin-card__top {
    grid-template-columns: 1fr;
  }

  .admin-action-panel--metrics {
    grid-column: auto;
  }

  .admin-panel {
    padding: 16px;
  }

  .admin-panel__header {
    flex-direction: column;
  }

  .admin-users-toolbar {
    width: 100%;
  }

  .admin-card__actions {
    justify-content: start;
  }

  .admin-card__actions .btn {
    min-height: 36px;
  }

  .admin-card__status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: initial;
  }

  .admin-card__status .admin-last-login,
  .admin-card__status .admin-subscription {
    grid-column: 1;
  }

  .admin-card__actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-content: end;
    overflow: visible;
    padding-bottom: 0;
  }

  .admin-card__permissions .admin-permission-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

}

@media (max-width: 560px) {
  .admin-user-modal__footer {
    flex-wrap: wrap;
  }

  .admin-user-modal__danger-actions {
    width: auto;
  }

  .admin-user-modal__danger-actions .btn {
    flex: 0 0 auto;
  }

  .admin-user-modal__actions {
    width: auto;
    margin-left: auto;
  }

  .admin-user-modal__content {
    max-height: 92vh;
  }

  .admin-user-modal__grid,
  .admin-permission-grid,
  .admin-permission-row {
    grid-template-columns: 1fr;
  }

}

.task-scope-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.task-scope-nav::-webkit-scrollbar {
  display: none;
}

/* Раскладка фильтров рейтингов. */
.ratings-sub-nav {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap;
  margin-bottom: 24px !important;
}

.qualification-stats-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.qualification-stats-head > div:first-child {
  min-width: 0;
}

.qualification-stats-total {
  min-width: 116px;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.qualification-stats-total span,
.qualification-stats-total small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.qualification-stats-total strong {
  color: var(--text-bright);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.qualification-stats-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.qualification-stats-subtitle span {
  color: var(--text-glass-2);
}

.qualification-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.qualification-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background-color: #1a1d27;
  background-image:
    linear-gradient(180deg, rgba(16, 18, 27, 0.16), rgba(16, 18, 27, 0.86)),
    var(--qualification-stat-bg, url('/static/img/part.png'));
  background-size: 100% 100%, cover;
  background-position: center;
}

.qualification-stat-card--beginner {
  --qualification-stat-bg: url('/static/img/begin.png');
}

.qualification-stat-card--ambassador {
  --qualification-stat-bg: url('/static/img/ambas.png');
}

.qualification-stat-card--master {
  --qualification-stat-bg: url('/static/img/master.png');
}

.qualification-stat-card--leader {
  --qualification-stat-bg: url('/static/img/leader.png');
}

.qualification-stat-card__main,
.qualification-stat-card__numbers,
.qualification-stat-card__delta {
  position: relative;
  z-index: 1;
}

.qualification-stat-card__main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.qualification-stat-card__code {
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}

.qualification-stat-card__label {
  color: rgba(255,255,255,0.78);
  font-size: 15px;
  font-weight: 900;
  text-align: left;
  line-height: 1.18;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qualification-stat-card__numbers {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.qualification-stat-card__numbers strong {
  color: var(--lime);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.qualification-stat-card__numbers span {
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 850;
}

.qualification-stat-card__delta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.66);
  font-size: 11px;
  font-weight: 800;
}

.qualification-stat-delta {
  color: rgba(255,255,255,0.74);
}

.qualification-stat-delta--up {
  color: var(--lime);
}

.qualification-stat-delta--down {
  color: var(--red);
}

@media (max-width: 992px) {
  .qualification-stats-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
    align-items: flex-start;
  }

  .qualification-stats-head .mentor-assistant-heading {
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .qualification-stats-subtitle {
    display: grid;
    gap: 4px;
    font-size: 12px;
    line-height: 1.25;
  }

  .qualification-stats-total {
    min-width: 46px;
    max-width: 54px;
    flex-shrink: 0;
  }

  .qualification-stats-total span,
  .qualification-stats-total small {
    font-size: 10px;
    line-height: 1.1;
  }

  .qualification-stats-total strong {
    font-size: 22px;
  }

  .qualification-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .qualification-stat-card {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 112px;
    padding: 10px;
  }

  .qualification-stat-card__label {
    font-size: 12px;
  }

  .qualification-stat-card__numbers strong {
    font-size: 24px;
  }

  .qualification-stat-card__numbers span,
  .qualification-stat-card__delta {
    font-size: 10px;
  }

  .qualification-stat-card__numbers,
  .qualification-stat-card__delta {
    justify-content: space-between;
  }
}

.ratings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ratings-page-header__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-bright);
  font-size: 18px;
  font-weight: 800;
}

.ratings-page-header__meta {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.ratings-title-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--surface-glass), var(--bg-glass-3));
  box-shadow: 0 12px 34px var(--bg-glass-5);
}

.ratings-title-card h4 {
  margin: 0;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 800;
}

.ratings-title-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.tasks-page-header,
.analytics-page-header,
.events-page-header {
  justify-content: space-between;
}

/* Заголовок страницы Аналитика */
.analytics-page-header {
  align-items: center;
}

/* Кнопка «Показать всех» / «Развернуть» */
.mentor-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: var(--desktop-control-size);
  padding: 0 12px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--bg-glass-4);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mentor-expand-btn:hover {
  background: var(--bg-glass-3);
  color: var(--text);
}

.mentor-expand-btn svg {
  transition: transform 0.2s ease;
}

.mentor-expand-btn.expanded svg {
  transform: rotate(180deg);
}

.mentor-assistant-section {
  border: 1px solid var(--bg-glass-4);
  border-radius: 12px;
  background: var(--surface-glass);
  padding: 16px;
}

.mentor-assistant-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.mentor-assistant-toolbar--detail {
  align-items: center;
  justify-content: flex-start;
}

.mentor-assistant-toolbar--overview {
  align-items: center;
}

.mentor-assistant-kicker {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.mentor-assistant-heading {
  color: var(--text-bright);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.mentor-data-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.mentor-data-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.mentor-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.mentor-focus {
  gap: 0;
}

.mentor-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.mentor-focus__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.mentor-focus-card {
  min-width: 0;
  border: 1px solid rgba(203, 240, 120, 0.18);
  border-left: 4px solid var(--lime);
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
}

.mentor-focus-card.mentor-action-card--red {
  border-left-color: var(--danger-text, #f87171);
}

.mentor-focus-card.mentor-action-card--blue {
  border-left-color: #60a5fa;
}

.mentor-focus-card.mentor-action-card--green {
  border-left-color: #34d399;
}

.mentor-focus-card.mentor-action-card--amber {
  border-left-color: #fbbf24;
}

.mentor-focus-card__top {
  padding: 13px 14px 10px;
}

.mentor-focus-card__person {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  display: block;
  align-items: center;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mentor-focus-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mentor-focus-card__label {
  display: block;
  min-width: 0;
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentor-focus-card__name {
  min-width: 0;
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentor-focus-card__name span {
  color: var(--text-glass-2);
  font-size: 12px;
  font-weight: 600;
}

.mentor-focus-card__meta {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentor-focus-card__metric {
  display: block;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-glass-1);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentor-action-card__actions.mentor-action-card__actions--compact {
  padding: 0 14px 13px;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
}

.mentor-action-card__actions .mentor-action-icon-btn {
  width: var(--desktop-control-size);
  min-width: var(--desktop-control-size);
  height: var(--desktop-control-size);
  padding: 0 !important;
  flex: 0 0 var(--desktop-control-size) !important;
}

.mentor-category-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--bg-glass-4);
  border-radius: 12px;
  background: var(--surface-glass);
  box-sizing: border-box;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .mentor-category-card:hover {
    background: var(--bg-glass-3);
    transform: translateY(-1px);
  }
}

.mentor-category-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.mentor-category-card__title {
  display: block;
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 800;
}

.mentor-category-card__description {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.mentor-category-card__count {
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  background: var(--bg-glass-3);
  color: var(--text-bright);
  text-align: right;
  flex-shrink: 0;
}

.mentor-category-card__count strong {
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.mentor-category-card__count small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.mentor-category-card__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.mentor-category-card__meta > span:first-child {
  color: var(--text-bright);
  font-weight: 900;
}

.mentor-category-card__arrow {
  margin-left: auto;
  color: var(--lime);
  font-size: 18px;
  line-height: 1;
}

.mentor-category-card--lime {
  border-left: 4px solid var(--lime);
  background: rgba(204, 255, 0, 0.055);
}

.mentor-category-card--red {
  border-left: 4px solid var(--danger-text, #f87171);
  background: rgba(248, 113, 113, 0.055);
}

.mentor-category-card--blue {
  border-left: 4px solid #60a5fa;
  background: rgba(96, 165, 250, 0.055);
}

.mentor-category-card--green {
  border-left: 4px solid #34d399;
  background: rgba(52, 211, 153, 0.055);
}

.mentor-category-card--amber {
  border-left: 4px solid #fbbf24;
  background: rgba(251, 191, 36, 0.055);
}

.mentor-category-card--lime .mentor-category-card__count {
  background: rgba(204, 255, 0, 0.14);
}

.mentor-category-card--red .mentor-category-card__count {
  background: rgba(248, 113, 113, 0.14);
}

.mentor-category-card--blue .mentor-category-card__count {
  background: rgba(96, 165, 250, 0.14);
}

.mentor-category-card--green .mentor-category-card__count {
  background: rgba(52, 211, 153, 0.14);
}

.mentor-category-card--amber .mentor-category-card__count {
  background: rgba(251, 191, 36, 0.14);
}

.mentor-category-card--red .mentor-category-card__arrow {
  color: #f87171;
}

.mentor-category-card--blue .mentor-category-card__arrow {
  color: #60a5fa;
}

.mentor-category-card--green .mentor-category-card__arrow {
  color: #34d399;
}

.mentor-category-card--amber .mentor-category-card__arrow {
  color: #fbbf24;
}

.mentor-scope-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mentor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mentor-action-card {
  border: 1px solid var(--bg-glass-4);
  border-radius: 10px;
  background: transparent;
}

.mentor-action-card__main {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  box-sizing: border-box;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.mentor-action-card__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #111219;
  font-size: 13px;
  font-weight: 900;
}

.mentor-action-card--red .mentor-action-card__avatar {
  background: rgba(248, 113, 113, 0.16);
  color: var(--danger-text, #f87171);
}

.mentor-action-card--blue .mentor-action-card__avatar {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

.mentor-action-card--green .mentor-action-card__avatar {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.mentor-action-card--amber .mentor-action-card__avatar {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

.mentor-action-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mentor-action-card__name {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentor-action-card__name span {
  color: var(--text-glass-2);
  font-size: 12px;
  font-weight: 600;
}

.mentor-action-card__meta {
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mentor-action-card__metrics {
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  text-align: right;
}

.mentor-action-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px 66px;
}

.mentor-detail-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mentor-detail-controls .mentor-scope-switch {
  display: flex;
  flex: 0 0 auto;
}

.mentor-detail-search {
  flex: 1 1 260px;
}

.mentor-action-card__actions button:not(.mentor-action-icon-btn) {
  min-height: var(--desktop-control-size);
  padding: 0 12px;
  border: 1px solid var(--bg-glass-4);
  border-radius: 8px;
  background: var(--bg-glass-2);
  color: var(--text-bright);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mentor-action-card__actions button:not(.mentor-action-icon-btn):hover {
  border-color: rgba(204, 255, 0, 0.35);
  background: rgba(204, 255, 0, 0.1);
}

.mentor-action-card__actions button.mentor-action-button--primary {
  border-color: rgba(204, 255, 0, 0.3);
  background: rgba(204, 255, 0, 0.1);
  color: var(--text-bright);
}

.mentor-action-card__actions .mentor-structure-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
}

.mentor-action-card__actions .mentor-structure-link svg {
  flex: 0 0 auto;
}

.mentor-action-card__actions button.is-done,
.mentor-action-card__actions button.is-done:hover {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  cursor: default;
  opacity: 1;
}

.mentor-action-card__actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.mentor-line-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-glass-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.mentor-empty-state {
  padding: 28px 16px;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 720px) {
  .mentor-assistant-section {
    padding: 14px;
  }

  .mentor-assistant-toolbar--overview {
    align-items: stretch;
    flex-direction: column;
  }

  .mentor-assistant-toolbar--overview .mentor-scope-switch {
    width: 100%;
  }

  .mentor-assistant-toolbar--overview .mentor-data-status {
    margin-left: 0;
  }

  .mentor-refresh-btn {
    width: 100%;
    justify-content: center;
  }

  .mentor-section-header {
    align-items: flex-start;
  }

  .mentor-category-grid,
  .mentor-focus__list {
    grid-template-columns: 1fr;
  }

  .mentor-assistant-toolbar--detail {
    align-items: flex-start;
    flex-direction: column;
  }

  .mentor-focus-card__person,
  .mentor-action-card__main {
    grid-template-columns: minmax(0, 1fr);
  }

  .mentor-focus-card__label,
  .mentor-focus-card__name,
  .mentor-focus-card__meta,
  .mentor-focus-card__metric {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .mentor-focus-card__metric {
    width: fit-content;
  }

  .mentor-action-card__avatar {
    display: none;
  }

  .mentor-action-card__name,
  .mentor-action-card__meta {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mentor-action-card__metrics {
    grid-column: 1;
    justify-self: start;
    flex-wrap: wrap;
    text-align: left;
  }

  .mentor-action-card__actions {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mentor-action-card__actions button:not(.mentor-action-icon-btn) {
    flex: 1 1 136px;
    white-space: nowrap;
  }

  .mentor-detail-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .mentor-detail-search {
    flex-basis: 100%;
  }

}

/* ── Заголовки секций рейтинга ── */
.rating-card {
  padding: 12px 12px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: 0 0 16px 16px;
  background: color-mix(in srgb, var(--surface-glass) 88%, transparent);
  box-shadow: 0 12px 34px var(--bg-glass-5);
  backdrop-filter: blur(14px);
}

.rating-card--leaders,
.rating-card--empty {
  border-radius: 16px;
}

.analytics-state {
  padding: 20px;
  color: var(--text-muted);
  text-align: center;
}

.analytics-state--error {
  color: #ef4444;
}

.rating-empty-title {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
}

.rating-empty-text {
  color: var(--text-muted);
  font-size: 14px;
}

.rating-list-title {
  padding: 12px 12px 8px;
}

.rating-list-title h4 {
  font-size: 20px;
  font-weight: 700;
}

.rating-card--empty {
  padding: 24px;
  background: var(--bg-glass-3);
}

.lo-champion-list {
  display: grid;
  gap: 8px;
}

.lo-champion-list__note {
  padding: 0 4px 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.lo-champion-list__cards {
  display: grid;
  gap: 8px;
}

.lo-champion-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-glass) 88%, transparent);
  box-shadow: 0 8px 24px var(--bg-glass-5);
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.lo-champion-card:hover {
  border-color: color-mix(in srgb, var(--lime) 34%, var(--border-light));
  background: color-mix(in srgb, var(--surface-glass) 90%, var(--lime) 5%);
  transform: translateY(-1px);
}

.lo-champion-card__place {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 11px;
  background: var(--bg-glass-4);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.lo-champion-card--gold .lo-champion-card__place {
  border-color: rgba(245, 197, 66, 0.5);
  background: rgba(245, 197, 66, 0.13);
  color: #f5c542;
}

.lo-champion-card--silver .lo-champion-card__place {
  border-color: rgba(203, 210, 220, 0.42);
  background: rgba(203, 210, 220, 0.1);
  color: #d7dde7;
}

.lo-champion-card--bronze .lo-champion-card__place {
  border-color: rgba(208, 139, 76, 0.46);
  background: rgba(208, 139, 76, 0.12);
  color: #d99a61;
}

.lo-champion-card__main {
  min-width: 0;
}

.lo-champion-card__name {
  overflow: hidden;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lo-champion-card__meta {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lo-champion-card__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lo-champion-card__score-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.lo-champion-card__score strong {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.lo-champion-card__score-value span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lo-champion-card__progress {
  margin-top: 4px;
  color: #d98469;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px rgba(217, 132, 105, 0.14);
}

.lo-champion-card__progress--done {
  color: var(--success);
}

.rating-row {
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 16px;
  margin-bottom: 6px;
  border-radius: 12px;
  background-color: color-mix(in srgb, var(--bg-glass-2) 76%, transparent);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.rating-row__main,
.rating-info-container,
.rating-info-city,
.rating-info-qual {
  display: flex;
  align-items: center;
}

.rating-row__main,
.rating-info-container {
  width: 100%;
}

.rating-row__main {
  gap: 16px;
}

.rating-rank {
  width: 28px;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.rating-info-main {
  display: flex;
  width: 60%;
  flex-direction: column;
  gap: 4px;
}

.rating-info-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.rating-info-city {
  gap: 4px;
  font-size: 13px;
}

.rating-info-city__icon {
  flex-shrink: 0;
}

.rating-info-city__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-info-qual {
  width: 40%;
  justify-content: center;
  text-align: center;
}

.rating-qual-badge {
  display: inline-block;
  white-space: nowrap;
}

.rating-score {
  min-width: 60px;
  flex-shrink: 0;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.rating-score-icon {
  margin-left: 2px;
  color: var(--text-glass-3);
  font-size: 12px;
}

.rating-row:hover {
  transform: translateY(-1px);
  background-color: color-mix(in srgb, var(--bg-glass-3) 88%, transparent);
}

.rating-card--qualification {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.rating-card--qualification .rating-row,
.rating-card--leaders .rating-row:not(.rating-row--medal) {
  margin-bottom: 0;
  border-radius: 0;
  background-color: transparent;
}

.rating-card--qualification .rating-row:hover,
.rating-card--leaders .rating-row:not(.rating-row--medal):hover {
  transform: none;
  background-color: transparent;
}

.rating-card--leaders {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.rating-row--medal {
  min-height: 72px;
  overflow: hidden;
}

.rating-expand-btn {
  margin-top: 8px !important;
  border-radius: 12px !important;
}

.rating-section-header {
  height: 56px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-size: cover;
  background-position: center;
  margin-bottom: 0;
  box-shadow: 0 12px 30px var(--bg-glass-5);
}

.rating-section-header__title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: var(--text-shadow-strong);
}

.rating-section-header__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  background: var(--bg-glass-5);
  padding: 4px 12px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Анимация появления скрытых строк */
@keyframes fadeInRow {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rating-row-visible {
  animation: fadeInRow 0.2s ease forwards;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--modal-bg);
  border: 1px solid var(--border-light);
  color: var(--text-bright);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast--error {
  background: rgba(255, 59, 48, 0.9);
  border-color: rgba(255, 59, 48, 0.5);
  color: white;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
}

.network-status {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--modal-bg);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  color: var(--text-bright);
  backdrop-filter: blur(18px);
}

.network-status.hidden {
  display: none;
}

.network-status__text {
  flex: 1;
  min-width: 0;
}

.network-status__title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.network-status__message {
  margin-top: 3px;
  color: var(--text-glass-1);
  font-size: 12px;
  line-height: 1.35;
}

.network-status__retry {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--lime);
  color: #111219;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 520px) {
  .network-status {
    align-items: stretch;
    flex-direction: column;
  }

  .network-status__retry {
    width: 100%;
  }
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* ────────────────────────────────────────────── */
/* Mobile Analytics Adjustments                   */
/* ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tasks-page-title {
    margin: 0 !important;
    font-size: 24px !important;
    line-height: 1.12 !important;
  }

  .tabs-nav,
  .crm-primary-nav {
    margin-bottom: 14px !important;
  }

  .task-scope-nav {
    margin-bottom: 12px;
  }

  .events-tags-container {
    padding-bottom: 10px;
  }

  #viewAnalytics {
    padding: 0 !important;
  }

  .ratings-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
  }

  .ratings-page-header__meta {
    text-align: left;
    white-space: normal;
  }

  .ratings-title-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
  }

  .ratings-title-card p {
    text-align: left;
  }

  .tabs-nav,
  .ratings-sub-nav {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  /* Hide scrollbars for smooth swiping */
  .tabs-nav::-webkit-scrollbar,
  .ratings-sub-nav::-webkit-scrollbar {
    display: none;
  }

  #viewAnalytics,
  #viewAnalytics .tab-pane,
  #mentorAssistantContent,
  #mentorAssistantContent .mentor-assistant-shell,
  #mentorAssistantContent .mentor-detail-controls {
    min-width: 0;
    max-width: 100%;
  }

  #viewAnalytics .tabs-nav {
    width: 100% !important;
    min-width: 0 !important;
  }

  #viewAnalytics .tab-btn {
    flex: 0 0 auto;
  }

  #mentorAssistantContent .mentor-detail-controls {
    width: 100%;
  }

  #mentorAssistantContent .mentor-scope-switch,
  #mentorAssistantContent .mentor-detail-search {
    min-width: 0;
    max-width: 100%;
  }

  .rating-section-header {
    padding: 24px 16px !important;
    font-size: 20px !important;
  }

  .rating-card {
    padding: 8px 8px 16px;
    margin-bottom: 18px;
  }

  .rating-row {
    min-height: 74px;
    padding: 10px 12px;
  }

  .lo-champion-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 70px;
    padding: 10px 12px;
  }

  .lo-champion-card__place {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 15px;
  }

  .lo-champion-card__name {
    font-size: 15px;
  }

  .lo-champion-card__meta {
    font-size: 12px;
  }

  .lo-champion-card__score strong {
    font-size: 20px;
  }

  .rating-row > div:first-child {
    gap: 10px !important;
    min-width: 0;
  }

  .rating-info-container {
    min-width: 0;
  }

  .rating-info-name {
    font-size: 14px !important;
  }

  .rating-info-city {
    max-width: 160px;
  }

  .rating-info-qual {
    justify-content: flex-end !important;
  }
}

/* ═══════════════════════════════════════════
   PERSONAL GOAL
═══════════════════════════════════════════ */
.personal-goal-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.personal-goal-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.personal-goal-edit-btn {
  background: transparent;
  border: none;
  color: var(--lime);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.personal-goal-edit-btn:hover {
  text-decoration: underline;
}

.personal-goal-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.personal-goal-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-glass-1);
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
}

.personal-goal-progress-fill {
  width: 0;
  height: 100%;
  background: var(--lime);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(203, 240, 120, 0.25);
}

.team-focus-edit-btn {
  position: relative;
  z-index: 10;
}

.personal-goal-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

#personalGoalCurrent {
  color: var(--text-bright);
}

.personal-goal-pct {
  color: var(--lime);
}

/* RIGHT COLUMN WIDGETS */
.my-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-glass-4);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.my-link-btn:hover {
  background: var(--bg-glass-1);
  border-color: var(--text-glass-5);
}

.my-link-btn__actions {
  display: flex;
  gap: 8px;
}

.my-link-btn__icon-btn {
  background: var(--bg-glass-1);
  border: none;
  border-radius: 8px;
  width: var(--desktop-control-size);
  min-width: var(--desktop-control-size);
  height: var(--desktop-control-size);
  min-height: var(--desktop-control-size);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.my-link-btn__icon-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.my-link-btn__icon-btn:hover {
  background: var(--bg-glass-2);
  color: var(--lime);
}

.my-links-empty {
  padding: 10px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.home-tasks-widget__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-tasks-widget__add-btn {
  background: var(--lime);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-tasks-widget__add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(203, 240, 120, 0.3);
}

.home-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass-3);
  border: 1px solid var(--bg-glass-4);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  transition: background 0.2s ease;
}

.home-task-item--dashboard {
  cursor: pointer;
  margin-bottom: 0;
}

#homeTasksList {
  display: grid;
  gap: 6px;
}

.home-task-item--critical {
  background: rgba(239, 68, 68, 0.05);
}

.home-task-item--high {
  background: rgba(250, 204, 21, 0.05);
}

@media (hover: hover) {
  .home-task-item:hover {
    background: var(--bg-glass-4);
  }

  .home-task-item--dashboard:hover {
    background: var(--bg-glass-2);
  }

  .home-task-item--critical:hover {
    background: rgba(239, 68, 68, 0.1);
  }

  .home-task-item--high:hover {
    background: rgba(250, 204, 21, 0.1);
  }
}

.home-task-item:active {
  transform: scale(0.98);
}

.home-task-item__content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-task-item__content--dashboard {
  flex: 1;
  align-items: flex-start;
}

.home-task-item__body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.home-task-item__title {
  font-size: 14px;
  color: var(--text);
}

.home-task-item__title--dashboard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.home-task-item__title-text {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 500;
}

.home-task-item__status {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-task-item__status--dashboard {
  flex-shrink: 0;
  margin-left: 12px;
}

.home-task-desc {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.mobile-today-hub {
  display: none;
}

.mobile-today-hub,
.mobile-today-hub * {
  box-sizing: border-box;
}

.mobile-today-hub__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-today-hub__eyebrow {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.mobile-today-hub__title {
  color: var(--text-bright);
  font-size: 22px;
  font-weight: 800;
  margin: 2px 0 0;
}

.mobile-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 154px;
  padding: 3px;
  background: var(--bg-glass-3);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.mobile-mode-switch__btn {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mobile-mode-switch__btn.active {
  background: var(--lime);
  color: #10130d;
}

.mobile-hub-loading,
.mobile-hub-empty {
  padding: 18px;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.mobile-hub-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mobile-hub-summary div,
.mobile-hub-stat,
.mobile-attention-grid button {
  min-width: 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-glass-3);
}

.mobile-hub-summary div {
  padding: 10px;
}

.mobile-hub-summary strong,
.mobile-hub-stat strong,
.mobile-attention-grid strong {
  display: block;
  color: var(--text-bright);
  font-size: 18px;
  line-height: 1.1;
}

.mobile-hub-summary span,
.mobile-hub-stat span,
.mobile-attention-grid span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.mobile-hub-section {
  padding: 14px;
  background: var(--surface-glass);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.mobile-hub-section__title {
  margin-bottom: 10px;
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 800;
}

.mobile-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-agenda-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-glass-3);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mobile-agenda-item__mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--bg-glass-4);
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 900;
}

.mobile-agenda-item--danger .mobile-agenda-item__mark {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}

.mobile-agenda-item--warn .mobile-agenda-item__mark {
  background: rgba(250, 204, 21, 0.14);
  color: #facc15;
}

.mobile-agenda-item--event .mobile-agenda-item__mark {
  background: rgba(96, 165, 250, 0.14);
  color: #60a5fa;
}

.mobile-agenda-item__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-agenda-item__title {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-agenda-item__meta {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-best-action {
  width: 100%;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(203, 240, 120, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(203, 240, 120, 0.12), rgba(96, 165, 250, 0.06));
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mobile-best-action span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-best-action small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-best-action strong {
  color: var(--text-bright);
  font-size: 15px;
  line-height: 1.25;
}

.mobile-best-action em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.mobile-best-action b {
  flex: 0 0 auto;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--lime);
  color: #10130d;
  font-size: 12px;
}

.mobile-goal-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-glass-3);
}

.mobile-goal-strip__label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-goal-strip strong {
  color: var(--text-bright);
  font-size: 14px;
}

.mobile-goal-strip__pct {
  align-self: center;
  color: var(--lime);
  font-size: 15px;
  font-weight: 900;
}

.mobile-goal-strip__bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-glass-4);
}

.mobile-goal-strip__bar span {
  display: block;
  width: var(--goal-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
}

.mobile-goal-strip p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.team-focus-source,
.mobile-goal-strip__source {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.mobile-goal-strip__source {
  grid-column: 1 / -1;
  margin-top: -2px;
}

.mobile-hub-stats,
.mobile-attention-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-hub-stat,
.mobile-attention-grid button {
  padding: 12px;
}

.mobile-hub-stat--today-activation {
  border-color: rgba(204, 255, 0, 0.5);
  background: rgba(204, 255, 0, 0.12);
}

.mobile-hub-stat--today-activation strong {
  color: var(--lime);
}

.mobile-attention-grid button {
  min-height: 68px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mobile-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-quick-actions button {
  min-height: var(--mobile-button-size);
  padding: 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface-glass);
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mobile-quick-actions button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-glass-4);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-glass-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-item__content {
  flex: 1;
}

.activity-item__text {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.activity-item__text strong {
  color: var(--text-bright);
  font-weight: 600;
}

.activity-item__time {
  font-size: 11px;
  color: var(--text-muted);
}

.activity-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ═══════════════════════════════════════════
   KANBAN BOARD
═══════════════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 0;
  align-items: flex-start;
  scroll-behavior: smooth;
}

.kanban-col {
  flex: 1;
  min-width: 300px;
  min-height: 0;
  background: var(--bg-glass-3);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: background 0.3s ease;
}

.kanban-scroll-shell {
  position: relative;
}

.kanban-scroll-btn {
  position: absolute;
  top: 50%;
  bottom: auto;
  z-index: 12;
  width: var(--kanban-scroll-btn-size);
  min-width: var(--kanban-scroll-btn-size);
  height: var(--kanban-scroll-btn-size);
  min-height: var(--kanban-scroll-btn-size);
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 23, 31, 0.92);
  color: var(--text-bright);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.kanban-scroll-shell.has-overflow .kanban-scroll-btn {
  opacity: 1;
  pointer-events: auto;
}

.kanban-scroll-btn--prev {
  left: 8px;
}

.kanban-scroll-btn--next {
  right: 8px;
}

.kanban-scroll-btn:hover:not(:disabled) {
  background: rgba(203, 240, 120, 0.18);
  color: var(--lime);
}

.kanban-scroll-btn:disabled {
  opacity: 0 !important;
  pointer-events: none !important;
}

[data-theme="light"] .kanban-scroll-btn {
  color: #fff;
}

.kanban-col.drag-over {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--bg-glass-2);
}

.kanban-col__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kanban-col__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.kanban-col__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--kanban-dot-color, var(--text-muted));
  box-shadow: 0 0 8px rgba(var(--kanban-dot-rgb, 148, 163, 184), 0.5);
}

/* Задачи: стандартные три колонки */
.kanban-col--todo .kanban-col__dot {
  --kanban-dot-color: #ef4444;
  --kanban-dot-rgb: 239, 68, 68;
}

.kanban-col--in_progress .kanban-col__dot,
#col-funnel-interested .kanban-col__dot {
  --kanban-dot-color: #f59e0b;
  --kanban-dot-rgb: 245, 158, 11;
}

.kanban-col--done .kanban-col__dot,
#col-funnel-registered .kanban-col__dot {
  --kanban-dot-color: #10b981;
  --kanban-dot-rgb: 16, 185, 129;
}

/* Воронка: уникальные цвета для каждой стадии */
#col-funnel-new .kanban-col__dot {
  --kanban-dot-color: #60a5fa;
  --kanban-dot-rgb: 96, 165, 250;
}

#col-funnel-meeting .kanban-col__dot {
  --kanban-dot-color: #a78bfa;
  --kanban-dot-rgb: 167, 139, 250;
}

.kanban-col__count {
  background: var(--bg-glass-1);
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.kanban-col__cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 50px;
}

.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  cursor: grab;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--bg-glass-5);
  }
}

.kanban-card:active {
  transform: scale(0.98);
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.task-template-picker {
  margin-bottom: 16px;
}

.task-template-picker > span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-glass-1);
  font-size: 13px;
  font-weight: 600;
}

.task-template-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-template-picker button {
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-glass-3);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.task-template-picker button:hover {
  border-color: rgba(203, 240, 120, 0.45);
  color: var(--lime);
}

.lead-history-section {
  margin-bottom: 22px;
}

.lead-history-section__title {
  margin-bottom: 8px;
  color: var(--text-glass-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.lead-history-next-action,
.lead-history-empty {
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--bg-glass-3);
  color: var(--text-muted);
  font-size: 13px;
}

.lead-next-action-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.lead-next-action-editor .lead-history-next-action {
  grid-column: 1 / -1;
}

.lead-next-action-editor__input {
  width: 100%;
}

.lead-next-action-editor__quick {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-next-action-editor__quick .btn {
  padding: 8px 10px;
  font-size: 12px;
}

.lead-next-action-editor__save {
  min-width: 118px;
}

.lead-history-form__add {
  justify-self: end;
}

#leadModal .modal-content {
  height: min(90dvh, 760px);
}

#leadModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.crm-modal-footer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: 0 !important;
  padding: 16px 0 0;
  background: var(--modal-bg);
}

@media (max-width: 768px) {
  #leadModal .modal-content {
    height: min(90dvh, 720px) !important;
  }

  .crm-modal-footer .btn {
    flex: 1;
  }
}

.lead-history-form,
.lead-history-list {
  display: grid;
  gap: 8px;
}

.lead-history-form .input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: var(--bg-glass-5);
  color: var(--text-bright);
}

.lead-history-item {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: var(--bg-glass-2);
}

.lead-history-item > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.lead-history-item__head {
  align-items: center;
}

.lead-history-item__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lead-history-item__delete {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  cursor: pointer;
}

.lead-history-item__delete:hover {
  background: rgba(239, 68, 68, 0.16);
}

.lead-history-item time,
.lead-history-item span,
.lead-history-item p {
  color: var(--text-muted);
  font-size: 12px;
}

.lead-history-item p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.kanban-task-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.kanban-task-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-glass-3);
  font-size: 11px;
  font-weight: 500;
}

.kanban-task-date--overdue {
  color: #ef4444;
}

.kanban-task-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--text-glass-3);
  font-size: 11px;
}

.kanban-task-meta-row--wrap {
  flex-wrap: wrap;
  margin-top: 8px;
}

.kanban-task-meta-badge {
  width: fit-content;
  margin-top: 10px;
}

.kanban-task-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-task-card-actions,
.lead-card__action-row,
.lead-card__actions-end {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}

.kanban-task-card-footer-actions {
  display: flex;
  gap: 4px;
}

.tasks-page-header {
  align-items: center;
}

.tasks-page-title {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═══════════════════════════════════════════
   DASHBOARD & CALENDAR
═══════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--surface-glass);
  box-shadow: 0 8px 32px var(--bg-glass-5);
  backdrop-filter: blur(10px);
}

.dashboard-card--compact,
.dashboard-card--padded {
  padding: 20px;
}

.dashboard-card--column {
  display: flex;
  flex-direction: column;
}

.dashboard-card--flat {
  box-shadow: none;
  backdrop-filter: none;
}

.dashboard-card--focus {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-color: rgba(16, 185, 129, 0.2);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.dashboard-card--decorated {
  position: relative;
  overflow: hidden;
}

.personal-goal-header,
.home-tasks-widget__header,
.dashboard-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 12px;
}

.dashboard-card__header {
  gap: 12px;
}

.dashboard-card__header--raised,
.dashboard-stack--raised {
  position: relative;
  z-index: 1;
}

.dashboard-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 0 0 12px;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 600;
}

.dashboard-card__header .dashboard-card__title,
.personal-goal-header .personal-goal-label {
  margin-bottom: 0;
}

.dashboard-card__title--clickable {
  cursor: pointer;
}

.dashboard-card__count {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-glass-2);
  color: var(--text-glass-3);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-card__decor {
  position: absolute;
  opacity: 0.1;
}

.dashboard-card__decor--team {
  top: -10px;
  right: -10px;
}

.dashboard-card__decor--top {
  top: -20px;
  right: -20px;
  opacity: 0.05;
}

.dashboard-card__text {
  margin-bottom: 0;
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.dashboard-card__tag {
  padding: 4px 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-glass-2);
  color: var(--text-bright);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-stack--tight {
  gap: 10px;
}

.dashboard-loading {
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.personal-goal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.personal-goal-left {
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  #viewHome {
    display: flex;
    flex-direction: column;
  }

  #viewHome > #widgetLoRace {
    order: -1;
  }

  .mobile-today-hub {
    display: block;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--surface-glass);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--bg-glass-5);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Unwrap columns so flex order works on children */
  .dashboard-col-left,
  .dashboard-col-right {
    display: contents !important;
  }

  .dashboard-col-left>*,
  .dashboard-col-right>* {
    order: 20;
  }

  /* Reorder widgets for mobile */
  #widgetTasks {
    order: 1;
  }

  #widgetCalendar {
    order: 2;
  }

  #widgetTopPartners {
    order: 3;
  }

  #widgetTeamFocus {
    order: 4;
  }

  #personalGoalCard {
    order: 5;
  }

  #widgetActivity {
    order: 99;
  }

  #viewHome .dashboard-grid .setting-card,
  #viewHome .dashboard-grid .personal-goal-card {
    border-radius: 8px !important;
    padding: 14px !important;
  }

  .mobile-today-hub__top {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-mode-switch {
    width: 100%;
  }

  .badge-text-mobile-hide {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════
   LEAD CARD (CRM Funnel)
═══════════════════════════════════════════ */
.lead-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
  flex: 1;
  margin-right: 8px;
  margin-bottom: 4px;
}

.lead-card__name--flush {
  margin-bottom: 0;
}

.lead-card__top,
.kanban-task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.lead-card__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-card__meta {
  font-size: 13px;
  color: var(--text-glass-2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lead-card__meta--flush {
  margin-bottom: 0;
}

.lead-card__meta--source {
  margin-bottom: 8px;
}

.lead-card__meta--city {
  margin-bottom: 0;
  font-size: 13px;
}

.lead-card__icon {
  background: var(--bg-glass-4);
  padding: 4px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-card__icon--phone {
  padding: 2px 4px;
  border-radius: 4px;
}

.lead-card__icon--city {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.lead-card__phone {
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 700;
}

.lead-card__source {
  font-size: 14px;
}

.lead-card__notes {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.lead-card__callback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--lime);
  background: rgba(203, 240, 120, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.lead-card__callback--flush {
  margin-bottom: 0;
}

.lead-card__callback--overdue {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.lead-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-card__actions--spread {
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.lead-card__actions-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-card__actions-end {
  margin-left: auto;
}

.lead-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 4px 10px;
  min-height: var(--desktop-control-size);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.lead-card__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.lead-card__btn--move {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.lead-card__btn--move-fwd {
  color: var(--lime);
  border-color: rgba(203, 240, 120, 0.3);
  background: rgba(203, 240, 120, 0.08);
}

.lead-card__btn--move-fwd:hover {
  background: rgba(203, 240, 120, 0.18);
}

.lead-card__action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.lead-card__action-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.lead-card__action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.hidden-leads-container {
  display: none;
}

/* ═══════════════════════════════════════════
   FUNNEL STATS BAR
═══════════════════════════════════════════ */
.tasks-stats-bar {
  flex: 1;
}

.tasks-stats-bar-wrapper {
  display: flex;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.funnel-stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  min-width: 60px;
  transition: transform 0.2s;
}

.funnel-stat-pill:hover {
  transform: translateY(-2px);
}

.funnel-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.funnel-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.funnel-stat-pill--total {
  border-color: var(--bg-glass-2);
}

.funnel-stat-pill--total:not(.kanban-tab) {
  cursor: default;
  background: rgba(255, 255, 255, 0.025);
  opacity: 0.72;
}

.funnel-stat-pill--total:not(.kanban-tab):hover {
  transform: none;
}

.funnel-stat-pill--tab-blue {
  border-color: rgba(96, 165, 250, 0.2);
  background: rgba(96, 165, 250, 0.1);
}

.funnel-stat-pill--tab-blue .funnel-stat-num {
  color: #60a5fa;
}

.funnel-stat-pill--tab-purple {
  border-color: rgba(192, 132, 252, 0.2);
  background: rgba(192, 132, 252, 0.1);
}

.funnel-stat-pill--tab-purple .funnel-stat-num {
  color: #c084fc;
}

.funnel-stat-pill--tab-yellow {
  border-color: rgba(250, 204, 21, 0.2);
  background: rgba(250, 204, 21, 0.1);
}

.funnel-stat-pill--tab-yellow .funnel-stat-num {
  color: #facc15;
}

.funnel-stat-pill--success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.funnel-stat-pill--success .funnel-stat-num,
.funnel-stat-pill--registered .funnel-stat-num {
  color: #10b981;
}

.funnel-stat-pill--new {
  border-color: rgba(96, 165, 250, 0.3);
}

.funnel-stat-pill--new .funnel-stat-num {
  color: #60a5fa;
}

.funnel-stat-pill--interested {
  border-color: rgba(245, 158, 11, 0.3);
}

.funnel-stat-pill--interested .funnel-stat-num {
  color: #f59e0b;
}

.funnel-stat-pill--meeting {
  border-color: rgba(167, 139, 250, 0.3);
}

.funnel-stat-pill--meeting .funnel-stat-num {
  color: #a78bfa;
}

.funnel-stat-pill--registered {
  border-color: rgba(16, 185, 129, 0.3);
}

.funnel-stat-pill--conv {
  border-color: rgba(203, 240, 120, 0.3);
}

.funnel-stat-pill--conv .funnel-stat-num {
  color: var(--lime);
}

/* ═══════════════════════════════════════════
   KANBAN EMPTY STATE
═══════════════════════════════════════════ */
.kanban-col__empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--bg-glass-1);
  border-radius: 10px;
  margin: 4px 0;
}

/* ═══════════════════════════════════════════
   EVENTS PAGE (Мероприятия)
═══════════════════════════════════════════ */
.events-page-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.events-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn.events-create-btn {
  font-size: 13px !important;
}

.events-create-slot {
  display: none;
}

.events-tabs-menu {
  display: flex;
}

@media (max-width: 768px) {
  .events-tabs-nav {
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .events-tabs-menu {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
  }

  .events-create-slot {
    display: flex;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .events-page-header .events-page-actions {
    display: none;
  }

  .btn.events-create-btn {
    width: var(--mobile-button-size);
    min-width: var(--mobile-button-size);
    height: var(--mobile-button-size);
    min-height: var(--mobile-button-size);
    padding: 0 !important;
    gap: 0;
    font-size: 0 !important;
  }
}

/* ── Layout ── */
.events-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 0;
  min-height: calc(100vh - 200px);
}

/* ── Список ── */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.events-empty,
.events-detail__empty,
.event-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
}

.events-empty,
.events-detail__empty {
  justify-content: center;
  text-align: center;
}

.events-empty {
  padding: 48px 20px;
  font-size: 14px;
  gap: 8px;
}

.events-empty__icon,
.events-detail__empty-icon {
  font-size: 40px;
}

.events-empty__icon {
  margin-bottom: 4px;
}

.events-empty__hint,
.events-detail__empty-hint {
  font-size: 13px;
}

.events-empty__hint {
  margin-top: 4px;
  opacity: 0.6;
}

/* ── Event Card ── */
.event-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  border-left: 3px solid var(--event-color, #cbf078);
  flex-shrink: 0;
}

@media (hover: hover) {
  .event-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--bg-glass-2);
    transform: translateX(3px);
  }
}

.event-card:active {
  transform: scale(0.98);
}

.event-card--active {
  background: rgba(203, 240, 120, 0.05);
  border-color: rgba(203, 240, 120, 0.3);
  border-left-color: var(--event-color, #cbf078);
}

.event-card--past {
  opacity: 0.6;
}

.event-card__cover,
.event-detail__cover,
.event-cover-preview {
  overflow: hidden;
}

.event-detail__cover,
.event-cover-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card__cover {
  width: 100%;
  height: 100px;
}

.event-card__cover img,
.event-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-card__body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
}

.event-card__date-badge,
.event-comment__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-card__date-badge {
  flex-direction: column;
  min-width: 44px;
  height: 44px;
  border-radius: 10px;
  font-family: inherit;
}

.event-card__day {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.event-card__month {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 2px;
}

.event-card__info {
  flex: 1;
  min-width: 0;
}

.event-card__title,
.event-file-slot__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.event-card__meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.event-card__private {
  color: #f87171;
}

.event-card__participants {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.event-card__participant-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.event-card__participant-label {
  flex: 0 0 76px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.event-card__participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.event-card__participant-more,
.event-card__participant-fallback {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bg-glass-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.event-card__participant-row--going .event-card__participant-label {
  color: var(--lime);
}

.event-card__participant-row--interested .event-card__participant-label {
  color: #fbbf24;
}

.event-card__participant-row--declined .event-card__participant-label {
  color: #f87171;
}

/* ── Detail Panel ── */
.events-detail {
  background: var(--card-detail-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 100px;
}

.events-detail__empty {
  height: 100%;
  min-height: 300px;
  padding: 40px;
}

.events-detail__empty-icon {
  margin-bottom: 12px;
}

.events-detail__empty-title {
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 600;
}

.events-detail__empty-hint {
  margin-top: 6px;
  opacity: 0.5;
}

.event-detail__cover {
  width: 100%;
  max-height: 250px;
  border-bottom: 1px solid var(--bg-glass-1);
  background: rgba(0, 0, 0, 0.5);
}

.event-detail__cover img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
  border-radius: 8px;
}

.event-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  gap: 12px;
  flex-wrap: wrap;
}

.event-detail__badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-detail__color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--event-color, #cbf078);
}

.event-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.event-badge--private {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

.event-badge--specific {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
  color: #60a5fa;
}

.event-detail__actions {
  display: flex;
  gap: 6px;
}

.event-detail__delete {
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.event-detail__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-bright);
  padding: 12px 24px 0;
  margin: 0;
  line-height: 1.3;
}

.event-detail-section {
  padding: 16px 24px;
  border-top: 1px solid var(--bg-glass-4);
}

.event-detail-section:first-of-type {
  border-top: none;
}

.event-detail-section__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-glass-3);
  margin-bottom: 10px;
}

.event-detail__when,
.event-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-detail__when-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}

.event-detail__when-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.event-detail__desc {
  font-size: 14px;
  color: var(--text-bright);
  opacity: 0.9;
  line-height: 1.6;
}

.event-detail__link {
  color: var(--lime);
  text-decoration: underline;
}

.event-files-list--detail {
  margin-top: 8px;
}

.event-detail-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-glass-4);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--lime);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.event-attendance {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.event-attendance__count {
  color: var(--text-bright);
}

.event-attendance__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.event-attendance__person {
  display: inline-block;
  margin: 0;
  padding: 4px 8px;
  background: var(--bg-glass-4);
  border-radius: 6px;
  color: var(--text-bright);
}

/* Список «Что нужно» */
.event-what-needed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-what-needed-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text-bright);
  opacity: 0.9;
  line-height: 1.5;
}

.event-what-needed-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}

/* Смена обложки */
.event-cover-change-btn {
  color: var(--lime);
}

.event-cover-change-btn:hover {
  background: rgba(203, 240, 120, 0.08);
  border-color: rgba(203, 240, 120, 0.6);
}

/* ── Комментарии ── */
.event-comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.event-comment:last-of-type {
  border-bottom: none;
}

.event-comment__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(203, 240, 120, 0.15);
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
}

.event-comment__body {
  flex: 1;
}

.event-comment__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.event-comment__author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}

.event-comment__time {
  font-size: 11px;
  color: var(--text-muted);
}

.event-comment__delete {
  color: var(--text-glass-5);
  margin-left: auto;
}

.event-comment__delete:hover {
  color: #f87171;
}

.event-comment__text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

[data-theme="light"] .event-comment__text {
  color: var(--text);
}

.event-comment-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bg-glass-4);
}

.event-comment-form__submit {
  width: 100%;
  margin-top: 8px;
}

.event-comment-form__input {
  min-height: 96px;
  font-size: 15px;
  line-height: 1.5;
}

.event-comments-state {
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.event-comments-state--error {
  color: #f87171;
}

/* ── Event Modal ── */
.event-modal-card {
  max-width: 640px;
}

.event-cover-upload {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px dashed var(--bg-glass-1);
  transition: border-color 0.2s;
  cursor: pointer;
}

.event-cover-upload.dragover {
  border-color: rgba(203, 240, 120, 0.4);
  background: rgba(203, 240, 120, 0.05);
}

.event-cover-upload--flush {
  margin-bottom: 0;
}

.event-cover-preview {
  height: 240px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  position: relative;
}

.event-cover-preview--compact {
  height: 120px;
}

.event-cover-img {
  display: none;
  border-radius: 12px;
}

.event-cover-input {
  display: none;
}

.event-cover-placeholder {
  gap: 8px;
  font-size: 13px;
}

.event-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.event-form-group {
  display: flex;
  flex-direction: column;
}

.event-form-group--spaced {
  margin-bottom: 20px;
}

.event-form-group--offset {
  margin-top: 16px;
}

.event-form-group--full {
  grid-column: 1 / -1;
}

.form-required {
  color: #ef4444;
}

.event-search-option {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-glass-4);
  color: var(--text-bright);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.event-search-option:hover {
  background: var(--bg-glass-4);
}

.event-search-option__name {
  font-weight: 500;
}

.event-search-option__meta {
  color: var(--text-glass-3);
  font-size: 11px;
}

.event-search-empty {
  padding: 10px 12px;
  color: var(--text-glass-2);
  font-size: 13px;
  text-align: center;
}

.event-participant-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg-glass-3);
  color: var(--text-bright);
  font-size: 12px;
}

.event-participant-chip__status {
  color: var(--text-muted);
}

.event-participant-chip__remove,
.event-file-slot__remove {
  border: none;
  background: none;
  color: #f87171;
  cursor: pointer;
  font-size: 14px;
}

.event-participant-chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 0;
}

.event-partner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(203, 240, 120, 0.1);
  border: 1px solid rgba(203, 240, 120, 0.3);
  border-radius: 6px;
  color: var(--lime);
  font-size: 12px;
}

.event-partner-chip__remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.event-file-slot--filled,
.event-file-slot__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
}

.event-file-slot--filled {
  border: 1px solid var(--border-light);
  background: var(--bg-glass-3);
}

.event-file-slot__name {
  flex: 1;
  color: var(--text-bright);
  font-size: 13px;
}

.event-file-slot__remove {
  padding: 0 4px;
}

.event-file-slot__label {
  border: 1px dashed var(--border-light);
  background: var(--bg-glass-5);
  cursor: pointer;
  transition: background 0.2s;
}

.event-file-slot__label:hover {
  background: var(--bg-glass-4);
}

.event-file-slot__placeholder {
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
}

.event-form-input {
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
}

.event-form-input:focus {
  border-color: rgba(203, 240, 120, 0.4);
}

.event-form-input::placeholder {
  color: var(--text-glass-5);
}

input[type="datetime-local"].event-form-input::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}

/* Выбор цвета */
.event-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.event-color-swatch[data-color="#cbf078"] { background: #cbf078; }
.event-color-swatch[data-color="#60a5fa"] { background: #60a5fa; }
.event-color-swatch[data-color="#f59e0b"] { background: #f59e0b; }
.event-color-swatch[data-color="#a78bfa"] { background: #a78bfa; }
.event-color-swatch[data-color="#f87171"] { background: #f87171; }
.event-color-swatch[data-color="#34d399"] { background: #34d399; }

.event-color-swatch.active {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.15);
  box-shadow: 0 0 8px var(--text-glass-5);
}

.event-color-swatch:hover:not(.active) {
  transform: scale(1.1);
}

.event-detail__cover img.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  box-sizing: border-box;
  object-fit: contain;
  cursor: zoom-out;
}

/* Event Tag Filters */
.events-tags-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px 0;
  -webkit-overflow-scrolling: touch;
}

.events-tags-container::-webkit-scrollbar {
  display: none;
}

/* Mobile Event Detail Bottom Sheet */
.event-bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.event-bottom-sheet-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.event-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 1001;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--border-light);
}

.event-bottom-sheet.hidden {
  transform: translateY(100%);
  display: flex !important;
  /* Override hidden class display: none to allow animation */
}

.event-bottom-sheet__drag-handle {
  width: 40px;
  height: 4px;
  background: var(--bg-glass-5);
  border-radius: 4px;
  margin: 12px auto;
}

.event-bottom-sheet > .modal-icon-close {
  position: absolute;
  top: 8px;
  right: 12px;
}

.event-bottom-sheet__content {
  padding: 0 20px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Event RSVP actions */
.event-rsvp-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.event-rsvp-btn {
  flex: 1;
}

.event-rsvp-btn[data-status="going"].active {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border-color: #4ade80;
}

.event-rsvp-btn[data-status="interested"].active {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border-color: #fbbf24;
}

.event-rsvp-btn[data-status="declined"].active {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border-color: #f87171;
}

.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-grid-2col--flush {
  margin-bottom: 0;
}

@media (max-width: 992px) {
  .events-layout {
    grid-template-columns: 1fr !important;
  }

  .events-detail {
    display: none;
  }

  .modal-grid-2col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-grid-span-2 {
    grid-column: auto;
  }

  .modal-content label {
    font-size: 14px !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
  }

  .modal-content input,
  .modal-content select,
  .modal-content textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
  }

  .modal-content h2 {
    font-size: 20px !important;
  }

  .modal-backdrop:not(.hidden) {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.62) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .modal-backdrop:not(.hidden) .modal-content,
  .modal-backdrop:not(.hidden) .event-modal-card {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(92dvh, 720px) !important;
    margin: 0 !important;
    padding: 16px !important;
    border-radius: 16px 16px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: var(--modal-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45) !important;
  }

  .modal-close-btn,
  .account-refresh-modal__close,
  .partner-detail-modal__close,
  #closeEventModal,
  #btnTaskViewModalClose,
  #btnLeadViewModalClose,
  #btnTaskModalCancelTop,
  #btnLeadModalCancelTop,
  #closeCalEventDetailModal {
    --modal-close-size: var(--mobile-button-size);
    width: var(--modal-close-size) !important;
    min-width: var(--modal-close-size) !important;
    height: var(--modal-close-size) !important;
    min-height: var(--modal-close-size) !important;
    padding: 0 !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg-glass-3) !important;
    color: var(--text-muted) !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  .modal-close-btn,
  .account-refresh-modal__close,
  .partner-detail-modal__close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
  }

  #partnerDetailModal:not(.hidden) {
    align-items: center !important;
    padding: 16px !important;
  }

  #partnerDetailModal:not(.hidden) .partner-detail-modal__content {
    width: min(100%, 420px) !important;
    max-height: min(90dvh, 720px) !important;
    margin: auto !important;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 18px !important;
    overflow-y: auto !important;
    background: var(--surface) !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48) !important;
  }

  #partnerDetailModal:not(.hidden) .partner-detail-modal__close {
    top: 12px;
    right: 12px;
  }

  #partnerDetailModal:not(.hidden) .partner-detail-modal__header {
    margin-bottom: 16px;
  }

  #partnerDetailModal:not(.hidden) .partner-detail-modal__row {
    grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.2fr);
  }

  #vibeConfirmModal:not(.hidden),
  #cropActionModal:not(.hidden),
  #avatarActionModal:not(.hidden),
  #calendarChoiceModal:not(.hidden),
  #accountRefreshModal:not(.hidden),
  #personalGoalModal:not(.hidden),
  #teamFocusModal:not(.hidden) {
    align-items: center !important;
    padding: 16px !important;
  }

  #vibeConfirmModal:not(.hidden) .modal-content,
  #cropActionModal:not(.hidden) .modal-content,
  #avatarActionModal:not(.hidden) .modal-content,
  #calendarChoiceModal:not(.hidden) .modal-content,
  #accountRefreshModal:not(.hidden) .modal-content,
  #personalGoalModal:not(.hidden) .modal-content,
  #teamFocusModal:not(.hidden) .modal-content {
    max-width: 420px !important;
    border-radius: 16px !important;
    margin: auto !important;
  }

  .modal-backdrop:not(.hidden) .modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 0 !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop:not(.hidden) input,
  .modal-backdrop:not(.hidden) select,
  .modal-backdrop:not(.hidden) textarea,
  .modal-backdrop:not(.hidden) .event-form-input {
    min-height: 44px;
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  .modal-backdrop:not(.hidden) textarea {
    min-height: 96px;
  }

  .modal-backdrop:not(.hidden) .btn {
    min-height: var(--mobile-button-size);
    border-radius: 10px !important;
  }

  .modal-backdrop:not(.hidden) .modal-content > div:last-child {
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .modal-backdrop:not(.hidden) .modal-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .modal-backdrop:not(.hidden) [style*="grid-column: span 2"] {
    grid-column: auto !important;
  }

  #eventModal:not(.hidden),
  #adminUserModal:not(.hidden) {
    align-items: center !important;
    padding: 20px !important;
  }

  #eventModal:not(.hidden) .event-modal-card,
  #adminUserModal:not(.hidden) .admin-user-modal__content {
    height: auto !important;
    max-height: 85vh !important;
    margin: auto !important;
    border-radius: 20px !important;
  }

  #eventModal:not(.hidden) .event-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #eventModal:not(.hidden) .event-form-group--full {
    grid-column: auto;
  }

  #eventModal:not(.hidden) .modal-footer {
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #taskModalAssigneeDropdown,
  #taskModalPartnerDropdown,
  #taskModalVisibleToDropdown {
    top: 100% !important;
    bottom: auto !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
    max-height: 180px !important;
    z-index: 2200 !important;
  }

  #eventParticipantsDropdown,
  #eventModalPartnerDropdown,
  #adminUserVibeIdDropdown {
    max-height: 180px !important;
    z-index: 2200 !important;
  }

  #personalGoalModal:not(.hidden) .modal-content,
  #teamFocusModal:not(.hidden) .modal-content,
  #avatarActionModal:not(.hidden) .modal-content,
  #calendarChoiceModal:not(.hidden) .modal-content {
    max-height: none !important;
  }
}

@media (max-width: 992px) {
  #tabCrmTasks #kanbanBoard,
  #tabCrmTasks #tasksPagination {
    display: flex !important;
  }

  .kanban-board {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    gap: 12px !important;
    max-width: 100%;
    contain: inline-size;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    transition: height 0.18s ease;
  }

  .kanban-board::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .kanban-board {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .kanban-scroll-shell {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  }

  .kanban-scroll-btn {
    position: fixed;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 950;
    transform: none;
  }

  .kanban-scroll-btn--prev {
    left: 16px;
  }

  .kanban-scroll-btn--next {
    right: 16px;
  }

  .kanban-col {
    display: flex !important;
    flex: 0 0 calc(100vw - 32px) !important;
    scroll-snap-align: center !important;
    max-width: none !important;
    width: auto !important;
    min-width: 0 !important;
    height: max-content !important;
  }

  .kanban-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
    z-index: 950;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 0 6px 18px var(--bg-glass-5);
    transform: translateX(-50%);
  }

  .kanban-pagination .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-glass-4);
    transition: background 0.3s, transform 0.3s;
  }

  .kanban-pagination .dot.active {
    background: var(--lime);
    transform: scale(1.2);
  }

  .tasks-stats-bar-wrapper {
    gap: 8px;
  }

  .tasks-stats-bar-wrapper .funnel-stat-pill {
    flex: 1;
    justify-content: center;
    padding: 8px 4px;
    text-align: center;
  }

  .kanban-tab {
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
  }

  .kanban-tab.active-tab {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

.kanban-col__show-all {
  width: 100%;
  padding: 10px;
  background: var(--bg-glass-3);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  border-radius: 12px;
  margin-top: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.kanban-col__show-all:hover {
  background: var(--bg-glass-5);
  color: var(--text-bright);
}

/* Цветовое кодирование карточек задач */
.kanban-card.card-priority-high {
  background: rgba(250, 204, 21, 0.05);
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.kanban-card.card-priority-critical {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.text-line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════
   Увеличение тап-зон (Mobile UX)
═══════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Единый мобильный размер для действий в карточках. */
  .lead-card__action-btn,
  .lead-card__btn,
  .event-cover-change-btn,
  .event-comment__delete {
    min-width: var(--mobile-button-size) !important;
    min-height: var(--mobile-button-size) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
  }

}

/* ═══════════════════════════════════════════
   NATIVE APPLE-STYLE CALENDAR (всё устройства)
═══════════════════════════════════════════ */

/* ── Шапка ── */
.nc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nc-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nc-header__nav {
  display: flex;
  gap: 4px;
}

.nc-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-glass-3);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nc-nav-btn:active {
  transform: scale(0.9);
}

/* Кнопка "Сегодня" */
.nc-today-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg-glass-3);
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nc-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.nc-title__month {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.4px;
}

.nc-title__year {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Дни недели ── */
.nc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.nc-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 4px 0 10px;
}

.nc-weekday:nth-child(6),
.nc-weekday:nth-child(7) {
  color: var(--text-glass-3);
}

/* ── Сетка дней ── */
.nc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

/* ── Ячейка дня (мобильная база) ── */
.nc-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 2px;
  min-height: 44px;
  gap: 2px;
  min-width: 0;
}

.nc-day:active {
  background: var(--bg-glass-5) !important;
}

.nc-day--other {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

.nc-day__num {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

/* Сегодня */
.nc-day--today .nc-day__num {
  color: var(--lime);
  font-weight: 800;
  background: rgba(203, 240, 120, 0.13);
}

/* Выбранный */
.nc-day--selected .nc-day__num {
  background: var(--lime);
  color: #111219;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(203, 240, 120, 0.4);
}

/* ── Dots (мобилка) ── */
.nc-day__dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-height: 6px;
}

.nc-day__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Чипы событий в ячейке (десктоп) ── */
.nc-day__chips {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
  min-width: 0;
}

.nc-day__event-chip,
.nc-event-item__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-day__event-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.5;
  transition: opacity 0.15s, filter 0.15s;
  max-width: 100%;
}

.nc-day__more {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 1px 4px;
}

/* ═══════════════════════════════════════════
   ДЕСКТОПНЫЙ LAYOUT (двухколоночный)
═══════════════════════════════════════════ */
.nc-desktop-layout {
  display: flex;
  min-height: 380px;
}

.nc-desktop-left {
  flex: 1;
  min-width: 0;
}

.nc-desktop-right {
  width: 240px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-light);
  margin-left: 20px;
  padding-left: 20px;
}

/* Десктоп: ячейки высокие, с местом для чипов */
@media (min-width: 769px) {
  .nc-day {
    min-height: 72px;
    align-items: flex-start;
    padding: 6px 4px 4px;
    border-radius: 0;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
  }

  .nc-day__num {
    font-size: 13px;
    width: 28px;
    height: 28px;
    align-self: flex-end;
    margin-bottom: 2px;
    margin-left: auto;
    margin-right: 2px;
  }

  .nc-weekday {
    font-size: 10px;
    padding-bottom: 8px;
  }

  .nc-grid {
    gap: 1px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
  }

  .nc-day:nth-child(7n) {
    border-right: none;
  }

  .nc-grid>.nc-day:nth-last-child(-n+7) {
    border-bottom: none;
  }
}

/* ═══════════════════════════════════════════
   ПАНЕЛЬ СОБЫТИЙ (десктоп справа)
═══════════════════════════════════════════ */
.nc-events-panel {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-glass-3) transparent;
}

.nc-events-panel::-webkit-scrollbar {
  width: 4px;
}

.nc-events-panel::-webkit-scrollbar-thumb {
  background: var(--bg-glass-3);
  border-radius: 2px;
}

/* ── Мобильный список событий (снизу) ── */
.nc-events {
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

/* ── Заголовок дня ── */
.nc-events__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.nc-events__create {
  flex: 0 0 auto;
  padding-inline: 10px;
  font-size: 12px;
}

/* ── Плейсхолдер ── */
.nc-events__placeholder,
.nc-events__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.nc-events__placeholder {
  gap: 10px;
  padding: 40px 16px;
  opacity: 0.6;
}

/* ── Пусто ── */
.nc-events__empty {
  gap: 8px;
  padding: 24px 8px;
  opacity: 0.7;
}

.nc-events__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Карточка события ── */
.nc-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass-3);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.nc-event-item:active {
  transform: scale(0.97);
}

.nc-event-item__color-bar {
  width: 3px;
  min-height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nc-event-item__body {
  flex: 1;
  min-width: 0;
}

.nc-event-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}

.nc-event-item__time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.nc-event-item__arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.35;
}

@media (hover: hover) {
  .nc-nav-btn:hover,
  .nc-event-item:hover {
    background: var(--bg-glass-5);
  }

  .nc-today-btn:hover {
    background: rgba(203, 240, 120, 0.12);
    border-color: rgba(203, 240, 120, 0.3);
  }

  .nc-day:hover {
    background: var(--bg-glass-3);
  }

  .nc-day__event-chip:hover {
    filter: brightness(1.2);
    opacity: 0.95;
  }
}

/* ── Мобильный: убираем правую колонку, возвращаем dots ── */
@media (max-width: 768px) {
  .nc-desktop-layout {
    flex-direction: column;
  }

  .nc-desktop-right {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-light);
    margin-left: 0;
    padding-left: 0;
    margin-top: 14px;
    padding-top: 14px;
  }

  .nc-day {
    padding: 4px 0;
  }

  .nc-day__num {
    font-size: 16px;
    width: 34px;
    height: 34px;
  }

  .nc-grid {
    gap: 2px;
  }

  .nc-title__month {
    font-size: 18px;
  }

  .nc-title__year {
    font-size: 12px;
  }

  .nc-events-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* Fix for Safari iOS rendering bug with backdrop-filter and display: none */
.modal-backdrop.hidden {
  display: flex !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -100 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* Единый размер действий на мобильном. */
@media (max-width: 992px) {
  .btn--control {
    min-height: var(--mobile-button-size);
  }

  .tab-btn,
  .mentor-refresh-btn,
  .mentor-expand-btn,
  .mentor-action-card__actions button {
    min-height: var(--mobile-button-size) !important;
  }

  .tab-btn {
    padding-block: 0 !important;
  }

  .modal-icon-close,
  .nc-nav-btn {
    width: var(--mobile-button-size) !important;
    min-width: var(--mobile-button-size) !important;
    height: var(--mobile-button-size) !important;
    min-height: var(--mobile-button-size) !important;
  }

  .mobile-mode-switch__btn {
    width: auto !important;
    min-width: 0 !important;
    height: var(--mobile-button-size) !important;
    min-height: var(--mobile-button-size) !important;
  }

  .nc-nav-btn {
    border-radius: 10px;
  }

  .lead-card__btn--move {
    width: var(--mobile-button-size) !important;
    height: var(--mobile-button-size) !important;
  }

  .kanban-col__header > .btn--control.icon-control {
    width: var(--mobile-button-size);
    min-width: var(--mobile-button-size);
    height: var(--mobile-button-size);
    min-height: var(--mobile-button-size);
  }

}

/* Единый контейнер и отступ заголовков основных разделов. */
.page-section-header {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  padding: 0;
  margin-bottom: 16px !important;
}

#viewStructure .top-controls {
  align-items: stretch;
  min-width: 0;
  padding: 0;
  margin-bottom: 16px !important;
}

.scroll-to-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(203, 240, 120, 0.42);
  border-radius: 999px;
  background: rgba(21, 25, 31, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  color: var(--lime);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.scroll-to-top-btn:hover {
  background: var(--lime);
  color: #16191f;
}

.scroll-to-top-btn--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 992px) {
  .scroll-to-top-btn {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    width: var(--mobile-button-size);
    min-width: var(--mobile-button-size);
    padding: 0;
    justify-content: center;
  }

  .scroll-to-top-btn span {
    display: none;
  }
}
