.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(7, 16, 25, 0.98), rgba(10, 20, 31, 0.95));
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--gold-line);
  background: rgba(7, 16, 25, 0.78);
  backdrop-filter: blur(16px);
}

.app-main {
  padding: 28px;
  display: grid;
  gap: 24px;
}

/* =========================
   BRAND / LOGO BLOCK
========================= */

.brand-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gold-line);
}

.brand-logo {
  width: 80%;
  max-width: 170px;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.3;
}

/* =========================
   SIDEBAR NAV / SUBMENUS
========================= */

.sidebar-nav-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-nav-wrap::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav-wrap::-webkit-scrollbar-thumb {
  background: rgba(184, 145, 77, 0.18);
  border-radius: 999px;
}

.sidebar-nav-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-submenu-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.sidebar-submenu-toggle:hover {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border-color: rgba(212, 175, 55, 0.22);
  transform: translateX(2px);
  box-shadow: 0 0 0 1px rgba(70, 120, 255, 0.06);
}

.sidebar-submenu-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-item.is-open .sidebar-submenu-toggle,
.sidebar-item.is-active .sidebar-submenu-toggle {
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(70, 120, 255, 0.10), rgba(212, 175, 55, 0.05)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(212, 175, 55, 0.04);
}

.sidebar-item.is-open .sidebar-submenu-toggle::before,
.sidebar-item.is-active .sidebar-submenu-toggle::before {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.95), rgba(120, 170, 255, 0.65));
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.18);
}

.sidebar-submenu-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sidebar-submenu-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: transform 0.18s ease, color 0.18s ease;
}

.sidebar-item.is-open .sidebar-submenu-arrow {
  transform: rotate(90deg);
  color: var(--text);
}

.sidebar-submenu {
  display: none;
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(184, 145, 77, 0.18);
  gap: 6px;
}

.sidebar-item.is-open .sidebar-submenu {
  display: flex;
  flex-direction: column;
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.sidebar-sublink:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(2px);
}

.sidebar-sublink.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(75, 136, 217, 0.08), rgba(184, 145, 77, 0.05));
  border: 1px solid rgba(184, 145, 77, 0.18);
}

/* =========================
   TOPBAR
========================= */

.topbar__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.topbar__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.topbar__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
}

.menu-toggle {
  display: none;
}

/* =========================
   SIDEBAR SOCIAL ICONS
========================= */

.sidebar-social-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gold-line);
}

.sidebar-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--gold-line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.sidebar-social-icon:hover {
  color: var(--text);
  background: linear-gradient(180deg, rgba(75, 136, 217, 0.08), rgba(184, 145, 77, 0.06));
  border-color: rgba(184, 145, 77, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(75, 136, 217, 0.05);
}

.sidebar-social-icon i {
  font-size: 1.05rem;
  line-height: 1;
}

/* =========================
   FOOTER
========================= */

.footer-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 28px 32px;
  text-align: center;
}

.footer-citation {
  max-width: 680px;
  color: var(--text-soft);
}

.footer-quote {
  margin: 0;
  font-style: italic;
}

.footer-author {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-separator {
  width: 120px;
  height: 1px;
  background: var(--gold-line);
  opacity: 0.8;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================
   RESPONSIVE
========================= */

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--gold-line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .topbar,
  .app-main,
  .footer-bar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar__meta {
    display: none;
  }
}