/* Dashboard Screen — no scroll, fits screen exactly via JS height */

#screen-dashboard {
  overflow: hidden !important;
}

#dashboard-content {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Высота задаётся через JS в render() */
}

/* Standalone PWA — отступ сверху под статус бар */
@media all and (display-mode: standalone) {
  #dashboard-content {
    padding-top: env(safe-area-inset-top, 44px);
  }
}

#screen-dashboard .scroll-content {
  background: #fff;
}

/* =================== NEXT SESSION =================== */
.next-session-card {
  background: var(--primary-gradient);
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
/* с.94-v3: карточка НЕ кнопка целиком — кликается только внутренняя зона тренировки.
   base cursor/:active-scale убраны (сжимали карточку при тапе по ленте/пустому месту) */
.ns-zone--tap { cursor: pointer; transition: transform 0.15s ease; }
.ns-zone--tap:active { transform: scale(0.98); }
.next-session-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none; /* с.94-v3: декор не перехватывает тапы/скролл */
}
.next-session-card__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-bottom: 4px;
}
.next-session-card__type { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.next-session-card__time { font-size: 13px; opacity: 0.9; display: flex; align-items: center; gap: 6px; }
.next-session-card__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; overflow: hidden;
}
.next-session-card__empty { font-size: 13px; opacity: 0.8; }
.next-session-card__arrow { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); opacity: 0.6; }

/* =================== CHART =================== */
.dashboard-chart { background: #fff; border: 1px solid #D1D5DB; border-radius: 16px; padding: 16px; margin: 12px 0; }
.dashboard-chart__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dashboard-chart__title { font-size: 14px; font-weight: 600; color: #111827; }
.dashboard-chart__periods { display: flex; gap: 2px; }
.dashboard-chart__period-btn { padding: 4px 6px; border-radius: 20px; font-size: 11px; font-weight: 500; border: none; background: none; color: #6B7280; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.dashboard-chart__period-btn:active { transform: scale(0.92); }
.dashboard-chart__period-btn--active { background: #7C3AED; color: #fff; }
.dashboard-chart__bars { display: flex; align-items: flex-end; gap: 8px; height: 100px; width: 100%; padding: 0 8px; }
.dashboard-chart__bar { flex: 1; background: #F3F4F6; border-radius: 4px 4px 0 0; min-height: 6px; transition: height 0.3s ease; }
.dashboard-chart__bar--active { background: #7C3AED; }
.dashboard-chart__labels { display: flex; gap: 8px; padding: 8px 8px 0; }
.dashboard-chart__label { flex: 1; text-align: center; font-size: 11px; color: #6B7280; }

/* =================== DASH CARD TAP =================== */
.dash-card:active { transform: scale(0.97); transition: transform 0.1s ease; }

/* =================== CLIENT PICKER =================== */
.dashboard-picker-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; transition: background 0.15s; }
.dashboard-picker-item:active { background: #F3F4F6; }
.dashboard-picker-item__info { flex: 1; min-width: 0; }
.dashboard-picker-item__name { font-size: 15px; font-weight: 600; color: #111827; }
.dashboard-picker-item__meta { font-size: 13px; color: #6B7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== с.108 (v968): пилюля Главной — постоянная высота, доли зон 40 / 60 =====
   Высота задана жёстко: содержимое не имеет права двигать экран (иначе нижний ряд
   плиток уезжает под меню). Переполнение любой зоны — прокрутка ВНУТРИ неё. */
.ns-pill {
  height: 190px;
  border-radius: 14px;
  background: var(--primary-gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ns-pill::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}

/* верхняя зона — события */
.ns-pill__notes {
  height: 40%;
  padding: 8px 14px 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}
.ns-pill__notes::-webkit-scrollbar { width: 3px; }
.ns-pill__notes::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 2px; }
.ns-pill__ntitle {
  font-size: 9px; letter-spacing: 0.6px; text-transform: uppercase;
  opacity: 0.75; line-height: 1.2; margin-bottom: 2px;
}
.ns-pill__nrow { display: flex; gap: 7px; align-items: flex-start; padding: 2px 0; cursor: pointer; }
.ns-pill__ndot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.95); flex-shrink: 0; margin-top: 5px; }
.ns-pill__ntext {
  font-size: 12px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.ns-pill__nempty { font-size: 12px; opacity: 0.75; padding: 3px 0; }

.ns-pill__div { height: 1px; background: rgba(255,255,255,0.22); margin: 0 14px; flex-shrink: 0; }

/* нижняя зона — тренировка */
.ns-pill__next {
  height: 60%;
  padding: 7px 14px 9px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ns-pill__label { font-size: 9px; line-height: 1.2; letter-spacing: 0.6px; text-transform: uppercase; opacity: 0.8; margin-bottom: 2px; }
/* название всегда в одну строку: перенос менял высоту карточки на 30 пунктов */
.ns-pill__type {
  font-size: 17px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ns-pill__time { font-size: 13px; line-height: 1.2; opacity: 0.92; margin-top: 1px; display: flex; align-items: center; gap: 5px; }
/* распорки между временем и клиентом НЕТ — блок плотный (решение тренера) */
.ns-pill__who { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.ns-pill__who--sm { margin-top: 0; padding: 1px 0; gap: 7px; }
.ns-pill__ava {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.ns-pill__ava--sm { width: 20px; height: 20px; font-size: 8px; }
.ns-pill__ava img { width: 100%; height: 100%; object-fit: cover; }
.ns-pill__nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-pill__who--sm .ns-pill__nm { font-size: 12px; opacity: 0.95; }
.ns-pill__empty { font-size: 13px; opacity: 0.85; margin-top: 4px; }

/* групповая: список участников прокручивается внутри нижней зоны */
.ns-pill__list {
  margin-top: 4px; flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-y;
}
.ns-pill__list::-webkit-scrollbar { width: 3px; }
.ns-pill__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 2px; }

.ns-pill__arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); opacity: 0.65; }
