/* ============================================================
   layout.css — Sidebar, Header, Footer chrome
   ============================================================ */

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

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: 260px;
  height: 100vh;
  /* Changed from min-height so it perfectly fits the window */
  position: fixed;
  /* Locks it in place */
  top: 0;
  left: 0;
  z-index: 100;
  /* Keeps it layered above the main content */
  overflow-y: auto;
  /* Allows scrolling inside the sidebar if menus get too long */

  /* Keep your existing flex and background properties */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 32px;
  background: var(--grad-primary-vertical);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  text-decoration: none;
}

.sidebar__logo-icon {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
}

.sidebar__logo-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar__logo-name {
  display: block;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
}

.sidebar__logo-sub {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-sm);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar__item {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}

.sidebar__item--active {
  background: rgba(255, 255, 255, 0.08);
  /* Unified dark translucent background */
}

.sidebar__item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  /* Increased from 4px 0 */
}

.sidebar__icon {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.sidebar__label {
  flex: 1;
  color: var(--color-white);
  font-size: var(--text-base);
}

.sidebar__toggle {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-base);
  transition: transform var(--t-fast);
}

.sidebar__submenu {
  list-style: none;
  margin: 0;
  padding: 0 16px 12px 42px;
  /* Aligns items perfectly with the parent text */
  display: none;
}

.sidebar__submenu--open {
  display: block;
}

.sidebar__subitem {
  font-size: var(--text-sm);
  line-height: 30px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color var(--t-fast);
}

.sidebar__subitem:hover {
  color: rgba(255, 255, 255, 0.8);
}

.sidebar__subitem--active {
  color: var(--color-white);
}

.sidebar__divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 24px;
}

/* ─── Main area ─────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 260px;
  /* This acts as your dummy spacer! */
}

/* ─── Header band ───────────────────────────────────────── */
.header-band {
  position: sticky;
  top: 0;
  z-index: 90;
  /* Keeps it above the scrolling content, but below the sidebar's 100 */

  /* Keep your existing properties */
  background: var(--grad-primary-horizontal);
  padding-bottom: 0px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  margin: 16px;
  border-radius: 52px;
  background: var(--grad-header-bar);
}

.header__search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  width: 400px;
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
}

.header__search i {
  color: var(--color-white);
  font-size: 14px;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header__icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: opacity var(--t-fast);
}

.header__icon-btn:hover {
  opacity: 0.85;
}

.header__user {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--color-white);
}

.header__avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #E0E0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 18px;
}

.header__username {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.header__role {
  font-size: var(--text-sm);
  opacity: 0.8;
  margin: 0;
}

/* ─── Welcome ───────────────────────────────────────────── */
.welcome {
  padding: 32px 32px 0;
}

.welcome h1 {
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
}

/* ─── Content container ─────────────────────────────────── */
.content-container {
  flex: 1;
  padding: 0 24px 32px;
  margin-top: 24px;
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  height: 89px;
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--text-sm);
}