/* ─── App Layout ─── */
body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-top {
  padding: 28px 20px 0;
}

.sidebar-bottom {
  padding: 0 20px 24px;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.sidebar-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ─── Nav Items ─── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-body);
  text-decoration: none;
  user-select: none;
  margin-left: -3px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-item.active {
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-card);
  border-left-color: var(--text-primary);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  white-space: nowrap;
}

/* ─── Connection Status ─── */
.connection-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
}

.status-label {
  flex: 1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.status-dot.green { background: var(--success); }
.status-dot.red { background: var(--error); }
.status-dot.checking {
  background: var(--warning);
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Sign Out ─── */
.signout-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-body);
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--transition);
  text-align: left;
  width: 100%;
}

.signout-btn:hover {
  color: var(--error);
}

/* ─── Main Content ─── */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ─── Topbar ─── */
.topbar {
  height: 60px;
  min-height: 60px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-greeting {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
}

/* ─── Module Container ─── */
.module-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}
