*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
.topbar {
  background: #1e3a5f;
  color: #fff;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.45rem 1.25rem;
  flex-shrink: 0;
  gap: 1rem;
}

.topbar-title {
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

.main-menu {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.main-menu button {
  background: transparent;
  border: none;
  color: #b0c4de;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.main-menu button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main-menu button.active {
  background: #2e6da4;
  color: #fff;
}

/* Body layout */
.body-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Side menu */
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #dde1e7;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease, border-color 0.2s ease;
}

.sidebar.collapsed {
  width: 0;
  border-right-color: transparent;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  padding: 1rem 1.25rem 0.4rem;
}

.sidebar ul {
  list-style: none;
  padding: 0.25rem 0.5rem 1rem;
}

.sidebar li button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #333;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.sidebar li button:hover {
  background: #eef2f8;
}

.sidebar li button.active {
  background: #dbeafe;
  color: #1e3a5f;
  font-weight: 600;
}

/* Main content */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.content-panel {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 10px;
  min-height: 300px;
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
}

.content-loading,
.content-error {
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
}

.content-error {
  color: #c0392b;
}

.page-content h3 {
  font-size: 1rem;
  color: #1e3a5f;
  margin-bottom: 0.75rem;
}

.page-content p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
}

.hidden {
  display: none;
}

/* Embedded standalone pages */
.content-body:has(.app-embed) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-body:has(.app-embed) .content-panel {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.content-panel:has(.app-embed) {
  display: flex;
  flex-direction: column;
}

.app-embed {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.app-embed-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  border-radius: 10px;
  background: #fff;
}
