/* Общая оболочка приложения: сайдбар, layout */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  min-width: 0;
}
.sidebar .brand { margin-bottom: 26px; padding: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side-nav a {
  padding: 11px 14px; border-radius: 10px; font-size: .92rem;
  color: var(--graphite-2); display: flex; align-items: center; gap: 10px;
  transition: background .15s;
}
.side-nav a:hover { background: var(--bg-alt); }
.side-nav a.active { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.plan-box { background: var(--bg-alt); border-radius: 12px; padding: 14px; font-size: .82rem; }
.plan-box .plan-name { font-weight: 700; margin-bottom: 4px; }
.plan-box .plan-usage { color: var(--muted); }
.main { padding: 32px 40px; overflow-x: hidden; min-width: 0; }
.main-head { margin-bottom: 28px; }
.main-head h1 { font-size: 1.9rem; }
.main-head p { color: var(--muted); margin-top: 6px; }
.site-header-mobile { display: none; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }

  /* Сайдбар превращаем в закреплённую горизонтальную панель навигации:
     из любой части страницы можно перейти в нужный раздел. */
  .sidebar {
    position: sticky; top: 0; z-index: 200;
    display: flex; flex-direction: column; gap: 0;
    height: auto; padding: 8px 12px;
    border-right: none; border-bottom: 1px solid var(--border);
    background: rgba(20, 23, 26, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .sidebar .brand { margin: 0 0 6px; padding: 0; font-size: 1rem; }
  .sidebar .brand-logo { width: 26px; height: 26px; }

  /* Меню — горизонтальная прокручиваемая строка. */
  .side-nav {
    flex-direction: row; gap: 6px;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a {
    padding: 8px 12px; font-size: .84rem; white-space: nowrap; flex: 0 0 auto;
  }
  /* Блок тарифа и «Выйти» на мобильном прячем. */
  .side-foot { display: none; }

  .main { padding: 20px 16px; }
  .site-header-mobile { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
}

/* ============================================================
   Удаление аккаунта (152-ФЗ): кнопка в подвале сайдбара
   (десктоп) + пункт меню на мобильных, где .side-foot скрыт.
   ============================================================ */
.side-foot .side-nav-delete {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 6px;
  padding: 11px 6px;
  min-height: var(--tap);
  border-radius: 10px;
  font-size: .92rem;
  text-align: left;
  color: var(--muted-2);
  transition: background .15s, color .15s;
}
.side-foot .side-nav-delete:hover { background: var(--red-soft); color: var(--red); }

.side-nav a.side-nav-delete-mobile { display: none; }

@media (max-width: 860px) {
  .side-nav a.side-nav-delete-mobile { display: flex; color: var(--muted); }
  .side-nav a.side-nav-delete-mobile:active { background: var(--red-soft); color: var(--red); }
}

/* ---- Модалка подтверждения ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  width: min(480px, 100%);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  padding: 26px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}
.modal-dialog h3 { font-size: 1.2rem; margin-bottom: 10px; }
.modal-dialog p { color: var(--ink-2); font-size: .94rem; line-height: 1.6; }
.modal-ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 20px;
  min-height: var(--tap);
  font-size: .9rem;
  color: var(--ink-2);
  cursor: pointer;
}
.modal-ack input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn-danger { background: var(--red); color: #14090a; font-weight: 700; }
.btn-danger:hover { background: #f56565; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }

