/* Компоновка перенесена из https://freeslots.bazabz.ru/ui-kit. */
.app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100%;
  min-width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  background: var(--bg-app);
}

.app-shell .sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 40;
}

.app-shell .sidebar {
  width: 240px;
  flex: 0 0 240px;
  height: 100%;
  padding: 16px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.app-shell .menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.app-shell .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--btn-height);
  min-height: var(--btn-height);
  padding: 0 10px;
  border-radius: 10px;
  color: #374151;
  text-decoration: none;
  font-size: calc(14px + var(--font-bump));
}

.app-shell .menu-item:hover {
  background: #eef2ff;
  color: #1f2937;
}

.app-shell .menu-item.active {
  background: #e0e7ff;
  color: #1d4ed8;
  font-weight: 600;
}

.app-shell .menu-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.app-shell .menu-item.active .menu-icon,
.app-shell .menu-item:hover .menu-icon {
  color: inherit;
}

.app-shell .footer-menu {
  position: relative;
  margin-top: auto;
  padding-top: 16px;
}

.app-shell .footer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.app-shell .footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 0;
}

.app-shell .footer-title {
  font-size: calc(13px + var(--font-bump));
  font-weight: 600;
}

.app-shell .footer-toggle-icon {
  margin-left: auto;
  color: #6b7280;
}

.app-shell .footer-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  width: auto;
  max-width: none;
  padding: 0;
  display: none;
  overflow: hidden;
  z-index: 5;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.app-shell .footer-menu.is-open .footer-dropdown {
  display: block;
}

.app-shell .footer-link {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111827;
  box-shadow: none;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  font-size: calc(14px + var(--font-bump));
  font-weight: 400;
  line-height: normal;
  cursor: pointer;
}

.app-shell .footer-link + .footer-link {
  border-top: 1px solid #f1f5f9;
}

.app-shell .footer-link:hover {
  background: #f8fafc;
  text-decoration: none;
  transform: none;
}

.app-shell .footer-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}

.app-shell .main-content {
  width: auto;
  max-width: none;
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  background: var(--bg-app);
}

.app-shell .top-bar {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell .page-title {
  margin: 0;
  color: var(--text-main);
  font-size: calc(24px + var(--font-bump));
  letter-spacing: normal;
}

.app-shell .page-subtitle {
  max-width: none;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: calc(14px + var(--font-bump));
}

.app-shell .page-divider {
  display: block;
  width: 100%;
  margin: 12px 0 18px;
  border-top: 1px solid var(--border);
}

.app-shell .section.settings-container,
.app-shell .preview-panel {
  width: 100%;
  max-width: none;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.app-shell .hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  color: #111827;
}

.app-shell .hamburger svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.4;
}

@media (max-width: 768px) {
  .app-shell .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    padding: 16px 14px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 50;
  }

  body.sidebar-open .app-shell .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .app-shell .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell .hamburger {
    display: inline-flex;
  }

  .app-shell .top-bar {
    flex-direction: row;
    align-items: flex-start;
    padding: 0;
    border-radius: 0;
  }

  .app-shell .main-content {
    width: 100%;
    padding: 16px;
  }

  .app-shell .section.settings-container,
  .app-shell .preview-panel {
    padding: 16px;
    border-radius: 14px;
  }
}
