:root {
  --admin-bg: #07111f;
  --admin-panel: rgba(11, 22, 38, 0.88);
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-strong: rgba(79, 209, 255, 0.28);
  --admin-text: #f5f7fb;
  --admin-muted: #9aa8bf;
  --admin-cyan: #44d9ff;
  --admin-violet: #7c5cff;
}

.admin-layout {
  position: relative;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */

.admin-layout .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 20;
  border-right: 1px solid var(--admin-border);
  background: rgba(4, 10, 18, 0.86);
  backdrop-filter: blur(18px);
  padding: 22px 14px 18px;
  scrollbar-width: none;
}

.admin-layout .sidebar::-webkit-scrollbar {
  display: none;
}

.admin-layout .sidebar::before,
.admin-layout .sidebar::after,
.overlay {
  pointer-events: none;
}

/* Brand */
.admin-layout .sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.admin-layout .sidebar__brand h2 {
  margin: 0;
  color: var(--admin-text);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}

.admin-layout .sidebar__brand p {
  margin: 3px 0 0;
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.3;
}

.admin-layout .sidebar__logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--admin-cyan), var(--admin-violet));
  color: #04111d;
  font-weight: 800;
  font-size: 12px;
}

/* Nav */
.admin-layout .sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.nav-group--plain {
  margin-bottom: 4px;
}

.nav-group__label {
  display: block;
  padding: 8px 10px 4px;
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.admin-layout .sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  color: var(--admin-muted);
  border: 1px solid transparent;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-layout .sidebar__link:hover {
  color: var(--admin-text);
  border-color: var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
}

.admin-layout .sidebar__link.active {
  color: var(--admin-text);
  background: rgba(68, 217, 255, 0.1);
  border-color: var(--admin-border-strong);
  box-shadow: inset 3px 0 0 var(--admin-cyan);
}

.sidebar__link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}

.admin-layout .sidebar__link:hover .sidebar__link-icon,
.admin-layout .sidebar__link.active .sidebar__link-icon {
  opacity: 1;
}

.sidebar__link-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Note box */
.admin-layout .sidebar__note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.admin-layout .sidebar__note-label {
  margin: 0 0 8px;
  color: var(--admin-cyan);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.admin-layout .sidebar__note p {
  margin: 0;
  color: var(--admin-muted);
  line-height: 1.55;
  font-size: 11.5px;
}

/* Footer */
.sidebar__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.sidebar__back-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  color: var(--admin-muted);
  border: 1px solid transparent;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sidebar__back-link:hover {
  color: var(--admin-text);
  border-color: var(--admin-border);
  background: rgba(255, 255, 255, 0.04);
}

/* ── MAIN CONTENT ─────────────────────────────────────────────── */

.admin-layout .main-content {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.page-header,
.header-actions,
.btn {
  position: relative;
  z-index: 10;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-layout .sidebar {
    position: relative;
    height: auto;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
  }

  .sidebar__footer {
    margin-top: 14px;
  }
}
