/* layout.css — Sidebar, topbar, main content area */

/* ── App Shell ────────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.sidebar-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.sidebar-logo-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-sm) 4px;
  margin-top: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--border-soft);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
}

.nav-item.active svg { color: var(--red); }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 240px;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 90;
  gap: var(--space-md);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.admin-badge {
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
  margin-left: 240px;
  padding-top: 64px;
  min-height: 100vh;
  flex: 1;
}

.page-body {
  padding: var(--space-xl);
  max-width: 1400px;
}

.page-header {
  margin-bottom: var(--space-xl);
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Two column layout ────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-xl);
  align-items: start;
}

.two-col-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* ── View visibility ──────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col-equal { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .page-body { padding: var(--space-md); }
}
