/* ============================================================
   Aesthetic Lash — каркас: sidebar, topbar, bottom-nav, сетка
   ============================================================ */

/* ------------------------------------------------------------
   Основной контейнер приложения
   ------------------------------------------------------------ */
#app {
  display: none;
}

#app.active {
  display: flex;
  min-height: 100vh;
}

/* ------------------------------------------------------------
   Sidebar (боковое меню — ПК)
   ------------------------------------------------------------ */
.sidebar {
  width: 230px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  font-size: 14px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}
.sidebar-logo .ico {
  font-size: 24px;
}
.sidebar-logo .accent {
  color: var(--rose);
}
.sidebar-logo small {
  display: block;
  font-size: 9.5px;
  color: var(--lavender);
  font-weight: 600;
  margin-top: 1px;
}

#sidebarNav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  cursor: pointer;
  color: var(--text2);
  font-weight: 550;
  font-size: 13.5px;
  transition: all var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--panel3);
  color: var(--text);
}
.nav-item.active {
  background: var(--pink-bg);
  color: var(--rose);
  font-weight: 650;
}
.nav-item .ico {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ------------------------------------------------------------
   Основная область
   ------------------------------------------------------------ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ------------------------------------------------------------
   Верхняя панель (topbar)
   ------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  font-size: 17px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--panel2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.icon-toggle:hover {
  background: var(--panel3);
  border-color: var(--border2);
}

/* ------------------------------------------------------------
   Контент
   ------------------------------------------------------------ */
.content {
  padding: 24px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------------------------------------
   Bottom-nav (нижнее меню — мобилки)
   ------------------------------------------------------------ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2px;
}

.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  border-radius: 11px;
  transition: all var(--transition);
  min-width: 0;
}
.bn-item:hover {
  color: var(--text2);
}
.bn-item.active {
  color: var(--rose);
  background: var(--pink-bg);
}
.bn-item .ico {
  font-size: 20px;
  line-height: 1;
}
.bn-item span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ------------------------------------------------------------
   Сетки
   ------------------------------------------------------------ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* ------------------------------------------------------------
   Разделители
   ------------------------------------------------------------ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.divider-soft {
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin: 16px 0;
}

/* ------------------------------------------------------------
   Flex-утилиты
   ------------------------------------------------------------ */
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ------------------------------------------------------------
   Скрытие / показ по брейкпоинтам
   ------------------------------------------------------------ */
.only-mobile  { display: none; }
.only-desktop { display: block; }


/* ============================================================
   Фикс 100vh для iOS Safari
   ============================================================ */

@supports (height: 100dvh) {
  #app.active {
    min-height: 100dvh;
  }
  #loginScreen {
    min-height: 100dvh;
  }
}

/* Для старых iOS — fallback */
@supports not (height: 100dvh) {
  #app.active {
    min-height: -webkit-fill-available;
  }
  #loginScreen {
    min-height: -webkit-fill-available;
  }
}