/* assets/css/layout.css */

/* =========================
   APP LAYOUT
========================= */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 16px;
  background:
    radial-gradient(circle at top left, rgba(143, 92, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(10, 9, 22, 0.97), rgba(6, 5, 14, 0.99));
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.brand {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: 2.8rem;
  line-height: 1;
  letter-spacing: 0.14em;
  color: #fff;
  overflow-wrap: anywhere;
}

.brand-sub {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* =========================
   NAVIGATION
========================= */

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nav-btn {
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text-dim);
  background: transparent;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.nav-btn:hover,
.nav-btn.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(143, 92, 255, 0.14), rgba(143, 92, 255, 0.03));
}

.nav-btn:focus-visible {
  outline: 2px solid rgba(176, 140, 255, 0.75);
  outline-offset: 3px;
}

.nav-icon {
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
  line-height: 1;
}

.nav-btn span:not(.nav-icon) {
  min-width: 0;
}

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

.side-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.status-badge {
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.staff-active {
  background: var(--green);
  box-shadow: 0 0 10px rgba(110, 234, 167, 0.28);
}

/* =========================
   MAIN CONTENT
========================= */

main {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.page {
  display: none;
  width: 100%;
  max-width: 1180px;
  min-width: 0;
  margin: 0 auto;
}

.page.active {
  display: block;
}

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    max-height: none;
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .brand {
    flex: 0 0 auto;
  }

  .brand h1 {
    font-size: 1.6rem;
  }

  .brand-sub {
    display: none;
  }

  .nav {
    flex: 1 1 auto;
    min-width: 240px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-btn {
    width: auto;
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .side-footer {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    margin-top: 0;
  }

  .status-badge {
    max-width: 240px;
  }

  main {
    height: auto;
    min-height: calc(100vh - 90px);
    overflow: visible;
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    align-items: stretch;
  }

  .brand {
    width: 100%;
  }

  .nav {
    width: 100%;
    min-width: 0;
  }

  .nav-btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    text-align: center;
  }

  .side-footer {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .status-badge {
    max-width: none;
    justify-content: center;
  }

  main {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .nav-btn {
    flex-basis: 100%;
  }
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
  .nav-btn,
  .status-dot {
    transition-duration: 0.001ms !important;
  }
}