body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  background: #f4f7fb;
  color: #0f172a;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 276px;
  background: #0b1420;
  color: #e8eef7;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  z-index: 60;
}

.sidebar-top {
  position: relative;
  padding: 18px 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.logo-image {
  width: 160px;
  max-width: 100%;
  height: auto;
  display: block;
}


.menu {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 163, 189, 0.35) transparent;
}

.menu::-webkit-scrollbar {
  width: 8px;
}

.menu::-webkit-scrollbar-track {
  background: transparent;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(142, 163, 189, 0.28);
  border-radius: 999px;
}

.menu::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 163, 189, 0.45);
}

.menu-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ea3bd;
  padding: 14px 10px 8px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #e8eef7;
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.menu-item:hover {
  background: rgba(255,255,255,0.06);
}

.menu-item.is-active {
  background: rgba(77, 163, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.32);
}

.sidebar-bottom {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.logout-btn {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.18);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: 0.2s;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.28);
}

.main-area {
  margin-left: 276px;
  min-height: 100vh;
  background: #f4f7fb;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

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

.topbar-copy h1 {
  margin: 0;
}

.topbar-copy p {
  margin: 4px 0 0;
}

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

.user-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
}

.user-chip-label {
  font-size: 12px;
  color: #64748b;
}

.icon-btn.mobile-only {
  display: none;
}

@media (max-width: 980px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar {
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 32px rgba(2, 8, 23, 0.24);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .icon-btn.mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(15,23,42,0.1);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    flex: 0 0 auto;
  }

  .topbar {
    padding: 14px 16px;
    align-items: flex-start;
  }

  .topbar-left {
    align-items: flex-start;
    min-width: 0;
  }

  .topbar-copy h1 {
    font-size: 18px;
    line-height: 1.15;
  }

  .topbar-copy p {
    font-size: 13px;
  }

  .topbar-right {
    max-width: 42%;
  }

  .user-chip {
    padding: 8px 10px;
  }

  .user-chip strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* ===== Embed Mode ===== */
html.embed-mode,
html.embed-mode body {
  background: #ffffff !important;
}

html.embed-mode .sidebar,
html.embed-mode .topbar,
html.embed-mode .topbar-left,
html.embed-mode .topbar-right,
html.embed-mode .user-chip,
html.embed-mode .sidebar-bottom,
html.embed-mode .mobile-menu-toggle,
html.embed-mode .overlay {
  display: none !important;
}

html.embed-mode .app-shell {
  min-height: auto !important;
}

html.embed-mode .main-area {
  margin-left: 0 !important;
  width: 100% !important;
  min-height: auto !important;
}

html.embed-mode .content {
  padding: 0 !important;
  margin: 0 !important;
  min-height: auto !important;
  overflow: visible !important;
}

html.embed-mode .header {
  display: none !important;
}

html.embed-mode .card {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  margin: 0 !important;
}

html.embed-mode .layout,
html.embed-mode .page,
html.embed-mode .page-shell,
html.embed-mode main {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}
