/* Gromche.fun — dashboard layout (desktop + mobile) */

:root {
  --dash-header-h: calc(56px + env(safe-area-inset-top, 0px));
  --dash-drawer-w: min(300px, 86vw);
  --sidebar-w: 260px;
}

/* ——— Desktop sidebar ——— */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #0a0a0f;
}

.dashboard-layout .main-content {
  flex: 1;
  min-width: 0;
  padding: 30px 40px;
  overflow-y: auto;
  color: #e0e0e0;
}

.dashboard-layout .main-content h1,
.dashboard-layout .main-content h2,
.dashboard-layout .main-content h3 {
  color: #fff;
}

.dash-header,
.mobile-nav-overlay,
.sidebar-mobile {
  display: none;
}

.dashboard-layout > .sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(20, 20, 30, 0.8);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-desktop {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sidebar-desktop .logo-slot {
  margin-bottom: 24px;
  flex-shrink: 0;
}

.sidebar-desktop__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sidebar-desktop__nav a,
.sidebar-desktop__foot a {
  display: block;
  padding: 12px 16px;
  border-radius: 12px;
  color: #a0a0b0;
  text-decoration: none;
  margin-bottom: 5px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.sidebar-desktop__nav a:hover,
.sidebar-desktop__nav a.active,
.sidebar-desktop__foot a:hover {
  background: rgba(192, 132, 252, 0.15);
  color: #fff;
}

.sidebar-desktop__nav a.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: #c084fc;
  border-radius: 4px;
}

.sidebar-desktop__foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-link-admin {
  color: #f59e0b !important;
}

.sidebar-link-logout {
  color: #f87171 !important;
}

.sidebar-link-muted {
  display: block;
  padding: 12px 16px;
  border-radius: 12px;
  color: #666;
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 0.92rem;
}

.sidebar-passport-note,
.sidebar-email-note {
  display: block;
  margin: 12px 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.sidebar-passport-note {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.sidebar-passport-note a,
.sidebar-email-note a {
  display: inline-block;
  margin-top: 8px;
  color: #c084fc;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-passport-note--pending {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.28);
  color: #93c5fd;
}

.sidebar-email-note {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.22);
  color: #93c5fd;
}

/* ——— Mobile dashboard ——— */
@media (max-width: 768px) {
  body {
    background: #0a0a0f;
  }

  .dashboard-layout {
    display: block;
    min-height: 100dvh;
  }

  .dash-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    height: var(--dash-header-h);
    padding: env(safe-area-inset-top, 0px) 12px 0;
    background: rgba(10, 10, 15, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
  }

  .dash-header__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
  }

  .dash-header__menu .mobile-menu-btn__bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 18px;
  }

  .dash-header__menu .mobile-menu-btn__bars span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #c084fc;
  }

  .dash-header__title {
    display: block;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .dash-header__action {
    display: flex;
    justify-content: flex-end;
  }

  .dash-header__action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c084fc, #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
  }

  .dash-header__spacer {
    width: 44px;
    height: 44px;
  }

  .dashboard-layout > .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
  }

  .sidebar-desktop {
    display: none !important;
  }

  .sidebar-mobile {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .dashboard-layout > .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: var(--dash-drawer-w);
    height: 100dvh;
    margin: 0;
    padding: 0;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #12121c;
    overflow: hidden;
    transform: translateX(-105%);
    transition: transform 0.26s ease;
    visibility: hidden;
  }

  .dashboard-layout > .sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
  }

  .sidebar-drawer__head .site-logo__text {
    font-size: 0.95rem;
  }

  .sidebar-drawer__head .site-logo__mark {
    width: 36px;
    height: 36px;
  }

  .sidebar-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  .sidebar-drawer__nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-drawer__nav a,
  .sidebar-drawer__nav .sidebar-link-muted {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: #b0b0c0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
  }

  .sidebar-drawer__nav a.active {
    background: rgba(192, 132, 252, 0.18);
    color: #fff;
    font-weight: 600;
  }

  .sidebar-drawer__foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-drawer__foot a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    margin-bottom: 4px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
  }

  .dashboard-layout .main-content {
    padding: calc(var(--dash-header-h) + 16px) 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .dashboard-layout .main-content > h1:first-of-type,
  .dashboard-layout .page-toolbar {
    display: none;
  }

  .dashboard-passport-banner,
  .dashboard-email-banner {
    margin-bottom: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .releases-list {
    gap: 10px;
  }

  .release-card {
    border-radius: 14px;
    padding: 14px;
  }

  .release-card__title {
    font-size: 1rem;
  }

  .fab-new-release {
    display: none !important;
  }

  .profile-form {
    max-width: none;
    padding: 18px 16px;
    border-radius: 14px;
  }

  .profile-form input,
  .profile-form textarea,
  .profile-form button.btn {
    font-size: 16px;
    min-height: 48px;
  }

  .profile-form textarea {
    min-height: 100px;
  }

  .info-card {
    padding: 16px;
    border-radius: 14px;
  }

  .stats-row {
    margin: 12px 0;
  }

  .stat-card {
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
    padding: 16px;
    margin: 4px;
  }

  .stats-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
