/* Navegação por área. Os arquivos de marca originais são exibidos sem filtros. */
.topbar-workspace {
  --nav-shadow: 0 18px 48px rgba(0, 0, 0, .28), 0 3px 10px rgba(0, 0, 0, .12);
  background: var(--surface);
  border-bottom-color: var(--border);
}
:root[data-theme="light"] .topbar-workspace {
  --nav-shadow: 0 18px 48px rgba(28, 35, 29, .12), 0 3px 10px rgba(28, 35, 29, .05);
}
.topbar-workspace .topbar-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 1440px;
  padding: 0 28px;
}
.topbar-workspace .topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
}
.topbar-workspace .brand { gap: 22px; min-width: 0; }
.topbar-workspace .brand-logo-window {
  display: block;
  position: relative;
  flex: 0 0 215px;
  width: 215px;
  height: 40px;
  overflow: hidden;
}
.topbar-workspace .brand-logo-window .brand-logo {
  position: absolute;
  left: -18px;
  top: -11px;
  width: 250px;
  height: auto;
  max-width: none;
  filter: none !important;
  transition: none;
}
.topbar-workspace .brand-logo-window .brand-logo-light { display: none; }
.topbar-workspace .brand-logo-window .brand-logo-dark { display: block; }
:root[data-theme="light"] .topbar-workspace .brand-logo-window .brand-logo-light { display: block; }
:root[data-theme="light"] .topbar-workspace .brand-logo-window .brand-logo-dark { display: none; }
.topbar-workspace .brand-app {
  display: block;
  padding-left: 22px;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2px;
  line-height: 1.5;
  text-transform: none;
}
.topbar-workspace .workspace-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  flex-shrink: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.topbar-workspace .workspace-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  min-width: 112px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.topbar-workspace .workspace-option:hover { background: var(--surface-3); color: var(--text); }
.topbar-workspace .workspace-option[aria-current="true"],
.topbar-workspace .workspace-option[aria-current="page"] {
  background: var(--surface);
  border-color: var(--gold-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  color: var(--gold);
  font-weight: 800;
}
.topbar-workspace .workspace-option svg { width: 16px; height: 16px; flex-shrink: 0; }
.topbar-workspace .workspace-option .mi { display: inline-flex; }
.topbar-workspace .topbar-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  flex: none;
  gap: 20px;
  min-height: 57px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.topbar-workspace .drawer-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}
.topbar-workspace .drawer-nav > a,
.topbar-workspace .nav-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.topbar-workspace .drawer-nav > a:hover,
.topbar-workspace .nav-menu > summary:hover { color: var(--text); background: var(--surface-2); }
.topbar-workspace .drawer-nav > a.active,
.topbar-workspace .nav-menu.is-active > summary,
.topbar-workspace .nav-menu[open] > summary {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold-border);
}
.topbar-workspace .topbar-links .mi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: currentColor;
}
.topbar-workspace .topbar-links .mi svg { width: 16px; height: 16px; }
.topbar-workspace .nav-menu > summary::after { content: none; }
.topbar-workspace .nav-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-left: 2px;
  opacity: .8;
  transition: transform .15s;
}
.topbar-workspace .nav-menu[open] > summary .nav-chevron { transform: rotate(180deg); }
.topbar-workspace .nav-menu-links {
  top: calc(100% + 9px);
  left: 0;
  min-width: 244px;
  max-width: min(340px, calc(100vw - 32px));
  max-height: calc(100dvh - 170px);
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--nav-shadow);
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.topbar-workspace .nav-menu-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
}
.topbar-workspace .nav-menu-links a:hover { color: var(--text); background: var(--surface-2); }
.topbar-workspace .nav-menu-links a.active { color: var(--gold); background: var(--gold-soft); font-weight: 700; }
.topbar-workspace .nav-menu-label {
  padding: 13px 12px 7px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .7px;
}
.topbar-workspace .nav-menu-label:not(:first-child) { margin-top: 7px; border-top: 1px solid var(--border); }
.topbar-workspace .topbar-tools { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-workspace .theme-control { margin: 0; padding: 0; }
.topbar-workspace .theme-control select {
  min-height: 38px;
  min-width: 100px;
  border-radius: 8px;
  background-color: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  padding: 8px 27px 8px 11px;
}
.topbar-workspace .account-menu > summary { gap: 9px; padding: 3px 8px 3px 4px; }
.topbar-workspace .account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}
.topbar-workspace .account-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-workspace .account-menu .nav-menu-links { left: auto; right: 0; }
.topbar-workspace .account-caption { padding: 10px 12px; color: var(--text-faint); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.topbar-workspace .nav-menu-links :is(.topbar-logout, .account-logout) { color: var(--err) !important; }
.topbar-workspace .nav-menu-links :is(.topbar-logout, .account-logout):hover { background: var(--err-soft); }
.topbar-workspace :is(a, button, select, summary):focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.topbar-workspace .drawer-head { display: none; }

@media (min-width: 1025px) and (max-width: 1199px) {
  .topbar-workspace .topbar-inner { padding-right: 22px; padding-left: 22px; }
  .topbar-workspace .drawer-nav { gap: 2px; }
  .topbar-workspace .drawer-nav > a,
  .topbar-workspace .drawer-nav > .nav-menu > summary { padding-right: 9px; padding-left: 9px; font-size: 12px; }
  .topbar-workspace .topbar-links { gap: 12px; }
  .topbar-workspace .topbar-tools { gap: 8px; }
  .topbar-workspace .account-name { max-width: 115px; }
}

@media (max-width: 1024px) {
  .topbar-workspace .topbar-inner { padding: 12px 20px; }
  .topbar-workspace .topbar-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 18px;
    min-height: 0;
  }
  .topbar-workspace .brand { grid-column: 1; grid-row: 1; justify-self: start; }
  .topbar-workspace .brand-app { display: none !important; }
  .topbar-workspace .topbar-burger {
    display: inline-flex !important;
    grid-column: 2;
    grid-row: 1;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--surface-2);
  }
  .topbar-workspace .workspace-switch { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: 420px; justify-self: center; }
  .topbar-workspace .workspace-option { flex: 1; min-width: 0; min-height: 40px; font-size: 13px; }
  .topbar-workspace .topbar-links {
    display: flex !important;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 20;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    width: min(88vw, 360px);
    max-width: 360px;
    min-height: 0;
    padding: 0 !important;
    border: 0;
    border-left: 1px solid var(--border);
    background: var(--surface);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    box-shadow: none;
    transition: transform .2s ease, visibility .2s;
  }
  .topbar-workspace .topbar-links.open { transform: translateX(0); visibility: visible; box-shadow: var(--nav-shadow); transition: transform .2s ease; }
  .topbar-workspace .drawer-head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 12px;
    min-height: 77px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
  }
  .topbar-workspace .drawer-kicker { display: block; margin-bottom: 4px; color: var(--text-faint); font-size: 10px; font-weight: 600; letter-spacing: .5px; }
  .topbar-workspace .drawer-title { display: block; color: var(--text); font-size: 16px; font-weight: 800; }
  .topbar-workspace .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-dim);
    cursor: pointer;
  }
  .topbar-workspace .drawer-close svg { width: 18px; height: 18px; }
  .topbar-workspace .drawer-close:hover { color: var(--text); border-color: var(--border-bright); }
  .topbar-workspace .drawer-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 0 auto;
    gap: 5px;
    min-height: 0;
    padding: 16px 14px;
  }
  .topbar-workspace .drawer-nav > a,
  .topbar-workspace .nav-menu > summary {
    display: flex !important;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 11px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: var(--text-dim) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: normal;
  }
  .topbar-workspace .drawer-nav > a:hover,
  .topbar-workspace .nav-menu > summary:hover { color: var(--text) !important; background: var(--surface-2) !important; }
  .topbar-workspace .drawer-nav > a.active,
  .topbar-workspace .nav-menu.is-active > summary,
  .topbar-workspace .nav-menu[open] > summary { color: var(--gold) !important; background: var(--gold-soft) !important; border-color: var(--gold-border) !important; }
  .topbar-workspace .topbar-links .mi { display: inline-flex !important; width: 20px; height: 20px; color: currentColor; }
  .topbar-workspace .topbar-links .mi svg { width: 18px; height: 18px; }
  .topbar-workspace .nav-chevron { margin-left: auto; }
  .topbar-workspace .nav-menu-links {
    position: static;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin: 5px 0 3px 10px;
    padding: 5px;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0 8px 8px 0;
    background: var(--surface-2);
    box-shadow: none;
    overflow: visible;
  }
  .topbar-workspace .nav-menu-links a {
    display: flex !important;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: var(--text-dim) !important;
    font-size: 13px !important;
    white-space: normal !important;
  }
  .topbar-workspace .nav-menu-links a:hover { color: var(--text) !important; background: var(--surface-3) !important; }
  .topbar-workspace .nav-menu-links a.active { color: var(--gold) !important; background: var(--gold-soft) !important; }
  .topbar-workspace .topbar-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 17px 14px max(20px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
  }
  .topbar-workspace .theme-control { display: flex; flex-wrap: wrap; padding: 0 10px; gap: 8px; }
  .topbar-workspace .theme-control label { position: static; width: auto; height: auto; clip: auto; overflow: visible; color: var(--text-dim); font-size: 12px; }
  .topbar-workspace .theme-control select { margin-left: auto; min-width: 130px; min-height: 42px; font-size: 16px; }
  .topbar-workspace .account-menu > summary { gap: 11px; }
  .topbar-workspace .account-avatar { width: 32px; height: 32px; }
  .topbar-workspace .account-name { max-width: 200px; }
  .topbar-workspace .account-menu .nav-menu-links { margin: 5px 0 0; border-left: 0; border-radius: 8px; }
  .topbar-workspace .nav-menu-links :is(.topbar-logout, .account-logout) { color: var(--err) !important; }
  .topbar-workspace .nav-menu-links :is(.topbar-logout, .account-logout):hover { background: var(--err-soft) !important; }
}

@media (max-width: 420px) {
  .topbar-workspace .topbar-inner { padding-right: 14px; padding-left: 14px; }
  .topbar-workspace .workspace-option { padding-right: 10px; padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-workspace *, .topbar-workspace *::before, .topbar-workspace *::after { transition: none !important; }
}
