/* Cabeçalho compartilhado por todas as telas autenticadas. */
.app-topbar {
    --topbar-control-size: 40px;
    --topbar-border: #ced9e5;
    --topbar-ink: #183c63;
    --topbar-muted: #52657a;
    --topbar-hover: #eef4fa;
    min-height: 60px;
    padding: 10px 16px;
    gap: 16px;
    flex-wrap: nowrap;
    background: #fff;
    backdrop-filter: none;
    box-shadow: none;
}
.app-topbar .topbar-context {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 26rem;
    gap: 8px;
}
.app-topbar .topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
    letter-spacing: -.015em;
}
.app-topbar .topbar-title > strong {
    display: block;
    overflow: hidden;
    color: var(--topbar-ink);
    font-size: 1.25rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-topbar .topbar-global-search-shell {
    position: static;
    flex: 1 1 20rem;
    width: auto;
    min-width: 100px;
    margin: 0;
}
.app-topbar .topbar-dashboard-search {
    height: var(--topbar-control-size);
    min-height: var(--topbar-control-size);
    padding: 0 12px;
    gap: 8px;
    border-color: var(--topbar-border);
    border-radius: 8px;
    background: #f7f9fc;
    box-shadow: none;
}
.app-topbar .topbar-dashboard-search > svg { width: 18px; height: 18px; flex: none; stroke: var(--topbar-muted); }
.app-topbar .topbar-dashboard-search input { height: 100%; font-size: 1.125rem; color: var(--topbar-ink); }
.app-topbar .topbar-dashboard-search input::placeholder { color: var(--topbar-muted); }
.app-topbar .topbar-dashboard-search:focus-within { border-color: #326ba2; outline: 2px solid #326ba2; outline-offset: 2px; box-shadow: none; }
.app-topbar .global-search-clear { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border: 0; border-radius: 4px; color: var(--topbar-muted); background: transparent; }
.app-topbar .global-search-clear[hidden] { display: none; }
.app-topbar .global-search-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.app-topbar .global-search-clear:hover { color: var(--topbar-ink); background: var(--topbar-hover); }
.app-topbar .topbar-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 6px; margin-inline-start: auto; }
.app-topbar .theme-toggle,
.app-topbar .page-help-trigger.page-help-trigger--icon,
.app-topbar .topbar-back-link,
.app-topbar .mobile-menu-trigger,
.app-topbar .topbar-signout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--topbar-control-size);
    height: var(--topbar-control-size);
    min-width: var(--topbar-control-size);
    min-height: var(--topbar-control-size);
    padding: 0;
    border: 1px solid var(--topbar-border);
    border-radius: 8px;
    color: var(--topbar-muted);
    background: transparent;
    box-shadow: none;
    transform: none;
}
.app-topbar .topbar-signout { width: auto; padding-inline: 10px; gap: 6px; font-size: 1.083rem; }
.app-topbar .topbar-signout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-topbar .mobile-menu-trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-topbar .mobile-topbar-brand { align-items: center; text-decoration: none; }
.app-topbar .theme-toggle:hover,
.app-topbar .page-help-trigger.page-help-trigger--icon:hover,
.app-topbar .topbar-back-link:hover,
.app-topbar .mobile-menu-trigger:hover,
.app-topbar .topbar-signout:hover { color: var(--topbar-ink); border-color: #9fb4ca; background: var(--topbar-hover); transform: none; }
.app-topbar .page-help-trigger.page-help-trigger--icon[aria-expanded="true"] { color: #fff; background: #174d83; border-color: #174d83; }
.app-topbar button:focus-visible,
.app-topbar .topbar-back-link:focus-visible,
.app-topbar .mobile-topbar-brand:focus-visible { outline: 2px solid #326ba2; outline-offset: 2px; }
.app-topbar .page-help-trigger--icon svg,
.app-topbar .theme-toggle svg,
.app-topbar .topbar-back-link svg { width: 20px; height: 20px; }
.app-topbar .app-topbar-clock {
    flex: none;
    min-width: 0;
    padding: 0 8px;
    border: 0;
    line-height: 1.25;
    color: var(--topbar-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.app-topbar .app-topbar-clock span { font-size: .95rem; }
.app-topbar .app-topbar-clock strong { font-size: 1.25rem; font-weight: 650; color: var(--topbar-ink); }
.app-topbar .topbar-session-form { display: flex; margin: 0; }
.app-topbar .global-search-panel {
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    width: auto;
    max-width: 80rem;
    margin-inline: auto;
    max-height: calc(100dvh - 140px);
    transform: none;
    display: flex;
    flex-direction: column;
    color: var(--topbar-ink);
    background: #fff;
    border-color: var(--topbar-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px #183c6326;
}
.app-topbar .global-search-tabs { flex: none; gap: 6px; padding: 10px 12px; border-color: var(--topbar-border); }
.app-topbar .global-search-tabs:empty { display: none; }
.app-topbar .global-search-tabs button { min-height: 36px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--topbar-muted); background: transparent; border-color: var(--topbar-border); border-radius: 6px; }
.app-topbar .global-search-tabs button.is-active { color: #fff; background: #174d83; border-color: #174d83; box-shadow: none; }
.app-topbar .global-search-layout { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.app-topbar .global-search-results { min-height: 0; max-height: min(36rem, calc(100dvh - 240px)); padding: 0; overscroll-behavior: contain; }
.app-topbar .global-search-group + .global-search-group { border-color: var(--topbar-border); }
.app-topbar .global-search-group-heading { min-height: 32px; padding: 6px 14px; font-size: 12px; color: var(--topbar-muted); background: #f7f9fc; }
.app-topbar .global-search-result { grid-template-columns: 32px minmax(0, 1fr) minmax(10rem, .45fr) 16px; min-height: 68px; gap: 12px; padding: 10px 14px; border-color: #e7edf3; }
.app-topbar .global-search-result-icon { width: 32px; height: 32px; color: var(--topbar-muted); background: transparent; border: 0; border-radius: 0; }
.app-topbar .global-search-result-icon svg { width: 22px; height: 22px; }
.app-topbar .global-search-result-main { gap: 2px; line-height: 1.35; }
.app-topbar .global-search-result-main strong { color: var(--topbar-ink); font-size: 14px; font-weight: 650; }
.app-topbar .global-search-result-main span { color: var(--topbar-muted); font-size: 13px; }
.app-topbar .global-search-result-main small,
.app-topbar .global-search-result-meta > span { color: var(--topbar-muted); font-size: 12px; }
.app-topbar .global-search-result-meta { gap: 4px; }
.app-topbar .global-search-result-meta > span,
.app-topbar .global-search-result-meta em { max-width: 100%; overflow-wrap: anywhere; }
.app-topbar .global-search-result-meta em { color: var(--topbar-ink); font-size: 12px; font-weight: 500; }
.app-topbar .global-search-result-arrow { display: flex; color: var(--topbar-muted); }
.app-topbar .global-search-result-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-topbar .global-search-result:hover,
.app-topbar .global-search-result.is-active { color: var(--topbar-ink); background: var(--topbar-hover); box-shadow: none; }
.app-topbar .global-search-result:focus-visible { outline: 2px solid #326ba2; outline-offset: -2px; }
.app-topbar .global-search-all { flex: none; min-height: 40px; padding: 8px 14px; font-size: 12px; color: var(--topbar-muted); background: #f7f9fc; border-color: var(--topbar-border); }
.app-topbar .global-search-all[hidden] { display: none; }
.app-topbar .global-search-keyboard { display: flex; align-items: center; gap: 14px; }
.app-topbar .global-search-keyboard > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.app-topbar .global-search-keyboard kbd { padding: 1px 4px; color: var(--topbar-muted); background: transparent; border: 1px solid var(--topbar-border); border-radius: 3px; box-shadow: none; font-size: inherit; }
.app-topbar .global-search-intro,
.app-topbar .global-search-state { min-height: 140px; padding: 24px; color: var(--topbar-muted); }
.app-topbar .global-search-intro strong,
.app-topbar .global-search-state strong { color: var(--topbar-ink); font-size: 14px; }
.app-topbar .global-search-intro > span,
.app-topbar .global-search-state > span { font-size: 13px; }
.app-topbar .global-search-intro-icon,
.app-topbar .global-search-state-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 4px; color: var(--topbar-muted); background: transparent; border: 0; }
.app-topbar .global-search-intro-icon svg,
.app-topbar .global-search-state-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .app-topbar {
    --topbar-border: #3d4d60;
    --topbar-ink: #e6edf3;
    --topbar-muted: #adbbcb;
    --topbar-hover: #1c2a39;
    background: #0d1117;
}
html[data-theme="dark"] .app-topbar .topbar-title > strong,
html[data-theme="dark"] .app-topbar .app-topbar-clock strong { color: var(--topbar-ink); }
html[data-theme="dark"] .app-topbar .topbar-dashboard-search { color: var(--topbar-ink); background: #161b22; border-color: var(--topbar-border); }
html[data-theme="dark"] .app-topbar .theme-toggle,
html[data-theme="dark"] .app-topbar .page-help-trigger.page-help-trigger--icon,
html[data-theme="dark"] .app-topbar .topbar-back-link,
html[data-theme="dark"] .app-topbar .mobile-menu-trigger,
html[data-theme="dark"] .app-topbar .topbar-signout { color: var(--topbar-muted); background: transparent; border-color: var(--topbar-border); }
html[data-theme="dark"] .app-topbar .app-topbar-clock { color: var(--topbar-muted); }
html[data-theme="dark"] .app-topbar .global-search-panel { background: #161b22; border-color: var(--topbar-border); }
html[data-theme="dark"] .app-topbar .global-search-group-heading,
html[data-theme="dark"] .app-topbar .global-search-all { color: var(--topbar-muted); background: #0d1117; border-color: var(--topbar-border); }
html[data-theme="dark"] .app-topbar .global-search-result { border-color: #273343; }
html[data-theme="dark"] .app-topbar .global-search-result-icon { color: var(--topbar-muted); background: transparent; border-color: transparent; }
html[data-theme="dark"] .app-topbar .global-search-result:hover,
html[data-theme="dark"] .app-topbar .global-search-result.is-active { background: var(--topbar-hover); }
html[data-theme="dark"] .app-topbar button:focus-visible,
html[data-theme="dark"] .app-topbar .topbar-back-link:focus-visible { outline-color: #8bbcf0; }
@media (max-width: 1199.98px) {
    .app-topbar { gap: 12px; padding-inline: 12px; }
    .app-topbar .topbar-context { max-width: 20rem; }
    .app-topbar .app-topbar-clock { padding-inline: 4px; }
}
@media (max-width: 991.98px) {
    .app-topbar .topbar-context { max-width: 28rem; }
    .app-topbar .mobile-topbar-brand { flex: none; margin: 0; padding: 0; }
    .app-topbar .mobile-topbar-brand .brand-mark { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
    .app-topbar .topbar-context:has(.topbar-back-link) .mobile-topbar-brand { display: none; }
}
@media (max-width: 767.98px) {
    .app-topbar { --topbar-control-size: 44px; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .app-topbar .topbar-context { flex: 1 0 100%; max-width: 100%; gap: 8px; }
    .app-topbar .topbar-title > strong { font-size: 1.25rem; }
    .app-topbar .topbar-global-search-shell { flex: 1 1 100px; }
    .app-topbar .topbar-dashboard-search { padding-inline: 10px; }
    .app-topbar .topbar-dashboard-search input { font-size: 16px; }
    .app-topbar .topbar-signout { width: 44px; padding: 0; }
    .app-topbar .topbar-signout-label { display: none; }
    .app-topbar .topbar-actions { gap: 4px; }
    .app-topbar .global-search-panel { left: 8px; right: 8px; max-height: calc(100dvh - 132px); }
    .app-topbar .global-search-results { max-height: calc(100dvh - 250px); }
    .app-topbar .global-search-tabs { padding: 8px; }
    .app-topbar .global-search-tabs button { min-height: 44px; }
    .app-topbar .global-search-result { grid-template-columns: 26px minmax(0, 1fr) 16px; gap: 8px; padding: 10px; }
    .app-topbar .global-search-result-icon { grid-row: 1 / 3; width: 26px; }
    .app-topbar .global-search-result-meta { display: flex; grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
    .app-topbar .global-search-result-arrow { grid-column: 3; grid-row: 1 / 3; }
    .app-topbar .global-search-result-meta > span { max-width: 100%; }
    .app-topbar .global-search-result-meta:empty { display: none; }
    .app-topbar .global-search-result-main small { white-space: normal; }
    .app-topbar .global-search-keyboard { display: none; }
}
@media (pointer: coarse) and (min-width: 768px) {
    .app-topbar { --topbar-control-size: 44px; }
}
