/* ============================================
   LAYOUT — Shell del demo
   ============================================ */

.layout { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: background var(--transition);
}
.sidebar-header {
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header img { height: 40px; width: auto; }
.sidebar-header .brand-text {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: -.3px;
  line-height: 1.2;
}

/* Nav items */
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-group-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.3);
  padding: 14px 14px 6px;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font: 600 13px/1 'DM Sans', sans-serif;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-text-active); }
.nav-item .material-icons { font-size: 20px; opacity: .7; }
.nav-item.active .material-icons { opacity: 1; }

/* Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.theme-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.theme-switch input { display: none; }
.switch-track {
  width: 42px; height: 24px;
  background: var(--switch-track);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition);
}
.switch-track::after {
  content: '';
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.theme-switch input:checked ~ .switch-track { background: var(--accent-500); }
.theme-switch input:checked ~ .switch-track::after { transform: translateX(18px); }
.theme-switch .theme-label { color: var(--sidebar-text); font-size: 12px; font-weight: 600; }

/* ---- Main ---- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--transition), border var(--transition);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Role switcher */
.role-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.role-btn {
  padding: 5px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.role-btn:hover { color: var(--text); }
.role-btn.active { background: var(--brand-900); color: #fff; }
[data-theme="dark"] .role-btn.active { background: var(--brand-300); color: var(--bg); }

/* Content */
.content {
  padding: 32px;
  max-width: 1200px;
}

/* Page header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 4px;
}
.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumbs a {
  color: var(--brand-900);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}
[data-theme="dark"] .breadcrumbs a { color: var(--brand-300); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .separator { font-size: 16px; color: var(--muted); }
.breadcrumbs .current { color: var(--text); font-weight: 700; }
