* { box-sizing: border-box; }
body { margin: 0; font-family: 'Sinter Inter', 'Segoe UI', sans-serif; color: #163f7d; background: #f5faff; }
input, select, button { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 100; padding: 1rem; background: white; }
.skip-link:focus { top: 1rem; }
.login-field input { width: 100%; border: 1px solid #c7d8ef; }
.password-visibility { position: absolute; right: 4px; top: 4px; min-height: 36px; border: 0; border-radius: 4px; background: transparent; font-size: 12px; }
.consulta-host select { display: block; width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid #c8d9ef; border-radius: 8px; color: #0b3676; background: white; }
.consulta-host .municipio-destaque { grid-template-columns: minmax(0, 1fr); }
.consulta-host .campo { width: 100%; }
.erro { color: #a61b1b; line-height: 1.5; }
.loading { display: grid; place-items: center; min-height: 80vh; }
.document { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.document h1 { font-size: clamp(24px, 4vw, 36px); }
.legal { max-width: 800px; line-height: 1.7; overflow-wrap: anywhere; }
.legal header, .legal footer { padding-block: 20px; border-block: 1px solid #d1dff0; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; background: white; border-bottom: 1px solid #d1dff0; }
.app-header > a { font-weight: 700; font-size: 20px; color: #103b7c; text-decoration: none; }
.app-shell nav { display: flex; gap: 20px; flex-wrap: wrap; padding: 20px 24px; background: white; }
.app-shell nav a { color: #163f7d; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; margin-top: 24px; }
.client-card { padding: 24px; border: 1px solid #d1dff0; border-radius: 12px; background: white; }
.client-card h2 { margin-top: 0; }
.client-card button, dialog:not(.original-dialog) button { border: 0; background: #1266e8; color: white; border-radius: 8px; padding: 12px 24px; }
dialog:not(.original-dialog) { border: 1px solid #c7d8ef; border-radius: 12px; color: #163f7d; padding: 32px; max-width: calc(100vw - 32px); }
dialog:not(.original-dialog)::backdrop { background: #10264d66; }
dialog:not(.original-dialog) h2 { margin-top: 0; }
dialog:not(.original-dialog) dt { font-weight: 700; }
dialog:not(.original-dialog) dd { margin: 4px 0 16px; overflow-wrap: anywhere; }
.operations { color: #153258; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-header h1, .page-header h2 { margin: 0 0 8px; }
.page-header p { color: #52677f; margin: 0; }
.primary-action { background: #1266e8; color: #fff; border: 1px solid #1266e8; border-radius: 8px; min-height: 44px; padding: 11px 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.operations button { min-height: 44px; padding: 8px 14px; border: 1px solid #c7d8ef; border-radius: 8px; background: white; color: #163f7d; }
.operations button.primary-action { background: #1266e8; color: white; }
.operations button:disabled { opacity: .55; }
.operations :is(input, select) { width: 100%; min-width: 0; min-height: 44px; background: white; color: #153258; border: 1px solid #c7d8ef; border-radius: 8px; padding: 8px 12px; }
.operations :is(input,select,button,a):focus-visible { outline: 3px solid #1266e8; outline-offset: 3px; }
.operation-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 16px; }
.operation-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid #d1dff0; border-radius: 12px; color: #153258; background: white; text-decoration: none; }
.operation-card h3,.operation-card h2 { margin: 0; font-size: 18px; }
.operation-card p { color: #52677f; line-height: 1.6; margin: 0 0 12px; }
.operation-card span { margin-top: auto; font-weight: 600; color: #1266e8; }
.operation-card:hover { border-color: #1266e8; box-shadow: 0 5px 16px #103b7c10; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.metric,.panel,.state-panel { padding: 24px; border: 1px solid #d1dff0; border-radius: 12px; background: white; margin-bottom: 20px; }
.metric { margin: 0; }
.metric h2 { color: #52677f; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.metric p { font-size: 30px; font-weight: 600; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.metric.success p { color: #07844e; } .metric.danger p { color: #b42318; }
.failure-list { padding: 0; list-style: none; }
.failure-list li { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #d1dff0; padding: 12px 0; }
.failure-list p { margin: 4px 0; color: #52677f; font-size: 14px; }
.failure-list b { margin-left: auto; font-variant-numeric: tabular-nums; }
.badge { padding: 5px 8px; border-radius: 6px; background: #edf4ff; font-size: 13px; }
.badge.danger { background: #fff0ee; color: #a61b1b; }
.operations details summary { cursor: pointer; line-height: 1.5; }
.operations details summary p { color: #52677f; font-size: 14px; margin: 4px 0 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 16px; align-items: end; margin-bottom: 24px; }
.filter-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #52677f; }
.table-scroll { position: relative; overflow: auto; max-width: 100%; border: 1px solid #d1dff0; border-radius: 10px; background: white; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.table-scroll :is(td,th) { padding: 12px; border-bottom: 1px solid #e7eef8; white-space: nowrap; }
.table-scroll th { background: #f3f7fc; color: #52677f; font-weight: 600; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding-block: 20px; font-size: 14px; }
.detail-dialog { width: min(1000px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; }
.operations pre { white-space: pre-wrap; overflow-wrap: anywhere; color: #153258; background: #f3f7fc; padding: 16px; border-radius: 8px; font-size: 12px; }
.draft-notice { display: block; padding: 20px; background: #fff7e0; border: 1px solid #d7b561; border-radius: 10px; color: #7a5200; margin-bottom: 20px; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.password-form { max-width: 560px; margin-top: 24px; display: grid; gap: 12px; }
.password-form label { font-weight: 600; margin-top: 8px; }
.field-help { margin: 0 0 8px; font-size: 13px; color: #52677f; line-height: 1.6; }
.notice { position: relative; margin: 16px; max-width: calc(100vw - 32px); z-index: 100; display: flex; gap: 20px; align-items: center; border: 1px solid #7ec89f; border-radius: 10px; padding: 16px; background: #f0fff6; color: #13653b; box-shadow: 0 4px 20px #0001; }
.notice button { border: 0; background: transparent; color: inherit; text-decoration: underline; }
@media(max-width:750px) { .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .metric { padding: 16px; } .failure-list li { align-items: start; } }
@media (max-width: 500px) { .app-header { flex-wrap: wrap; } .login-welcome h2 { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; } }

.form-page fieldset{min-inline-size:0}.form-section legend,.form-row legend{font-weight:650;padding:0 .4rem}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.form-field{display:flex;flex-direction:column;gap:.35rem;min-width:0}.form-field input,.form-field select,.form-page textarea{width:100%;min-width:0;border:1px solid #b8c4cd;border-radius:.4rem;background:#fff;padding:.65rem;font:inherit;color:inherit}.form-field small:empty{display:none}.form-field [aria-invalid=true]{border-color:#b42318}.form-field input:disabled,.form-field select:disabled{background:#edf1f4;color:#64748b}.form-page [role=tablist]{display:flex;flex-wrap:wrap;gap:.4rem;margin:1rem 0}.form-page [role=tab][aria-selected=true]{background:#155677;color:#fff}.form-row{margin:1rem 0;border:1px solid #d5dfe6;border-radius:.5rem;padding:1rem}.form-actions{display:flex;gap:.6rem;flex-wrap:wrap;margin:1.25rem 0}.form-page details{margin:.7rem 0}.form-page summary{cursor:pointer;font-weight:600;padding:.7rem 0}.form-page textarea{box-sizing:border-box}.form-page input:focus-visible,.form-page select:focus-visible,.form-page textarea:focus-visible{outline:3px solid #4a9fc0;outline-offset:2px}@media(max-width:640px){.form-grid{grid-template-columns:minmax(0,1fr)}}

.glossario > div { padding: 1rem 0; border-bottom: 1px solid #c7d8ef; }
.glossario dd { margin: .5rem 0 0; line-height: 1.6; }
kbd { border: 1px solid #879db8; border-radius: .25rem; padding: .1rem .4rem; }

/* Preferência herdada do cliente anterior; cores sem depender de componentes JS. */
.app-header button { min-height:44px; padding:8px 14px; border:1px solid #c7d8ef; border-radius:8px; background:#fff; color:#163f7d; }
.app-dark { color-scheme:dark; }
.app-dark body { background:#101b2a; color:#e1eaf5; }
.app-dark .app-shell { min-height:100dvh; color:#e1eaf5; background:#101b2a; }
.app-dark .app-shell :is(.app-header,nav,.client-card,.operation-card,.panel,.metric,.state-panel,.table-scroll,dialog) { background:#18283c; color:#e1eaf5; border-color:#42566e; }
.app-dark .app-shell :is(.operations,.operation-card h2,.operation-card h3) { color:#e1eaf5; }
.app-dark .app-shell :is(a,.operation-card span) { color:#9dc8ff; }
.app-dark .app-shell :is(.page-header p,.operation-card p,.metric h2,.failure-list p,.filter-grid label,.field-help,details summary p) { color:#b9c8da; }
.app-dark .app-shell :is(input,select,textarea,button,pre,th) { color:#e1eaf5; background:#21344c; border-color:#526985; }
.app-dark .app-shell :is(td,th,fieldset,.glossario>div,.failure-list li) { border-color:#42566e; }
.app-dark .app-shell :is(input,select,textarea):disabled { color:#b9c8da; background:#1c2a3c; }
.app-dark .app-shell .primary-action,.app-dark .app-shell [role=tab][aria-selected=true] { color:#fff; background:#246bce; }
.app-dark .app-shell :is([role=alert],.erro,.metric.danger p) { color:#ffb4aa; }
.app-dark .app-shell .metric.success p { color:#85dfad; }
.app-dark .app-shell .badge { background:#284565; }
.app-dark .app-shell .badge.danger { background:#592b2b; color:#ffb4aa; }
.app-dark .app-shell .draft-notice { background:#41381d; color:#ffe4a0; border-color:#9b8450; }
.app-dark .app-shell :focus-visible { outline:3px solid #b6d7ff; outline-offset:3px; }
