:root {
  --blue: #0b5394;
  --blue-deep: #083d6e;
  --blue-soft: #e6eef7;
  --ink: #15263a;
  --muted: #5b697a;
  --paper: #f3f6f9;
  --card: #ffffff;
  --line: #d8e0e9;
  --leaf: #b6d7a8;
  --leaf-ink: #2c5a1c;
  --amber: #f3e3b3;
  --amber-ink: #6b4d05;
  --red: #b3261e;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: 'Figtree', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7fb0e0; outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barra superior ---------- */
.topbar { background: var(--blue); color: #fff; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand small { font-size: 12px; font-weight: 500; opacity: .85; letter-spacing: .02em; }
.brand b { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: -2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #d5e4f3; text-decoration: none; padding: 8px 12px; border-radius: var(--radius-s); font-weight: 500; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.user-menu { position: relative; }
.user-btn { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.user-pop { position: absolute; right: 0; top: 44px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-m); min-width: 230px; box-shadow: 0 12px 32px rgba(8,61,110,.18); padding: 8px; z-index: 30; }
.user-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.user-pop .who strong { display: block; color: var(--ink); font-size: 15px; }
.user-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; }
.user-pop button:hover { background: var(--paper); }

/* ---------- Layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.015em; }
.head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Botões e campos ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; font-weight: 600; text-decoration: none; font-size: 14px; }
.btn:hover { border-color: #b8c6d6; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
label.f { display: block; font-size: 13px; font-weight: 600; margin: 0 0 14px; }
label.f > span.hint { font-weight: 400; color: var(--muted); }
.in, select.in, textarea.in { display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; background: #fff; font-weight: 400; }
textarea.in { resize: vertical; min-height: 70px; }
.in:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.login-side { background: var(--blue); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side .brand b { font-size: 56px; }
.login-side .brand small { font-size: 20px; }
.login-side h2 { font-size: 30px; font-weight: 600; max-width: 18ch; letter-spacing: -.01em; }
.login-side p { color: #cfe0f1; max-width: 42ch; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-form form { width: 100%; max-width: 340px; }
.login-form h1 { font-size: 24px; margin-bottom: 4px; }
.login-form p.sub { color: var(--muted); margin: 0 0 24px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 0 0 10px; }

/* ---------- Início ---------- */
.hello h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.hello p { color: var(--muted); margin: 6px 0 22px; }
.search { position: relative; max-width: 620px; margin-bottom: 30px; }
.search input { width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; font-size: 16px; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.results { position: absolute; left: 0; right: 0; top: 54px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(8,61,110,.16); max-height: 380px; overflow: auto; z-index: 20; }
.results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--paper); }
.results a:hover, .results a:focus { background: var(--blue-soft); }
.results small { color: var(--muted); white-space: nowrap; }
.results .none { padding: 14px; color: var(--muted); }
.modules { display: grid; gap: 14px; }
.module { display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: var(--radius-m); padding: 22px 24px; text-decoration: none; color: var(--ink); }
.module:hover { border-color: #b8c6d6; border-left-color: var(--blue-deep); }
.module .ico { width: 56px; height: 56px; border-radius: 12px; background: var(--blue-soft); display: grid; place-items: center; color: var(--blue); }
.module h2 { font-size: 21px; font-weight: 700; }
.module p { margin: 3px 0 0; color: var(--muted); }
.module .count { font-size: 14px; color: var(--muted); text-align: right; }
.module .count b { display: block; font-size: 30px; color: var(--blue); line-height: 1; }

/* ---------- Setores ---------- */
.sectors { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sector { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; text-decoration: none; color: var(--ink); }
.sector:hover { border-color: var(--blue); }
.mono { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.sector h3 { font-size: 17px; }
.sector p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.empty { background: #fff; border: 1px dashed #b8c6d6; border-radius: var(--radius-m); padding: 34px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; }

/* ---------- Catálogo ---------- */
.catalog { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.catalog-h { background: var(--blue); color: #fff; padding: 12px 20px; font-weight: 700; letter-spacing: .01em; }
.catalog ol { list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 2px 16px; }
.catalog li a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.catalog li a:hover { background: var(--paper); }
.num { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--blue); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.catalog .meta { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag.draft { background: var(--amber); color: var(--amber-ink); }
.tag.pub { background: #e3f0dc; color: var(--leaf-ink); }

/* ---------- Ficha do processo ---------- */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; container-type: inline-size; min-width: 0; }
.sheet-top > div, .grid5 > div { min-width: 0; overflow-wrap: break-word; }
@container (max-width: 860px) { .sheet-top { grid-template-columns: 1fr 1fr; } .sheet-top > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .sheet-top > div:nth-child(2) { border-right: 0; } }
.sheet-top { display: grid; grid-template-columns: 2.2fr 1.4fr .8fr .8fr; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 16px; }
.sheet-top > div { padding: 10px 14px; border-right: 1px solid var(--line); }
.sheet-top > div:last-child { border-right: 0; }
.sheet-top small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.sheet-top strong { font-size: 16px; }
.sheet-top .t strong { font-size: 18px; color: var(--blue); }
.grid5 { display: grid; grid-template-columns: 1.3fr 1.6fr 1.2fr 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 24px; }
.grid5 > div { border-right: 1px solid var(--line); }
.grid5 > div:last-child { border-right: 0; }
.grid5 h4 { margin: 0; background: #e9eef4; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--ink); text-align: center; }
.grid5 .c { padding: 10px 12px; font-size: 14px; }
.grid5 ol, .grid5 ul { margin: 0; padding-left: 18px; }
.grid5 li + li { margin-top: 4px; }
.blank { color: #9aa6b3; font-style: italic; }
.people li { list-style: none; margin-left: -18px; display: flex; gap: 8px; align-items: center; }
.people li .pin { margin: 0; }

.flow-wrap { overflow-x: auto; padding-bottom: 6px; }
.flow { display: grid; grid-template-columns: 74px repeat(var(--n), minmax(160px, 1fr)); grid-template-rows: auto auto auto 1fr; gap: 0 6px; min-width: min-content; }
.lane { grid-column: 1; font-weight: 800; font-size: 14px; line-height: 1.15; color: var(--ink); display: flex; align-items: center; padding-right: 6px; }
.lane.l1 { grid-row: 2; }
.lane.l3 { grid-row: 4; align-items: flex-start; padding-top: 16px; }
.endcap { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.endcap b { background: var(--leaf); color: var(--leaf-ink); padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.endcap span:nth-child(3) { margin: 0 10px; padding: 0 10px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.step { grid-row: 1 / 5; display: grid; grid-template-rows: subgrid; }
.step .who { display: flex; align-items: flex-end; gap: 3px; min-height: 26px; padding: 0 0 5px 18px; flex-wrap: wrap; }
.pin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c); flex: none; }
.pin svg { width: 13px; height: 13px; fill: #fff; }
.in-tag { background: var(--leaf); color: var(--leaf-ink); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 6px; line-height: 1.3; max-width: 120px; }
.step .note .out-tag { background: #f4cfc8; color: #7a2418; display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-top: 4px; }
.endcap b.out { background: #f4cfc8; color: #7a2418; }
.endcap .muted { font-weight: 400; opacity: .8; }
.chev { position: relative; background: var(--blue); color: #fff; min-height: 76px; padding: 10px 26px 10px 24px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); display: flex; flex-direction: column; justify-content: center; }
.flow > .step:nth-child(3) .chev { clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); padding-left: 14px; }
.chev .n { font-size: 12px; font-weight: 700; opacity: .8; }
.chev .tt { font-weight: 700; font-size: 14px; line-height: 1.25; hyphens: auto; overflow-wrap: break-word; }
.step .note { margin: 8px 6px 0; min-height: 22px; }
.step .note span { display: inline-block; background: var(--leaf); color: var(--leaf-ink); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.step .how { margin: 8px 4px 0; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius-s); padding: 10px; font-size: 13px; background: #fbfcfe; }
.step .how .role { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; font-weight: 600; line-height: 1.5; }
.step .how .role i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.roles-ed { font-size: 13px; font-weight: 600; margin: 0 0 14px; }
.roles-ed > span:first-child { display: block; margin-bottom: 6px; }
.roles-ed .hint { font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }
.chip:focus-within { outline: 3px solid #7fb0e0; outline-offset: 1px; }
.hint-p { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ---------- Histórico ---------- */
.history { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; }
.history summary { cursor: pointer; font-weight: 600; }
.history ul { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.history li { padding: 6px 0; border-top: 1px solid var(--paper); display: flex; justify-content: space-between; gap: 12px; }
.history li small { color: var(--muted); white-space: nowrap; }

/* ---------- Editor de processo ---------- */
.editor { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.panel h3 { font-size: 15px; margin: 4px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.panel h3:not(:first-child) { margin-top: 22px; }
.form-col { max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 16px; }
.preview-col { min-width: 0; }
.preview-col .preview-label { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.list-ed .li { display: flex; gap: 6px; margin-bottom: 6px; }
.list-ed .li .in { margin-top: 0; }
.step-ed { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; margin-bottom: 10px; background: #fbfcfe; }
.step-ed.drag-over { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.step-ed .bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.step-ed .grip { cursor: grab; color: var(--muted); padding: 0 4px; user-select: none; }
.step-ed .bar strong { flex: 1; font-size: 13px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: var(--radius-s); width: 30px; height: 30px; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.icon-btn:hover { border-color: var(--blue); }
.editor-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); margin: 16px -18px -18px; padding: 12px 18px; display: flex; gap: 8px; justify-content: flex-end; border-radius: 0 0 var(--radius-m) var(--radius-m); }

/* ---------- POPs e relatórios ---------- */
.items { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); }
.item { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); align-items: center; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--paper); }
.item h3 { font-size: 16px; }
.item p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.item .side { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px 28px; }
.doc .meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.doc .body { white-space: pre-wrap; max-width: 78ch; font-size: 15px; line-height: 1.65; }
.frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; margin-top: 16px; }
.file-box { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; margin: 0 0 16px; background: var(--paper); }

/* ---------- POP estruturado ---------- */
.md { max-width: 92ch; font-size: 15px; line-height: 1.6; }
.md h3 { font-size: 17px; color: var(--blue); margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 10px; }
.md h4 { font-size: 15px; color: var(--ink); margin: 18px 0 8px; }
.md-note { display: inline-block; margin: 0 0 12px 22px !important; padding: 4px 10px; border: 1px dashed #b8c6d6; border-radius: var(--radius-s); color: var(--muted); font-size: 13px; background: #fbfcfe; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li + li { margin-top: 4px; }
.md-table { overflow-x: auto; margin: 4px 0 14px; }
.md-img { display: block; margin: 10px 0 14px; max-width: 100%; }
.md-img img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; box-shadow: 0 1px 3px rgba(8,61,110,.08); }
a.md-img { cursor: zoom-in; width: fit-content; }
.md li .md-img { margin: 8px 0 16px; }
.md ol > li { margin-bottom: 6px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.md th { background: #e9eef4; font-size: 13px; }
.code { display: inline-block; font-size: 12px; font-weight: 700; color: var(--blue-deep); background: var(--blue-soft); padding: 1px 8px; border-radius: 4px; margin-bottom: 4px; }
.row-code { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }

/* ---------- Importação ---------- */
.imp { margin-bottom: 16px; }
.imp-help { font-size: 13px; color: var(--muted); margin: -4px 0 14px; max-width: 90ch; }
.imp-sum { margin: 0 0 10px; }
.imp-notes { margin: 0 0 14px; padding: 10px 14px 10px 30px; background: var(--amber); color: var(--amber-ink); border-radius: var(--radius-s); font-size: 14px; }
.imp-h { margin: 18px 0 8px; font-size: 14px; }
.imp-item { border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 8px; background: #fff; }
.imp-row { display: grid; grid-template-columns: 200px auto 1fr; gap: 12px; align-items: start; padding: 12px 14px; }
.imp-row .num { margin-top: 2px; }
.imp-row .code { margin: 3px 0 0; white-space: nowrap; }
.imp-ctl .imp-act { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 6px; background: #fff; width: 100%; }
.imp-main .meta { display: block; font-size: 13px; color: var(--muted); }
.imp-warn { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--amber-ink); }
.imp-prev { border-top: 1px solid var(--line); }
.imp-prev > summary { cursor: pointer; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--blue); }
.imp-prev > .sheet, .imp-prev > .doc { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.imp-status { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.imp-status legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.imp-done p { margin: 0 0 14px; }

/* ---------- Painel de R&S ---------- */
.print-only { display: none; }
.rs-top { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 14px; }
.rs-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.rs-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rs-filters select, .rs-filters input { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 8px; background: #fff; font-size: 14px; color: var(--ink); }
.rs-dates { flex-direction: row !important; align-items: center; gap: 6px !important; }
.rs-dates.dim input { color: var(--muted); }
.rs-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rs-upd { font-size: 12px; color: var(--muted); margin-right: 4px; }
.rs-scope { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.rs-warn { background: var(--amber); color: var(--amber-ink); padding: 8px 12px; border-radius: var(--radius-s); font-size: 14px; }
.rs-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rs-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rs-kpi .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.rs-kpi b { font-size: 34px; line-height: 1.05; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.rs-kpi b small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.rs-kpi .s { font-size: 13px; color: var(--muted); }
.rs-late { color: var(--red); font-weight: 700; }
.rs-late::before { content: '▲ '; font-size: .75em; }
.rs-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rs-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rs-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; min-width: 0; margin-bottom: 14px; }
.rs-grid2 > .rs-card, .rs-grid3 > .rs-card { margin-bottom: 0; }
.rs-card h3 { font-size: 16px; margin: 0 0 2px; line-height: 1.3; }
.rs-cap { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.rs-card h4.rs-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
.rs-lead { font-size: 17px; line-height: 1.5; margin: 0 0 6px; max-width: 95ch; color: var(--ink); }
.rs-lead strong { font-weight: 700; }
.rs-late-t { color: var(--red); font-weight: 700; }
.rs-card h3.rs-sub { margin-top: 16px; }
.rs-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.rs-card > .rs-note:first-of-type { margin: -4px 0 8px; }
.rs-empty { color: var(--muted); font-size: 14px; margin: 8px 0; }
.rs-legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink); margin: -2px 0 6px; }
.rs-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: #e6ebf1; stroke-width: 1; }
svg.chart .base { stroke: #9aa6b3; stroke-width: 1; }
svg.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
svg.chart .val { font-size: 11px; fill: var(--ink); font-weight: 600; font-family: var(--font); }
svg.chart .ref { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 5 4; }
svg.chart .ref-t { font-size: 11px; fill: var(--red); font-weight: 600; font-family: var(--font); }
svg.chart .hit:hover path { opacity: .82; }
.rs-bars { display: grid; gap: 8px; }
.rs-bar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.rs-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-track { height: 12px; background: #f0f3f7; border-radius: 3px; overflow: hidden; }
.rs-track span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.rs-bv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rs-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.rs-tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: bottom; line-height: 1.25; }
.rs-open th { white-space: nowrap; }
.rs-tbl td { padding: 8px; border-bottom: 1px solid #eef2f6; font-variant-numeric: tabular-nums; }
.rs-tbl td:not(:first-child) { white-space: nowrap; }
.rs-tbl tr:last-child td { border-bottom: 0; }
.rs-tbl td:not(:first-child), .rs-tbl th:not(:first-child) { text-align: right; }
.rs-open td, .rs-open th { text-align: left !important; }
.rs-open td:last-child, .rs-open th:last-child { text-align: right !important; }
.rs-matrix { border-collapse: separate; border-spacing: 2px; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; }
.rs-matrix th { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; text-align: center; white-space: nowrap; }
.rs-matrix th:first-child, .rs-matrix td:first-child { text-align: left; position: sticky; left: 0; background: #fff; padding-right: 12px; white-space: nowrap; font-weight: 500; }
.rs-matrix td { text-align: center; padding: 6px 4px; min-width: 44px; border-radius: 4px; }
.rs-matrix td.z { color: #b8c2cd; }
.rs-matrix td.t, .rs-matrix th:last-child { font-weight: 700; color: var(--ink); background: #f3f6f9; }
.rs-matrix tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: #f3f6f9; }
.rs-matrix tfoot td:first-child { background: #f3f6f9; }
.rs-card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; margin-bottom: 2px; flex-wrap: wrap; }
.rs-card-h h3 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--blue); color: #fff; }
.gm-bars { display: grid; grid-template-columns: minmax(150px, max-content) repeat(var(--m), minmax(46px, 1fr)) 56px; align-items: end; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; }
.gm-bars > div { padding: 0 3px; }
.gm-h { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding-bottom: 6px !important; align-self: end; }
.gm-name { position: sticky; left: 0; background: #fff; white-space: nowrap; padding: 0 12px 0 0 !important; align-self: center; font-weight: 500; z-index: 1; }
.gm-h.gm-name { text-align: left; align-self: end; }
.gm-cell { height: 46px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid #c9d3de; }
.gm-v { font-size: 11px; font-weight: 600; line-height: 1; margin-bottom: 2px; }
.gm-b { width: 62%; max-width: 30px; background: var(--blue); border-radius: 4px 4px 0 0; }
.gm-0 { height: 0; }
.gm-cell:hover .gm-b { opacity: .8; }
.gm-tot { text-align: center; font-weight: 700; align-self: center; background: #f3f6f9; border-radius: 4px; padding: 6px 0 !important; }
.gm-h.gm-tot { background: #f3f6f9; padding: 6px 0 !important; color: var(--ink); }
.gm-f { font-weight: 700; text-align: center; padding-top: 8px !important; }
.gm-name.gm-f { text-align: left; }
.rs-matrix-foot { display: flex; gap: 14px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.rs-matrix-foot .rs-note { margin: 0; }
.rs-quality summary { cursor: pointer; font-weight: 600; }
.rs-q { margin-top: 12px; font-size: 14px; }
.rs-q div { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.drill { cursor: pointer; }
.rs-kpi.drill:hover, .rs-kpi.drill:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.rs-bar.drill:hover .rs-bl, .rs-bar.drill:focus-visible .rs-bl { text-decoration: underline; color: var(--blue); }
.rs-bar.drill:hover .rs-track span { filter: brightness(.9); }
svg.chart .hit.drill:hover path, svg.chart .hit.drill:focus path { opacity: .75; }
svg.chart .hit.drill:focus { outline: none; }
.rs-matrix td.drill:hover, .rs-matrix td.drill:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.gm-cell.drill:hover .gm-b, .gm-cell.drill:focus-visible .gm-b { filter: brightness(.85); }
.drill-n { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: #b8c6d6; text-underline-offset: 3px; }
.drill-n:hover { color: var(--blue); text-decoration-color: currentColor; }
.drill-n.rs-late { color: var(--red); }
.modal.modal-wide { width: min(1100px, 100%); }
.drill-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drill-h h2 { margin-bottom: 4px; }
.drill-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.drill-wrap .rs-tbl th { position: sticky; top: 0; background: #fff; z-index: 1; }
.rs-drill-hint { margin-top: 4px; }
.drill-wrap td:first-child, .drill-wrap td:nth-last-child(-n+3) { white-space: nowrap; }
#rs-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; opacity: 0; transition: opacity .1s; max-width: 280px; }
@media (max-width: 1100px) { .rs-kpis { grid-template-columns: repeat(3, 1fr); } .rs-grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .rs-kpis { grid-template-columns: 1fr 1fr; } .rs-grid2, .rs-grid3 { grid-template-columns: 1fr; } .rs-kpi b { font-size: 28px; } }
@media print {
  .no-print, .drill { cursor: pointer; }
.rs-kpi.drill:hover, .rs-kpi.drill:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.rs-bar.drill:hover .rs-bl, .rs-bar.drill:focus-visible .rs-bl { text-decoration: underline; color: var(--blue); }
.rs-bar.drill:hover .rs-track span { filter: brightness(.9); }
svg.chart .hit.drill:hover path, svg.chart .hit.drill:focus path { opacity: .75; }
svg.chart .hit.drill:focus { outline: none; }
.rs-matrix td.drill:hover, .rs-matrix td.drill:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.gm-cell.drill:hover .gm-b, .gm-cell.drill:focus-visible .gm-b { filter: brightness(.85); }
.drill-n { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: #b8c6d6; text-underline-offset: 3px; }
.drill-n:hover { color: var(--blue); text-decoration-color: currentColor; }
.drill-n.rs-late { color: var(--red); }
.modal.modal-wide { width: min(1100px, 100%); }
.drill-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drill-h h2 { margin-bottom: 4px; }
.drill-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.drill-wrap .rs-tbl th { position: sticky; top: 0; background: #fff; z-index: 1; }
.rs-drill-hint { margin-top: 4px; }
.drill-wrap td:first-child, .drill-wrap td:nth-last-child(-n+3) { white-space: nowrap; }
#rs-tip { display: none !important; }
  .print-only { display: block; font-size: 20px; margin: 0 0 4px; }
  .rs-kpis { grid-template-columns: repeat(5, 1fr); }
  .rs-grid2 { grid-template-columns: 1fr 1fr; } .rs-grid3 { grid-template-columns: 1fr 1fr 1fr; }
  .rs-card, .rs-kpi { break-inside: avoid; }
  .rs-quality { display: none; }
  .md-img img { max-height: 120mm; box-shadow: none; }
  .md-img, .md li { break-inside: avoid; }
  .rs-track span, svg.chart path, .rs-legend i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl th { background: #e9eef4; border-top: 0; font-size: 13px; }
.tbl-wrap { overflow-x: auto; }
.role-pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); }
.off { color: var(--muted); }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix select { border: 1px solid var(--line); border-radius: 4px; padding: 3px 4px; background: #fff; }

/* ---------- Modal e aviso ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(12,32,56,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: min(640px, 100%); max-height: 92vh; overflow: auto; padding: 22px 24px; box-shadow: 0 24px 60px rgba(8,30,56,.35); }
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--red); }
.loading { color: var(--muted); padding: 30px 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .editor { grid-template-columns: 1fr; }
  .form-col { max-height: none; position: static; }
  .grid5 { grid-template-columns: 1fr; }
  .grid5 > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .sheet-top { grid-template-columns: 1fr 1fr; }
  .sheet-top > div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 32px 24px; }
  .login-side .brand b { font-size: 40px; }
  .login-side h2 { font-size: 22px; margin-top: 20px; }
  .topbar-in { padding: 0 14px; gap: 10px; }
  .nav { overflow-x: auto; }
  .nav a { padding: 8px; font-size: 14px; }
  .brand b { font-size: 21px; }
  .page { padding: 20px 14px 48px; }
  .module { grid-template-columns: 1fr auto; }
  .module .ico { display: none; }
  .catalog ol { grid-template-columns: 1fr; }
  .flow { display: block; min-width: 0; }
  .lane { display: none; }
  .chev, .flow > .step:nth-child(3) .chev { clip-path: none; border-radius: var(--radius-s); padding: 10px 14px; min-height: 0; }
  .step { display: block; margin-bottom: 16px; }
  .step .who { padding-left: 0; }
  .row2, .row3, .row-code { grid-template-columns: 1fr; gap: 0; }
  .imp-row { grid-template-columns: auto 1fr; }
  .imp-ctl { grid-column: 1 / -1; }
  .sheet { padding: 12px; }
  .user-btn { padding: 6px 10px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .head h1 { font-size: 23px; }
  .hello h1 { font-size: 27px; }
}

/* ---------- Impressão / PDF ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .topbar, .crumbs, .actions, .history, .no-print, #toast, .modal-bg { display: none !important; }
  .page { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; }
  .flow-wrap { overflow: visible; }
  .head { display: none; }
  .flow { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: none; gap: 10px 4px; min-width: 0; }
  .lane { display: none; }
  .step { grid-column: auto !important; grid-row: auto; display: block; break-inside: avoid; }
  .chev { padding: 8px 20px 8px 20px; }
  .grid5, .sheet-top { break-inside: avoid; }
  .chev { -webkit-print-color-adjust: exact; print-color-adjust: exact; min-height: 58px; }
  .chev .tt { font-size: 11px; }
  .step .how { font-size: 10px; }
  .pin, .in-tag, .out-tag, .step .how .role i, .grid5 h4, .step .note span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =================== Cargos e Responsabilidades (documento no padrão da descrição de cargo) =================== */
/* Layout: documento de coluna única (estilo descrição de cargo), capa em faixa escura, seções numeradas e pranchas de fluxo em largura total */
.cargo-doc {
  --bg: #F6F5F1; --paper: #FDFCFA; --ink: #15233A; --soft: #4B5563; --muted: #6B7280; --line: #D9DDE3;
  --accent: #E8A21A; --accent-ink: #8A5D08; --band: #15233A; --band-ink: #F6F5F1; --band-soft: #C9D3E0;
  --lane: #FBFCFD; --lane-alt: #F1F4F7; --head: #E3E8EE; --task: #FFFFFF; --start: #2F8A4C; --end: #B23A3A; --gw: #C98A13; --link: #1F5FA8;
  --display: "Oswald", "Arial Narrow", Arial, sans-serif; --body: "Public Sans", "Segoe UI", Arial, sans-serif;
}
.cargo-doc { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15.5px; line-height: 1.6; }
.cargo-doc .cover { background: var(--band); color: var(--band-ink); position: relative; overflow: hidden; }
.cargo-doc .cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: repeating-linear-gradient(180deg, var(--accent) 0 28px, transparent 28px 56px); }
.cargo-doc .cover-in { max-width: 1080px; margin: 0 auto; padding-block: 56px 48px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; }
.cargo-doc .kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.cargo-doc .cover h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5.4vw, 56px); line-height: 1.05; margin: 0; text-wrap: balance; }
.cargo-doc .cover p { margin: 0; max-width: 64ch; color: var(--band-soft); font-size: 17px; }
.cargo-doc .meta { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 13px; color: var(--band-soft); border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; margin-top: 8px; }
.cargo-doc .meta b { color: var(--band-ink); font-weight: 600; }
.cargo-doc main { max-width: 1080px; margin: 0 auto; padding-block: 40px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 56px; }
.cargo-doc section { display: grid; gap: 18px; min-width: 0; }
.cargo-doc .sh { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.cargo-doc .sn { font-family: var(--display); font-size: 15px; color: var(--accent-ink); letter-spacing: .06em; }
.cargo-doc h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 0; line-height: 1.15; text-wrap: balance; }
.cargo-doc h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.cargo-doc p { margin: 0; max-width: 72ch; }
.cargo-doc .lead { font-size: 17px; color: var(--soft); }
.cargo-doc .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cargo-doc .facts div { background: var(--paper); padding: 14px 18px; display: grid; gap: 2px; min-width: 0; }
.cargo-doc .facts dt { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cargo-doc .facts dd { margin: 0; font-weight: 500; }
.cargo-doc .mission { background: var(--paper); border-left: 4px solid var(--accent); padding: 16px 20px; border-radius: 0 10px 10px 0; font-size: 16.5px; }
.cargo-doc ol.legal { margin: 0; padding: 0; list-style: none; counter-reset: l; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 28px; }
.cargo-doc ol.legal li { counter-increment: l; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.cargo-doc ol.legal li::before { content: counter(l, decimal-leading-zero); font-family: var(--display); font-size: 20px; color: var(--accent-ink); line-height: 1.3; }
.cargo-doc .note { font-size: 13.5px; color: var(--muted); }
.cargo-doc .chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cargo-doc .link { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cargo-doc .lhead { background: var(--band); color: var(--band-ink); font-family: var(--display); font-size: 17px; letter-spacing: .02em; padding: 10px 16px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.cargo-doc .link ul, .cargo-doc .rot ul { margin: 0; padding: 12px 16px 14px 32px; display: grid; gap: 4px; font-size: 14.5px; }
.cargo-doc .support { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--head); border-radius: 10px; padding: 10px 16px; font-size: 14px; }
.cargo-doc .support b { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.cargo-doc .tw { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.cargo-doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cargo-doc th, .cargo-doc td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cargo-doc th { background: var(--head); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.cargo-doc tbody tr:last-child td { border-bottom: none; }
.cargo-doc .t-resp td:first-child, .cargo-doc .t-ind td:nth-child(2) { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cargo-doc .t-resp td:nth-child(2) { font-weight: 600; }
.cargo-doc .t-lim td:first-child { font-weight: 600; }
.cargo-doc .flow { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; gap: 14px; min-width: 0; }
.cargo-doc .flow figcaption { display: grid; gap: 6px; }
.cargo-doc .fmeta { display: flex; align-items: center; gap: 4px; }
.cargo-doc .fnum { font-family: var(--display); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-right: 10px; }
.cargo-doc .fcod { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--head); color: var(--soft); }
.cargo-doc .flow p { color: var(--soft); font-size: 14.5px; }
.cargo-doc .scroll { overflow-x: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.cargo-doc .scroll svg { display: block; max-width: none; }
.cargo-doc .rotgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.cargo-doc .rot { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: 10px; }
.cargo-doc .rot:nth-child(3) { border-top-color: var(--accent); }
.cargo-doc .rhead { font-family: var(--display); font-size: 18px; padding: 12px 16px 0; }
.cargo-doc footer { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.cargo-doc svg .pool { fill: var(--paper); stroke: var(--line); stroke-width: 1.2; }
.cargo-doc svg .poolhead { fill: var(--head); stroke: var(--line); }
.cargo-doc svg .lane { fill: var(--lane); stroke: var(--line); }
.cargo-doc svg .lane.alt { fill: var(--lane-alt); }
.cargo-doc svg .lanehead { fill: var(--head); stroke: var(--line); }
.cargo-doc svg .poolt { font: 600 13px var(--body); fill: var(--ink); }
.cargo-doc svg .lanet { font: 600 11.5px var(--body); fill: var(--ink); }
.cargo-doc svg .task { fill: var(--task); stroke: var(--ink); stroke-width: 1.4; }
.cargo-doc svg .t { font: 500 12px var(--body); fill: var(--ink); }
.cargo-doc svg .lbl { font: 400 11px var(--body); fill: var(--muted); }
.cargo-doc svg .flbl { font: 600 11px var(--body); fill: var(--link); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.cargo-doc svg .ev-start { fill: var(--task); stroke: var(--start); stroke-width: 2; }
.cargo-doc svg .ev-inner { fill: none; stroke: var(--start); stroke-width: 1; }
.cargo-doc svg .ev-end { fill: var(--task); stroke: var(--end); stroke-width: 4; }
.cargo-doc svg .clock, .cargo-doc svg .env { fill: none; stroke: var(--start); stroke-width: 1.4; }
.cargo-doc svg .gw { fill: var(--task); stroke: var(--gw); stroke-width: 2; }
.cargo-doc svg .gwx { stroke: var(--gw); stroke-width: 2.4; }
.cargo-doc svg .doc { fill: var(--task); stroke: var(--muted); stroke-width: 1.2; }
.cargo-doc svg .flow { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.cargo-doc svg .msgf { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-dasharray: 6 4; }
.cargo-doc svg .assoc { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.cargo-doc svg .ah { fill: var(--ink); }
.cargo-doc svg .aho { fill: var(--paper); stroke: var(--muted); stroke-width: 1.2; }
.cargo-doc svg .gear { fill: none; stroke: var(--link); stroke-width: 2; stroke-dasharray: 2.2 1.6; }
.cargo-doc svg .gearh { fill: var(--link); }
.cargo-doc svg .usr { fill: var(--muted); }
@media (max-width: 720px) { .cargo-doc .facts { grid-template-columns: 1fr; } }
@media print {
  .cargo-doc { font-size: 11pt; }
  .cargo-doc .scroll { overflow: visible; }
  .cargo-doc .scroll svg { width: 100%; height: auto; }
  .cargo-doc .flow, .cargo-doc .tw, .cargo-doc .rot, .cargo-doc .link, .cargo-doc .facts, .cargo-doc .chain, .cargo-doc .legal { break-inside: avoid; }
  .cargo-doc main, .cargo-doc section { display: block; }
  .cargo-doc section { margin-top: 26px; break-inside: auto; }
  .cargo-doc section > * + * { margin-top: 12px; }
  .cargo-doc .sh, .cargo-doc .lead, .cargo-doc .flow figcaption { break-after: avoid; }
  .cargo-doc .flow { display: block; }
  .cargo-doc .flow + .flow { margin-top: 16px; }
  .cargo-doc .cover { break-after: avoid; }
  .cargo-doc main > section:nth-of-type(3) { break-before: page; }
}.cargo-doc { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.cargo-doc main { padding-top: 32px; }
.cargo-doc .cover-in { padding-block: 40px 36px; }
.cargo-doc .flow { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-width: 0; }
.cargo-doc .fmeta { flex-wrap: wrap; row-gap: 6px; }
.cargo-doc figcaption > * { min-width: 0; }
.cargo-doc a { color: var(--link); }
.cargo-doc .t-resp td a { text-decoration: none; }
.cargo-doc .t-resp td a:hover { text-decoration: underline; }
.cargo-doc .auto { margin-left: auto; align-self: center; display: inline-flex; gap: 6px; align-items: center; font: 600 12px var(--body); color: #2c5a1c; background: #e3f0dc; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.cargo-doc .auto svg { width: 13px; height: 13px; fill: currentColor; }
.cargo-doc .val { display: inline-block; font: 700 11px var(--body); letter-spacing: .02em; color: #6b4d05; background: #f3e3b3; padding: 1px 8px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.cargo-doc .sh { flex-wrap: wrap; }
.cargo-doc .goto { font: 600 12.5px var(--body); color: var(--link); text-decoration: none; margin-left: 8px; }
.cargo-doc .zoom { margin-left: auto; font: 600 12.5px var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.cargo-doc .swipe { display: none; font: 500 12px var(--body); color: var(--muted); }
.cargo-doc .from { font-size: 13px; }
.cargo-doc.embed { margin-top: 18px; }
.cargo-doc.embed main { padding-block: 24px 28px; gap: 18px; }
.cargo-doc.zoom-box { overflow: auto; max-height: 72vh; border: 0; border-radius: 0; background: #fff; }
.cargo-doc.zoom-box svg { display: block; max-width: none; }
.modal.modal-zoom { width: min(1500px, 100%); }
@media (min-width: 900px) { .cargo-doc .scroll svg { width: 100%; height: auto; } .cargo-doc .scroll.legend svg { width: auto; } }
@media (max-width: 899px) { .cargo-doc .swipe { display: block; } }
.cargo-head { margin-bottom: 14px; }
.notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.notice a { font-weight: 600; }

/* Cargos do setor */
.kick { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.roles-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 26px; }
.role-card { display: grid; grid-template-columns: 48px 1fr; gap: 14px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: var(--radius-m); padding: 18px; text-decoration: none; color: var(--ink); }
.role-card:hover { border-color: #b8c6d6; border-left-color: var(--blue-deep); }
.role-card .av { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.role-card .av svg { width: 26px; height: 26px; fill: #fff; }
.role-card h3 { font-size: 18px; }
.role-card p { margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.role-card .stats { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.role-card .stats b { color: var(--blue); font-size: 20px; display: block; line-height: 1.1; }
.box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; }
.box-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.box-h h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; max-width: 70ch; }
.box-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 80ch; }
.box .legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mx-wrap { overflow-x: auto; }
table.mx { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; min-width: 760px; }
.mx th, .mx td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.mx thead th { font-size: 12px; font-weight: 700; color: var(--muted); vertical-align: bottom; line-height: 1.3; background: #f7f9fb; }
.mx thead th.me { color: var(--blue-deep); background: var(--blue-soft); border-radius: 8px 8px 0 0; }
.mx td.me { background: #f2f7fc; }
.mx tbody tr:last-child td { border-bottom: 0; }
.mx th:first-child, .mx td:first-child { text-align: left; }
.mx td:first-child a { color: var(--ink); text-decoration: none; font-weight: 600; }
.mx td:first-child a:hover { color: var(--blue); text-decoration: underline; }
.mx tbody tr:hover td { background: #f7f9fb; }
.mx tbody tr:hover td.me { background: #e8f1fa; }
.mx tfoot td { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 0; padding-top: 10px; }
.r { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.r.ex { background: var(--blue); color: #fff; }
.r.pa { background: #e9eef4; color: #4a5a6c; font-weight: 600; }
.dash { color: #c3ccd6; }
.cargo-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; align-items: start; }
.cargo-form textarea.in { font-size: 14px; line-height: 1.45; }
@media (max-width: 560px) { .cargo-form { grid-template-columns: minmax(0, 1fr); } .roles-cards { grid-template-columns: minmax(0, 1fr); } }

/* Cadeia de valor */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; }
.kpi b { display: block; font-size: 28px; color: var(--blue); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi .bar { height: 6px; border-radius: 3px; background: #e3e9f0; margin-top: 8px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--blue); }
.vc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; display: grid; gap: 14px; }
.vc-h h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.vc-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 90ch; }
.band { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.band > .lbl { border-radius: var(--radius-s); padding: 12px 14px; font-weight: 700; font-size: 14px; display: flex; flex-direction: column; justify-content: center; }
.band > .lbl small { font-weight: 500; font-size: 12px; opacity: .8; margin-top: 2px; }
.band.g > .lbl, .band.a > .lbl { background: #e9eef4; color: var(--ink); }
.band.f > .lbl { background: var(--blue); color: #fff; }
.band .row { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.vchain { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)) 120px; gap: 6px; }
.mp { background: #f7f9fb; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; display: flex; flex-direction: column; }
.mp .h { background: var(--blue-deep); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 26px 10px 14px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); min-height: 44px; display: flex; align-items: center; }
.mp .b { padding: 10px; display: grid; gap: 6px; flex: 1; align-content: start; }
.mp .sup { background: #eef6ea; border-top: 1px dashed var(--line); padding: 8px 10px 10px; font-size: 12px; color: var(--muted); }
.mp .sup b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; color: var(--leaf-ink); }
.mp .sup span { display: block; }
.out { border-radius: var(--radius-s); background: var(--leaf); color: var(--leaf-ink); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.vs { display: block; border-radius: var(--radius-s); padding: 9px 11px; font-size: 13px; text-decoration: none; min-width: 0; }
.vs b { display: block; font-size: 13.5px; line-height: 1.25; }
.vs span { font-size: 12px; }
.vs.ok { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.vs.ok span { color: #d5e4f3; }
a.vs.ok:hover { background: var(--blue-deep); }
.vs.todo { border: 1px dashed #b8c6d6; color: var(--muted); background: #fff; }
.vs.todo b { color: #4a5a6c; font-weight: 600; }
.legend2 { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.legend2 i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.foot2 { font-size: 13px; color: var(--muted); margin: 0; }
fieldset.fin { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 14px 12px; margin: 0 0 10px; }
fieldset.fin legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
@media (max-width: 860px) {
  .nav { overflow-x: auto; } .nav a { white-space: nowrap; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .band { grid-template-columns: minmax(0, 1fr); }
  .band .row { grid-template-columns: 1fr 1fr; }
  .vchain { grid-template-columns: minmax(0, 1fr); }
  .vc { padding: 14px; }
}
@media print {
  .cargo-doc { border: 0; }
  .cargo-doc svg .lane { display: inline !important; }
  .notice, .cargo-doc .zoom, .cargo-doc .goto, .cargo-doc .swipe { display: none !important; }
  .cargo-doc .cover, .cargo-doc .cover *, .mp .h, .vs.ok, .band .lbl, .out, .r { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =================== Segurança: mostrar senha, recuperação e troca obrigatória =================== */
.pw { position: relative; display: block; }
.pw .in { padding-right: 46px; width: 100%; }
.pw .eye { position: absolute; right: 1px; top: 6px; bottom: 1px; width: 40px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0; background: transparent; color: var(--muted); cursor: pointer; }
.pw .eye svg { width: 20px; height: 20px; }
.pw .eye:hover { color: var(--blue); }
.pw .eye:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.pw .eye[aria-pressed="true"] { color: var(--blue); }
.pw input::-ms-reveal { display: none; }
.forgot { text-align: center; margin: 14px 0 0; }
.link { background: none; border: 0; padding: 4px; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--blue-deep); }
.sent { width: 100%; max-width: 340px; }
.sent-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: 14px; }
.steps-mini { margin: 0 0 22px; padding-left: 20px; color: var(--ink); font-size: 14px; }
.steps-mini li + li { margin-top: 4px; }
.rules { list-style: none; margin: -6px 0 14px; padding: 0; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.rules li { display: flex; align-items: center; gap: 8px; }
.rules li::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c3ccd6; box-sizing: border-box; flex: none; }
.rules li.ok { color: var(--leaf-ink); }
.rules li.ok::before { border-color: var(--leaf-ink); background: var(--leaf-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2 4.8-4.8' fill='none' stroke='white' stroke-width='1.8'/%3E%3C/svg%3E") center/10px no-repeat; }

/* =================== Simulação do fluxo BPMN =================== */
.cargo-doc .sim-btn { margin-left: auto; font: 600 12.5px var(--body); color: #fff; background: var(--link); border: 1px solid var(--link); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.cargo-doc .sim-btn + .zoom { margin-left: 6px; }
.cargo-doc .simulating .sim-btn { background: var(--paper); color: var(--end); border-color: var(--end); }
.cargo-doc .sim-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: #fff7e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 9px 12px; font: 500 14px var(--body); color: var(--ink); }
.cargo-doc .sim-bar[hidden] { display: none; }
.cargo-doc .sim-now { flex: 1 1 260px; }
.cargo-doc .sim-q { display: block; font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.cargo-doc .sim-ctrl, .cargo-doc .sim-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.cargo-doc .sim-chip { font: 600 12.5px var(--body); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.cargo-doc .sim-chip:hover { border-color: var(--link); color: var(--link); }
.cargo-doc .sim-chip.pick { background: var(--link); border-color: var(--link); color: #fff; }
.cargo-doc .sim-chip.pick:hover { filter: brightness(1.1); color: #fff; }
.cargo-doc svg .sim-dot { fill: #E8A21A; stroke: #fff; stroke-width: 2; }
.cargo-doc svg .sim-halo { fill: #E8A21A; opacity: .25; animation: simpulse 1.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes simpulse { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(1.6); opacity: 0; } }
.cargo-doc svg .sim-on { stroke: #E8A21A !important; stroke-width: 3.5 !important; }
.cargo-doc svg rect.task.sim-on { fill: #fff4dc; }
.cargo-doc svg .sim-done { stroke: #2F8A4C; }
.cargo-doc svg rect.task.sim-done { fill: #eef7f0; }
.cargo-doc svg path.sim-path { stroke: #E8A21A; stroke-width: 2.4; }
@media (prefers-reduced-motion: reduce) { .cargo-doc svg .sim-halo { animation: none; } }
@media print { .cargo-doc .sim-btn, .cargo-doc .sim-bar { display: none !important; } }
/* Fluxos importados do Bizagi */
.cargo-doc svg .ev-mid { fill: var(--task); stroke: #C98A13; stroke-width: 1.6; }
.cargo-doc svg .ev-mid-in { fill: none; stroke: #C98A13; stroke-width: 1.2; }
.cargo-doc svg .env-mid { fill: none; stroke: #C98A13; stroke-width: 1.3; }
.cargo-doc svg .gwo { fill: none; stroke: var(--gw); stroke-width: 2.4; }
.cargo-doc svg .submark { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.cargo-doc .scroll svg.abs { width: max(100%, var(--w)); max-width: none; height: auto; }
.imp-row.flowrow { grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); }
@media (max-width: 700px) { .imp-row.flowrow { grid-template-columns: minmax(0, 1fr); } }
.imp-prev .cargo-doc.embed { margin: 0; border: 0; }
.imp-prev .cargo-doc.embed main { padding: 10px 0 0; }
.imp-prev .cargo-doc .flow { padding: 0; border: 0; }
.cargo-doc .linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--end); text-decoration: underline; cursor: pointer; }
.cargo-doc svg .jump, svg .jump{fill:none;stroke:none;pointer-events:none}
.rs-cargos .rs-bar { grid-template-columns: minmax(120px, 34%) 1fr 34px; }
@media (max-width: 760px) { .rs-cargos .rs-bar { grid-template-columns: minmax(110px, 46%) 1fr 28px; } }
@media (max-width: 760px) { .rs-cargos .rs-bl { white-space: normal; line-height: 1.25; } }
