/* Global 2-Column Desktop Shell, Sidebar, Topbar, and Responsive Drawer */

.shell {
  display: grid;
  grid-template-columns: 252px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(180deg, #0D0E12 0%, #0A0B0E 100%);
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 500;
  transition: transform 0.24s var(--ease);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 18px;
  cursor: pointer;
}

.sb-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(255, 213, 0, 0.28);
  flex-shrink: 0;
}

.sb-brand-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.35));
}

.sb-brand-name {
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 16px;
}

.sb-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 18px;
}

.sb-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding: 4px 12px 6px;
}

.sb-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sb-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sb-link.active {
  background: linear-gradient(90deg, rgba(255, 213, 0, 0.13) 0%, rgba(255, 213, 0, 0.03) 100%);
  color: var(--text);
  font-weight: 600;
}

.sb-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sb-link svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex-shrink: 0;
}

.sb-link.active svg {
  color: var(--accent);
}

.sb-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.sb-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sb-profile {
  margin-top: 8px;
  padding: 10px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.sb-profile:hover {
  border-color: var(--line-2);
  background: var(--card-2);
}

.user-menu-pop {
  position: absolute;
  width: 248px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72);
  padding: 12px;
  z-index: 700;
}

.user-menu-pop.um-sidebar {
  left: 0;
  bottom: 64px;
}

.user-menu-pop.um-topbar {
  right: 0;
  top: 48px;
}

.um-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.um-item:hover {
  background: var(--card-2);
  color: var(--text);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD500 0%, #FF7A18 100%);
  color: #111111;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.topbar {
  height: 64px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 14px;
}

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

.hamburger-btn {
  display: none;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.crumbs strong {
  color: var(--text);
  font-weight: 700;
}

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

.license-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 12px;
  background: rgba(255, 213, 0, 0.08);
  border: 1px solid rgba(255, 213, 0, 0.36);
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.license-pill:hover {
  border-color: rgba(255, 213, 0, 0.65);
  background: rgba(255, 213, 0, 0.13);
}

.license-pill-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.license-pill-sub {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .license-pill { display: none; }
}

.bell-btn {
  position: relative;
}

.unread-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.notif-popover {
  position: absolute;
  top: 48px;
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  padding: 14px;
  z-index: 600;
}

.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
}

.page.wide {
  max-width: 1580px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 450;
}

.scrim.open {
  display: block;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger-btn {
    display: inline-flex;
  }
}
