/* Design-System Verwaltung — Layout
 * ─────────────────────────────────
 * Shell (Grid), Sidebar mit Brand + Section-Labels + Nav-Items + Footer.
 * Mobile: Sidebar wird Off-Canvas-Drawer via .sb-open auf .vw-shell.
 * Erfordert tokens.css. drawer.js für Hamburger-Toggle.
 */

/* ── Shell: Grid Sidebar+Main ─────────────────────────── */
.vw-shell{
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas: "sidebar main";
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────── */
.vw-sidebar{
  grid-area: sidebar;
  position: sticky; top: 0; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 3px;
  overflow-y: auto; overflow-x: hidden;
}

/* Brand-Header (Logo/Initiale + Name + Untertitel) */
.vw-brand{
  display: flex; align-items: center; gap: 11px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.vw-brand .mark{
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-title);
  font-weight: 600; font-size: 18px; flex-shrink: 0;
  letter-spacing: -.01em;
}
.vw-brand .name{
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.25; letter-spacing: -.01em;
}
.vw-brand .sub{
  font-size: 10px; color: var(--text-dim); letter-spacing: .05em;
  margin-top: 2px; font-weight: 500; text-transform: uppercase;
}

/* Section-Label zwischen Nav-Gruppen (Monospace, UPPERCASE) */
.vw-section-label{
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 14px 4px;
  white-space: nowrap;
}
.vw-section-label:first-of-type{padding-top: 8px}

/* Nav-Item (Link zu einem Bereich) */
.vw-nav-item{
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.vw-nav-item:hover{background: var(--bg-2); color: var(--accent)}
.vw-nav-item.active{
  background: var(--accent-bg); color: var(--accent);
  font-weight: 600;
}
.vw-nav-item svg{flex-shrink: 0; opacity: .65}
.vw-nav-item.active svg{opacity: 1}

/* Footer der Sidebar: kleine Icon-Links + Logout */
.vw-sidebar-footer{
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.vw-user{
  padding: 8px 12px;
  font-size: 11px; color: var(--text-dim);
  letter-spacing: .02em; line-height: 1.35;
}
.vw-user strong{color: var(--text-soft); font-weight: 600}
.vw-footer-links{
  display: flex; gap: 6px; margin-bottom: 8px;
  padding-top: 6px;
}
.vw-footer-link{
  display: flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: var(--radius-sm);
  font-size: 11.5px; font-weight: 500;
  color: var(--text-dim); text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg);
  flex: 1; justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.vw-footer-link:hover{
  color: var(--text); background: var(--bg-2);
  border-color: var(--border-2);
}
.vw-footer-link.active{
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-bg);
}
.vw-footer-link svg{flex-shrink: 0; opacity: .7}
.vw-footer-link.active svg{opacity: 1}
.vw-logout{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  background: none; border: none; width: 100%;
  cursor: pointer; text-align: left;
  font-family: inherit;
}
.vw-logout:hover{background: var(--warn-bg); color: var(--warn)}

/* ── Main-Bereich ─────────────────────────────────────── */
.vw-main{
  grid-area: main;
  background: var(--bg);
  padding: 1.5rem;
  min-width: 0;               /* verhindert Grid-Overflow bei breiten Kindern */
}

/* ── Mobile-Hamburger + Scrim (Default aus) ───────────── */
.vw-menu-btn{display: none}
.vw-scrim{display: none}

/* ── Mobile: Sidebar → Off-Canvas-Drawer ──────────────── */
@media (max-width: 720px){
  .vw-shell{
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
  .vw-main{
    padding: 1.1rem .9rem;
    padding-top: calc(1.1rem + 44px + .5rem);  /* Platz für fixierten Hamburger */
  }

  .vw-menu-btn{
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 10px; z-index: 60;
    width: 44px; height: 44px; border-radius: var(--radius-lg);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
  }
  .vw-menu-btn:hover{border-color: var(--accent); color: var(--accent)}
  .vw-menu-btn:active{transform: scale(.97)}

  .vw-sidebar{
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-mobile-w);
    height: 100vh; height: 100dvh;
    z-index: 70;
    border-right: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(20,15,8,.18);
    transform: translateX(-100%);
    transition: transform var(--transition-drawer);
    padding: 20px 12px;
    display: flex; flex-direction: column;
  }
  .vw-shell.sb-open .vw-sidebar{transform: translateX(0)}

  .vw-scrim{
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(20,15,8,.42);
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition-drawer);
  }
  .vw-shell.sb-open .vw-scrim{opacity: 1; pointer-events: auto}

  body.vw-sb-open{overflow: hidden}
}
