#root {
  height: 100vh;
}

/* App shell — header, neon accent bar, sidebar + content underneath */
.app {
  display: grid;
  grid-template-rows: auto auto 1fr; /* header • neon bar • body */
  height: 100vh;
}

.app__header {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Neon accent bar — its own grid row so the gradient + glow are guaranteed
   to span the full viewport width (grid items stretch to fill the column
   track). The shimmer is a child ::after that slides across via animated
   `left`; overflow:hidden on the bar keeps the highlight clipped inside. */
.app__neon-bar {
  position: relative;
  height: 3px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--neon-blue) 0%,
    var(--neon-cyan) 50%,
    var(--neon-blue) 100%
  );
  box-shadow:
    0 0 6px var(--neon-glow),
    0 0 14px rgba(30, 144, 255, 0.35);
  overflow: hidden;
  pointer-events: none;
}

.app__neon-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  left: -30%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--neon-edge) 50%,
    transparent 100%
  );
  animation: neon-bar-shimmer 7s linear infinite;
}

@keyframes neon-bar-shimmer {
  0%   { left: -30%; }
  100% { left: 100%; }
}

/* Respect OS-level reduced-motion preference — the bar still shows, the
   highlight just stops drifting. */
@media (prefers-reduced-motion: reduce) {
  .app__neon-bar::after { animation: none; }
}

.app__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* NaviGrade mascot logo.
   Shown as-is (no crop, no resize); the negative margin-bottom pulls the
   wrapper down past the header so the artwork overlaps the neon bar.
   z-index keeps it stacked above the bar (which is the next grid row). */
.app__logo {
  position: relative;
  z-index: 2;
  width: 56px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: -14px;
  pointer-events: none;
  user-select: none;
}

.app__logo-img {
  display: block;
  width: 100%;
  height: auto;
}

.app__header-title {
  font-weight: 700;
  font-size: 18px;
}

.app__header-sub {
  font-style: italic;
  font-size: 11px;
  color: rgb(160, 195, 230);
}

.hamburger {
  background: transparent;
  border: 0;
  padding: 6px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s ease;
}

.hamburger:hover {
  background: var(--navy-hover);
}

.hamburger span {
  display: block;
  height: 2px;
  width: 22px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.app__body {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--navy);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  z-index: 20;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
}

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

.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 10;
}

.app.is-sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar__spacer {
  flex: 1;
}

.content {
  background: var(--page-bg);
  padding: 16px;
  overflow: auto;
  min-width: 0;
  height: 100%;
}

/* Center the content of dynamic panels so the page doesn't feel cramped */
.view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.view__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px 0;
}

/* Modal overlay for the program-select dialog */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal__panel {
  background: #fff;
  width: 460px;
  max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal__header {
  background: var(--navy);
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
}

.modal__body {
  flex: 1;
  overflow: auto;
  padding: 6px 0;
}

.modal__footer {
  background: #fff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
}

.modal__version {
  font-size: 12px;
  color: var(--muted, #888);
  font-family: monospace;
}

.modal__footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}

.modal__user {
  color: var(--navy, #1a2a4a);
  font-weight: 600;
}

.modal__signout {
  color: var(--muted, #888);
  text-decoration: underline;
  font-size: 11px;
  cursor: pointer;
}

.modal__signout:hover {
  color: var(--red-btn, #c33);
}

/* ──────────────────────────────────────────────────────────────────
   RESPONSIVE — desktop: persistent sidebar, no hamburger
   ────────────────────────────────────────────────────────────────── */

@media (min-width: 900px) {
  .app__body {
    display: grid;
    grid-template-columns: 215px 1fr;
    overflow: visible;
  }

  .hamburger {
    display: none;
  }

  .sidebar {
    position: static;
    transform: none;
    width: auto;
    box-shadow: none;
    transition: none;
    z-index: auto;
  }

  .sidebar-backdrop {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────────────
   RESPONSIVE — mobile tweaks
   ────────────────────────────────────────────────────────────────── */

@media (max-width: 899px) {
  .sidebar {
    width: min(82vw, 280px);
  }

  .app__header {
    padding: 8px 12px;
    gap: 8px;
  }

  .app__header-title {
    font-size: 15px;
  }

  .app__logo {
    width: 44px;
    margin-bottom: -12px;
  }

  .content {
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .app__header-sub {
    display: none;
  }

  .app__header-title {
    font-size: 14px;
  }
}
