/*
 * Authenticated shell (UX-SHELL-1): sidebar + compact topbar around the existing pages. Builds on the app.css tokens
 * and on Bootstrap's offcanvas-lg (a drawer below 992px, a fixed column from 992px). Pages keep their own markup; the
 * shell only offsets them (.cq-sidebar ~ ...). Pages without the shell (login, error pages) are untouched.
 */

:root {
    --cq-sidebar-width: 15.5rem;
    --cq-sidebar-bg: #0e1f45;
    --cq-topbar-height: 3.5rem;
    --cq-canvas: #f5f7fb;
    --cq-line: #e3e8ef;
}

/* ---------- Sidebar ---------- */

.cq-sidebar {
    --bs-offcanvas-width: 17rem;
    --bs-offcanvas-border-width: 0;
}

.cq-sidebar__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 1.125rem .75rem 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--cq-sidebar-bg);
    color: rgba(255, 255, 255, .78);
}

.cq-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
    padding: 0 .5rem;
    margin-bottom: .75rem;
}

.cq-sidebar__brand {
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
}

.cq-sidebar__brand:hover {
    color: #fff;
}

.cq-sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: -.375rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .8);
}

.cq-sidebar__close:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.cq-sidebar__close svg,
.cq-topbar__menu svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.cq-nav {
    flex: 1 0 auto;
    margin: 0 -.125rem;
}

/* NAV-2 (doc 96): Início and Relatórios are lists without a heading; the domains are groups. */
.cq-nav__list {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cq-nav__list--reports {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.cq-nav__group {
    margin-top: .5rem;
}

.cq-nav__group[data-nav-group="administration"],
.cq-nav__list--reports + .cq-nav__group--flat {
    margin-top: .75rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.cq-nav__heading {
    margin: 0;
    font-size: .6875rem;
    font-weight: 650;
    letter-spacing: .09em;
    line-height: 1.2;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

/* Wave 2B (navigation-collapsible-groups.md): the group title is a button the person uses to collapse or open the
   group. The chevron points down when open (▾) and right when collapsed (▸); the group of the current page cannot be
   closed (aria-disabled), so its active item is never hidden. Without JavaScript the button submits the sidebar form. */
.cq-nav__title {
    margin: .625rem 0 .125rem;
}

.cq-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    min-height: 2.25rem;
    padding: .375rem .625rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease;
}

.cq-nav__toggle:hover {
    background: rgba(255, 255, 255, .05);
}

.cq-nav__toggle:hover .cq-nav__heading,
.cq-nav__group.has-active .cq-nav__heading {
    color: rgba(255, 255, 255, .86);
}

.cq-nav__chevron {
    flex: none;
    width: .875rem;
    height: .875rem;
    background: rgba(255, 255, 255, .55);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .18s cubic-bezier(.2, .7, .2, 1);
}

.cq-nav__toggle[aria-expanded="false"] .cq-nav__chevron {
    transform: rotate(-90deg);
}

.cq-nav__toggle:hover .cq-nav__chevron {
    background: rgba(255, 255, 255, .85);
}

/* The group of the current page: open, its title does not close it. */
.cq-nav__toggle[aria-disabled="true"] {
    cursor: default;
}

.cq-nav__toggle[aria-disabled="true"]:hover {
    background: transparent;
}

.cq-nav__toggle[aria-disabled="true"] .cq-nav__chevron,
.cq-nav__toggle[aria-disabled="true"]:hover .cq-nav__chevron {
    background: rgba(255, 255, 255, .3);
}

.cq-nav__panel[hidden] {
    display: none;
}

/* N1: one group inside a section (Administração → Integrações); a label, never a collapsible submenu. */
.cq-nav__subheading {
    margin: .75rem .625rem .25rem;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(255, 255, 255, .62);
}

/* Item: icon (CSS mask from data-icon, so the label stays text), label and the domain hint under it. */
.cq-nav__link {
    position: relative;
    display: grid;
    grid-template-columns: 1.125rem minmax(0, 1fr);
    column-gap: .75rem;
    align-items: center;
    min-height: 2.5rem;
    padding: .4375rem .625rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, .8);
    font-size: .9063rem;
    line-height: 1.3;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background-color .15s ease, color .15s ease;
}

.cq-nav__link::before {
    content: "";
    grid-row: 1 / span 2;
    width: 1.125rem;
    height: 1.125rem;
    background: rgba(255, 255, 255, .5);
    -webkit-mask: var(--cq-nav-icon) center / contain no-repeat;
    mask: var(--cq-nav-icon) center / contain no-repeat;
    transition: background-color .15s ease;
}

.cq-nav__item:not([data-icon]) > .cq-nav__link::before {
    visibility: hidden;
}

/* The current page: a bar on the edge, besides the tint (colour alone does not carry the state: aria-current does). */
.cq-nav__link::after {
    content: "";
    position: absolute;
    top: .5rem;
    bottom: .5rem;
    left: -.125rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #8fb4e8;
    transform: scaleY(0);
    transition: transform .18s cubic-bezier(.2, .7, .2, 1);
}

.cq-nav__link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.cq-nav__link:hover::before {
    background: rgba(255, 255, 255, .85);
}

.cq-nav__link.is-active {
    background: rgba(143, 180, 232, .14);
    color: #fff;
    font-weight: 600;
}

.cq-nav__link.is-active::before {
    background: #8fb4e8;
}

.cq-nav__link[aria-current="page"]::after {
    transform: scaleY(1);
}

/* N1: the domain name users search for (Levey-Jennings, Westgard), on its own line under the item label. */
.cq-nav__hint {
    grid-column: 2;
    display: block;
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.3;
    color: rgba(255, 255, 255, .6);
}

.cq-nav__link:hover .cq-nav__hint,
.cq-nav__link.is-active .cq-nav__hint {
    color: rgba(255, 255, 255, .78);
}

.cq-nav__link:focus-visible,
.cq-nav__toggle:focus-visible,
.cq-sidebar__brand:focus-visible,
.cq-sidebar__close:focus-visible {
    outline: 3px solid var(--cq-focus);
    outline-offset: -1px;
}

@media (prefers-reduced-motion: reduce) {
    .cq-nav__link,
    .cq-nav__link::after,
    .cq-nav__toggle,
    .cq-nav__chevron {
        transition: none;
        animation: none;
    }
}

.cq-nav__item[data-icon="home"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-6.5 8 6.5M6.5 9.5V19h11V9.5'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="equipment"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 7.5h9v9h-9zM10 3.5v4M14 3.5v4M10 16.5v4M14 16.5v4M3.5 10h4M3.5 14h4M16.5 10h4M16.5 14h4'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="metrology"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15a8 8 0 0 1 16 0M12 15l4-5M6.5 15h-1M18.5 15h1M12 8V7M3 19h18'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="lots"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="samples"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v4H4zM5.5 9v10h13V9M10 13h4'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="record"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="occurrences"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 15.5H3zM12 10v4M12 16.8v.2'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="nonconformities"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4a8 8 0 100 16 8 8 0 100-16zM12 8a4 4 0 100 8 4 4 0 100-8zM12 12h.01'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="audits"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4.5h6M8 6H5.5v14h13V6H16M8.5 13l2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="documents"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3.5h7l4 4v13H7zM14 3.5v4h4M9.5 12.5h6M9.5 16h6'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="indicators"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 18l5-5.5 3.5 3L20 7.5M15 7.5h5v5'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="routine_qc"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 4.5h6v6h-6zM13.5 4.5h6v6h-6zM4.5 13.5h6v6h-6zM13.5 13.5h6v6h-6z'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="triage"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13.5l2.5-8h11l2.5 8v6H4zM4 13.5h5l1 2.5h4l1-2.5h5'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="levey_jennings"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h3l2-5 3 10 3-8 2 3h5M3 4v16'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="test_systems"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l8.5 4.5L12 13 3.5 8.5zM3.5 12.5L12 17l8.5-4.5M3.5 16.5L12 21l8.5-4.5'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="targets"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5v3M12 17.5v3M3.5 12h3M17.5 12h3M12 7a5 5 0 100 10 5 5 0 100-10zM12 11.2a.8.8 0 100 1.6.8.8 0 100-1.6z'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="strategies"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4v16M12 4v16M19 4v16M3 15h4M10 8h4M17 13h4'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="reports"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 20h15M7.5 17v-6M12 17V5.5M16.5 17V9'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="settings"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9.2a2.8 2.8 0 100 5.6 2.8 2.8 0 000-5.6zM12 3v2.2M12 18.8V21M3 12h2.2M18.8 12H21M5.6 5.6l1.6 1.6M16.8 16.8l1.6 1.6M5.6 18.4l1.6-1.6M16.8 7.2l1.6-1.6'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="thermometer"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14.2V5a2 2 0 114 0v9.2a3.6 3.6 0 11-4 0zM12 9v6.5'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="tasks"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11M4 6.5l1 1 1.8-2M4 12l1 1 1.8-2M4 17.5l1 1 1.8-2'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="catalog"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4.5h11.5a2 2 0 012 2V20H7a2 2 0 01-2-2zM5 18a2 2 0 012-2h11.5M9 8.5h6'/%3E%3C/svg%3E"); }
.cq-nav__item[data-icon="connectors"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4v4M15 4v4M7 8h10v3a5 5 0 01-10 0zM12 16v4'/%3E%3C/svg%3E"); }

.cq-sidebar__by {
    margin: 1.5rem .625rem 0;
    font-size: .75rem;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .42);
}

.cq-sidebar__by span {
    font-weight: 600;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .7);
}

/* ---------- Topbar ---------- */

.cq-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: var(--cq-topbar-height);
    padding: .5rem clamp(1rem, 2.5vw, 2rem);
    border-bottom: 1px solid var(--cq-line);
    background: #fff;
}

.cq-topbar__menu {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--cq-line);
    border-radius: 8px;
    background: #fff;
    color: var(--cq-text);
}

.cq-topbar__menu:hover {
    background: var(--cq-surface-alt);
}

.cq-topbar__brand {
    color: var(--cq-brand);
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
    white-space: nowrap;
}

.cq-topbar__end {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    margin-left: auto;
}

.cq-topbar__place {
    min-width: 0;
    max-width: 18rem;
    margin: 0;
    padding: .25rem .625rem;
    overflow: hidden;
    border: 1px solid var(--cq-line);
    border-radius: 999px;
    color: var(--cq-text);
    font-size: .8125rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cq-topbar__place-label {
    margin-right: .25rem;
    color: var(--cq-muted);
}

.cq-topbar__user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: .25rem .5rem .25rem .25rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cq-text);
    font-size: .875rem;
}

.cq-topbar__user:hover {
    background: var(--cq-surface-alt);
}

.cq-topbar__avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e7eef9;
    color: var(--cq-brand);
    font-size: .8125rem;
    font-weight: 700;
}

.cq-topbar__username {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cq-topbar__menu:focus-visible,
.cq-topbar__brand:focus-visible,
.cq-topbar__user:focus-visible {
    outline: 3px solid var(--cq-focus);
    outline-offset: 2px;
}

/* ---------- Content area ---------- */

.cq-sidebar ~ .cq-messages {
    padding: 1rem clamp(1rem, 2.5vw, 2rem) 0;
    background: var(--cq-canvas);
}

.cq-sidebar ~ .cq-main {
    min-height: calc(100vh - var(--cq-topbar-height));
    padding: clamp(1rem, 2.5vw, 2rem);
    background: var(--cq-canvas);
}

@media (max-width: 575.98px) {
    .cq-topbar {
        gap: .5rem;
    }

    .cq-topbar__place {
        max-width: 8.5rem;
    }

    .cq-topbar__place-label,
    .cq-topbar__username {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .cq-topbar__user {
        padding-right: .25rem;
    }
}

/* Very narrow phones: the product name gives way to the place and the account. */
@media (max-width: 359.98px) {
    .cq-topbar__brand {
        display: none;
    }
}

@media (min-width: 992px) {
    .cq-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1030;
        width: var(--cq-sidebar-width);
    }

    .cq-sidebar__close,
    .cq-topbar__menu,
    .cq-topbar__brand {
        display: none;
    }

    .cq-sidebar ~ .cq-topbar,
    .cq-sidebar ~ .cq-messages,
    .cq-sidebar ~ .cq-main {
        margin-left: var(--cq-sidebar-width);
    }
}

/* ---------- Wave 2C (PRD-072): the desktop sidebar as a rail of icons ----------
   Only from 992px (the drawer below ignores .is-rail and keeps the full menu). The person reduces it by hand; every
   item stays reachable: the top-level entries are icons with a tooltip (hover and focus, Esc closes), each group is one
   icon button that opens a flyout with its items (shell.js). The labels are kept in the DOM (font-size 0 / clipped), so
   the accessible names do not change. The active entry has a bar on the edge besides the tint. */

:root {
    --cq-rail-width: 4.5rem;
}

.cq-sidebar__rail-toggle {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: -.375rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .8);
}

.cq-sidebar__rail-toggle:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.cq-sidebar__rail-toggle:focus-visible {
    outline: 3px solid var(--cq-focus);
    outline-offset: -1px;
}

.cq-sidebar__rail-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Icons of the groups (the rail shows one icon per group; the items keep their own). */
.cq-nav__group[data-nav-group="operations"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11M4 6.5l1 1 1.8-2M4 12l1 1 1.8-2M4 17.5l1 1 1.8-2'/%3E%3C/svg%3E"); }
.cq-nav__group[data-nav-group="quality"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4.5h6M8 6H5.5v14h13V6H16M8.5 13l2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.cq-nav__group[data-nav-group="analytical"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h3l2-5 3 10 3-8 2 3h5M3 4v16'/%3E%3C/svg%3E"); }
.cq-nav__group[data-nav-group="administration"] { --cq-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9.2a2.8 2.8 0 100 5.6 2.8 2.8 0 000-5.6zM12 3v2.2M12 18.8V21M3 12h2.2M18.8 12H21M5.6 5.6l1.6 1.6M16.8 16.8l1.6 1.6M5.6 18.4l1.6-1.6M16.8 7.2l1.6-1.6'/%3E%3C/svg%3E"); }

.cq-nav-tooltip {
    position: fixed;
    z-index: 1070;
    max-width: 16rem;
    padding: .3125rem .625rem;
    border-radius: 6px;
    background: #0a1630;
    color: #fff;
    font-size: .8125rem;
    line-height: 1.3;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    pointer-events: none;
}

.cq-nav-tooltip[hidden] {
    display: none;
}

@media (min-width: 992px) {
    .cq-sidebar__rail-toggle {
        display: inline-flex;
    }

    .cq-sidebar.is-rail {
        width: var(--cq-rail-width);
    }

    .cq-sidebar.is-rail ~ .cq-topbar,
    .cq-sidebar.is-rail ~ .cq-messages,
    .cq-sidebar.is-rail ~ .cq-main {
        margin-left: var(--cq-rail-width);
    }

    .is-rail .cq-sidebar__panel {
        padding-right: .5rem;
        padding-left: .5rem;
    }

    .is-rail .cq-sidebar__head {
        justify-content: center;
        padding: 0;
    }

    .is-rail .cq-sidebar__brand,
    .is-rail .cq-sidebar__by {
        display: none;
    }

    .is-rail .cq-sidebar__rail-toggle {
        margin-right: 0;
    }

    .is-rail .cq-sidebar__rail-toggle svg {
        transform: scaleX(-1);
    }

    .is-rail .cq-nav {
        margin: 0;
    }

    /* top-level entries (Início, Relatórios) and group buttons: an icon, centred */
    .is-rail .cq-nav > .cq-nav__list .cq-nav__link,
    .is-rail .cq-nav__toggle {
        position: relative;
        grid-template-columns: 1.25rem;
        justify-content: center;
        min-height: 2.75rem;
        padding: .5rem 0;
        font-size: 0;
        line-height: 0;
    }

    .is-rail .cq-nav > .cq-nav__list .cq-nav__link::before,
    .is-rail .cq-nav__toggle::before {
        content: "";
        flex: none;
        width: 1.25rem;
        height: 1.25rem;
        background: rgba(255, 255, 255, .6);
        -webkit-mask: var(--cq-nav-icon) center / contain no-repeat;
        mask: var(--cq-nav-icon) center / contain no-repeat;
    }

    .is-rail .cq-nav__toggle:hover::before,
    .is-rail .cq-nav__toggle:focus-visible::before,
    .is-rail .cq-nav__group.is-flyout .cq-nav__toggle::before {
        background: #fff;
    }

    .is-rail .cq-nav__group.has-active .cq-nav__toggle::before {
        background: #8fb4e8;
    }

    /* the group heading stays for assistive technology, off the screen; the arrow is replaced by the icon */
    .is-rail .cq-nav__heading {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .is-rail .cq-nav__chevron,
    .is-rail .cq-nav > .cq-nav__list .cq-nav__hint {
        display: none;
    }

    .is-rail .cq-nav__title {
        margin: .25rem 0 0;
    }

    .is-rail .cq-nav__group {
        margin-top: .25rem;
    }

    /* the current entry carries a bar on the edge as well as the tint, also when it is a sub-page */
    .is-rail .cq-nav__link.is-active::after,
    .is-rail .cq-nav__group.has-active .cq-nav__toggle::after {
        transform: scaleY(1);
    }

    .is-rail .cq-nav__group.has-active .cq-nav__toggle {
        background: rgba(143, 180, 232, .14);
    }

    .is-rail .cq-nav__group.has-active .cq-nav__toggle::after {
        content: "";
        position: absolute;
        top: .5rem;
        bottom: .5rem;
        left: -.125rem;
        width: 3px;
        border-radius: 0 3px 3px 0;
        background: #8fb4e8;
    }

    /* the group's items: hidden in the rail until the flyout opens */
    .is-rail .cq-nav__panel {
        display: none;
    }

    .is-rail .cq-nav__group.is-flyout > .cq-nav__panel {
        display: block;
        position: fixed;
        top: var(--cq-flyout-top, 0);
        left: calc(var(--cq-rail-width) + .25rem);
        z-index: 1060;
        width: 16rem;
        max-height: calc(100vh - var(--cq-flyout-top, 0px) - 1rem);
        padding: .5rem;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 10px;
        background: var(--cq-sidebar-bg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cq-sidebar__rail-toggle svg {
        transition: none;
    }
}

@media print {
    .cq-sidebar,
    .cq-topbar {
        display: none !important;
    }

    .cq-sidebar ~ .cq-main,
    .cq-sidebar ~ .cq-messages,
    .cq-sidebar ~ .cq-topbar {
        margin-left: 0;
        background: #fff;
    }
}
