/* ===== Android-like web shell =====
   Этот слой отвечает только за общий каркас веб-приложения: шапку, меню,
   нижнюю мобильную навигацию и базовый карточный ритм. Страницы продолжают
   использовать свои существующие классы, поэтому бизнес-логика не меняется. */

body {
  background:
    linear-gradient(180deg, rgba(240, 253, 244, 0.86) 0%, rgba(248, 250, 252, 0.96) 34%, #f8fbf9 100%),
    var(--bg);
}

.topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(197, 220, 206, 0.86);
}

.topbar-inner {
  min-height: 74px;
}

.menu-trigger {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border-color: rgba(20, 83, 45, 0.16);
  color: #134e35;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #16a34a 0%, #10b981 100%);
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.24);
}

.brand-title {
  color: #134e35;
  font-size: 1.28rem;
  letter-spacing: 0;
}

.brand-subtitle {
  color: #597166;
  font-size: 0.84rem;
  font-weight: 650;
}

.inline-pill {
  min-height: 42px;
  border-color: rgba(20, 83, 45, 0.14);
  background: #edfff4;
  color: #134e35;
}

.tabs-wrap {
  top: 75px;
  background: rgba(248, 251, 249, 0.92);
  border-bottom-color: rgba(197, 220, 206, 0.74);
}

.tabs-top .nav-link {
  min-height: 42px;
  border-radius: 14px;
  color: #52665d;
}

.tabs-top .nav-link.active {
  color: #0f7a3f;
  border-color: rgba(22, 163, 74, 0.18);
  background: #edfff4;
}

.main-shell {
  padding-top: 22px;
}

.page-hero {
  border-radius: 24px;
  background: linear-gradient(135deg, #f8fbff 0%, #eefff6 100%);
  border-color: rgba(197, 220, 206, 0.74);
}

.page-hero::after {
  display: none;
}

.page-hero__eyebrow {
  border-radius: 10px;
  background: #dcfce7;
  color: #0f7a3f;
}

.page-hero__title {
  color: #103c2a;
}

.card,
.fiz-card,
.section-card,
.metric-card,
.selection-card,
.btn-list,
.results-card,
.filter-group,
.empty-state {
  border-color: rgba(197, 220, 206, 0.82);
}

.selection-card__icon {
  border-radius: 16px;
  background: #dcfce7;
  color: #0f7a3f;
}

.side-menu {
  width: min(430px, 100vw) !important;
  background: #f8fbf9;
  color: #13251c;
  border-right: 1px solid rgba(197, 220, 206, 0.85);
}

.side-menu .offcanvas-header {
  min-height: 108px;
  padding: 24px 22px 18px;
  border-bottom: 1px solid rgba(197, 220, 206, 0.85);
  background: linear-gradient(135deg, #f6fbff 0%, #edfff4 100%);
}

.side-menu .offcanvas-title {
  color: #103c2a;
  font-size: 1.5rem;
  font-weight: 900;
}

.side-menu .small {
  color: #597166 !important;
  font-weight: 750;
}

.side-menu .btn-close {
  filter: none;
}

.side-menu .menu-list {
  padding: 16px;
  gap: 10px;
}

.side-menu .menu-link {
  min-height: 62px;
  border-radius: 18px;
  background: #ffffff;
  border-color: rgba(197, 220, 206, 0.82);
  color: #13251c;
  box-shadow: 0 8px 18px rgba(15, 47, 34, 0.04);
}

.side-menu .menu-link i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #dcfce7;
  color: #0f7a3f;
}

.side-menu .menu-link:hover,
.side-menu .menu-link.is-active {
  background: #edfff4;
  border-color: rgba(22, 163, 74, 0.34);
  color: #0f7a3f;
}

.side-menu .menu-link--logout {
  background: #fff5f5;
  border-color: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.side-menu .menu-link--logout i {
  background: #fee2e2;
  color: #dc2626;
}

.side-menu .ant-hub-nav-status {
  color: #597166;
}

.side-menu .ant-hub-nav-status.is-online {
  color: #15803d;
}

.side-menu .ant-hub-nav-status.is-offline {
  color: #b45309;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-bottom-nav__item {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #597166;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 7px 4px 8px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.08;
  text-align: center;
  text-decoration: none;
}

.mobile-bottom-nav__item i {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: inherit;
  font-size: 1.05rem;
}

.mobile-bottom-nav__item.is-active {
  color: #0f7a3f;
}

.mobile-bottom-nav__item.is-active i {
  background: #dcfce7;
}

@media (max-width: 768px) {
  body {
    background: #f8fbf9;
  }

  .topbar {
    position: sticky;
    top: 0;
    box-shadow: 0 8px 24px rgba(15, 47, 34, 0.05);
  }

  .topbar-inner {
    min-height: 88px;
    padding: 14px 18px 12px;
  }

  .brand-block {
    gap: 14px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 17px;
  }

  .brand-title {
    font-size: 1.5rem;
    line-height: 1;
  }

  .brand-subtitle {
    max-width: 185px;
    font-size: 0.82rem;
    line-height: 1.12;
  }

  .tabs-wrap {
    display: none;
  }

  .main-shell {
    width: 100%;
    padding: 18px 12px calc(92px + env(safe-area-inset-bottom));
  }

  .auth-shell {
    padding: 12px;
  }

  .page-hero,
  .page-hero--compact {
    border-radius: 26px;
    margin-bottom: 16px;
    padding: 24px 18px;
    background: linear-gradient(135deg, #f7fbff 0%, #ecfff4 100%);
  }

  .page-hero__eyebrow {
    margin-bottom: 10px;
    padding: 0;
    background: transparent;
    color: #0f7a3f;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .page-hero__title,
  .page-hero--compact .page-hero__title {
    font-size: 2rem;
    line-height: 1.03;
  }

  .page-hero__text {
    color: #52665d;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.36;
  }

  .card,
  .fiz-card,
  .section-card,
  .metric-card,
  .selection-card,
  .btn-list,
  .results-card,
  .filter-group,
  .surface-panel,
  .empty-state {
    border-radius: 18px;
    box-shadow: none;
  }

  .selection-card,
  .btn-list {
    min-height: 92px;
    padding: 16px;
  }

  .selection-card__icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .selection-card__title {
    color: #103c2a;
    font-size: 1.12rem;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 1040;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 10px;
    min-height: 64px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    border: 1px solid rgba(197, 220, 206, 0.92);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 44px rgba(15, 47, 34, 0.16);
    backdrop-filter: blur(16px);
    overflow: hidden;
  }

  .app-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .brand-title {
    font-size: 1.35rem;
  }

  .brand-subtitle {
    max-width: 150px;
    font-size: 0.75rem;
  }

  .mobile-bottom-nav__item {
    font-size: 0.63rem;
  }
}
