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

/* Desktop Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #007aff, #5856d6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -0.04em;
  flex: none;
}

.brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--navy);
  line-height: 1.2;
}

.brand-sub {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.workspace-box {
  margin: 0 2px 18px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
}

.workspace-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}

.workspace-meta {
  min-width: 0;
  flex: 1;
}

.workspace-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.workspace-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group-label {
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 10px 10px 6px;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  width: 100%;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--navy);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 650;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 600;
}

.nav-item.active .nav-badge {
  background: #d0e5ff;
  color: var(--accent-hover);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 14px;
}

.sidebar-demo-note {
  margin: 0 2px 12px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.sidebar-demo-note strong {
  display: block;
  color: var(--text-2);
  margin-bottom: 3px;
  font-size: 11.5px;
}

.profile-card {
  border-top: 1px solid var(--line);
  padding: 12px 6px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-meta {
  min-width: 0;
  flex: 1;
}

.profile-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 11px;
  color: var(--muted);
}

/* Main Area */
.main-area {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 15;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.crumb {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb strong {
  color: var(--text);
  font-weight: 650;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

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

.global-search {
  height: 36px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 7px;
  color: var(--muted);
  transition: border-color 0.15s;
}

.global-search:focus-within {
  border-color: var(--accent);
}

.global-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 12.5px;
  color: var(--text);
}

.role-switcher {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}

/* Main Content Container */
.content-wrap {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 48px;
  flex: 1;
}

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

.page-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.page-title {
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
}

.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

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

/* Grid Helpers */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.footer-note {
  text-align: center;
  color: var(--muted-2);
  font-size: 11.5px;
  margin-top: 28px;
  padding-bottom: 8px;
}

/* Mobile Bottom Nav & More Sheet */
.mobile-nav {
  display: none;
}

.mobile-menu-btn {
  display: none;
}
