*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-body-size);
  line-height: 1.2;
  color: var(--color-text);
  background: var(--color-bg);
}

body.is-nav-locked {
  overflow: hidden;
}

.lk-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header (МЕНЮ) ---------- */

.lk-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--header-height);
  padding: 0 var(--space-page);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.lk-header-left,
.lk-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lk-brand {
  display: inline-flex;
  align-items: center;
}

.lk-brand img {
  width: 84px;
  height: 36px;
  display: block;
}

.lk-header-phone {
  display: none;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--color-neutral-700);
  border-radius: var(--radius-button);
  color: var(--color-neutral-900);
  font-size: var(--text-desc-size);
  text-decoration: none;
  white-space: nowrap;
}

.lk-header-nav {
  display: none;
  align-items: center;
}

.lk-header-nav a {
  display: inline-flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 20px;
  color: var(--color-neutral-900);
  font-size: var(--text-menu-size);
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
}

.lk-header-account {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: var(--text-desc-size);
  color: var(--color-neutral-900);
  line-height: 1.1;
  white-space: nowrap;
}

.lk-header-account b {
  font-weight: 700;
}

#logout-form {
  display: flex;
  align-items: center;
  margin: 0;
}

.lk-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: #fff;
  font-family: var(--font-ui);
  font-size: var(--text-desc-size);
  cursor: pointer;
}

.lk-logout img,
.lk-logout-icon {
  width: 40px;
  height: 40px;
  display: block;
}

.lk-logout:hover .lk-logout-icon {
  content: url("/assets/img/icon-exit-hover.svg");
}

.lk-logout-label {
  display: none;
}

/* Burger (только мобайл/планшет) */
.lk-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  cursor: pointer;
}

.lk-burger-icon {
  width: 40px;
  height: 40px;
  display: block;
}

.lk-burger:hover .lk-burger-icon {
  content: url("/assets/img/icon-burger-hover.svg");
}

/* ---------- Layout: sidebar + content ---------- */

.lk-layout {
  display: flex;
  flex: 1;
  align-items: stretch;
}

.lk-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-width);
  padding: 100px 16px 40px;
  background: var(--color-surface);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
}

.lk-shell.nav-open .lk-sidebar {
  transform: none;
}

.lk-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.5);
  border: 0;
  padding: 0;
  display: none;
}

.lk-shell.nav-open .lk-scrim {
  display: block;
}

.lk-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.lk-sidebar-nav a {
  color: var(--color-text);
  font-size: var(--text-sidebar-size);
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
}

.lk-sidebar-nav a:hover {
  color: var(--color-brand-green);
}

.lk-sidebar-nav a.is-active {
  color: var(--color-neutral-400);
  font-weight: 500;
  pointer-events: none;
}

.lk-sidebar-nav a.is-active:hover {
  color: var(--color-neutral-400);
}

.lk-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-content-top) var(--space-page) 60px;
}

.lk-content-inner {
  max-width: 670px;
  width: 100%;
}

.lk-title {
  margin: 0 0 16px;
  font-size: var(--text-title-size);
  letter-spacing: var(--text-title-tracking);
  font-weight: 700;
  line-height: 1;
}

.lk-lead {
  margin: -8px 0 24px;
  font-size: var(--text-desc-size);
  line-height: 1.2;
  color: var(--color-text);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Auth-страницы (без сайдбара) ---------- */

.lk-layout.no-sidebar .lk-content {
  width: 100%;
}

/* ---------- Планшет ---------- */

@media (min-width: 768px) {
  .lk-header-phone {
    display: inline-flex;
  }
}

/* ---------- Desktop ---------- */

@media (min-width: 1024px) {
  .lk-header-nav {
    display: flex;
  }

  .lk-burger {
    display: none;
  }

  .lk-logout {
    width: auto;
    padding: 0 0 0 12px;
    background: var(--color-header-btn);
  }

  .lk-logout-label {
    display: inline;
  }

  .lk-sidebar {
    position: static;
    transform: none;
    max-width: 365px;
    flex-shrink: 0;
    padding: 40px 40px 40px;
    z-index: auto;
  }

  .lk-scrim {
    display: none !important;
  }

  .lk-sidebar-nav {
    gap: 34px;
  }

  .lk-content {
    padding-left: 25px;
    padding-right: 25px;
  }

  .lk-content-inner {
    max-width: 940px;
  }

  .lk-content-inner.is-wide {
    max-width: none;
  }
}

/* ---------- Admin ---------- */

.lk-shell.is-admin .lk-sidebar {
  background: var(--color-neutral-100);
}

.lk-footer {
  display: none;
}

@media (max-width: 767px) {
  .lk-header-account {
    font-size: 12px;
    max-width: 110px;
    white-space: nowrap;
    text-align: right;
  }

  .lk-header-account b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lk-content {
    padding-top: 20px;
    padding-bottom: 32px;
  }
}
