/* ============================================================
   layout.css — App shell: sidebar, topbar, content area
   ============================================================ */

/* ── App grid ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-logo {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--text2);
}

/* ── Navigation ── */
.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
  user-select: none;
}

.nav-item i { font-size: 17px; width: 20px; flex-shrink: 0; }

.nav-item:hover {
  color: var(--text);
  background: rgba(128,128,128,.06);
}

.nav-item.active {
  color: var(--accent2);
  background: rgba(31,111,235,.08);
  border-left-color: var(--accent);
}

/* ── Sidebar footer (user info + logout) ── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-meta { min-width: 0; }

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

.user-role {
  font-size: 11px;
  color: var(--text2);
}

/* ── Main area ── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
}

/* ── Topbar ── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

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

.status-indicator {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(63,185,80,.2);
}

/* Theme toggle button */
.theme-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text2);
  font-size: 17px;
  transition: color 0.15s, border-color 0.15s;
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--text2);
}

/* Mobile menu button (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

/* ── Page content ── */
.content {
  padding: 24px 28px;
  flex: 1;
}

/* ── Sidebar overlay for mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 45;
}

.sidebar-overlay.show { display: block; }
