/*
 * Application shell for the clinical work areas (médica, profissional, recepção, financeiro)
 * plus the shared page components. Colors come from tokens.css.
 * - The physician's initial clinic (body.side-shell): from 1200 px the header becomes a fixed side menu
 *   (docs/SIDE-MENU.md); below that the top bar and the bottom navigation stay.
 * - Professional, reception, finance and management (body.topbar-shell, UX-C): the top bar of one row
 *   (docs/TOP-BAR.md), in the section "Top bar" at the end of this file.
 */
:root { --pm-sidebar-width: 15.5rem; }

@media (min-width: 1200px) {
  body.side-shell { padding-left: var(--pm-sidebar-width); }
  body.side-shell #header {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--pm-sidebar-width);
    display: block;
    padding: 0;
    transform: none !important;
    background-color: var(--pm-surface) !important;
    border-right: 1px solid var(--pm-border);
    box-shadow: none !important;
    z-index: 1030;
  }
  /* Three parts, top to bottom: the brand, the work items and who is signed in. Only the work items scroll, so an open
     group never pushes the brand, the search or the account row out of reach. The menu edge clips what does not fit
     (the labels, in the rail). */
  body.side-shell #header > .container { width: 100%; max-width: none; height: 100%; padding: 1.25rem .875rem .75rem; overflow: hidden; overflow: clip; }
  /* The container is a flex row (Bootstrap navbar): without min-width 0 the menu would not shrink below its widest label. */
  body.side-shell #header .navbar-nav-wrap { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; align-self: stretch; gap: .875rem; flex: 1 1 auto; width: 100%; min-width: 0; height: 100%; min-height: 0; }
  body.side-shell #header .navbar-nav-wrap > * { min-width: 0; max-width: 100%; }
  body.side-shell #header .navbar-brand { flex: 0 0 auto; margin: 0; padding: 0 .5rem; }
  body.side-shell #header .brand-wordmark { font-size: 1.5rem !important; }
  body.side-shell #header .navbar-collapse { display: flex !important; flex-direction: column; align-items: stretch; flex: 1 1 0%; gap: .5rem; min-height: 0; }
  /* Front makes every .navbar-nav grow and aligns it at the end; here each list is a column of rows. */
  body.side-shell #header .navbar-nav { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-content: flex-start; gap: .125rem; width: 100%; margin: 0; padding: 0; }
  /* Items may be narrower than their label (the rail clips it at the menu edge, from the left). */
  body.side-shell #header .navbar-nav > .nav-item { flex: 0 0 100%; min-width: 0; margin: 0 !important; }
  /* The work list takes the height that is left and scrolls by itself. Its slim scrollbar lives in the menu's side
     padding: the list is wider than the column by that much and keeps the gutter even with nothing to scroll, so the
     items have the same width with or without the bar (custom.css zeroes the right padding with !important). */
  body.side-shell #header #navbarNavDropdownNav { flex: 1 1 0%; width: calc(100% + .75rem); max-width: none; min-height: 0; margin-right: -.75rem; padding: 0 0 .25rem; padding-right: .375rem !important; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 3.25rem .5rem; scrollbar-gutter: stable; }
  body.side-shell #header #navbarNavDropdownNav::-webkit-scrollbar { width: .375rem; }
  body.side-shell #header #navbarNavDropdownNav::-webkit-scrollbar-track { background: transparent; }
  body.side-shell #header #navbarNavDropdownNav::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--pm-border); }
  body.side-shell #header #navbarNavDropdownNav:is(:hover, :focus-within)::-webkit-scrollbar-thumb { background: var(--pm-border-strong); }
  /* Firefox has no scrollbar pictures to restyle (and Chrome ignores them once scrollbar-width is set): its thin bar. */
  @supports not selector(::-webkit-scrollbar) {
    body.side-shell #header #navbarNavDropdownNav { width: 100%; margin-right: 0; padding-right: 0 !important; scrollbar-gutter: auto; scrollbar-width: thin; scrollbar-color: var(--pm-border-strong) transparent; }
  }
  /* The search stays at the top of the list while it scrolls; a soft edge shows there is something under it (side-menu.js). */
  body.side-shell #header #navbarNavDropdownNav > .nav-command { position: sticky; top: 0; z-index: 2; padding-bottom: .375rem; background: var(--pm-surface); }
  body.side-shell #header #navbarNavDropdownNav > .nav-command::after { content: ''; position: absolute; top: 100%; right: 0; left: 0; height: .625rem; background: linear-gradient(var(--pm-surface), transparent); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
  body.side-shell #header #navbarNavDropdownNav.is-scrolled > .nav-command::after { opacity: 1; }
  body.side-shell #header .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: .5rem .75rem !important;
    border-radius: var(--pm-radius);
    color: var(--pm-ink-2);
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
  }
  body.side-shell #header .navbar-nav .nav-link:hover,
  body.side-shell #header .navbar-nav .nav-link:focus-visible { color: var(--pm-ink) !important; background-color: var(--pm-surface-2); }
  body.side-shell #header .navbar-nav .nav-link[aria-current="page"] { color: var(--pm-brand-ink) !important; background-color: var(--pm-brand-soft); font-weight: 600; }
  /* The list clips at its edges, so the focus ring of its rows is drawn inside them. */
  body.side-shell #header #navbarNavDropdownNav :is(.nav-link, .dropdown-item):focus-visible { outline-offset: -2px; }
  body.side-shell #header .navbar-nav .nav-link > .badge { margin-left: auto !important; }
  /* Group arrow: a small chevron in the text color (Front's is a picture in one fixed gray). */
  body.side-shell #header .navbar-nav .dropdown-toggle::after { content: "\F282"; flex: 0 0 auto; width: auto; height: auto; margin-left: auto; background: none; color: var(--pm-ink-3); font-family: bootstrap-icons; font-size: .75rem; line-height: 1; transition: transform .15s ease; }
  body.side-shell #header .navbar-nav .nav-link > .badge + .dropdown-toggle::after, body.side-shell #header .navbar-nav .dropdown-toggle:has(> .badge)::after { margin-left: .375rem; }
  body.side-shell #header .navbar-nav .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  /* A group that holds the page on screen stands out even when closed. */
  body.side-shell #header .navbar-nav .nav-item.dropdown:has(.dropdown-item[aria-current="page"]) > .dropdown-toggle { color: var(--pm-ink); font-weight: 600; }
  body.side-shell #header .navbar-nav .nav-item.dropdown:has(.dropdown-item[aria-current="page"]) > .dropdown-toggle > i { color: var(--pm-brand-ink); }
  /* Groups open inside the menu, under their item (side-menu.js): a guide line under the item's icon, and the pages as
     text rows that start where the item's label starts. A row keeps the width it has in the open menu (the menu's
     15.5rem less the paddings around it) and its list item clips it, so a long name wraps the same way while the rail
     opens and closes and no row changes height on the way. */
  body.side-shell #header .navbar-nav .dropdown-menu,
  body.side-shell #header .navbar-nav .dropdown-menu[data-bs-popper] { position: static; inset: auto; transform: none; min-width: 0; width: auto; margin: .125rem 0 .375rem 1.375rem; padding: 0; border: 0 !important; border-left: 1px solid var(--pm-border) !important; border-radius: 0; background: transparent !important; box-shadow: none !important; }
  body.side-shell #header .navbar-nav .dropdown-menu.is-opening { animation: side-group-in .18s cubic-bezier(.2, 0, 0, 1); }
  body.side-shell #header .navbar-nav .dropdown-menu > li + li { margin-top: 1px; }
  body.side-shell #header #navbarNavDropdownNav .dropdown-menu > li { position: relative; margin-left: -2px; padding-left: calc(.5625rem + 2px); overflow: hidden; overflow: clip; border-radius: 0 var(--pm-radius-sm) var(--pm-radius-sm) 0; }
  body.side-shell #header #navbarNavDropdownNav .dropdown-menu .dropdown-item { width: calc(15.5rem - 3.6875rem - 2px); }
  html:not(.side-rail, .side-rail-switching) body.side-shell #header #navbarNavDropdownNav .dropdown-menu .dropdown-item { max-width: 100%; }
  body.side-shell #header .navbar-nav .dropdown-menu .dropdown-item { position: relative; display: flex; align-items: center; gap: .5rem; min-height: 2.125rem; padding: .375rem .5rem; border-radius: var(--pm-radius-sm); color: var(--pm-ink-2); font-size: .8125rem; line-height: 1.25; white-space: normal; }
  body.side-shell #header .navbar-nav .dropdown-menu .dropdown-item:hover,
  body.side-shell #header .navbar-nav .dropdown-menu .dropdown-item:focus-visible { color: var(--pm-ink) !important; background-color: var(--pm-surface-2) !important; }
  body.side-shell #header .navbar-nav .dropdown-menu .dropdown-item[aria-current="page"] { color: var(--pm-brand-ink) !important; background-color: var(--pm-brand-soft) !important; font-weight: 600; }
  /* The page on screen is also marked on the guide line. */
  body.side-shell #header #navbarNavDropdownNav .dropdown-menu > li:has(> .dropdown-item[aria-current="page"])::before { content: ''; position: absolute; top: .4375rem; bottom: .4375rem; left: .5px; width: 2px; border-radius: 2px; background: var(--pm-brand); transition: opacity .18s ease; }
  /* The "Buscar" box finds pages and patients and leads to the search page, so the menu keeps one search entry. */
  body.side-shell #header .nav-search-page { display: none !important; }
  body.side-shell #header .nav-command-button[aria-current="page"] { border-color: var(--pm-brand) !important; color: var(--pm-brand-ink) !important; }
}
@keyframes side-group-in { from { opacity: 0; transform: translateY(-.25rem); } }
@keyframes nav-account-in { from { opacity: 0; transform: translateY(.375rem); } }

/* Footer of work areas: neutral and compact instead of the institutional green band. */
/* Work areas and the patient portal share the neutral footer. */
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer { color: var(--pm-ink-2); background-color: var(--pm-surface) !important; border-top: 1px solid var(--pm-border); padding-block: 1.75rem 1.25rem; }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .footer-logo,
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .footer-nav-title,
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .footer-intro,
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .footer-copyright { color: var(--pm-ink) !important; }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .link-light { color: var(--pm-link) !important; }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .btn-outline-light { color: var(--pm-ink); border-color: var(--pm-border-strong); }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .btn-outline-light:hover { color: var(--pm-ink); background-color: var(--pm-surface-2); }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .footer-bottom { border-top-color: var(--pm-border); }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer { --pm-focus: inherit; } /* the white footer keeps the page's focus color, not the green band's white (theme-shell.css) */
/* In work areas the side menu and the phone menu already lead to every page (the
   doctor's work preferences open from Configurações), so the footer keeps only the
   legal line. The sitemap stays in the markup for the patient and public pages. */
:is(body.app-shell, body.management-shell) .site-footer { padding-block: 1rem; }
:is(body.app-shell, body.management-shell, body.patient-shell) .site-footer .footer-main { display: none; }
:is(body.app-shell, body.management-shell) .site-footer .footer-bottom { border-top: 0; margin-top: 0; padding-top: 0; }

/* Bottom navigation on phones and tablets: a flat bar with the current page marked. */
@media (max-width: 991.98px) {
  .mobile-glass-nav {
    left: 0;
    right: 0;
    bottom: 0;
    gap: .25rem;
    padding: .375rem .5rem calc(.375rem + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--pm-border);
    border-radius: 0;
    background: var(--pm-surface) !important;
    box-shadow: 0 -4px 16px rgba(19, 32, 25, .06);
    backdrop-filter: none;
    /* The bar keeps its height when the page reads at 16 px (UX-B). */
    line-height: 1.45;
  }
  .mobile-glass-nav::before { display: none; }
  .mobile-glass-nav a,
  .mobile-glass-nav button { min-height: 52px; color: var(--pm-ink-3); background: transparent; border: 0; border-radius: var(--pm-radius); font-size: .75rem; font-weight: 600; }
  .mobile-glass-nav a[aria-current="page"] { color: var(--pm-brand-ink); background: var(--pm-brand-soft); box-shadow: inset 0 0 0 2px var(--pm-brand); } /* not by color alone (WCAG 1.4.1, 09/11) */
  .mobile-glass-nav i { font-size: 1.25rem; }
  html.dark-mode .mobile-glass-nav { background: var(--pm-surface) !important; border-top-color: var(--pm-border); box-shadow: none; }
  html.dark-mode .mobile-glass-nav a,
  html.dark-mode .mobile-glass-nav button { color: var(--pm-ink-3); background: transparent; border: 0; }
  html.dark-mode .mobile-glass-nav a[aria-current="page"] { color: var(--pm-brand-ink); background: var(--pm-brand-soft); }
  .back-to-top { bottom: 5.5rem; }
}
/* UX-E (12/11/2026): on a phone the "↑" button sat over fields, acceptance boxes and the bottom bar of the work areas
   and of the portals (UX review, item 8). It is not shown there; the public pages of the product keep it. */
@media (max-width: 767.98px) { body:is(.app-shell, .management-shell, .patient-shell, .topbar-shell) .back-to-top { display: none !important; } }

/* Shared page components (ui-page-header, ui-empty-state, ui-notice). */
.pm-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin: 1.5rem 0 1.25rem; }
.pm-page-header-text { flex: 1 1 20rem; min-width: 0; }
/* The eyebrow is a mono section label and the title takes the page size (components.css, docs/VISUAL-SYSTEM.md). */
.pm-page-header-eyebrow { display: block; margin-bottom: .25rem; }
.pm-page-header h1 { margin: 0; }
.pm-page-header-subtitle { margin: .375rem 0 0; color: var(--pm-ink-2); max-width: 48rem; }
.pm-page-header-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Page header in one line (docs/VISUAL-SYSTEM.md, "Cabeçalho numa linha"): the back arrow, the title and the actions of
   the page share a row; on a phone the actions go under the title. The arrow is a link whose accessible name is where it
   leads ("Voltar à agenda"). What used to be explanatory text under the title goes behind "Saiba mais" (.pm-page-more). */
.pm-page-line { align-items: center; gap: .5rem .75rem; }
.pm-page-line .pm-page-header-text { flex: 1 1 12rem; }
.pm-page-back { display: inline-grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; margin-left: -.5rem; border-radius: 999px; color: var(--pm-ink); font-size: 1.25rem; text-decoration: none; }
.pm-page-back:hover { color: var(--pm-ink); background: var(--pm-surface-2); }
.pm-page-back:focus-visible { outline: 2px solid var(--pm-focus); outline-offset: 2px; }
.pm-page-header + .pm-page-more { margin: -.75rem 0 1rem; }
@media (max-width: 575.98px) { .pm-page-line .pm-page-header-actions { flex: 1 1 100%; } }
/* UX-F (H1): on paper (the AI audit statement, for example) the back arrow and the "Saiba mais" under the header are
   not printed. */
@media print { .pm-page-back, .pm-page-more { display: none !important; } }
/* In dark mode every link takes the link colour (theme-shell.css); the arrow keeps the ink colour of the title. */
html.dark-mode a.pm-page-back:not(.btn) { color: var(--pm-ink); }
/* Empty state (UX-N2, C6): the quiet next step by default; the dashed line is a rule, not a control outline (3:1 is for
   controls). .is-compact sits inside the card of a list: no box, the icon beside the text. */
.pm-empty-state { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2.5rem 1.5rem; text-align: center; color: var(--pm-ink-2); background: var(--pm-surface); border: 1px dashed var(--pm-border); border-radius: var(--pm-radius-card); }
.pm-empty-state-icon { display: grid; place-items: center; flex: none; width: 3rem; height: 3rem; border-radius: 999px; color: var(--pm-brand-ink); background: var(--pm-brand-soft); font-size: 1.35rem; }
.pm-empty-state-text { display: flex; flex-direction: column; align-items: center; gap: .5rem; min-width: 0; }
.pm-empty-state :is(h2, h3).pm-empty-state-title, .pm-empty-state h2 { margin: .25rem 0 0; color: var(--pm-ink); font-size: 1.125rem; font-weight: 700; }
.pm-empty-state p { margin: 0; max-width: 32rem; }
.pm-empty-state-action { margin-top: .25rem; }
.pm-empty-state.is-compact { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 0; text-align: left; background: transparent; border: 0; border-radius: 0; }
.pm-empty-state.is-compact .pm-empty-state-icon { width: 2.5rem; height: 2.5rem; font-size: 1.125rem; }
.pm-empty-state.is-compact .pm-empty-state-text { align-items: flex-start; gap: 4px; }
.pm-empty-state.is-compact .pm-empty-state-title { margin: 0; font-size: 1rem; font-weight: 650; }
.pm-empty-state.is-compact .pm-empty-state-action { margin: 4px 0 0 -12px; }
.pm-notice { border: 1px solid var(--pm-border); border-radius: var(--pm-radius-card); background: var(--pm-surface-2); }
.pm-notice > summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 1rem; color: var(--pm-ink-2); font-weight: 600; cursor: pointer; list-style: none; }
.pm-notice > summary::-webkit-details-marker { display: none; }
.pm-notice > summary::after { content: "\F282"; margin-left: auto; font-family: bootstrap-icons; transition: transform .15s ease; }
.pm-notice[open] > summary::after { transform: rotate(180deg); }
.pm-notice-body { padding: 0 1rem 1rem; color: var(--pm-ink-2); }
.pm-notice-body > :last-child { margin-bottom: 0; }

/* Account, at the foot of the side menu. From 1200 px it is one row, who is signed in, that opens a panel over the menu
   with the account pages, the area switch, the display switches and "Sair" (side-menu.js): the work items keep the
   height. Below 1200 px the same list is part of the open menu: tiles for the pages and one row of icon buttons. */
body.side-shell :is(.nav-account-trigger, .nav-action-label, .nav-action-switch) { display: none; }
.nav-account-prefs { display: contents; }
.nav-account-person { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; overflow: hidden; padding: .25rem .5rem .5rem; }
.nav-account-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--pm-brand-soft); color: var(--pm-brand-ink); font-size: .8125rem; font-weight: 700; }
.nav-account-text { display: flex; flex-direction: column; min-width: 0; }
.nav-account-text strong { overflow: hidden; color: var(--pm-ink); font-size: .875rem; text-overflow: ellipsis; white-space: nowrap; }
.nav-account-text small { color: var(--pm-ink-3); font-size: .75rem; }
.nav-account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.nav-account-actions > span { display: inline-flex; }
@media (min-width: 1200px) {
  body.side-shell #header .nav-account { position: relative; flex: 0 0 auto; padding-top: .5rem; border-top: 1px solid var(--pm-border); }
  /* The avatar sits on the icon column (container .875rem + .375rem + half of 2rem = 2.25rem), so it stays put in the rail. */
  body.side-shell #header .nav-account-trigger { display: flex; align-items: center; gap: .625rem; width: 100%; min-height: 3rem; padding: .375rem .5rem .375rem .375rem; overflow: hidden; border: 0; border-radius: var(--pm-radius); background: transparent; color: var(--pm-ink); text-align: left; transition: background-color .15s ease; }
  body.side-shell #header .nav-account-trigger:is(:hover, [aria-expanded="true"]) { background: var(--pm-surface-2); }
  body.side-shell #header .nav-account-trigger .nav-account-avatar { flex: 0 0 2rem; width: 2rem; height: 2rem; font-size: .75rem; transition: box-shadow .15s ease; }
  body.side-shell #header .nav-account-trigger .nav-account-text { flex: 1 1 auto; line-height: 1.25; }
  body.side-shell #header .nav-account-trigger .nav-account-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.side-shell #header .nav-account-trigger > i { flex: 0 0 auto; margin-left: auto; color: var(--pm-ink-3); font-size: .875rem; line-height: 1; }
  /* An account page is on screen: the avatar wears a ring. */
  body.side-shell #header .nav-account.has-current .nav-account-avatar { box-shadow: 0 0 0 2px var(--pm-surface), 0 0 0 4px var(--pm-brand); }
  /* The panel has the width of the open menu's column, so it does not stretch while the rail opens. */
  body.side-shell #header .nav-account-panel { position: absolute; bottom: calc(100% + .25rem); left: 0; z-index: 5; display: none; width: calc(15.5rem - 1.75rem - 1px); max-height: calc(100dvh - 5.5rem); padding: .375rem; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--pm-border); border-radius: var(--pm-radius-lg); background: var(--pm-surface); box-shadow: var(--pm-shadow-lg); }
  html.dark-mode body.side-shell #header .nav-account-panel { background: var(--pm-surface-raised); }
  body.side-shell #header .nav-account.is-open > .nav-account-panel { display: block; animation: nav-account-in .16s cubic-bezier(.2, 0, 0, 1); }
  body.side-shell #header .navbar-nav.nav-account-list { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 1px; }
  body.side-shell #header .navbar-nav.nav-account-list > .nav-item { flex: 0 0 auto; }
  body.side-shell #header .navbar-nav.nav-account-list > .nav-account-person { display: none; }
  /* The account pages are a flat list: the panel itself is "Minha conta". */
  body.side-shell #header .navbar-nav.nav-account-list > .dropdown > .dropdown-toggle { display: none; }
  body.side-shell #header .navbar-nav.nav-account-list > .dropdown > .dropdown-menu { display: flex !important; flex-direction: column; gap: 1px; width: 100%; margin: 0; padding: 0; border: 0 !important; animation: none; }
  body.side-shell #header .navbar-nav.nav-account-list > .dropdown > .dropdown-menu > li + li { margin-top: 0; }
  /* Every entry of the panel is the same row: icon, name and, for what is on or off, a switch. */
  body.side-shell #header .nav-account-panel :is(.nav-link, .dropdown-item, .nav-action, .nav-account-logout .btn) { display: flex; align-items: center; justify-content: flex-start; gap: .5rem; width: 100%; min-height: 2.25rem; margin: 0; padding: .375rem .5rem !important; border: 0 !important; border-radius: var(--pm-radius-sm); background: transparent !important; box-shadow: none !important; color: var(--pm-ink-2) !important; font-size: .875rem; font-weight: 500; line-height: 1.25; text-align: left; white-space: normal; }
  body.side-shell #header .nav-account-panel :is(.nav-link, .dropdown-item)[aria-current="page"] { background: var(--pm-brand-soft) !important; color: var(--pm-brand-ink) !important; font-weight: 600; }
  body.side-shell #header .nav-account-panel :is(.nav-link, .dropdown-item, .nav-action, .nav-account-logout .btn):is(:hover, :focus-visible) { background: var(--pm-surface-2) !important; background: color-mix(in srgb, var(--pm-ink) 7%, transparent) !important; color: var(--pm-ink) !important; }
  body.side-shell #header .nav-account-panel :is(.nav-link, .dropdown-item, .nav-action, .btn) > i { flex: 0 0 1.25rem; width: 1.25rem; margin: 0 !important; font-size: 1rem; line-height: 1; text-align: center; }
  /* Groups: account pages, then area and help, then the display switches, then "Sair". */
  body.side-shell #header .navbar-nav.nav-account-list > .nav-account-switch:not(:first-child) { margin-top: .375rem !important; padding-top: .375rem; border-top: 1px solid var(--pm-border); }
  body.side-shell #header .navbar-nav.nav-account-list > .nav-account-actions { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 1px; padding: 0; }
  body.side-shell #header .nav-account-panel #botao-cta-menu { display: flex; margin-top: 0; }
  body.side-shell #header .nav-account-panel :is(.nav-account-prefs, .nav-account-logout) { display: flex; flex-direction: column; gap: 1px; margin-top: .3125rem; padding-top: .375rem; border-top: 1px solid var(--pm-border); }
  body.side-shell #header .nav-account-panel .nav-account-logout form { display: flex !important; width: 100%; margin: 0; }
  body.side-shell #header .nav-account-panel .nav-action-label { display: block; flex: 1 1 auto; min-width: 0; }
  body.side-shell #header .nav-account-panel .nav-action-switch { position: relative; display: block; flex: 0 0 1.75rem; width: 1.75rem; height: 1rem; margin-left: auto; border-radius: 999px; background: var(--pm-border-strong); transition: background-color .15s ease; }
  body.side-shell #header .nav-account-panel .nav-action-switch::after { content: ''; position: absolute; top: .125rem; left: .125rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--pm-surface); transition: transform .15s cubic-bezier(.2, 0, 0, 1); }
  body.side-shell #header .nav-account-panel [aria-pressed="true"] > .nav-action-switch { background: var(--pm-brand); }
  body.side-shell #header .nav-account-panel [aria-pressed="true"] > .nav-action-switch::after { transform: translateX(.75rem); }
  /* Named "Tema escuro", the row keeps the moon in both themes (theme-ui.js swaps the icon for the phone button). */
  body.side-shell #header .nav-account-panel .theme-toggle > i::before { content: "\F496"; }
  body.side-shell #header .nav-account-panel .nav-account-logout .btn { color: var(--pm-danger) !important; }
  body.side-shell #header .nav-account-panel .nav-account-logout .btn:is(:hover, :focus-visible) { background: var(--pm-danger-bg) !important; color: var(--pm-danger) !important; }
}
/* Touch screens at this width (large tablets, touch laptops) keep 44 px rows. */
@media (min-width: 1200px) and (pointer: coarse) {
  body.side-shell #header .navbar-nav .nav-link, body.side-shell #header .navbar-nav .dropdown-menu .dropdown-item { min-height: 2.75rem; }
  body.side-shell #header .nav-account-panel :is(.nav-link, .dropdown-item, .nav-action, .nav-account-logout .btn) { min-height: 2.75rem; }
}
@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
  body.side-shell #header .nav-account.is-open > .nav-account-panel, body.side-shell #header .navbar-nav .dropdown-menu.is-opening { animation: none; }
}
@media (max-width: 1199.98px) {
  /* Same look as the main menu on phones and tablets (theme-shell.css styles only #navbarNavDropdownNav). */
  body.side-shell #header .nav-account-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; width: 100%; margin: .6rem 0 0; padding: .6rem 0 0; border-top: 1px solid var(--pm-border); }
  body.side-shell #header .nav-account-list > .nav-item { min-width: 0; margin: 0 !important; }
  body.side-shell #header .nav-account-list > :is(.nav-account-person, .nav-account-actions), body.side-shell #header .nav-account-list > .nav-item.dropdown:has(> .dropdown-menu.show) { grid-column: 1 / -1; }
  body.side-shell #header .nav-account-list .nav-link { display: flex; align-items: center; width: 100%; min-height: 2.75rem; padding: .65rem .75rem; border: 1px solid var(--pm-border); border-radius: .75rem; background: var(--pm-surface); color: var(--pm-brand-ink); font-size: .82rem; line-height: 1.2; }
  body.side-shell #header .nav-account-list .nav-account-actions { padding: .25rem 0; }
  body.side-shell #header .nav-account-list .nav-account-actions .btn { min-height: 2.75rem; }
  /* Icon buttons are squares of one size, and "Sair" closes the row at the far end. */
  body.side-shell #header .nav-account-list .nav-account-actions .nav-action { width: 2.75rem; padding-inline: 0; }
  body.side-shell #header .nav-account-list .nav-account-logout { margin-left: auto; }
  body.side-shell #header .nav-account-list #botao-cta-menu { margin-top: 0; }
  body.side-shell #header .nav-account-list #botao-cta-menu .btn { color: var(--pm-on-brand); border-color: var(--pm-brand); background: var(--pm-brand); }
}

/* Work pages start near the top: the menu sits at the side (or in the slim top bar), never over the content.
   Front's spacing utilities (!important) were sized for a landing page and left a blank band above every title. */
body.app-shell #content > section.container[class*="content-space"],
body.app-shell #content > section > .container[class*="content-space"] { padding-top: 1.5rem !important; padding-bottom: 3rem !important; }
@media (min-width: 1200px) {
  body.app-shell #content > section.container[class*="content-space"],
  body.app-shell #content > section > .container[class*="content-space"] { padding-top: 2.25rem !important; }
}
/* Below a "← Voltar" link the title needs only a short gap (experience.css spaced headings for pages without one). */
body.app-shell #content .page-heading { margin-top: .5rem; }

/* Collapsible side menu (from 1200 px): a 72 px rail of icons. It opens over the page, without moving it, while the
   pointer is on it, the keyboard is inside it (:focus-visible, so a mouse click does not hold it open) or the account
   panel is open (.account-open, side-menu.js).
   Every icon keeps one place in both states: a 1.25rem box whose center is the rail's center (container .875rem + item
   .75rem + half the box = 2.25rem). Closing the menu only narrows it: labels fade (the text stays for screen readers)
   and the menu edge clips them. The edge button animates the menu and the page together; side-menu.js marks that
   moment (html.side-rail-switching), so resizing the window never animates. */
.brand-mark, .side-rail-toggle { display: none; }
@media (min-width: 1200px) {
  body.side-shell .side-rail-toggle { position: absolute; top: 1.5rem; right: -.875rem; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 1px solid var(--pm-border); border-radius: 999px; background: var(--pm-surface); color: var(--pm-ink-2); box-shadow: var(--pm-shadow-sm); font-size: .75rem; }
  body.side-shell .side-rail-toggle:hover, body.side-shell .side-rail-toggle:focus-visible { border-color: var(--pm-brand); color: var(--pm-brand-ink); }
  body.side-shell .side-rail-toggle i { transition: transform .24s cubic-bezier(.2, 0, 0, 1); }
  body.side-shell #header :is(.navbar-nav .nav-link, .navbar-nav .dropdown-item) > i { flex: 0 0 1.25rem; width: 1.25rem; margin: 0 !important; font-size: 1.0625rem; line-height: 1; text-align: center; }
  /* In the open menu the pages of a group are text rows; their icons show in the rail, where there is no text. The
     icon is placed over the row, on the icon column, so the text is laid out the same way in both states. */
  body.side-shell #header #navbarNavDropdownNav .dropdown-item > i { position: absolute; top: 50%; left: .75rem; transform: translateY(-50%); opacity: 0; pointer-events: none; }
  body.side-shell #header .navbar-nav .nav-link.nav-command-button { padding-left: calc(.75rem - 1px) !important; }
  html.side-rail { --pm-sidebar-width: 4.5rem; }
  html.side-rail body.side-shell .side-rail-toggle i { transform: rotate(180deg); }
  /* Motion: the switch by the edge button, and the peek of the rail. */
  html.side-rail-switching body.side-shell { transition: padding-left .24s cubic-bezier(.2, 0, 0, 1); }
  :is(html.side-rail, html.side-rail-switching) body.side-shell #header { transition: width .24s cubic-bezier(.2, 0, 0, 1), box-shadow .24s ease; }
  :is(html.side-rail, html.side-rail-switching) body.side-shell #header :is(.navbar-nav .nav-link, .navbar-nav .dropdown-item) { transition: color .18s ease, background-color .15s ease, padding .24s cubic-bezier(.2, 0, 0, 1), border-color .18s ease; }
  :is(html.side-rail, html.side-rail-switching) body.side-shell #header :is(.navbar-nav .dropdown-menu, .navbar-brand) { transition: margin .24s cubic-bezier(.2, 0, 0, 1), padding .24s cubic-bezier(.2, 0, 0, 1), border-color .18s ease; }
  :is(html.side-rail, html.side-rail-switching) body.side-shell #header #navbarNavDropdownNav .dropdown-menu > li { transition: margin .24s cubic-bezier(.2, 0, 0, 1), padding .24s cubic-bezier(.2, 0, 0, 1); }
  :is(html.side-rail, html.side-rail-switching) body.side-shell #header #navbarNavDropdownNav .dropdown-item > i { transition: opacity .18s ease; }
  :is(html.side-rail, html.side-rail-switching) body.side-shell #header :is(.nav-account-text, .nav-command-button > span, .nav-account-trigger > i) { transition: opacity .18s ease; }
  /* The peek opens after a short pause and closes a little later, so a pointer passing by does not flash it; labels
     fade out before the menu narrows and fade in as it widens. A click on the edge button acts at once. */
  html.side-rail body.side-shell #header { transition-delay: .3s; }
  html.side-rail body.side-shell #header:is(:has(> .container:hover), :has(> .container :focus-visible), .account-open) { width: 15.5rem; box-shadow: var(--pm-shadow) !important; transition-delay: .1s; }
  html.side-rail body.side-shell #header:is(:has(> .container:hover), :has(> .container :focus-visible), .account-open) :is(.navbar-nav .nav-link, .navbar-nav .dropdown-item, .nav-account-text, .nav-command-button > span, .nav-account-trigger > i) { transition-delay: .15s; }
  html.side-rail-switching body.side-shell #header, html.side-rail-switching body.side-shell #header * { transition-delay: 0s !important; }
  /* Closed rail. */
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .brand-wordmark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: .625rem; background: var(--pm-brand); color: var(--pm-on-brand); font-size: 1.125rem; font-weight: 700; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-brand { padding-left: .375rem; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) :is(.navbar-nav .nav-link, .navbar-nav .dropdown-item) { color: transparent !important; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) :is(.navbar-nav .nav-link, .navbar-nav .dropdown-item) > i { color: var(--pm-ink-2); }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) :is(.navbar-nav .nav-link, .navbar-nav .dropdown-item)[aria-current="page"] > i, html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav .nav-item.dropdown:has(.dropdown-item[aria-current="page"]) > .dropdown-toggle > i { color: var(--pm-brand-ink); }
  /* An open group keeps its pages under the item, as icons on the icon column: each row starts where the items do. */
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav .dropdown-menu { margin-left: 0; border-left-color: transparent !important; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) #navbarNavDropdownNav .dropdown-menu > li { margin-left: -1px; padding-left: 0; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) #navbarNavDropdownNav .dropdown-item > i { opacity: 1; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) #navbarNavDropdownNav .dropdown-menu > li::before { opacity: 0; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav .nav-link { position: relative; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav .nav-link > .badge { position: absolute; top: .2rem; left: 1.65rem; margin: 0 !important; padding: .15rem .3rem; font-size: .625rem; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .nav-command-button kbd { display: none !important; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav .dropdown-toggle::after { opacity: 0; }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) :is(.nav-account-text, .nav-command-button > span, .nav-account-trigger > i) { opacity: 0; }
  /* An item without its own icon shows a dot on the icon column rather than a blank row. */
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav :is(.nav-link, .dropdown-item):not(:has(> i))::before { content: ''; flex: 0 0 .375rem; width: .375rem; height: .375rem; margin-inline: .4375rem; border-radius: 50%; background: var(--pm-ink-3); }
  html.side-rail body.side-shell #header:not(:has(> .container:hover)):not(:has(> .container :focus-visible)):not(.account-open) .navbar-nav .dropdown-item:not(:has(> i))::before { margin-left: .6875rem; }
}
/* With "reduce motion" (a system setting) the switch still shows, shorter: switching it off entirely left the menu
   jumping between widths with no sign of what happened. */
@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
  html.side-rail-switching body.side-shell, :is(html.side-rail, html.side-rail-switching) body.side-shell #header, :is(html.side-rail, html.side-rail-switching) body.side-shell #header * { transition-duration: .14s !important; }
  body.side-shell .side-rail-toggle i { transition: none; }
}

/* ==========================================================================================================
   Top bar (UX-C, 12/11/2026; docs/TOP-BAR.md, prototype tmp/ux-prototypes/recepcao-hoje): one row of 56 px for
   professional, reception, finance (workspace-topbar.php) and management (management-navigation.php). The
   brand, the area and clinic, up to five pages and "Mais" with a 3 px pen line under the page on screen, the
   search (Ctrl+K), help, the theme and the account. Below 1200 px the pages fold into the menu button (a panel
   under the bar); below 768 px the area and clinic move into that panel and the brand is the glyph.
   ========================================================================================================== */
body.topbar-shell { --pm-bar-h: 56px; padding-left: 0; }
body.topbar-shell #header.workspace-topbar { position: sticky !important; top: 0; z-index: 1030; display: block; width: 100%; min-height: var(--pm-bar-h); margin: 0; padding: 0; background: var(--pm-topbar) !important; border-bottom: 1px solid var(--pm-border); box-shadow: none !important; }
/* UX-M1 (approved prototype tmp/ux-prototypes-m, section 5): the bar and the page share one frame. The bar's inner row is
   the page's own .container (720 and 960 px up to 1199, 90% from 1200, the same 12 px inset), so the brand starts where the
   title starts and the account ends where the content ends, at every width from 320 to 1920 px. Before, the bar kept
   1440 px with 24 px insets: wider than the content up to 1440 px and 312 px narrower at 1920. */
body.topbar-shell #header .workspace-topbar-in { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; min-height: var(--pm-bar-h); margin: 0 auto; }
/* Phones: 16 px of margin for the bar and for the content of every work area and of the patient's and guardian's portals
   (was 90% of the width plus 12 px, about 32 px at 390 px): the agenda gains 31 px at 390 px. */
@media (max-width: 767.98px) { body:is(.topbar-shell, .patient-shell) .container { width: 100%; max-width: none; padding-inline: 16px; } }
/* One order for the parts of the bar (Front orders the navbar's collapse after its toggler). */
body.topbar-shell #header .workspace-brand { order: 0; }
body.topbar-shell #header .workspace-switcher { order: 1; }
body.topbar-shell #header .workspace-nav { order: 2; }
body.topbar-shell #header .management-quick { order: 3; }
body.topbar-shell #header .workspace-search { order: 4; }
body.topbar-shell #header .workspace-topbar-end { order: 5; }
/* Brand: the glyph on phones, the wordmark from 768 px. */
body.topbar-shell #header .workspace-brand { display: inline-flex; flex: none; align-items: center; min-height: 44px; margin: 0; padding: 0; color: var(--pm-ink); text-decoration: none; }
body.topbar-shell #header .workspace-brand .brand-glyph { width: 32px; height: 32px; margin: 0; vertical-align: 0; }
body.topbar-shell #header .workspace-brand .brand-wordmark { display: none; font-size: 1.375rem; }
@media (min-width: 768px) {
  body.topbar-shell #header .workspace-brand .brand-glyph { display: none; }
  body.topbar-shell #header .workspace-brand .brand-wordmark { display: inline-flex; }
}
/* Area and clinic: a quiet button of two lines (from 768 px), a short menu to change the area or the clinic. */
body.topbar-shell #header .workspace-switcher { display: none; flex: none; min-width: 0; }
body.topbar-shell #header .workspace-switcher-button { display: flex; align-items: center; gap: .5rem; max-width: 15rem; min-height: 44px; padding: 2px 10px 2px 12px; border: 0; border-left: 1px solid var(--pm-border); border-radius: 0 var(--pm-radius-field) var(--pm-radius-field) 0; background: none; color: var(--pm-ink); text-align: left; }
body.topbar-shell #header .workspace-switcher-button:hover, body.topbar-shell #header .workspace-switcher-button[aria-expanded="true"] { background: var(--pm-surface-2); }
body.topbar-shell #header .workspace-switcher-text { display: flex; flex-direction: column; min-width: 0; }
body.topbar-shell #header .workspace-switcher-text b, body.topbar-shell #header .workspace-switcher-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; line-height: 1.25; }
body.topbar-shell #header .workspace-switcher-text b { font-weight: 700; }
body.topbar-shell #header .workspace-switcher-text span { color: var(--pm-ink-2); }
body.topbar-shell #header .workspace-switcher-button > i { flex: none; color: var(--pm-ink-2); font-size: .75rem; }
@media (min-width: 768px) { body.topbar-shell #header .workspace-switcher { display: block; } }
/* Menus of the bar (switcher, "Mais", account): flat panels with the only shadow of the system. */
body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) { min-width: 16rem; margin-top: .375rem; padding: .375rem; border: 1px solid var(--pm-border) !important; border-radius: var(--pm-radius-card); background: var(--pm-raised) !important; box-shadow: var(--pm-shadow-pop) !important; color: var(--pm-ink); }
body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) .dropdown-item { display: flex; align-items: center; gap: .625rem; width: 100%; min-height: 40px; margin: 0; padding: .5rem .75rem; border: 0 !important; border-radius: .5rem; background: transparent !important; color: var(--pm-ink) !important; font-size: .9375rem; font-weight: 500; line-height: 1.3; text-align: left; white-space: normal; box-shadow: none !important; }
body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) .dropdown-item > i { flex: 0 0 1.25rem; width: 1.25rem; margin: 0 !important; color: var(--pm-ink-2); font-size: 1rem; text-align: center; }
body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) .dropdown-item:is(:hover, :focus-visible) { background: var(--pm-surface-2) !important; color: var(--pm-ink) !important; }
body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) .dropdown-item[aria-current="page"] { background: var(--pm-brand-soft) !important; color: var(--pm-brand-ink) !important; font-weight: 650; box-shadow: inset 3px 0 0 var(--pm-brand) !important; }
body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) .dropdown-item[aria-current="page"] > i { color: var(--pm-brand-ink); }
body.topbar-shell #header .workspace-switcher-menu[data-bs-popper] { left: 0; right: auto; }
body.topbar-shell #header .nav-account-panel[data-bs-popper], body.topbar-shell #header .nav-account-panel { left: auto !important; right: 0 !important; }
body.topbar-shell #header .workspace-menu-context { display: flex; flex-direction: column; padding: .375rem .75rem .5rem; margin-bottom: .25rem; border-bottom: 1px solid var(--pm-rule); }
body.topbar-shell #header .workspace-menu-context b { font-size: .9375rem; }
body.topbar-shell #header .workspace-menu-context span { color: var(--pm-ink-2); font-size: .875rem; overflow-wrap: anywhere; }
/* Pages of the area. From 1200 px they sit in the bar; below, they are the menu panel. */
body.topbar-shell #header .workspace-nav .navbar-nav { margin: 0; padding: 0; list-style: none; }
body.topbar-shell #header .workspace-nav .nav-link { position: relative; display: flex; align-items: center; gap: .5rem; margin: 0; border: 0; background: none; color: var(--pm-ink-2) !important; font-size: 1rem; font-weight: 550; line-height: 1.25; text-decoration: none; white-space: nowrap; }
body.topbar-shell #header .workspace-nav .nav-link > i { flex: 0 0 1.25rem; width: 1.25rem; margin: 0 !important; font-size: 1.0625rem; text-align: center; }
body.topbar-shell #header .workspace-nav .nav-link:is(:hover, :focus-visible) { color: var(--pm-ink) !important; background: var(--pm-surface-2) !important; }
body.topbar-shell #header .workspace-nav .nav-link[aria-current="page"], body.topbar-shell #header .workspace-nav .nav-link.is-current { color: var(--pm-ink) !important; font-weight: 680; }
body.topbar-shell #header .workspace-nav .nav-link > .badge { margin-left: .125rem !important; }
body.topbar-shell #header .workspace-nav .dropdown-toggle::after { content: "\F282"; position: static; flex: 0 0 auto; width: auto !important; height: auto !important; margin: 0 0 0 -.25rem; padding: 0 !important; border: 0; background: none !important; color: var(--pm-ink-3); font-family: bootstrap-icons; font-size: .75rem; line-height: 1; vertical-align: 0; transition: transform .15s ease; }
body.topbar-shell #header .workspace-nav .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
body.topbar-shell #header .workspace-more-group { break-inside: avoid; padding: .25rem 0; }
body.topbar-shell #header .workspace-more-group .pm-label { padding: .5rem .75rem .25rem; }
body.topbar-shell #header .workspace-more-group ul { margin: 0; padding: 0; list-style: none; }
@media (min-width: 1200px) {
  body.topbar-shell #header .workspace-nav { display: flex !important; flex: none; align-self: stretch; width: auto; height: auto; margin: 0; padding: 0; border: 0; background: none !important; box-shadow: none; overflow: visible; }
  body.topbar-shell #header .workspace-nav .navbar-nav { display: flex; flex-direction: row; align-items: stretch; height: 100%; padding: 0; }
  body.topbar-shell #header .workspace-nav .nav-item { display: flex; margin: 0 !important; }
  body.topbar-shell #header .workspace-nav .nav-link { height: 100%; padding: 0 .75rem !important; }
  body.topbar-shell #header .workspace-nav .nav-link > i:first-child { display: none; }
  /* The page on screen: a 3 px pen line under it, as in the prototype (not by color alone). */
  body.topbar-shell #header .workspace-nav .nav-link:is([aria-current="page"], .is-current)::before { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--pm-brand); }
  body.topbar-shell #header .workspace-nav-context { display: none !important; }
  /* UX-M1: the bar sits in the content's frame, so "Mais" is further in; its menu opens to the left of the item's end
     (two columns are 34rem, which passed the screen's edge at 1200 px when opened to the right). */
  body.topbar-shell #header .workspace-more-menu { position: absolute !important; top: 100%; left: auto; right: 0; max-height: calc(100dvh - var(--pm-bar-h) - 1rem); overflow-y: auto; }
  body.topbar-shell #header .workspace-more-menu:has(> .workspace-more-group:nth-of-type(3)) { width: 34rem; columns: 2 15rem; column-gap: .5rem; }
  body.topbar-shell #header .navbar-toggler { display: none !important; }
}
@media (min-width: 1200px) and (max-width: 1439.98px) { body.topbar-shell #header .workspace-switcher-button { max-width: 11rem; } body.topbar-shell #header .workspace-nav .nav-link { padding: 0 .5rem !important; } body.topbar-shell #header .workspace-nav .nav-link:is([aria-current="page"], .is-current)::before { left: .5rem; right: .5rem; } }
@media (max-width: 1199.98px) {
  /* The menu panel spans the bar (the header is its containing block) and lines its items up with the frame (UX-M1). */
  body.topbar-shell #header .workspace-nav.navbar-collapse { position: absolute; top: 100%; right: 0; left: 0; z-index: 2; max-height: calc(100dvh - var(--pm-bar-h)); margin: 0; padding: .5rem 16px 1rem; overflow-y: auto; overscroll-behavior: contain; border: 0; border-bottom: 1px solid var(--pm-border); border-radius: 0; background: var(--pm-raised) !important; box-shadow: var(--pm-shadow-pop); }
  body.topbar-shell #header .workspace-nav #navbarNavDropdownNav { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 0 !important; }
  body.topbar-shell #header .workspace-nav #navbarNavDropdownNav > .nav-item { width: 100%; margin: 0 !important; }
  /* Two ids and the html element: above theme-shell.css's tiles of the phone menu, in both themes. */
  html body.topbar-shell #header #navbarNavDropdownNav :is(.nav-link, .dropdown-item) { display: flex; align-items: center; gap: .625rem; width: 100%; min-height: 48px; padding: .625rem .75rem !important; border: 0 !important; border-radius: .625rem; background: transparent !important; color: var(--pm-ink) !important; font-size: 1rem; font-weight: 550; line-height: 1.3; }
  html body.topbar-shell #header #navbarNavDropdownNav :is(.nav-link, .dropdown-item):is(:hover, :focus-visible) { background: var(--pm-surface-2) !important; }
  html body.topbar-shell #header #navbarNavDropdownNav :is(.nav-link, .dropdown-item)[aria-current="page"] { background: var(--pm-brand-soft) !important; color: var(--pm-brand-ink) !important; font-weight: 680; box-shadow: inset 3px 0 0 var(--pm-brand) !important; }
  html body.topbar-shell #header #navbarNavDropdownNav :is(.nav-link, .dropdown-item) > i { flex: 0 0 1.25rem; width: 1.25rem; margin: 0 !important; color: var(--pm-ink-2); font-size: 1.0625rem; text-align: center; }
  html body.topbar-shell #header #navbarNavDropdownNav :is(.nav-link, .dropdown-item)[aria-current="page"] > i { color: var(--pm-brand-ink); }
  /* "Mais" is open in the panel: its groups follow the pages, each one under its label. */
  body.topbar-shell #header .workspace-more > .dropdown-toggle { display: none !important; }
  body.topbar-shell #header .workspace-more > .workspace-more-menu { position: static !important; display: block !important; min-width: 0; margin: 0; padding: 0; border: 0 !important; border-top: 1px solid var(--pm-rule) !important; border-radius: 0; box-shadow: none !important; transform: none !important; }
  body.topbar-shell #header .workspace-nav-context { margin-top: .25rem !important; padding-top: .25rem; border-top: 1px solid var(--pm-rule); }
  body.topbar-shell #header .workspace-nav-context .pm-label { padding: .75rem .75rem .25rem; overflow-wrap: anywhere; }
}
@media (min-width: 576px) and (max-width: 1199.98px) { body.topbar-shell #header .workspace-more > .workspace-more-menu { columns: 2 14rem; column-gap: 1rem; } }
@media (min-width: 768px) and (max-width: 991.98px) { body.topbar-shell #header .workspace-nav.navbar-collapse { padding-inline: calc((100% - 720px) / 2 + 12px); } }
@media (min-width: 992px) and (max-width: 1199.98px) { body.topbar-shell #header .workspace-nav.navbar-collapse { padding-inline: calc((100% - 960px) / 2 + 12px); } }
/* Search (Ctrl+K): a field-like button that opens the search of pages and patients (command-palette.js). */
body.topbar-shell #header .workspace-search { position: relative; display: flex; flex: 1 1 8rem; align-items: center; gap: .5rem; min-width: 44px; max-width: 22rem; min-height: 40px; margin-left: auto; padding: 0 .75rem; border: 1px solid var(--pm-field); border-radius: var(--pm-radius-pill); background: var(--pm-surface-2); color: var(--pm-ink-3); font-size: 1rem; line-height: 1.2; text-align: left; cursor: text; }
body.topbar-shell #header .workspace-search:hover { border-color: var(--pm-ink-3); color: var(--pm-ink-2); }
body.topbar-shell #header .workspace-search > i { flex: none; color: var(--pm-ink-2); font-size: 1.0625rem; }
body.topbar-shell #header .workspace-search-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.topbar-shell #header .workspace-search-more { display: none; }
@media (min-width: 576px) { body.topbar-shell #header .workspace-search-more { display: inline; } }
/* UX-M1: below 1440 px the search is a magnifier button like the other icons of the bar (Ctrl K opens the same panel): it
   gives the room the bar needs inside the content's frame at 1200 px (1,056 px, 96 less than before); the field comes
   back from 1440 px. */
@media (max-width: 1439.98px) {
  body.topbar-shell #header .workspace-search { flex: 0 0 44px; justify-content: center; width: 44px; min-height: 44px; padding: 0; border-color: transparent; background: transparent; color: var(--pm-ink); cursor: pointer; }
  body.topbar-shell #header .workspace-search:hover { border-color: transparent; background: var(--pm-surface-2); color: var(--pm-ink); }
  body.topbar-shell #header .workspace-search > i { color: var(--pm-ink); font-size: 1.25rem; }
  body.topbar-shell #header .workspace-search-label, body.topbar-shell #header .workspace-search kbd { display: none !important; }
}
body.topbar-shell #header .workspace-search kbd { display: none; flex: none; padding: 2px 6px; border: 1px solid var(--pm-border-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--pm-surface); color: var(--pm-ink-2); font: 500 .75rem/1 var(--pm-font-mono); }
body:has(#work-tools-config[data-shortcuts="0"]) .workspace-search kbd { display: none !important; }
@media (min-width: 1440px) { body.topbar-shell #header .workspace-search { flex: 0 1 18rem; } body.topbar-shell #header .workspace-search kbd { display: inline-flex; } }
/* The end of the bar: icon buttons of 44 px and the account (initials). */
body.topbar-shell #header .workspace-topbar-end { display: flex; flex: none; align-items: center; gap: .125rem; }
body.topbar-shell #header .workspace-icon-button, body.topbar-shell #header .navbar-toggler, body.topbar-shell #header .management-icon-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0 !important; border-radius: var(--pm-radius-pill); background: transparent !important; color: var(--pm-ink) !important; font-size: 1.25rem; box-shadow: none !important; }
body.topbar-shell #header :is(.workspace-icon-button, .navbar-toggler, .management-icon-button):hover { background: var(--pm-surface-2) !important; }
body.topbar-shell #header .workspace-icon-button[aria-current="page"] { background: var(--pm-brand-soft) !important; color: var(--pm-brand-ink) !important; }
body.topbar-shell #header .workspace-icon-button > .badge { position: absolute; top: 4px; right: 2px; min-width: 1.125rem; padding: .125rem .3rem; font-size: .6875rem; }
body.topbar-shell #header .workspace-help { display: none; }
@media (min-width: 576px) { body.topbar-shell #header .workspace-help { display: inline-flex; } }
body.topbar-shell #header .navbar-toggler .navbar-toggler-default, body.topbar-shell #header .navbar-toggler .navbar-toggler-toggled { color: var(--pm-ink) !important; }
body.topbar-shell #header .nav-account { position: relative; flex: none; }
body.topbar-shell #header .nav-account-trigger { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; }
body.topbar-shell #header .nav-account-trigger .nav-account-avatar { flex: none; width: 36px; height: 36px; transition: background-color .15s ease, box-shadow .15s ease; }
body.topbar-shell #header .nav-account-trigger:is(:hover, [aria-expanded="true"]) .nav-account-avatar { background: var(--pm-brand-soft-2); }
body.topbar-shell #header .nav-account:has([aria-current="page"]) .nav-account-trigger .nav-account-avatar { box-shadow: 0 0 0 2px var(--pm-surface), 0 0 0 4px var(--pm-brand); }
body.topbar-shell #header .nav-account-panel { width: min(19rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - var(--pm-bar-h) - 1rem); overflow-y: auto; }
body.topbar-shell #header .nav-account-list { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 1px; width: 100%; margin: 0; padding: 0; list-style: none; border: 0; }
body.topbar-shell #header .nav-account-list > li { margin: 0; }
body.topbar-shell #header .nav-account-list .nav-account-person { padding: .375rem .75rem .625rem; border-bottom: 1px solid var(--pm-rule); margin-bottom: .25rem; }
body.topbar-shell #header .nav-account-list .nav-account-text strong { font-size: .9375rem; white-space: normal; overflow-wrap: anywhere; }
body.topbar-shell #header .nav-account-list .nav-account-text small { color: var(--pm-ink-2); font-size: .8125rem; overflow-wrap: anywhere; }
body.topbar-shell #header .nav-account-list .nav-account-group { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--pm-rule); }
body.topbar-shell #header .nav-account-list .nav-account-prefs { display: flex; flex-direction: column; gap: 1px; }
body.topbar-shell #header .nav-account-list .nav-action-label { display: block; flex: 1 1 auto; min-width: 0; }
body.topbar-shell #header .nav-account-list .nav-action-switch { position: relative; display: block; flex: 0 0 1.75rem; width: 1.75rem; height: 1rem; margin-left: auto; border-radius: 999px; background: var(--pm-border-strong); transition: background-color .15s ease; }
body.topbar-shell #header .nav-account-list .nav-action-switch::after { content: ""; position: absolute; top: .125rem; left: .125rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--pm-surface); transition: transform .15s cubic-bezier(.2, 0, 0, 1); }
body.topbar-shell #header .nav-account-list [aria-pressed="true"] > .nav-action-switch { background: var(--pm-brand); }
body.topbar-shell #header .nav-account-list [aria-pressed="true"] > .nav-action-switch::after { transform: translateX(.75rem); }
body.topbar-shell #header .nav-account-list .nav-account-logout form { display: flex !important; width: 100%; margin: 0; }
body.topbar-shell #header .nav-account-list .nav-account-signout, body.topbar-shell #header .nav-account-list .nav-account-signout > i { color: var(--pm-danger) !important; }
body.topbar-shell #header .nav-account-list .nav-account-signout:is(:hover, :focus-visible) { background: var(--pm-danger-bg) !important; }
@media (pointer: coarse) { body.topbar-shell #header :is(.workspace-switcher-menu, .workspace-more-menu, .nav-account-panel) .dropdown-item { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { body.topbar-shell #header .workspace-nav .dropdown-toggle::after, body.topbar-shell #header .nav-account-trigger .nav-account-avatar { transition: none; } }
/* The clinic strip under the bar is gone (UX-C): the strip keeps only the warning of a change in another tab. */
body.topbar-shell .professional-scope:not(:has(> :not([hidden]))) { display: none; }
/* Work pages start close to the bar: the frame before the title went from about 260 px to the bar's 56. */
body.topbar-shell #content > section.container[class*="content-space"], body.topbar-shell #content > section > .container[class*="content-space"] { padding-top: 1.5rem !important; }
/* Phone bottom bar: it steps aside (topbar.js) while it would cover a main action or while a field is typed in. */
@media (max-width: 991.98px) {
  body.topbar-shell .mobile-glass-nav { transition: transform .2s ease, visibility 0s linear 0s; }
  body.topbar-shell.bottom-nav-yield .mobile-glass-nav { visibility: hidden; transform: translateY(calc(100% + 1rem)); transition: transform .2s ease, visibility 0s linear .2s; }
}
@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) { body.topbar-shell .mobile-glass-nav, body.topbar-shell.bottom-nav-yield .mobile-glass-nav { transition: none; } }
