:root {
  /*--overlay-bg: #17212b;
  --card-bg: #232e3c;*/
    --overlay-bg: var(--tg-theme-secondary-bg-color);
  --card-bg: var(--tg-theme-section-bg-color); 
}

@media (hover: hover) and (pointer: fine) {
  :root {
    --overlay-bg: var(--tg-theme-section-bg-color);
    --card-bg: var(--tg-theme-secondary-bg-color);
  }
}

html,
body {
  height: 100%;
  overflow: hidden;
}


.overlay {
  position: fixed;
  inset: 0;

  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .25s ease;
}

.overlay.active {
  opacity: 1;
      padding-bottom: calc(
    var(--nav-height)
    + var(--nav-offset)
    + env(safe-area-inset-bottom)
    + 15px
  );
  pointer-events: auto;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: 16px;
  padding-right: 16px;
  padding-left: 16px;

}

.overlay[data-overlay="lessonPlayer"].active {
  padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
}

.overlay[data-overlay="lessonPlayer"] {
  z-index: 101;
}

/* base */
.overlay[data-type="base"] {
  z-index: 1;
  background: var(--overlay-bg, #fff);
}

/* fullscreen */
.overlay[data-type="fullscreen"] {
  z-index: 2;
  background: #fff;
}

/* modal */
.overlay[data-type="modal"] {
  z-index: 10;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* sheet */
.overlay[data-type="sheet"] {
  z-index: 11;
  display: flex;
  align-items: flex-end;
}

[data-view] { display: none; }

.overlay[data-role="guest"] [data-view="guest"] {
  display: block;
}

.overlay[data-role="client"] [data-view="client"] {
  display: block;
}


.overlay[data-role="supervisor"] [data-view="supervisor"],

.overlay[data-role="admin"] [data-view="supervisor"] {
  display: block;
}

.greeting {
  padding: 16px 16px 8px;
}

.greeting-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--tg-theme-text-color, #ffffff);
  letter-spacing: -0.2px;
}

/* ==SETTINGS OVERLAY== */

.my-settings {
  display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden auto;
    overflow: clip auto;
    overscroll-behavior-x: none;
    position: relative;
    scrollbar-width: none;
    width: 100%;
    -ms-overflow-style: none;

    position: relative;
    padding: 0 15px; 
    padding-top: 24px;
    padding-bottom: calc(var(--screen-padding-bottom) + 400px);
    background: none !important;
    max-height: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sectionSettings {
  display: flex;
  flex-direction: column;
  gap: 12px;

  background: var(--card-bg, #ffffff);
  padding-block: 20px 4px;
  padding-inline: 20px;
  border-radius: 8px;
}

.overlayTitle {
  
      font-size: 16px;
    font-weight: 600;
    line-height: 18px; 
    color: var(--tg-theme-text-color, #fff);
    margin-bottom: 12px;
}

.title {
  color: var(--tg-theme-link-color, #000000); 
    font-size: 15px;
    font-weight: 500;
    line-height: 18px; 
    margin-bottom: 12px;
}

.menuRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.menuList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--tg-theme-text-color);
}

.menuIcon {
  border-radius: 10px;
    height: 28px;
    color: #fff;
    overflow: hidden;
    position: relative;

}

/* ==Language Selector */

.language-overlay {
  padding: 12px 16px;
  color: var(--tg-theme-text-color);
}

.language-list {
  display: flex;
  flex-direction: column;
}

.language-item {
  display: flex;
  align-items: center;                 /* радио по центру */
  justify-content: space-between;

  padding: 12px 0;
  background: none;
  border: none;
  text-align: left;

  color: var(--tg-theme-text-color);
  cursor: pointer;
}

/* 🔑 КЛЮЧЕВОЙ БЛОК */
.language-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;             /* ← важно */
  gap: 2px;
}

.language-main {
  font-size: 16px;
  line-height: 1.2;
}

.language-sub {
  font-size: 13px;
  line-height: 1.2;
  color: var(--tg-theme-hint-color);
}

.language-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--tg-theme-hint-color);
  flex-shrink: 0;                      /* 🔑 чтобы не сжимался */
}

/* активный язык */
.language-item.active .language-radio {
  border-color: var(--tg-theme-button-color);
  background: var(--tg-theme-button-color);
}

/* === TASKS TODAY === */

.tasksToday {
    display: flex;
    flex-direction: column;
   /* gap: 12px; */
    background: var(--card-bg, #000);
    padding-block: 20px 4px;
    padding-inline: 20px;
    border-radius: 20px;
    padding: 20px;
    
}


.menuRow {
  border-bottom: 1px solid var(--tg-theme-hint-color, #fff);

}

.menuRow:last-child {
  border-bottom: none;
}

.task-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;

}

/* состояния */
.task-done {
  opacity: 0.5;
}

.task-done .task-title {
  text-decoration: line-through;
}

/* иконки по типам */
.task-icon.check {
  background: rgb(52, 199, 89); /* зелёный */
}

.task-icon.play {
  background: rgb(0, 122, 255); /* синий */
}

.task-icon.scale {
  background: rgb(255, 149, 0); /* оранжевый */
}

.quick-actions {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 0;
}

.action-btn {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0; 
  justify-content: flex-start; 
  align-items: center;
  gap: 8px;

  padding: 10px 12px;
  border-radius: 14px;

  background: var(--card-bg, #000);;
  border: 1px solid rgba(255, 255, 255, 0.08);

  color: var(--tg-theme-accent-text-color);
  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
  white-space: nowrap;
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn .icon {
  width: 28px;
  height: 28px;
  display: flex;
  flex-shrink: 0;
}

.action-btn svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.action-btn .label {
  line-height: 1;
    overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
    display: flex;
  flex-direction: column;
   /* align-items: flex-start;  */ 
  text-align: center;
  line-height: 1.1;
  font-size: 12px;
  font-weight: 500;
  
}

.motivation-card {
  display: flex;
  align-items: center;
  gap: 12px;
  
  padding: 14px 16px;
  border-radius: 16px;

  background: var(--card-bg, #000);
  color: var(--tg-theme-text-color);

  font-size: 14px;
  line-height: 1.4;
}

.motivation-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--tg-theme-accent-text-color);
}

.motivation-icon svg {
  width: 100%;
  height: 100%;
}

.motivation-text strong {
  font-weight: 600;
}

.stat-card {
  cursor: default;
      flex-direction: unset;
}

.stat-card:active {
  transform: none;
}


.stat-card .label strong {
  font-size: 16px;
  font-weight: 600;
}

.stat-icon {
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;

  color: #fff; /* иконка */
}

/* индивидуальные цвета */
.stat-icon.weight {
  background: linear-gradient(135deg, #5ac8fa, #007aff);
}

.stat-icon.days {
  background: linear-gradient(135deg, #34c759, #0fbf4a);
}

.stat-icon.streak {
  background: linear-gradient(135deg, #ff9f0a, #ff453a);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.progressChart {
    background: var(--card-bg, #000);
    
    border-radius: 20px;
}

.body-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.stat-left,
.stat-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--tg-theme-text-color);
}

.stat-sub {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
}

.stat-value-start,
.stat-value-current {
  font-size: 15px;
  font-weight: 500;
  color: var(--tg-theme-text-color);
}

.stat-diff.positive {
  color: #16a34a;
}

.stat-diff.negative {
  color: #dc2626;
}

.edit-btn {
  background: none;
  border: none;
  color: var(--tg-theme-link-color);
  font-size: 14px;
  cursor: pointer;
}

.measurements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
    font-size: 15px;
  font-weight: 500;
  color: var(--tg-theme-text-color);
}

.resultsButton {
    display: flex;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 15px;
    border-radius: 14px;
    background: var(--card-bg, #000);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--tg-theme-accent-text-color);
    font-size: 14px;
    font-weight: 500;

    
}

.stat-input {
  width: 100%;
  background: var(--card-bg);
  border: none;
  text-align: right;
  font-size: 15px;
  color: var(--tg-theme-text-color);
  outline: none;
      padding: 4px;
    border-radius: 8px;
}


.modalPage {
    
    display: flex;
    flex-direction: column;
}

/* MY CUSTOMERS LIST */
.clients-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card-bg);
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ddd;
  object-fit: cover;
}

.client-info {
  flex: 1;
  color: var(--tg-theme-text-color);
}

.client-name {
  font-weight: 600;
}

.client-meta {
  font-size: 12px;
  opacity: 0.7;
}

.client-status {
  font-size: 14px;
  font-weight: 500;
}

.status-active { color: #2ecc71; }
.status-frozen { color: #f1c40f; }
.status-blocked { color: #e74c3c; }
.status-expired { color: #e67e22; }

/* =========================
   Client Edit Overlay
========================= */

.overlay[data-overlay="clientEdit"] {
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */

.overlay[data-overlay="clientEdit"] .overlay-header {

  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.overlay[data-overlay="clientEdit"] .overlay-header .title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* ===== Content ===== */

.overlay[data-overlay="clientEdit"] .overlay-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;

}

/* ===== Field ===== */

.overlay[data-overlay="clientEdit"] .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hintLabel {
  font-size: 13px;
  opacity: 0.7;
    color: var(--tg-theme-text-color); 
.CORNER-SHAPE: SUPERELLIPSE(0.5);
  Optional. Main text color in the #RRGGBB format.Also available as the CSS variable var(--tg-theme-text-color)CORNER-SHAPE: SUPERELLIPSE(0.5);
}

/* ===== Select ===== */

.overlay[data-overlay="clientEdit"] select {
  appearance: none;
  -webkit-appearance: none;

  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  background-color: var(--card-bg, #fff);
  color: var(--tg-theme-text-color, #000);

  outline: none;
}

.overlay[data-overlay="clientEdit"] select:focus {
  border-color: var(--tg-theme-link-color, #2ea6ff);
}

/* ===== Save Button ===== */

.save-tg-btn {

  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;

  border: none;
  cursor: pointer;

  background: var(--tg-theme-button-color, #2ea6ff);
  color: var(--tg-theme-button-text-color, #fff);
}

.overlay[data-overlay="clientEdit"] #clientStatusSaveBtn:active {
  transform: scale(0.98);
}

/* ===== Disabled state (на будущее) ===== */

.overlay[data-overlay="clientEdit"] #clientStatusSaveBtn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* ==COURSES OVERLAY== */
.is-hidden {
  display: none !important;
}

.courses-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 10px;
}

.courses-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--card-bg, #ffffff);
  color: var(--tg-theme-text-color, #222);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.courses-back svg {
  width: 20px;
  height: 20px;
}

.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.course-card {
  background: var(--card-bg, #ffffff);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.course-cover {
  height: 120px;
  background: linear-gradient(120deg, #f4b186, #f7d6c1);
}

.course-cover--ocean {
  background: linear-gradient(120deg, #7cc6ff, #b8e0ff);
}

.course-cover--sunrise {
  background: linear-gradient(120deg, #ffb4a2, #ffe0b2);
}

.course-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.course-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tg-theme-text-color, #222);
}

.course-meta {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #7a7a7a);
}

.course-note {
  font-size: 13px;
  color: var(--tg-theme-text-color, #222);
  opacity: 0.8;
}

.lessons-header {
  padding: 6px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lessons-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tg-theme-text-color, #222);
}

.lessons-sub {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #7a7a7a);
}

.lesson-list {
  display: grid;
  gap: 12px;
}

.lesson-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--card-bg, #ffffff);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.lesson-index {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(77, 163, 255, 0.12);
  color: #2d6cdf;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lesson-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tg-theme-text-color, #222);
}

.lesson-meta {
  font-size: 12px;
  color: var(--tg-theme-hint-color, #7a7a7a);
}

.lesson-action {
  font-size: 12px;
  font-weight: 600;
  color: #2d6cdf;
}

.lesson-player {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lesson-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: var(--card-bg, #ffffff);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.lesson-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-theme-hint-color, #7a7a7a);
  font-size: 13px;
}

.lesson-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lesson-description {
  font-size: 14px;
  color: var(--tg-theme-text-color, #222);
}

.lesson-practice-block {
  background: var(--card-bg, #ffffff);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.lesson-practice-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--tg-theme-text-color, #222);
}

.lesson-practice-text {
  font-size: 13px;
  color: var(--tg-theme-text-color, #222);
  opacity: 0.85;
}

.courses-note {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #7a7a7a);
  margin-bottom: 12px;
}

.course-card.is-locked {
  opacity: 0.7;
}

.course-lock {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 12px;
  color: var(--tg-theme-text-color, #222);
}

.lesson-card.is-locked .lesson-action {
  color: #999;
}

.lesson-lock {
  margin-top: 6px;
  font-size: 12px;
  color: var(--tg-theme-hint-color, #7a7a7a);
}

.lesson-practice {
  margin-top: 6px;
  font-size: 12px;
  color: var(--tg-theme-text-color, #222);
  opacity: 0.85;
}

@media (min-width: 480px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
