/**
 * layout.css — App shell, sidebar, main content area, and tab animations.
 */

/* ─── App shell ─── */
.app-shell {
  display: flex;
  height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 200px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 10px;
  transition: background 0.3s;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 24px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}
.sb-brand i { font-size: 1.2rem; }
/* ─── Admin "Viewing: user" switch ─── */
.sb-viewas {
  margin: -8px 4px 14px;
  padding: 8px;
  border-radius: 10px;
  background: var(--accent-bg);
  border: 1px solid var(--border);
}
.sb-viewas-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 5px;
}
.sb-viewas-select {
  width: 100%;
  font-size: 0.8rem !important;
  padding: 5px 8px;
  background: var(--bg2) !important;
}
.sb-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s;
  font-size: 0.86rem;
  font-weight: 500;
}
.sb-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}
.sb-item:hover { background: var(--bg3); color: var(--text); }
.sb-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.sb-divider { border-top: 1px solid var(--border); margin: 10px 0; }
.sb-footer {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sb-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg3);
}
.sb-user-icon { font-size: 1.2rem; color: var(--accent); }
.sb-user-text { display: flex; flex-direction: column; line-height: 1.2; }
.sb-username { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.sb-role-badge { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Theme toggle switch ─── */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text3);
}
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border-radius: 22px;
  cursor: pointer;
  transition: 0.3s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--accent);
  border-radius: 50%;
  transition: 0.3s;
}
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ─── Main content area ─── */
.main-area {
  flex: 1;
  overflow-y: auto;
  transition: background 0.3s;
}
.tab {
  display: none;
  padding: 28px 32px;
}
.tab.active {
  display: block;
  animation: fadeUp 0.2s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Page header bar (sticky top bar inside each view) ─── */
.pg-head {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  margin: -28px -32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.pg-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}
.pg-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
