/* ===================================
   GymDiet Master — UI improvements
   =================================== */

/* Исправление наложения элементов на главном экране */
.dashboard-progress-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.dashboard-progress-ring-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dashboard-macro-stack {
  width: 100%;
}

/* На больших экранах показываем горизонтально */
@media (min-width: 480px) {
  .dashboard-progress-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .dashboard-progress-ring-shell {
    flex-shrink: 0;
    width: auto;
  }

  .dashboard-macro-stack {
    flex: 1;
  }
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: var(--bg-card);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  padding: 12px 20px;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  height: 86px;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  will-change: auto !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-md, 16px);
  cursor: pointer;
  transition: none !important;
  animation: none !important;
  transform: none !important;
  will-change: auto !important;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
}

.nav-item.active {
  background: rgba(46, 204, 113, 0.1);
  color: var(--primary);
}

.nav-item:hover {
  transform: none !important;
}

.nav-icon {
  font-size: 24px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* Добавляем отступ снизу для body, чтобы контент не перекрывался навигацией */
body {
  padding-bottom: 80px;
}

/* Улучшения для главного экрана */
.dashboard-main {
  padding-bottom: 20px;
}

/* Улучшенные кнопки быстрого доступа */
.menu-grid.dashboard-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.menu-card.menu-card-primary {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.menu-card.menu-card-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

/* Скрываем второстепенные кнопки на главном экране */
.dashboard-menu-block:last-of-type {
  display: none;
}

/* Показываем статусные плашки достижения целей */
.dashboard-goal-pill {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(46, 204, 113, 0.1);
  color: var(--primary);
}

/* Цветовая индикация прогресса */
.progress-fill-protein {
  transition: width 0.5s ease, background 0.3s ease;
}

.progress-fill-fat {
  transition: width 0.5s ease, background 0.3s ease;
}

.progress-fill-carbs {
  transition: width 0.5s ease, background 0.3s ease;
}

/* Анимация для кнопок воды */
.water-quick-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-quick-btn:active {
  transform: scale(0.95);
}

.water-quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

/* Улучшенная карточка прогресса */
.dashboard-progress-card {
  position: relative;
  overflow: hidden;
}

/* Исправление размеров макросов */
/* margin-bottom убран: интервал между карточками задаёт `gap` у .dashboard-macro-stack
   в styles.css (8px desktop / 6px mobile). margin-bottom стэкался с grid gap и давал
   избыточные 24-28px между карточками. */
.dashboard-macro-row {
  margin-bottom: 0;
}

.dashboard-macro-row:last-child {
  margin-bottom: 0;
}

.dashboard-macro-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-macro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.dashboard-macro-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Секция воды */
.water-progress-section {
  margin-top: 24px;
}

.dashboard-water-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-water-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Кнопки воды */
.water-quick-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.water-quick-buttons .water-quick-btn {
  flex: 1;
  min-width: 0;
}

/* Адаптивность нижней навигации */
@media (max-width: 360px) {
  .nav-label {
    font-size: 10px;
  }

  .nav-icon {
    font-size: 20px;
  }

  .nav-item {
    padding: 6px 12px;
  }
}

/* Темная тема для нижней навигации */
:root[data-theme='dark'] .bottom-nav,
body.dark-theme .bottom-nav {
  background: var(--bg-card);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

:root[data-theme='dark'] .nav-item.active,
body.dark-theme .nav-item.active {
  background: rgba(46, 204, 113, 0.15);
}

/* Плавные переходы между экранами */
.screen {
  animation: fadeIn 0.3s ease;
}

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

/* Улучшение читаемости текста */
.dashboard-section-kicker {
  letter-spacing: 0.5px;
}

.dashboard-progress-heading {
  margin-top: 4px;
}

/* Hover эффекты для интерактивных элементов */
.menu-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-card:active {
  transform: scale(0.98);
}

/* Улучшенные тени */
.card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

/* Скрываем статистику внизу главного экрана (дублирование) */
.dashboard-stats-grid {
  display: none;
}

/* Экран "Ещё" */
#screen-more .main-content {
  padding-bottom: max(100px, calc(env(safe-area-inset-bottom, 0px) + 96px));
}

#screen-more .menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

#screen-more .menu-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  cursor: pointer;
}

#screen-more .menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

#screen-more .menu-card:active {
  transform: scale(0.98);
}

/* Адаптивность для экрана "Ещё" */
@media (max-width: 380px) {
  #screen-more .menu-caption {
    font-size: 11px;
  }
}

/* Исправление переполнения текста */
.dashboard-macro-emoji {
  flex-shrink: 0;
}

.dashboard-water-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-water-emoji {
  flex-shrink: 0;
}

/* Убираем лишние отступы */
.dashboard-card-divider {
  margin: 24px 0;
}

/* Фикс для маленьких экранов */
@media (max-width: 380px) {
  .dashboard-macro-head {
    font-size: 13px;
  }

  .dashboard-macro-side strong {
    font-size: 13px;
  }

  .dashboard-water-value {
    font-size: 13px;
  }

  .water-quick-btn {
    font-size: 13px;
    padding: 10px 8px;
  }
}

/* ── Admin Panel v2 ──────────────────────────────────────── */

.admin-stats-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-stat-card {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 72px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.admin-stat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-accent, #6C8EFF);
}
.admin-stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--color-text-secondary, rgba(255,255,255,0.5));
  margin-top: 2px;
}

.admin-tab-bar {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}
.admin-tab {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  padding: 8px 16px;
  color: var(--color-text-secondary, rgba(255,255,255,0.55));
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.admin-tab.active {
  color: var(--color-accent, #6C8EFF);
  border-bottom-color: var(--color-accent, #6C8EFF);
}

.admin-tab-panel {
  padding: 12px 16px 24px;
}

.admin-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-search-row .search-input {
  flex: 1;
  min-width: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.admin-user-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--color-text-secondary, rgba(255,255,255,0.5));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.admin-user-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}
.admin-user-table tr.banned-row td {
  opacity: 0.5;
}
.admin-user-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
  border-radius: 6px;
  cursor: pointer;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-badge.badge-active {
  color: #43b89c;
  background: rgba(67, 184, 156, 0.14);
  border: 1px solid rgba(67, 184, 156, 0.22);
}

.admin-badge.badge-pending {
  color: #ffa34d;
  background: rgba(255, 163, 77, 0.14);
  border: 1px solid rgba(255, 163, 77, 0.22);
}

.admin-badge.badge-banned {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255,255,255,0.55));
}

.admin-plans-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-plan-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.admin-plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.admin-plan-code {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.admin-plan-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(108,142,255,0.15);
  color: var(--color-accent, #6C8EFF);
}
.admin-plan-badge.inactive {
  background: rgba(255,255,255,0.07);
  color: var(--color-text-secondary, rgba(255,255,255,0.4));
}
.admin-plan-price-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.admin-plan-price-row input {
  width: 90px;
}

.admin-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.admin-logs-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--color-text-secondary, rgba(255,255,255,0.5));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.admin-logs-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}

.admin-empty-hint {
  color: var(--color-text-secondary, rgba(255,255,255,0.4));
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
}
.admin-add-plan-form {
  margin-top: 8px;
}
.admin-add-plan-form h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

/* ── Admin Dashboard & Charts ─────────────────────────────── */

.admin-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px 4px;
}
@media (max-width: 380px) {
  .admin-dash-grid { grid-template-columns: repeat(2, 1fr); }
}
.admin-dash-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-dash-card--premium {
  border-color: rgba(108,142,255,0.25);
  background: rgba(108,142,255,0.08);
}
.admin-dash-card--revenue {
  border-color: rgba(80,220,120,0.25);
  background: rgba(80,220,120,0.07);
}
.admin-dash-card--conversion {
  border-color: rgba(255,180,50,0.25);
  background: rgba(255,180,50,0.07);
}
.adc-label {
  font-size: 0.66rem;
  color: var(--color-text-secondary, rgba(255,255,255,0.45));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.adc-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px 16px 20px;
}
@media (min-width: 600px) {
  .admin-charts-grid { grid-template-columns: 1fr 1fr; }
}
.admin-chart-card {
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(255,255,255,0.07);
}
.admin-chart-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary, rgba(255,255,255,0.55));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-chart-wrap {
  position: relative;
  height: 140px;
}
.admin-chart-wrap canvas {
  max-height: 140px;
}

.admin-section-heading {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary, rgba(255,255,255,0.5));
  padding: 8px 16px 2px;
  margin: 0;
}

/* Sales table */
.admin-sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.admin-sales-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--color-text-secondary, rgba(255,255,255,0.5));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
.admin-sales-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.admin-sales-table .status-paid { color: #50dc78; }
.admin-sales-table .status-pending { color: #ffa650; }
.admin-sales-table .status-failed { color: #ff5555; }

/* Settings */
.admin-settings-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 16px 24px;
}
.admin-setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-setting-info {
  flex: 1;
  min-width: 0;
}
.admin-setting-key {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}
.admin-setting-desc {
  font-size: 0.7rem;
  color: var(--color-text-secondary, rgba(255,255,255,0.4));
  margin-top: 1px;
}
.admin-setting-control {
  flex-shrink: 0;
}
.admin-setting-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  padding: 5px 8px;
  font-size: 0.82rem;
  width: 110px;
}
.admin-setting-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.admin-setting-toggle input { opacity: 0; width: 0; height: 0; }
.admin-setting-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 22px;
  transition: 0.2s;
}
.admin-setting-toggle input:checked + .admin-setting-toggle-slider {
  background: var(--color-accent, #6C8EFF);
}
.admin-setting-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.admin-setting-toggle input:checked + .admin-setting-toggle-slider::before {
  transform: translateX(18px);
}
.admin-setting-save-btn {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 4px 10px;
}

/* Analytics top-users table */
.admin-top-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 8px;
}
.admin-top-table th {
  text-align: left;
  padding: 5px 8px;
  color: var(--color-text-secondary, rgba(255,255,255,0.45));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-top-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Custom changes for "Ещё" screen to match dark design system */

/* Center screen title on the "Ещё" screen */
#screen-more .header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
#screen-more .header .screen-title {
  text-align: center !important;
  flex: 1 !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}

/* Section grid margins */
#screen-more .all-sections-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-top: 15px !important;
}

/* Standard tiles style */
#screen-more .section-tile {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  min-height: 108px !important;
  padding: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  text-decoration: none !important;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.34) !important;
}

#screen-more .section-tile:hover {
  border-color: rgba(0, 240, 118, 0.3) !important;
  box-shadow: 0 10px 25px rgba(0, 240, 118, 0.08) !important;
}

/* AI Coach featured tile - styled standard like others in dark template */
#screen-more .section-tile-featured {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.34) !important;
}

/* Standard icon box: translucent green background with green icon */
#screen-more .section-tile-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(0, 240, 118, 0.1) !important;
  border: 1px solid rgba(0, 240, 118, 0.15) !important;
  color: #00f076 !important;
  margin-bottom: 4px !important;
}

#screen-more .section-tile-icon svg {
  width: 20px !important;
  height: 20px !important;
  stroke: #00f076 !important;
}

/* Standard image icons: filtered to green */
#screen-more .section-tile-icon img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
  filter: invert(61%) sepia(91%) saturate(2421%) hue-rotate(113deg) brightness(98%) contrast(105%) !important;
}

/* Premium tile: Orange accents */
#screen-more [data-screen="subscription"].section-tile .section-tile-icon {
  background: rgba(253, 114, 0, 0.1) !important;
  border: 1px solid rgba(253, 114, 0, 0.2) !important;
  color: #fd7200 !important;
}
#screen-more [data-screen="subscription"].section-tile .section-tile-icon svg {
  stroke: #fd7200 !important;
}
#screen-more [data-screen="subscription"].section-tile .section-tile-icon img {
  filter: invert(56%) sepia(98%) saturate(1914%) hue-rotate(360deg) brightness(101%) contrast(106%) !important;
}

/* Admin tile: Red/Pink accents */
#screen-more .admin-menu-card.section-tile {
  background: rgba(147, 0, 10, 0.1) !important;
  border: 1px solid rgba(255, 180, 171, 0.2) !important;
}
#screen-more .admin-menu-card.section-tile:hover {
  border-color: rgba(255, 180, 171, 0.4) !important;
  box-shadow: 0 10px 25px rgba(147, 0, 10, 0.2) !important;
}
#screen-more .admin-menu-card.section-tile .section-tile-icon {
  background: rgba(147, 0, 10, 0.15) !important;
  border: 1px solid rgba(255, 180, 171, 0.2) !important;
  color: #ffb4ab !important;
}
#screen-more .admin-menu-card.section-tile .section-tile-icon svg {
  stroke: #ffb4ab !important;
}
#screen-more .admin-menu-card.section-tile .section-tile-caption {
  color: #ffb4ab !important;
}

/* Remove absolute badges from tiles */
#screen-more .section-tile-badge {
  display: none !important;
}

#screen-more .section-tile-label {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
}

#screen-more .section-tile-caption {
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.45) !important;
  line-height: 1.25 !important;
  margin-top: 2px !important;
}

/* Custom changes for bottom navigation bar to match photo 4 design */
.bottom-nav {
  background: #0b0f10 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.bottom-nav::before {
  display: none !important; /* Remove background glows */
}

/* Hide top active indicator line entirely */
.bottom-nav .nav-item::before,
.bottom-nav .nav-item.active::before,
.bottom-nav .nav-item[aria-current='page']::before {
  display: none !important;
}

.bottom-nav .nav-item {
  color: #bacbb8 !important; /* Muted inactive text */
  opacity: 0.8 !important;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item[aria-current='page'] {
  color: #00f076 !important; /* Active green text */
  opacity: 1 !important;
}

.bottom-nav .nav-item.active .nav-icon svg {
  stroke: #00f076 !important;
  fill: none !important;
}

/* Active three dots icon should be filled green, not stroked */
.bottom-nav .nav-item.active[data-screen="more"] .nav-icon svg,
.bottom-nav .nav-item.active[data-bottom-nav-item="more"] .nav-icon svg {
  stroke: none !important;
  fill: #00f076 !important;
}

/* Uppercase and clean nav label typography */
.bottom-nav .nav-label {
  text-transform: uppercase !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  margin-top: 4px !important;
}

/* Rotate the dumbbell icon (ЗАЛ/workout) in bottom-nav by -45deg to match Photo 4 */
.bottom-nav [data-screen="workout"] .nav-icon svg,
.bottom-nav [data-bottom-nav-item="workout"] .nav-icon svg {
  transform: rotate(-45deg) !important;
}

/* Force dark background on screen-more to match dark design theme */
#screen-more {
  background: #0b0f10 !important;
  background-image: none !important;
}

#screen-more .main-content {
  background: #0b0f10 !important;
}

#screen-more .main-content::before,
#screen-more .main-content::after {
  display: none !important;
}

/* ============================================================
   Unified flex header styling for standard screen headers
   ============================================================ */
.screen > .header:not(.flex):not(.app-header) {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px !important;
}

.screen > .header:not(.flex):not(.app-header) .screen-title {
  text-align: center !important;
  flex: 1 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  letter-spacing: -0.01em !important;
  color: #fff !important;
}

.screen > .header:not(.flex):not(.app-header) .back-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 16px !important;
  color: rgba(255, 255, 255, 0.84) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  flex: none !important;
  transition: transform 0.12s !important;
}

.screen > .header:not(.flex):not(.app-header) .back-btn:active {
  transform: scale(0.94) !important;
}

.screen > .header:not(.flex):not(.app-header) .header-spacer,
.screen > .header:not(.flex):not(.app-header) .ac-menu-wrapper {
  width: 40px !important;
  height: 40px !important;
  flex: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.screen > .header:not(.flex):not(.app-header) .ac-menu-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 16px !important;
  color: rgba(255, 255, 255, 0.84) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

/* Ensure AI Coach screen layout fits viewport height and respects bottom navigation bar */
#screen-ai-coach.active {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box !important;
}

#screen-ai-coach .ac-chat {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

#screen-ai-coach .ac-messages {
  flex: 1 !important;
  overflow-y: auto !important;
}

#screen-ai-coach .ac-welcome {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 24px 16px 32px !important;
}
