/* ============================================================
   WORKSTATION CRIATOR — layout.css
   Shell da aplicação: sidebar, área principal e topbar.
   ============================================================ */

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

/* ---------- Sidebar ---------- */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(165deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  transition: width .18s var(--ease), min-width .18s var(--ease), padding .18s var(--ease);
  position: relative;
}

/* "Encolhido" é um trilho só-ícones — conceito de desktop. No mobile (<=720px)
   a sidebar vira gaveta deslizante (responsive.css) e a classe `collapsed`,
   que já vem no HTML, não pode valer. Por isso todo este bloco é escopado. */
@media (min-width:721px) {
  .sidebar.collapsed {
    width: 72px;
    min-width: 72px;
    padding: 16px 8px;
  }

  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .side-box,
  .sidebar.collapsed .sidebar-footer span,
  .sidebar.collapsed .nav-item .chevron-r,
  .sidebar.collapsed .side-action-btn .sab-label {
    display: none;
  }

  .sidebar.collapsed .nav-item {
    justify-content: center;
  }

  .sidebar.collapsed .brand {
    justify-content: center;
    padding: 4px 0 20px;
  }

  .sidebar.collapsed .sidebar-footer {
    justify-content: center;
  }

  .sidebar.collapsed .side-action-btn {
    justify-content: center;
    padding: 10px;
  }

  .sidebar.collapsed .side-action-btn .ic {
    margin: 0;
  }

  .sidebar.collapsed #collapseBtn svg {
    transform: rotate(180deg);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px -2px rgba(17, 90, 228, 0.5);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  line-height: 1.2;
}

.brand-text b {
  display: block;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
}

.brand-text small {
  display: block;
  font-size: var(--text-2xs);
  letter-spacing: 2px;
  color: #8ba6dd;
  font-weight: 700;
  margin-top: 2px;
}

.nav-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #7484a3;
  padding: 16px 10px 8px;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #c2cbdf;
  font-size: var(--text-sm);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
  cursor: pointer;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blue-500);
}

.nav-item.active {
  background: rgba(47, 111, 237, 0.22);
  color: #fff;
  border-left-color: var(--blue-500);
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
  color: #7ea3ff;
}

.chevron-r {
  width: 13px !important;
  height: 13px !important;
  margin-left: auto;
  opacity: .4 !important;
  flex-shrink: 0;
}

.sidebar-spacer {
  flex: 1;
}

.side-box {
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 16px;
}

.side-box.solid {
  border: 1px solid var(--navy-line);
  background: rgba(255, 255, 255, 0.045);
}

.side-box p {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.55;
  color: #a6b1cc;
}

.side-box p.center {
  text-align: center;
}

.side-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin: 12px 0 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--navy-line);
  color: #e6eaf5;
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: left;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.side-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--navy-line-2);
}

.side-action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-500);
}

.side-action-btn .ic {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-action-btn .ic svg {
  width: 13px;
  height: 13px;
}

.ic-blue {
  background: rgba(47, 111, 237, 0.24);
  color: #8fb1ff;
}

.ic-red {
  background: rgba(197, 61, 51, 0.22);
  color: #ff9d92;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 0;
  margin-top: 12px;
  border-top: 1px solid var(--navy-line);
  color: #8592ad;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}

.sidebar-footer:hover {
  color: #c2cbdf;
}

.sidebar-footer:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-500);
  border-radius: var(--radius-xs);
}

.sidebar-footer svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.role-switcher-side {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--navy-line);
}

.role-switcher-side svg {
  width: 14px;
  height: 14px;
  color: #8ba6dd;
  flex-shrink: 0;
}

.role-switcher-side select {
  background: transparent;
  border: none;
  color: #e6eaf5;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  flex: 1;
  min-width: 0;
}

.role-switcher-side select option {
  color: #111;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 40px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 20;
}

.topbar-title h1,
.topbar-title h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.01em;
}

.topbar-title p {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: #fff;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  flex-shrink: 0;
}

.mobile-menu-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-scrim {
  display: none;
}

.crumb {
  font-size: var(--text-xs);
  color: var(--gray-400);
  font-weight: 500;
  margin-top: 3px;
}

.crumb a {
  color: var(--gray-500);
}

.crumb b {
  color: var(--gray-600);
  font-weight: 600;
}

.crumb-sep {
  margin: 0 6px;
  color: var(--gray-300);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tb-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: 500;
  padding: 7px 8px;
  border-radius: var(--radius-xs);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.tb-link:hover {
  background: var(--gray-50);
  color: var(--gray-800);
}

.tb-link svg {
  width: 16px;
  height: 16px;
}

.tb-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--gray-600);
}

.tb-icon-btn:hover {
  background: var(--gray-50);
}

.tb-icon-btn svg {
  width: 18px;
  height: 18px;
}

.badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--red-600);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 800;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--gray-0);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 14px;
  border-left: 1px solid var(--gray-100);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease);
}

.user-chip:hover {
  background: var(--gray-50);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--text-2xs);
  flex-shrink: 0;
  letter-spacing: .01em;
}

.user-meta {
  line-height: 1.2;
}

.user-meta b {
  display: block;
  font-size: var(--text-sm);
  color: var(--gray-900);
  font-weight: 700;
  white-space: nowrap;
}

.user-meta span {
  display: none;
}

/* papel do usuário não aparece — header enxuto */
.chev {
  width: 14px;
  height: 14px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.content {
  padding: 12px 6px 10px;
  flex: 1;
  max-width: 1440px;
  width: 100%;
}