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

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--gray-1);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--dur) var(--ease);
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--gray-1);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--rose-08);
  border: 1.5px solid var(--rose-15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--rose);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .03em;
}

.sidebar-logo-img {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-brand-name {
  font-size: .88rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-sub {
  font-size: .66rem;
  font-weight: 500;
  color: var(--ink-42);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.sidebar-section-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-22);
  padding: 8px 10px 6px;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-60);
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  margin-bottom: 2px;
}

.sidebar-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-link:hover {
  background: var(--off);
  color: var(--ink);
}
.sidebar-link:hover svg { opacity: 1; }

.sidebar-link.active {
  background: var(--rose-08);
  color: var(--rose);
  font-weight: 700;
}
.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-1);
  flex-shrink: 0;
}

.sidebar-version {
  font-size: .68rem;
  color: var(--ink-22);
  font-weight: 500;
}

/* ── MAIN WRAPPER ── */
#main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
#topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--ink-42);
}

.topbar-breadcrumb a {
  color: var(--ink-60);
  transition: color var(--dur);
}
.topbar-breadcrumb a:hover { color: var(--rose); }

.topbar-sep {
  opacity: .4;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── MAIN CONTENT ── */
#main-content {
  flex: 1;
  padding: 28px;
  max-width: var(--content-max);
  width: 100%;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-header-left {}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── MOBILE TOPBAR ── */
#mobile-topbar {
  display: none;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-1);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-topbar-brand {
  font-size: .9rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.01em;
}
.mobile-topbar-brand span { color: var(--rose); }

.mobile-topbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

#mobile-menu-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--off);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
#mobile-menu-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }

/* ── MOBILE SIDEBAR OVERLAY ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}
#sidebar-overlay.open { display: block; }

/* ── BOTTOM NAV ── */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--gray-1);
  z-index: 100;
  padding: 0 4px;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: .62rem;
  font-weight: 600;
  color: var(--ink-42);
  transition: color var(--dur);
  cursor: pointer;
  border: none;
  background: none;
}
.bottom-nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav-item.active { color: var(--rose); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  #sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(13,13,13,0.12);
  }
  #main-wrapper {
    margin-left: 0;
  }
  #topbar { display: none; }
  #mobile-topbar { display: flex; }
  #bottom-nav { display: flex; }
  #main-content {
    padding: 20px 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 20px);
  }
}

@media (max-width: 480px) {
  #main-content { padding: 16px 12px; padding-bottom: calc(var(--bottom-nav-h) + 16px); }
  .page-header { margin-bottom: 20px; }
}
