/* ── App body ───────────────────────────────────────────────────── */
#app-body {
  display: flex;
  height: 100vh;
  background: #F8FAFC;
  overflow: hidden;
}

/* ── Content column (topbar + main) ────────────────────────────── */
#app-content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#app-main {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.app-main-inner {
  padding: 28px 32px;
  max-width: 1400px;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar-aside {
  width: 240px;
  min-width: 240px;
  background: #FFFFFF;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #F1F5F9;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
}

@media (max-width: 1023px) {
  .sidebar-aside {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
  }
  .sidebar-aside.active {
    transform: translateX(0);
  }
}

/* ── Sidebar logo row ───────────────────────────────────────────── */
.sidebar-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid #F1F5F9;
}
.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.sidebar-logo-link img {
  max-width: 50%;
}

.sidebar-logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-name {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Sidebar nav ────────────────────────────────────────────────── */
.sidebar-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px 8px;
}

.sidebar-inner::-webkit-scrollbar { width: 3px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 800;
  color: #9CA3AF;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 4px 6px;
}

/* Collapsible category toggle */
.sidebar-cat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 4px 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.sidebar-cat-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #9CA3AF;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sidebar-cat-toggle:hover .sidebar-cat-toggle-label { color: #64748B; }
.sidebar-cat-arrow {
  font-size: 12px;
  color: #CBD5E1;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.sidebar-cat-arrow.rotated { transform: rotate(180deg); }
.sidebar-group-items.sg-hidden { display: none; }

.sidebar-divider {
  height: 1px;
  background: #F3F4F6;
  margin: 4px 0 8px;
}

.sidebar-submenu { padding-left: 32px; margin-bottom: 2px; }

.sidebar-sublink {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: #6B7280;
  text-decoration: none; transition: all 0.15s;
}
.sidebar-sublink:hover { background: #F9FAFB; color: #DC2626; }
.sidebar-sublink.active { color: #DC2626; font-weight: 700; }

.sidebar-badge {
  font-size: 9px; font-weight: 800;
  background: #DC2626; color: #FFFFFF;
  padding: 2px 5px; border-radius: 4px;
  min-width: 16px; text-align: center;
}
.sidebar-badge--amber { background: #EAB308; }

.sidebar-link--soon {
  cursor: default; opacity: 0.5;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #9CA3AF;
}
.sidebar-link--soon:hover { background: transparent; color: #9CA3AF; }

.sidebar-soon-tag {
  margin-left: auto; font-size: 9px; font-weight: 700;
  color: #94A3B8; background: #F1F5F9;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.05em; text-transform: uppercase;
}

.sidebar-link--mode-switch {
  margin-top: 4px; color: #64748B !important;
  border: 1px dashed #E2E8F0;
}
.sidebar-link--mode-switch:hover {
  background: #F9FAFB !important; border-color: #CBD5E1; color: #1E293B !important;
}

/* ── Sidebar upgrade card ───────────────────────────────────────── */
.sidebar-upgrade-card {
  margin: 4px 12px 10px;
  background: linear-gradient(135deg, #1E1B4B 0%, #3730A3 100%);
  border-radius: 14px;
  padding: 14px 16px;
  flex-shrink: 0;
}
.sidebar-upgrade-card h4 {
  font-size: 13px; font-weight: 800; color: #fff;
  margin: 0 0 4px; font-family: 'Plus Jakarta Sans', sans-serif;
}
.sidebar-upgrade-card p {
  font-size: 11px; color: rgba(255,255,255,0.55); line-height: 1.5;
  margin: 0 0 12px; font-family: 'Plus Jakarta Sans', sans-serif;
}
.sidebar-upgrade-btn {
  width: 100%; padding: 8px;
  border-radius: 9px; background: #fff; color: #3730A3;
  font-size: 12px; font-weight: 800; border: none; cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: opacity .15s;
}
.sidebar-upgrade-btn:hover { opacity: .9; }

/* ── Sidebar footer (user) ──────────────────────────────────────── */
.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid #F1F5F9;
  padding: 10px 12px;
}

/* ── Top bar ────────────────────────────────────────────────────── */
#app-topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1.5px solid #F1F5F9;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  flex-shrink: 0;
}


#app-topbar .nav-search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}
#app-topbar .nav-search-wrap input {
  width: 100%;
  padding: 9px 44px 9px 38px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #1E293B;
  outline: none;
  transition: border-color .15s, background .15s;
}
#app-topbar .nav-search-wrap input:focus {
  border-color: #DC2626;
  background: #fff;
}
#app-topbar .nav-search-wrap input::placeholder { color: #CBD5E1; }
#app-topbar .nav-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #94A3B8; font-size: 16px; pointer-events: none;
}
#app-topbar .nav-search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: #94A3B8; background: #E2E8F0;
  padding: 2px 6px; border-radius: 5px; font-family: monospace;
}
#app-topbar .nav-spacer { flex: 1; }
#app-topbar .nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  border: 1.5px solid #E2E8F0; background: #fff;
  font-size: 12px; font-weight: 700; color: #475569;
  cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color .12s, background .12s;
  white-space: nowrap;
}
.nav-btn:hover { border-color: #CBD5E1; background: #F8FAFC; }

.nav-icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1.5px solid #E2E8F0; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  position: relative; transition: border-color .12s, background .12s;
}
.nav-icon-btn:hover { border-color: #CBD5E1; background: #F8FAFC; }

/* ── Misc ───────────────────────────────────────────────────────── */
.chart-tooltip-static {
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.9);
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
