/* ===== APP SHELL ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-ink);
  text-decoration: none;
}

.sidebar-brand a:hover { text-decoration: none; }

.brand-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--color-muted);
  font-weight: 400;
}

/* ===== SIDEBAR SEARCH ===== */
.sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.sidebar-search-form {
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-bg);
  font-size: 0.8rem;
  color: var(--color-ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sidebar-search input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(184,134,11,0.12);
}

.sidebar-search input::placeholder { color: #bbb; }

.search-icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

/* ===== SIDEBAR NAV ===== */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0 1rem;
}

.nav-section { margin-bottom: 0.25rem; }

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem 0.35rem;
  cursor: pointer;
  user-select: none;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color var(--transition);
}

.nav-section-header:hover { color: var(--color-ink); }

.nav-chevron {
  font-size: 0.6rem;
  transition: transform var(--transition);
}

.nav-section.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-section.collapsed .nav-items { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 1rem 0.3rem 1.25rem;
  color: var(--color-ink-light);
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin: 0 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-ink);
  text-decoration: none;
}

.nav-item.active {
  background: var(--color-gold-bg);
  color: var(--color-gold);
  border-left-color: var(--color-gold);
  font-weight: 500;
}

.nav-item .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sidebar-footer a:hover {
  background: var(--color-surface-hover);
  color: var(--color-ink);
  text-decoration: none;
}

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== TOP BAR (mobile) ===== */
.topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-brand {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-ink);
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--color-ink);
  font-size: 1.2rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover { background: var(--color-surface-hover); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 860px;
}

.page-content-wide {
  flex: 1;
  padding: 0;
  max-width: 100%;
}

/* ===== OVERLAY (mobile sidebar) ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

.overlay.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    display: flex;
  }

  .page-content {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 1rem 0.875rem;
  }
}

/* ===== HOMEPAGE LAYOUT ===== */
.home-header {
  padding: 2.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  max-width: 860px;
}

.home-body {
  padding: 1.5rem 2.5rem 2.5rem;
  max-width: 860px;
}

@media (max-width: 768px) {
  .home-header {
    padding: 1.5rem 1rem 1rem;
  }
  .home-body {
    padding: 1rem 1rem 2rem;
  }
}
