:root {
    --navy: #051622;
    --sage: #7a9085;
    --cream: #f4d396;
    --red: #c00f0f;
    --maroon: #800000;
    --orange: #c45c32;

    --ink: #051622;
    --muted: #5c6f68;
    --paper: #f7f3ea;
    --card: #fffcf6;
    --line: #d7dfda;
    --primary: #7a9085;
    --primary-dark: #051622;
    --primary-soft: #f8edd4;
    --yellow: #f4d396;
    --green: #7a9085;
    --shadow: 0 8px 24px rgba(5, 22, 34, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Open Sans", "Segoe UI", sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.55;
    font-weight: 400;
}

a { color: var(--maroon); }
code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--primary-soft);
    color: var(--navy);
    border-radius: 6px;
}
code { padding: 0.1rem 0.35rem; }
pre { padding: 0.9rem 1rem; overflow: auto; }

.wrap { width: min(100%, calc(100% - 24px)); max-width: 1480px; margin: 0 auto; }
.topbar {
    background: var(--navy);
    color: #f7f3ea;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(5, 22, 34, .28);
}
.topbar__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    justify-self: start;
}
.brand strong {
    display: block;
    font-family: Poppins, "Open Sans", sans-serif;
    font-size: 1.28rem;
    font-weight: 600;
    letter-spacing: .01em;
}
.brand small { display: block; opacity: .85; font-size: .76rem; font-weight: 400; color: var(--cream); }
.brand__icon {
    display: block;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: cover;
    object-position: 8% 50%;
    background: #fff;
    border-radius: 8px;
}
.brand__lights { display: grid; gap: 5px; }
.topbar__user {
    margin: 0;
    justify-self: center;
    text-align: center;
    color: var(--cream);
    font-family: Poppins, "Open Sans", sans-serif;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    max-width: min(48vw, 420px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar__user--empty { visibility: hidden; }
.topbar__actions {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--red { background: var(--red); }
.dot--orange { background: var(--orange); }
.dot--yellow { background: var(--cream); }
.dot--green { background: var(--sage); }

.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
    color: #f7f3ea;
    text-decoration: none;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    border: 1px solid transparent;
}
.nav a.is-active, .nav a:hover { background: rgba(244, 211, 150, .18); color: var(--cream); }

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(244, 211, 150, .35);
    color: var(--cream);
    padding: 7px 14px;
    border-radius: 8px;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
}
.sidebar-toggle:hover { background: rgba(244, 211, 150, .18); }

body.is-auth { display: flex; flex-direction: column; min-height: 100vh; }
body.is-auth .topbar { flex-shrink: 0; }
body.is-auth .app-body .wrap { width: min(100% - 24px, 1600px); max-width: 1600px; }
.app-shell { display: flex; flex: 1; min-height: 0; align-items: stretch; position: relative; }
.sidebar-slot {
    width: 72px;
    flex-shrink: 0;
    position: relative;
}
body.sidebar-pinned .sidebar-slot { width: 268px; }
.sidebar {
    width: 72px;
    height: 100%;
    background: var(--navy);
    color: #f7f3ea;
    padding: 10px 8px 20px;
    box-shadow: 4px 0 16px rgba(5, 22, 34, .18);
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 21;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width .18s ease;
}
.sidebar:hover,
.sidebar.is-pinned {
    width: 268px;
}
.sidebar-pin {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    background: transparent;
    border: 1px solid rgba(244, 211, 150, .28);
    color: var(--cream);
    padding: 9px 10px;
    border-radius: 8px;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    text-align: left;
}
.sidebar-pin:hover,
.sidebar-pin[aria-pressed="true"] { background: rgba(244, 211, 150, .18); }
.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.nav-label { white-space: nowrap; }
.nav--side a,
.nav--side button,
.nav--side summary,
.sidebar-pin {
    overflow: hidden;
}
.nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 4px;
    padding: 6px 10px 2px;
    color: var(--cream);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    opacity: .85;
}
.nav--side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.nav--side a,
.nav--side .nav-logout,
.nav--side .nav-sub,
.nav--side .nav-group { width: 100%; }
.nav--side a,
.nav--side summary,
.nav--side button {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 9px 10px;
}
.nav--side .nav-logout { display: block; }
.nav--side .nav-logout button { width: 100%; }
.nav--side .nav-sub__menu {
    position: static;
    right: auto;
    top: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    min-width: 0;
    padding: 4px 0 4px 10px;
    margin-top: 2px;
}
.nav--side .nav-sub__menu a { font-size: .72rem; }
.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-body .page { flex: 1; }
.sidebar-backdrop {
    display: none;
}

@media (min-width: 901px) {
    .sidebar:not(:hover):not(.is-pinned) .nav-label {
        display: none;
    }
    .sidebar:not(:hover):not(.is-pinned) .nav-sub__menu {
        display: none;
    }
    .sidebar:not(:hover):not(.is-pinned) .nav--side a,
    .sidebar:not(:hover):not(.is-pinned) .nav--side button,
    .sidebar:not(:hover):not(.is-pinned) .nav--side summary,
    .sidebar:not(:hover):not(.is-pinned) .sidebar-pin {
        justify-content: center;
        gap: 0;
        padding-left: 8px;
        padding-right: 8px;
    }
}

.page { padding: 28px 0 64px; }
.hero h1, .panel h2, .prose h2, .card-head h2 {
    font-family: Poppins, "Open Sans", sans-serif;
    font-weight: 600;
    margin: 0 0 .45rem;
    letter-spacing: 0;
    color: var(--navy);
}
.card-head p { margin: 0 0 4px; }
.hero h1 { font-size: clamp(1.55rem, 2.4vw, 2.05rem); max-width: 28ch; }
.kicker {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .7rem;
    color: var(--sage);
    font-weight: 600;
    margin: 0 0 8px;
}
.lede { font-size: 1rem; color: var(--muted); max-width: 72ch; }
.meta { color: var(--muted); font-size: .9rem; }
.hero--compact h1 { max-width: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0; }
.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--sage);
}
.kpi strong {
    display: block;
    font-size: 2rem;
    font-family: Poppins, "Open Sans", sans-serif;
    font-weight: 600;
    color: var(--navy);
}
.kpi small, .kpi__label { color: var(--muted); font-size: .82rem; }
.kpi__label { display: block; font-weight: 600; margin-bottom: 4px; }
.kpi--vermelho { border-left-color: var(--red); }
.kpi--laranja { border-left-color: var(--orange); }
.kpi--amarelo { border-left-color: var(--cream); }

.panel, .filters, .empty-card, .prose {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.panel__head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: #fff; color: var(--navy);
    border-radius: 8px; padding: 9px 16px; text-decoration: none; cursor: pointer;
    font-weight: 600; font-family: inherit;
}
.btn--primary { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.btn--primary:hover { background: var(--red); }
.btn--danger { color: var(--maroon); border-color: #e8b4b4; background: #fff8f8; }
.btn--danger:hover { background: #f8e4e4; }

.criticos { list-style: none; margin: 0; padding: 0; }
.criticos li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.criticos a { text-decoration: none; color: inherit; }
.criticos__nome { display: block; font-weight: 600; color: var(--navy); }
.criticos__meta { color: var(--muted); font-size: .88rem; }

.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.filters--auditoria { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.filters label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters input, .filters select {
    border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
    font: inherit; background: #fff; color: var(--ink);
}
.filters input:focus, .filters select:focus {
    outline: 2px solid var(--primary-soft);
    border-color: var(--sage);
}
.filters__actions { display: flex; gap: 8px; align-items: end; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 8px 0 16px; color: var(--muted); font-size: .9rem; }
.legend .dot { margin-right: 6px; vertical-align: middle; }
.legend__count { margin-left: auto; font-weight: 600; color: var(--ink); }
.farol-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 16px; }
.legend--filters { margin: 0; flex: 1; gap: 8px; }
.legend__filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 600;
}
.legend__filter .dot { margin-right: 0; }
.legend__filter em {
    font-style: normal;
    background: var(--paper);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: .78rem;
    color: var(--muted);
}
.legend__filter:hover { border-color: var(--navy); }
.legend__filter.is-active { box-shadow: 0 0 0 2px var(--navy); }
.legend__filter--vermelho.is-active { background: #f8e4e4; border-color: var(--red); }
.legend__filter--laranja.is-active { background: #f6e4d8; border-color: var(--orange); }
.legend__filter--amarelo.is-active { background: #fbf1d8; border-color: var(--cream); }
.legend__filter--normal.is-active { background: #e4ebe8; border-color: var(--sage); }
.farol-toolbar__print { display: grid; gap: 4px; justify-items: end; }
.farol-toolbar__print small { color: var(--muted); font-size: .75rem; }
.btn--print { min-width: 12.5rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.print-only { display: none; }
.report-print { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--navy); }
.report-print h1 { margin: 0 0 4px; font-size: 1.35rem; }
.report-print__kicker { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; font-weight: 600; color: var(--sage); }
.report-print__meta { margin: 0; color: var(--muted); font-size: .82rem; }
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: var(--muted);
    font-size: .9rem;
}
.pager__pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pager__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}
.pager__btn.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager__btn.is-disabled { opacity: .45; cursor: default; }
.pager__size a { font-weight: 600; }
.pager__size a.is-active { color: var(--navy); text-decoration: none; }
.chip { background: var(--primary-soft); color: var(--navy); border-radius: 999px; padding: 6px 10px; font-size: .82rem; text-decoration: none; }

@media print {
    .print-hide,
    .topbar,
    .sidebar,
    .sidebar-slot,
    .sidebar-backdrop,
    .sidebar-toggle,
    .footer { display: none !important; }
    .pager { display: none !important; }
    .print-only { display: block !important; }
    .wrap { width: 100%; margin: 0; max-width: none; }
    .app-shell, .app-body { display: block; }
    .report-print { border-bottom: 2px solid #051622; }
    .report-print h1 { font-size: 16pt; color: #051622; }
    .table-wrap {
        box-shadow: none;
        border: 1px solid #ccc;
        overflow: visible;
    }
    .badge, .row--vermelho, .row--laranja, .row--amarelo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .row--vermelho { background: #f8e4e4 !important; }
    .row--laranja { background: #f6e4d8 !important; }
    .row--amarelo { background: #fbf1d8 !important; }
}

.table-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.grid { width: 100%; border-collapse: collapse; min-width: 920px; }
.grid--auditoria { min-width: 1080px; }
.grid th {
    text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--navy); padding: 13px 12px; border-bottom: 1px solid var(--line);
    background: var(--primary-soft); position: sticky; top: 0; font-weight: 600;
}
.grid td { padding: 12px; border-bottom: 1px solid #ebe6dc; vertical-align: top; font-size: .92rem; }
.row--vermelho { background: #f8e4e4; }
.row--laranja { background: #f6e4d8; }
.row--amarelo { background: #fbf1d8; }
.name-btn {
    background: none; border: 0; padding: 0; color: var(--maroon);
    font: inherit; font-weight: 600;
    cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px;
}
.muted { display: block; color: var(--muted); font-size: .78rem; margin-top: 4px; }

.badge { display: inline-block; min-width: 3.2rem; text-align: center; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.col-ch { white-space: nowrap; }
.ch-badge { min-width: 5.6rem; }
.badge--alerta { background: #f4d396; color: var(--navy); }
.row--aguardando { background: #fbf1d8; }
.badge--vermelho { background: var(--red); color: #fff; }
.badge--laranja { background: var(--orange); color: #fff; }
.badge--amarelo { background: var(--cream); color: var(--navy); }
.badge--normal { background: #e4ebe8; color: #3d524b; }

.overlay { position: fixed; inset: 0; background: rgba(5, 22, 34, .55); display: grid; place-items: center; padding: 20px; z-index: 40; }
.overlay[hidden] { display: none; }
.float-card {
    width: min(760px, 100%);
    max-height: min(86vh, 860px);
    overflow: auto;
    background: var(--card);
    border-radius: 16px;
    padding: 22px 22px 28px;
    position: relative;
    box-shadow: 0 24px 64px rgba(5, 22, 34, .28);
    animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.float-card__close {
    position: absolute; top: 12px; right: 14px; border: 0; background: var(--primary-soft);
    color: var(--navy);
    width: 36px; height: 36px; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}
.card-kpis { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 16px; }
.chip { background: var(--primary-soft); color: var(--navy); border-radius: 999px; padding: 6px 10px; font-size: .82rem; text-decoration: none; }
.vinculo { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.vinculo.is-pref { border-color: var(--sage); background: #eef3f1; }
.vinculo h3 { margin: 0 0 4px; font-size: 1rem; font-family: Poppins, "Open Sans", sans-serif; font-weight: 600; }
.vinculo p { margin: 0; color: var(--muted); font-size: .88rem; }
.hours { display: flex; gap: 12px; margin-top: 8px; font-size: .85rem; }

.footer { border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--muted); font-size: .85rem; background: var(--card); }
.prose { line-height: 1.65; }
.prose h2 { margin-top: 1.4rem; }
.empty, .empty-card { color: var(--muted); }
.flash { background: var(--primary-soft); border: 1px solid var(--cream); padding: 10px 14px; border-radius: 8px; }
.flash--erro { background: #f8e4e4; border-color: #e8b4b4; color: var(--maroon); }
.flash--erro ul { margin: 0; padding-left: 1.1rem; }
.flash--alerta { background: #f6e4d8; border-color: var(--orange); }

.nav-sub { position: relative; }
.nav-sub summary {
    list-style: none;
    cursor: pointer;
    color: #f7f3ea;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
}
.nav-sub summary::-webkit-details-marker { display: none; }
.nav-sub[open] summary, .nav-sub summary:hover { background: rgba(244, 211, 150, .18); color: var(--cream); }
.nav-sub__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #0b2433;
    border: 1px solid rgba(244, 211, 150, .25);
    border-radius: 10px;
    min-width: 240px;
    padding: 6px;
    display: grid;
    gap: 2px;
    box-shadow: 0 12px 28px rgba(5, 22, 34, .35);
    z-index: 30;
}
.nav-sub__menu a { display: block; }
.nav-logout { display: inline-flex; }
.nav-logout button {
    background: transparent;
    border: 1px solid transparent;
    color: #f7f3ea;
    padding: 7px 13px;
    border-radius: 8px;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
}
.nav-logout button:hover { background: rgba(244, 211, 150, .18); color: var(--cream); }

.split { display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 12px; margin: 12px 0; }
.stack label, .form-card label, .ficha label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.form-card, .ficha, .stack input, .stack select, .form-card input, .form-card select, .form-card textarea,
.ficha input, .ficha select, .ficha textarea {
    font: inherit;
}
.form-card { display: grid; gap: 14px; max-width: 640px; }
.form-card input, .form-card select, .form-card textarea,
.ficha input, .ficha select, .ficha textarea, .stack input, .stack select {
    border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--ink);
}
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--ink) !important; }
.check input { width: auto; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.fieldset legend { padding: 0 6px; font-weight: 600; color: var(--navy); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.subnav form { margin: 0; }
.estab-list { list-style: none; margin: 16px 0 0; padding: 0; }
.estab-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

.ficha {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow);
}
.ficha__head { border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 18px; }
.ficha__head p { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--sage); font-weight: 600; }
.ficha__head strong { display: block; font-family: Poppins, "Open Sans", sans-serif; font-size: 1.25rem; margin-top: 4px; color: var(--navy); }
.ficha-bloco { margin-bottom: 22px; }
.ficha-bloco h2 { font-size: 1rem; margin: 0 0 12px; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.span-2 { grid-column: 1 / -1; }
.ficha-dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin: 0; }
.ficha-dl div { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ficha-dl dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ficha-dl dd { margin: 2px 0 0; font-weight: 600; }
.col-check { width: 9rem; text-align: center; }
.row--inativo { background: #f8e4e4; }
.row-group td {
    background: var(--navy);
    color: #f7f3ea;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}
.grid--equip .input-num {
    width: 72px;
    padding: 6px 8px;
}
.grid--equip select {
    min-width: 72px;
    padding: 6px 8px;
}
.obs-field {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    font-weight: 600;
}
.obs-field textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-weight: 400;
    background: var(--card);
    resize: vertical;
}
.reset-senha { display: inline-block; }
.reset-senha > summary {
    list-style: none;
    cursor: pointer;
}
.reset-senha > summary::-webkit-details-marker { display: none; }
.reset-senha[open] > summary { margin-bottom: 8px; }
.reset-senha form {
    min-width: 220px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.pagination { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }

@media (max-width: 900px) {
    .split, .form-grid, .ficha-dl { grid-template-columns: 1fr; }
    .nav-sub__menu { position: static; box-shadow: none; }
    .sidebar-toggle { display: inline-flex; }
    body.is-auth .topbar { z-index: 30; }
    body.sidebar-pinned .sidebar-slot,
    .sidebar-slot { width: 0; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(5, 22, 34, .45);
        z-index: 24;
    }
    .sidebar-backdrop[hidden] { display: none; }
    .sidebar,
    .sidebar:hover,
    .sidebar.is-pinned {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 25;
        width: min(280px, 86vw);
        padding-top: 72px;
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 8px 0 24px rgba(5, 22, 34, .35);
    }
    body.sidebar-open .sidebar { transform: none; }
}

@media (max-width: 900px) {
    .kpi-grid, .filters, .filters--auditoria { grid-template-columns: 1fr 1fr; }
    .topbar__inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand actions"
            "user user";
    }
    .brand { grid-area: brand; }
    .topbar__user { grid-area: user; justify-self: center; max-width: 100%; }
    .topbar__actions { grid-area: actions; }
    .legend__count { margin-left: 0; }
    .farol-toolbar__print { justify-items: start; }
}
.equipe-status {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
}
.equipe-status--ok {
    background: #d9ebe4;
    border-color: #9cbcb0;
    color: #1f3d34;
}
.equipe-status--alerta {
    background: #f8edd4;
    border-color: #e2c48a;
    color: var(--navy);
}
.equipe-status__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: baseline;
    margin-bottom: 8px;
}
.equipe-status__head strong {
    letter-spacing: .04em;
    font-size: 0.95rem;
}
.equipe-status__lista {
    margin: 0;
    padding-left: 18px;
}
.equipe-status__lista li { margin: 4px 0; }
.equipe-status__lista .is-ok {
    color: var(--navy);
    font-weight: 400;
}
.equipe-status__lista .is-ok strong {
    font-weight: 700;
    color: var(--navy);
}
.equipe-status__lista .is-alerta {
    color: var(--red);
    font-weight: 700;
}
.equipe-status__lista .is-alerta strong {
    color: var(--red);
    font-weight: 700;
}
.ok-panel { margin-top: 18px; }

.dash-kpis { margin-bottom: 18px; }
.kpi--click {
    cursor: pointer;
    border: 1px solid var(--line);
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.kpi--click:hover {
    border-color: var(--sage);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.dash-floats {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
}
.dash-float {
    position: absolute;
    width: min(420px, calc(100vw - 24px));
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(5, 22, 34, .22);
    pointer-events: auto;
    overflow: hidden;
}
.dash-float--wide { width: min(760px, calc(100vw - 24px)); }
.dash-float__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--navy);
    color: #f7f3ea;
    cursor: move;
    user-select: none;
}
.dash-float__head strong {
    font-size: .95rem;
    line-height: 1.3;
}
.dash-float__close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.dash-float__body {
    padding: 14px;
    overflow: auto;
}
.dash-float-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dash-float-list li {
    padding: 8px 0;
    border-bottom: 1px solid #ebe6dc;
}
.dash-float-list a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}
.dash-float-list a:hover { color: var(--maroon); text-decoration: underline; }
.dash-cbo-row { cursor: pointer; }
.dash-cbo-row:hover td,
.dash-cbo-row:focus td { background: var(--primary-soft); }
.dash-cbo-filtro {
    width: 100%;
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.grid--cbo-prof { width: 100%; }
.grid--cbo-prof th:nth-child(1),
.grid--cbo-prof td:nth-child(1) { width: 36%; }
.grid--cbo-prof th:nth-child(2),
.grid--cbo-prof td:nth-child(2) { width: 44%; }
.grid--cbo-prof th:nth-child(3),
.grid--cbo-prof td:nth-child(3) { width: 20%; text-align: center; }
.dash-ch-detalhe { display: block; font-size: .75rem; font-weight: 400; }
.dash-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.dash-chart { min-width: 0; }
.dash-chart--wide { grid-column: 1 / -1; }
.dash-chart__plot {
    position: relative;
    height: 280px;
    width: 100%;
}
.dash-chart--wide .dash-chart__plot { height: 320px; }
.dash-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
.dash-card {
    display: grid;
    gap: 4px;
    align-content: start;
    text-align: left;
    min-height: 118px;
    height: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    min-width: 0;
}
.dash-card:hover { border-color: var(--sage); box-shadow: var(--shadow); }
.dash-card--clinica { border-left: 4px solid var(--navy); }
.dash-card.is-alerta { border-left: 4px solid var(--red); }
.dash-card strong {
    font-size: 0.95rem;
    line-height: 1.25;
    min-height: 3.4em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.dash-card span { color: var(--muted); font-size: 0.85rem; }
.dash-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    margin: 0 0 14px;
}
.dash-detail p { margin: 0; font-size: .92rem; }
.float-card--wide {
    width: min(1080px, 97vw);
    max-height: 92vh;
    overflow: auto;
    padding: 22px 24px 20px;
}
.float-card--wide .card-head { margin-bottom: 10px; }
.float-card--wide .card-head h2 { font-size: 1.25rem; margin: 0 0 4px; }
.float-card--wide .dash-kpis {
    margin-bottom: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.float-card--wide .dash-kpis .kpi {
    padding: 10px 12px;
}
.float-card--wide .table-wrap {
    overflow: visible;
    box-shadow: none;
}
.grid--compact {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}
.grid--compact th,
.grid--compact td {
    padding: 8px 10px;
    font-size: .86rem;
    word-break: break-word;
}
.grid--compact th:nth-child(1),
.grid--compact td:nth-child(1) { width: 28%; }
.grid--compact th:nth-child(2),
.grid--compact td:nth-child(2) { width: 16%; }
.grid--compact th:nth-child(n+3),
.grid--compact td:nth-child(n+3) {
    width: 14%;
    text-align: center;
}
.num { text-align: center; }

@media (max-width: 1400px) {
    .dash-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .dash-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .dash-charts { grid-template-columns: 1fr; }
    .dash-detail { grid-template-columns: 1fr; }
    .float-card--wide .dash-kpis { grid-template-columns: 1fr 1fr; }
    .dash-chart__plot,
    .dash-chart--wide .dash-chart__plot { height: 260px; }
}
@media (max-width: 760px) {
    .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .kpi-grid, .filters, .filters--auditoria { grid-template-columns: 1fr; }
    .panel__head { flex-direction: column; align-items: flex-start; }
    .grid { min-width: 720px; }
    .dash-cards { grid-template-columns: 1fr; }
}

/* Tela de login */
body.login-page {
    min-height: 100vh;
    background: #fff;
    color: #0b2a4a;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 36px 0;
    position: relative;
    z-index: 2;
}
.login-brand__icon {
    width: 78px;
    height: 58px;
    flex: 0 0 78px;
    object-fit: contain;
    object-position: center;
    display: block;
}
.login-brand strong {
    display: block;
    font-family: Poppins, "Open Sans", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #0b2a4a;
    line-height: 1.1;
}
.login-brand small {
    display: block;
    margin-top: 2px;
    font-size: .62rem;
    letter-spacing: .08em;
    font-weight: 600;
    color: #c9a227;
    line-height: 1.25;
}
.login-scene {
    position: relative;
    flex: 1;
    min-height: calc(100vh - 96px);
}
.login-hero {
    position: absolute;
    left: 46%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 0;
}
.login-art {
    position: relative;
    display: block;
    height: min(86vh, 740px);
    width: auto;
    max-width: none;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.login-panel {
    position: absolute;
    left: 54%;
    top: 32%;
    z-index: 3;
    width: min(400px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}
.login-foot {
    margin: 0;
    text-align: center;
    font-family: Poppins, "Open Sans", sans-serif;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: .15em .55em;
}
.login-foot span {
    color: #0b2a4a;
    font-size: .88rem;
    font-weight: 700;
}
.login-foot span + span {
    color: #c9a227;
    font-size: .82rem;
    font-weight: 600;
    font-style: italic;
}
.login-card {
    position: relative;
    width: 100%;
    background: #fff;
    border: 1px solid #e7eef5;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(11, 42, 74, .12);
    padding: 28px 28px 22px;
    display: grid;
    gap: 12px;
}
.login-card h1 {
    margin: 0 0 8px;
    font-family: Poppins, "Open Sans", sans-serif;
    font-size: 1.28rem;
    font-weight: 600;
    color: #0b2a4a;
}
.login-field {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #d7e0ea;
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
}
.login-field svg {
    width: 18px;
    height: 18px;
    color: #7b8ea3;
    flex: 0 0 18px;
}
.login-field input {
    border: 0;
    background: transparent;
    width: 100%;
    padding: 12px 0;
    font: inherit;
    color: #0b2a4a;
    outline: none;
}
.login-field:focus-within { border-color: #0b2a4a; }
.login-submit {
    margin-top: 6px;
    border: 0;
    border-radius: 999px;
    background: #0b2a4a;
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.login-submit:hover { filter: brightness(1.08); }
.login-ref {
    margin: 4px 0 0;
    text-align: center;
    color: #7b8ea3;
    font-size: .82rem;
}
.login-error {
    margin: 0;
    color: #c00f0f;
    background: #f8e4e4;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .88rem;
}
.login-status {
    margin: 0;
    color: #0b2a4a;
    background: #eef3f1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .88rem;
}
.login-chart {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(34vw, 380px);
    height: auto;
    opacity: .85;
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 860px) {
    .login-scene {
        display: block;
        min-height: auto;
        padding: 16px 16px 150px;
    }
    .login-hero {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        margin: 0 auto 16px;
    }
    .login-art {
        height: 260px;
        max-width: 100%;
        margin: 0 auto;
    }
    .login-panel {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        margin: 0 auto;
    }
    .login-card {
        width: 100%;
    }
}

.chat-bubble {
    max-width: 78%;
    background: #eef4ef;
    border-radius: 12px;
    padding: 8px 12px;
}
.chat-bubble p { margin: 0; }
.chat-bubble small { color: #5c6f68; }
.chat-bubble.is-mine { align-self: flex-end; background: #f8edd4; }
.alerta-vinculos {
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--orange, #d07a3a);
    background: #f6e4d8;
    border-radius: 10px;
}
.alerta-vinculos ul, .alerta-vinculos-card ul { margin: 8px 0 0; padding-left: 18px; }
.alerta-vinculos-overlay { z-index: 95; }
.alerta-vinculos-card {
    width: min(560px, 100%);
    background: #f6e4d8;
    border: 1px solid var(--orange, #d07a3a);
}
.alerta-vinculos-card .form-actions { margin-top: 16px; }

.farol-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    touch-action: none;
}
.farol-chat.is-arrastando { cursor: grabbing; user-select: none; }
.farol-chat__fab {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 0;
    border: 3px solid var(--cream);
    overflow: hidden;
    cursor: grab;
    background: var(--navy);
    color: var(--cream);
    box-shadow: 0 10px 28px rgba(5, 22, 34, .35);
    position: relative;
    display: grid;
    place-items: center;
}
.farol-chat__icone {
    width: 34px;
    height: 34px;
    display: block;
    pointer-events: none;
}
.farol-chat.has-alerta .farol-chat__fab {
    background: var(--red);
    border-color: #f4d396;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(244, 211, 150, .45), 0 10px 28px rgba(192, 15, 15, .4);
    animation: farol-pulse 1.15s ease-in-out infinite;
}
.farol-chat.has-alerta.is-arrastando .farol-chat__fab,
.farol-chat.is-arrastando .farol-chat__fab {
    animation: none;
    cursor: grabbing;
}
.farol-chat__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.farol-chat__badge[hidden] { display: none !important; }
.farol-chat__painel {
    position: absolute;
    right: 0;
    bottom: 80px;
    width: min(380px, calc(100vw - 24px));
    height: min(520px, calc(100vh - 120px));
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(5, 22, 34, .22);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.farol-chat.is-aberto .farol-chat__painel { display: flex; }
.farol-chat.is-acima .farol-chat__painel {
    bottom: auto;
    top: 80px;
}
.farol-chat__topo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--navy);
    color: #f7f3ea;
    cursor: grab;
}
.farol-chat.is-arrastando .farol-chat__topo { cursor: grabbing; }
.farol-chat__titulo { flex: 1; pointer-events: none; }
.farol-chat__voltar, .farol-chat__fechar {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
}
.farol-chat__fechar:hover, .farol-chat__voltar:hover { background: rgba(255,255,255,.12); }
.farol-chat__voltar[hidden] { display: none !important; }
.farol-chat__contatos {
    flex: 1;
    overflow: auto;
    padding: 8px 0 12px;
}
.farol-chat.is-thread .farol-chat__contatos { display: none; }
.farol-chat__grupo {
    margin: 12px 16px 4px;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.farol-chat__lista { list-style: none; margin: 0; padding: 0; }
.farol-chat__lista button {
    width: 100%;
    display: grid;
    grid-template-columns: 12px 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 16px;
    cursor: pointer;
    color: inherit;
}
.farol-chat__lista button:hover, .farol-chat__lista button.has-msg { background: #f8edd4; }
.farol-chat__status {
    grid-row: 1 / span 2;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: #b9c4be;
}
[data-lista="online"] .farol-chat__status { background: #2f9e6b; }
.farol-chat__nome { font-weight: 600; }
.farol-chat__lista small { color: var(--muted); }
.farol-chat__thread {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
}
.farol-chat.is-thread .farol-chat__thread { display: flex; }
.farol-chat__log {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}
.farol-chat__form {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--line);
}
.farol-chat__form input { flex: 1; }
@keyframes farol-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
@media (max-width: 860px) {
    .farol-chat { right: 12px; bottom: 12px; }
}

.relatorio-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: rgba(5, 22, 34, .45);
    padding: 16px;
}
.relatorio-modal[hidden] { display: none; }
.relatorio-modal__card {
    width: min(460px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(5, 22, 34, .22);
    overflow: hidden;
}
.relatorio-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--navy);
    color: #f7f3ea;
}
.relatorio-modal__body {
    display: grid;
    gap: 10px;
    padding: 16px;
}
.relatorio-modal__body label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}
.relatorio-modal__body select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}
.prefeitura-form {
    display: grid;
    gap: 14px;
    max-width: 640px;
    margin-bottom: 22px;
}
.prefeitura-form label {
    display: grid;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}
.prefeitura-form input,
.prefeitura-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.prefeitura-form .check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .95rem;
    font-weight: 500;
    color: inherit;
}
.prefeitura-form .check input { width: auto; margin-top: 3px; }
.prefeitura-caches {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 10px;
}
.prefeitura-caches-nota { max-width: 720px; margin-top: 0; }
.prefeitura-status {
    flex: 1 1 260px;
    max-width: 320px;
    margin: 0;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: left;
}
.prefeitura-status--ativa { border-color: var(--maroon); }
.prefeitura-cache {
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.prefeitura-cache:hover,
.prefeitura-cache:focus-visible { border-color: var(--maroon); outline: none; }
.prefeitura-cache-acoes { display: flex; gap: 8px; }
.prefeitura-logo {
    display: block;
    max-width: 240px;
    max-height: 96px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
}
.prefeitura-caixa-espera {
    width: 42px;
    height: 42px;
    margin: 4px auto 0;
    border: 3px solid var(--line);
    border-top-color: var(--maroon);
    border-radius: 50%;
    animation: prefeitura-gira 0.8s linear infinite;
}
@keyframes prefeitura-gira { to { transform: rotate(360deg); } }



