/* Э8.5 — адаптив 320–1920 px, touch-цели 44×44 */

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
       text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

.app-shell {
  width: 100%;
}

.panel-content {
  width: 100%;
  max-width: 100%;
}

.panel-content__page-title {
  display: none;
  margin: 0 0 1rem;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 700;
  color: #12313a;
  line-height: 1.3;
  word-break: break-word;
}

.header__brand {
  display: none;
  align-items: center;
  margin-left: auto;
  text-decoration: none;
  flex-shrink: 0;
  max-width: 42%;
}

.header__brand-text {
  margin: 0;
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--color-primary-hover);
  line-height: 1.1;
  white-space: nowrap;
}

.header__burger {
  flex-shrink: 0;
  background: #eef2f5;
}

.sidebar__user {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.sidebar__user-avatar {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  font-weight: 700;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.sidebar__user-distributor {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
  word-break: break-word;
}

.sidebar__logout {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.sidebar__logout svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.support-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: grid;
  place-items: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #5cc67c, #45a862);
  color: #fff;
  box-shadow: 0 6px 20px rgba(69, 168, 98, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.support-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(69, 168, 98, 0.55);
}

.support-fab svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.support-fab__badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  color: #fff;
  background: #e53935;
  border: 2px solid #fff;
}

.support-fab[hidden] {
  display: none;
}

.btn--sm {
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

.checkbox-inline {
  min-height: var(--touch-min);
  padding: 0.35rem 0;
}

.checkbox-field {
  min-height: var(--touch-min);
}

.auth-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0.35rem 0;
}

.product-card__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0.35rem 0;
}

.instruction-item__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0.35rem 0;
}

.analytics-field__input,
.analytics-field__select,
.news-period-select,
.products-period-select,
.products-toolbar .field__input {
  width: 100%;
  max-width: 100%;
}

.analytics-table {
  min-width: 28rem;
}

.analytics-table-wrap,
.modal {
  -webkit-overflow-scrolling: touch;
}

.panel-block,
.content-card,
.catalog-page,
.analytics-page,
.materials-page,
.products-page,
.profile-page,
.news-page {
  max-width: 100%;
}

@media (max-width: 960px) {
  .header__title-wrap {
    display: none;
  }

  .header__brand {
    display: flex;
  }

  .header-user {
    display: none;
  }

  .panel-content__page-title {
    display: block;
  }

  .sidebar__user {
    display: flex;
  }

  .sidebar {
    width: min(100%, 20rem);
  }

  .panel-content {
    padding: 1rem 0.85rem 5rem;
  }

  .header {
    padding: 0.65rem 0.85rem;
  }

  .news-toolbar,
  .analytics-toolbar,
  .products-toolbar,
  .notifications-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .news-toolbar .btn,
  .analytics-toolbar__actions .btn,
  .notifications-toolbar .btn {
    width: 100%;
  }

  .analytics-toolbar__filters {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-field__input,
  .analytics-field__select {
    min-width: 0;
  }

  .profile-tabs__btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .modal__actions .btn {
    flex: 1 1 100%;
  }

  .welcome-card__links .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .panel-content {
    padding: 0.85rem 0.65rem 5rem;
  }

  .panel-block {
    padding: 1rem 0.85rem;
  }

  .materials-stats {
    grid-template-columns: 1fr;
  }

  .header__brand-text {
    font-size: 0.88rem;
  }

  .summary-card__value,
  .analytics-summary__value {
    font-size: 1.15rem;
  }
}

@media (max-width: 320px) {
  :root {
    --header-height: 3.5rem;
  }

  .panel-content {
    padding: 0.75rem 0.5rem 5rem;
  }

  .header {
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
  }

  .header__brand-text {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
  }

  .profile-tabs__btn {
    flex: 1 1 100%;
    font-size: 0.88rem;
  }

  .stepper__label {
    font-size: 0.68rem;
  }

  .news-card__title,
  .material-card__title,
  .product-card__name {
    font-size: 0.85rem;
  }
}

@media (min-width: 961px) {
  .panel-content {
    padding: 1.5rem 2rem 2rem;
  }
}

:root {
  --color-primary: #5fdbe8;
  --color-primary-hover: #55cade;
  --color-badge: #c43b71;
  --color-progress: #fdee86;
  --color-icon: #8a9fb4;

  --color-text: #1a2a33;
  --color-text-muted: #5a6d78;
  --color-surface: #ffffff;
  --color-border: rgba(26, 42, 51, 0.1);

  --font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius-xl: 1rem;
  --radius-lg: 0.75rem;
  --radius-md: 0.5rem;
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
  --sidebar-width: 17.5rem;
  --header-height: 4rem;
  --touch-min: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--color-text);
  background: #eef6f8;
  line-height: 1.5;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

#app-layout {
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 320px) {
  :root {
    --sidebar-width: 100%;
  }
}
