:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  color: #18312b;
  background: #f5f7f3;
  --ink: #18312b;
  --muted: #526762;
  --green: #176141;
  --deep: #102a23;
  --accent: #c9eead;
  --line: #dfe7df;
  --paper: #fff;
  --radius: 18px;
  --shadow: 0 2px 5px #16332b08, 0 8px 24px #16332b05;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #44976b; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; vertical-align: middle; flex: none; }
button svg { width: 17px; height: 17px; }

.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side {
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
  padding: 29px 17px 18px; overflow: auto; color: #fff;
  background: radial-gradient(ellipse at 8% -25%, #235441 0, transparent 58%), #112b24;
}
.brand { display: flex; gap: 12px; align-items: center; margin: 0 8px 34px; font-size: 21px; letter-spacing: -.055em; line-height: 1.12; font-weight: 760; }
.brand small { display: block; color: #b7cdc2; font-size: 12px; font-weight: 530; letter-spacing: .015em; margin-top: 5px; }
.brand-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #224b32; background: var(--accent); flex: none; }
.brand-icon svg { width: 24px; height: 24px; }
.nav-label { margin: 21px 11px 8px; color: #a1bbaf; font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.nav-link { display: flex; gap: 11px; align-items: center; min-height: 43px; padding: 9px 11px; margin-bottom: 3px; color: #dce9e2; border: 1px solid transparent; border-radius: 10px; font-size: 14px; }
.nav-link svg { width: 18px; height: 18px; color: #b9d4c4; }
.nav-link:hover, .nav-link[aria-current=page] { background: #25483a; color: #fff; }
.nav-link[aria-current=page] { border-color: #426750; font-weight: 700; }
.nav-link[aria-current=page] svg { color: var(--accent); }
.side-bottom { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 12px 10px; border: 1px solid #355549; border-radius: 12px; color: #f3faf3; font-size: 13px; }
.side-bottom small { display: block; color: #adc7b8; margin-top: 2px; }
.connection-icon { display: grid; place-items: center; color: #c4e7b2; width: 29px; height: 29px; border-radius: 9px; background: #254539; }
.connection-icon svg { width: 15px; height: 15px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 70px; padding: 0 38px; background: #fff; border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.crumb strong { color: var(--ink); font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.account-tag { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 680; }
.account-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--green); background: #edf4e8; }
.account-avatar svg { width: 16px; height: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; background: var(--green); color: #fff; font-size: 14px; font-weight: 720; white-space: nowrap; }
.button:hover { background: #0e4c32; }
.button.quiet, .icon-button { border: 1px solid #d9e4dc; color: var(--ink); background: #fff; }
.button.quiet:hover, .icon-button:hover { background: #edf4eb; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.mobile-only { display: none; }

main { max-width: 1510px; margin: 0 auto; padding: 30px 38px 36px; }
.hero {
  display: flex; align-items: center; min-height: 215px; position: relative; isolation: isolate; overflow: hidden;
  padding: 30px 32px; border-radius: 22px; color: #fff;
  background: radial-gradient(ellipse at 88% 45%, #336557 0%, transparent 55%), linear-gradient(108deg,#15382e 15%,#1c473a 70%,#234d3d);
  box-shadow: 0 9px 24px #16392c16;
}
.hero-copy { position: relative; z-index: 2; max-width: min(70%, 610px); }
h1 { margin: 0; font-size: clamp(30px, 3.4vw, 49px); font-weight: 760; letter-spacing: -.06em; line-height: 1.035; }
.hero p { margin: 11px 0 0; color: #e1ece4; line-height: 1.45; }
.hero-tag { font-size: 13px; color: #ceefbb; font-weight: 650; letter-spacing: .035em; margin-bottom: 10px; }
.hero .button { margin-top: 20px; background: var(--accent); color: #1d382a; box-shadow: 0 4px 10px #09231a35; }
.hero .button:hover { background: #ddf7c7; }
.hero::after { content: ""; position: absolute; width: 294px; height: 294px; right: 43px; top: 50%; transform: translateY(-50%); border: 1px solid #cfe8b42f; border-radius: 50%; box-shadow: 0 0 0 26px #cfe8b41c, 0 0 0 56px #cfe8b410; z-index: -1; }
.hero-art { position: absolute; right: 54px; top: 50%; transform: translateY(-50%); width: 260px; height: 172px; pointer-events: none; }
.art-card { width: 94px; height: 118px; position: absolute; border-radius: 16px; }
.art-back { top: 20px; left: 102px; transform: rotate(17deg); border: 1px solid #cbefb27a; background: #b4df9e32; }
.art-front { top: 24px; left: 69px; transform: rotate(-12deg); padding: 14px; background: linear-gradient(150deg,#edf8de,#c6e6ba); border: 1px solid #e7fad6; box-shadow: 0 12px 28px #102c245f; }
.art-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #215e3e; background: #a9d59f; }
.art-symbol svg { width: 19px; height: 19px; }
.art-front > span { display: block; width: 55px; height: 5px; margin-top: 13px; border-radius: 5px; background: #8ebd8c; }
.art-front > span:last-child { width: 35px; margin-top: 7px; }
.art-check { display: grid; place-items: center; position: absolute; top: 101px; left: 157px; width: 37px; height: 37px; border: 1px solid #e6f9d4; border-radius: 12px; color: #215337; background: #c9eead; box-shadow: 0 6px 12px #1531274d; }
.art-check svg { width: 20px; height: 20px; }

.metrics, .stage-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin: 18px 0; }
.metric, .panel, .stage-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric { display: grid; gap: 8px; padding: 15px; }
.metric:hover, .stage-card:hover { border-color: #9fbea5; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 650; }
.metric strong, .stage-details strong { color: var(--ink); font-size: 29px; font-weight: 760; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: 13px; }
.stage-card { display: flex; gap: 11px; align-items: center; padding: 14px 15px; text-align: left; }
.stage-card[aria-pressed=true] { border-color: #70a57d; background: #f5faf2; box-shadow: inset 0 0 0 1px #70a57d; }
.stage-details { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 14px; font-weight: 650; }
.tile-icon, .register-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; color: #286a47; background: #e8f2e3; }
.tile-icon svg, .register-icon svg { width: 18px; height: 18px; }
.stage-card:nth-child(2) .tile-icon { color: #72512a; background: #f7efd9; }
.stage-card:nth-child(3) .tile-icon { color: #356684; background: #e5f0f7; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(248px,1fr); gap: 15px; align-items: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.035em; line-height: 1.2; }
.text-link { color: #216341; white-space: nowrap; font-weight: 710; font-size: 14px; }
.text-link:hover, .link:hover, .attachments a:hover { text-decoration: underline; }
.hero + .records-panel { margin-top: 18px; }
.register-heading { display: flex; align-items: center; gap: 10px; }
.register-icon { width: 32px; height: 32px; }
.record-count { padding: 5px 9px; border-radius: 99px; color: var(--muted); background: #eef3ee; font-size: 13px; font-weight: 650; white-space: nowrap; }
.tools { display: flex; gap: 10px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
input, select, textarea { min-width: 0; min-height: 41px; padding: 9px 11px; border: 1px solid #d3dfd6; border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #53936b; outline-offset: 1px; }
textarea { min-height: 85px; resize: vertical; }
select { appearance: none; padding-right: 35px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23526762' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 11px center; }
.search-field { position: relative; width: min(355px,100%); }
.search-field svg { position: absolute; top: 12px; left: 12px; width: 18px; height: 18px; color: #637e71; pointer-events: none; }
.search-field input { width: 100%; padding-left: 36px; }
.checkline { display: flex; align-items: center; gap: 7px; padding: 0 3px; color: var(--muted); font-size: 14px; cursor: pointer; }
.checkline input { width: 17px; height: 17px; min-height: 0; accent-color: var(--green); }
.table-wrap { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 13px 17px; vertical-align: middle; border-bottom: 1px solid #eaf0ea; }
th { color: #4a6157; background: #f5f8f3; font-size: 13px; white-space: nowrap; }
td { overflow-wrap: break-word; }
tbody tr:nth-child(even) { background: #fafbf8; }
tbody tr:hover { background: #f1f7ee; }
tbody tr:last-child td { border-bottom: 0; }
.link { border: 0; padding: 0; background: none; text-align: left; color: #216341; }
.record-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 720; }
.row-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: none; color: #568665; background: #edf4e9; border-radius: 8px; }
.row-icon svg { width: 14px; height: 14px; }
.sub { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 500; }
.badge { display: inline-flex; gap: 6px; align-items: center; padding: 5px 9px; border-radius: 20px; background: #eaf0ed; color: #405b53; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.badge.green { background: #e3f3e1; color: #275f3d; }
.badge.amber { background: #faefd7; color: #80541b; }
.badge.blue { background: #e4eff8; color: #2c5e85; }
.badge.red { background: #fce9e5; color: #983d32; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 34px 18px 37px; text-align: center; }
.empty-state.compact { padding-block: 25px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 0 3px; border-radius: 16px; background: linear-gradient(135deg,#ecf5e6,#dcebd7); color: #286a47; }
.empty-icon svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.empty-state p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.4; font-size: 14px; }
.empty-state .button { margin-top: 6px; }
.empty { margin: 0; padding: 23px 15px; text-align: center; color: var(--muted); }

.progress-list { display: grid; gap: 14px; padding: 16px 19px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 7px; font-size: 14px; }
.progress-label span:last-child { color: var(--muted); font-size: 13px; white-space: nowrap; }
.bar { height: 7px; margin-top: 6px; overflow: hidden; border-radius: 8px; background: #e7efe6; }
.bar span { display: block; height: 100%; border-radius: 8px; background: #399063; }
.due { margin-top: 16px; }
.due > ul, .attachments, .history { list-style: none; padding: 0; margin: 0; }
.due li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 10px 18px; font-size: 14px; }
.due li button, .attachments a { color: #216341; font-weight: 700; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin: 8px 0 0; }

dialog { width: min(680px,calc(100% - 26px)); max-height: calc(100dvh - 26px); padding: 0; border: 1px solid var(--line); border-radius: 19px; color: var(--ink); box-shadow: 0 24px 80px #102e3f48; }
dialog::backdrop { background: #102c23a0; backdrop-filter: blur(3px); }
.dialog-head, .dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 14px 19px; background: #fff; }
.dialog-head { border-bottom: 1px solid var(--line); }
dialog .dialog-head { position: sticky; top: 0; z-index: 1; }
.dialog-foot { border-top: 1px solid var(--line); justify-content: flex-end; flex-wrap: wrap; }
dialog .dialog-foot { position: sticky; bottom: 0; z-index: 1; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 13px; padding: 17px 19px; border: 0; margin: 0; min-inline-size: 0; }
.fields label { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 650; }
.fields .wide { grid-column: 1 / -1; }
.fields :disabled { opacity: 1; }
.dialog-info { padding: 11px 19px 16px; line-height: 1.5; }
.note { margin: 0; color: var(--muted); font-size: 14px; }
.record-meta, .record-extra { padding: 13px 19px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.record-meta { color: var(--muted); background: #f5f8f2; font-size: 13px; }
.record-extra h3, .dialog-info h3 { margin: 0 0 8px; font-size: 16px; }
.history > li, .attachments > li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history summary { cursor: pointer; font-weight: 650; }
.history summary .sub { display: inline; margin-left: 7px; }
.history ul { padding: 6px 0 0 20px; white-space: pre-wrap; }
.file-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-tools input { max-width: 100%; }
.archive { margin-right: auto; }
.warning { color: #992e2e; font-size: 14px; }
.editor-error { margin: 0; padding: 0 19px 12px; }
.editor-error:empty, #member-error:empty { display: none; }
.button:disabled { opacity: .55; cursor: wait; }
#toast { position: fixed; right: 19px; bottom: 19px; z-index: 6; padding: 10px 15px; border-radius: 10px; background: var(--deep); color: #fff; font-weight: 650; font-size: 14px; box-shadow: var(--shadow); }
#toast:empty { display: none; }

@media (max-width: 1060px) {
  .layout { grid-template-columns: 210px minmax(0,1fr); }
  main,.top { padding-left: 23px; padding-right: 23px; }
  .hero-art { right: 0; }
  .hero::after { right: -10px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .stage-card { padding: 12px 9px; gap: 7px; }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .side { display: none; position: fixed; top: 62px; left: 0; width: 237px; height: calc(100dvh - 62px); z-index: 4; box-shadow: 10px 0 30px #16392c30; }
  .side.open { display: flex; }
  .mobile-only { display: grid; flex: none; }
  .top { min-height: 62px; padding: 0 13px; justify-content: flex-start; }
  .top-actions { margin-left: auto; }
  .account-tag,.crumb > span { display: none; }
  main { padding: 17px 13px 24px; }
  .hero { min-height: 181px; padding: 22px; border-radius: 17px; }
  .hero-copy { max-width: 76%; }
  .hero-art { right: -61px; transform: translateY(-50%) scale(.7); }
  .hero::after { right: -155px; }
  .metrics,.stage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-block: 12px; }
  .panel-head,.tools { padding-inline: 13px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
  .history summary .sub { display: block; margin-left: 13px; }
}
@media (max-width: 420px) {
  .hero-copy { max-width: 100%; }
  .hero-art { display: none; }
  .fields { grid-template-columns: 1fr; }
  .button { padding-inline: 10px; }
  .metric { padding: 11px; }
}
@media (prefers-reduced-motion:no-preference) {
  .button,.nav-link,.metric,.stage-card { transition: background-color .14s ease,border-color .14s ease; }
}
.form-group { min-inline-size: 0; margin: 15px 19px; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.form-group legend { margin-left: 11px; padding: 0 6px; color: #365d49; font-size: 14px; font-weight: 730; }
.form-group .fields { padding: 12px 13px 14px; }

button.account-tag { border: 1px solid transparent; border-radius: 12px; background: transparent; padding: 4px 7px 4px 4px; cursor: pointer; }
button.account-tag:hover { border-color: var(--line); background: #f5f8f3; }
.account-tag .account-avatar { background: none; }
.member-avatar { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; font-size: 14px; font-weight: 780; }
.account-avatar .member-avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.member-avatar svg { width: 20px; height: 20px; }
.account-avatar .member-avatar svg { width: 15px; height: 15px; }
.member-avatar.sage { background: #e3f1df; color: #315b3e; }
.member-avatar.sky { background: #e0eff9; color: #245779; }
.member-avatar.violet { background: #f0e8fa; color: #684382; }
.member-avatar.amber { background: #f8efd8; color: #79511b; }
.member-avatar.rose { background: #fae9ee; color: #8c3d56; }
.member-avatar.teal { background: #ddf3ed; color: #20695d; }
.member-avatar.indigo { background: #e8ebfb; color: #464d86; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(220px,100%),1fr)); gap: 12px; padding: 16px 20px; }
.member-card { display: grid; grid-template-rows: auto 1fr auto auto; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fcfdfb; }
.member-card-top,.member-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.member-card h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.member-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.member-meta { color: var(--muted); font-size: 13px; padding: 8px 0; border-top: 1px solid var(--line); }
.member-meta span:first-child { color: var(--green); font-weight: 700; }
.member-card .button { justify-self: start; }
.member-events { margin: 0; padding: 0; list-style: none; }
.member-events li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: 14px; }
.member-events li:last-child { border-bottom: none; }
.avatar-picker,.permission-grid { min-inline-size: 0; border: 1px solid var(--line); border-radius: 13px; margin: 4px 19px 13px; padding: 10px 12px 12px; }
.avatar-picker legend,.permission-grid legend { font-size: 14px; font-weight: 720; padding-inline: 5px; }
.avatar-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.avatar-options label { position: relative; cursor: pointer; }
.avatar-options input { position: absolute; opacity: 0; }
.avatar-option { display: grid; gap: 5px; justify-items: center; padding: 6px 2px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 12px; }
.avatar-option:hover,.avatar-options input:checked + .avatar-option { border-color: #81ad89; background: #f1f8ef; color: var(--ink); }
.avatar-options input:focus-visible + .avatar-option { outline: 2px solid #44976b; outline-offset: 1px; }
.permission-grid label { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px,38%); align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.permission-grid label:last-child { border-bottom: 0; }
.permission-grid label span { display: flex; align-items: center; gap: 8px; }
.permission-grid label svg { width: 17px; height: 17px; color: var(--green); }
.member-access { padding-block: 7px 14px; }
@media(max-width:760px){
  button.account-tag { display: flex; }
  button.account-tag #identity { display: none; }
  .top-actions { gap: 4px; }
  .member-grid { padding: 13px; }
}

/* ---------- Integração: alertas, riscos e documentação do SG ---------- */
.metrics { grid-template-columns: repeat(auto-fit,minmax(165px,1fr)); }
.alerts .alert-list { list-style: none; margin: 0; padding: 0; }
.alerts .alert-list li { display: flex; gap: 11px; align-items: flex-start; justify-content: flex-start; }
.alert-dot { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; }
.alert-dot svg { width: 15px; height: 15px; }
.alert-dot.red { background: #fce9e5; color: #983d32; }
.alert-dot.amber { background: #faefd7; color: #80541b; }
.alert-more { padding: 8px 18px 12px; }
.record-alerts { display: grid; gap: 6px; padding: 12px 19px; border-bottom: 1px solid var(--line); background: #fffbf3; }
.record-alerts p { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 14px; }
.record-alerts p svg { width: 16px; height: 16px; margin-top: 2px; }
.record-alerts .red { color: #983d32; }
.record-alerts .amber { color: #80541b; }

.risk-grid { display: grid; grid-template-columns: minmax(280px,380px) minmax(0,1fr); gap: 15px; margin: 18px 0; }
.heat { display: grid; grid-template-columns: 62px repeat(3,1fr); gap: 5px; padding: 4px 18px 16px; }
.heat-cap { margin: 12px 18px 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.heat-axis { display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 650; }
.heat-cell { display: grid; place-items: center; min-height: 52px; border-radius: 9px; font-size: 19px; font-weight: 760; }
.heat-cell.lo { background: #e3f3e1; color: #275f3d; }
.heat-cell.mid { background: #faefd7; color: #80541b; }
.heat-cell.hi { background: #fce9e5; color: #983d32; }
.risk-count { display: flex; gap: 8px; flex-wrap: wrap; }

.docs-panel { margin-top: 18px; }
.docs-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.docs-tab, .chip { padding: 8px 13px; border: 1px solid #d9e4dc; border-radius: 99px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 650; }
.docs-tab:hover, .chip:hover { background: #edf4eb; }
.docs-tab[aria-pressed=true], .chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.docs-body { padding: 18px 20px 22px; }
.docs-intro { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.docs-body > .docs-intro:last-child { margin: 14px 0 0; }
.policy-grid { display: grid; gap: 14px; }
.policy { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.policy header { padding: 14px 18px; background: #f5f8f3; border-bottom: 1px solid var(--line); }
.policy h3 { margin: 0; font-size: 17px; }
.policy-text { padding: 6px 18px; font-size: 15px; line-height: 1.55; }
.policy footer { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.policy footer .button { margin-left: auto; min-height: 36px; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 11px; }
.doc-card { display: grid; gap: 6px; align-content: start; justify-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fcfdfb; text-align: left; color: var(--ink); }
.doc-card:hover { border-color: #9fbea5; background: #f5faf2; }
.doc-code { font-family: ui-monospace,Consolas,monospace; font-size: 13px; font-weight: 750; color: var(--green); }
.doc-card strong { font-size: 15px; line-height: 1.3; }
.wide-dialog { width: min(820px,calc(100% - 26px)); }
.proc h4 { margin: 16px 0 6px; color: var(--green); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.proc ol { padding-left: 20px; } .proc li { margin: 5px 0; }
.proc-ctrl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13px; margin-top: 6px; }
.proc-ctrl div { padding: 8px 10px; border-right: 1px solid var(--line); }
.proc-ctrl div:last-child { border-right: 0; }
.proc-ctrl span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

.pmap2 { display: grid; grid-template-columns: 140px minmax(0,1fr) 140px; gap: 12px; }
.pm-io { display: grid; align-content: center; gap: 6px; padding: 14px; border-radius: 14px; background: #1c473a; color: #fff; text-align: center; }
.pm-io span { color: #cfe8d6; font-size: 13px; }
.pm-mid { display: grid; gap: 9px; }
.pm-band { padding: 11px; border-radius: 13px; }
.pm-band h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #365d49; }
.pm-band.est { background: #eef4ec; } .pm-band.op { background: #e4f1e6; } .pm-band.ap { background: #f3f5f2; }
.pm-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 8px; }
.pm-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pm-box { display: grid; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; }
.pm-box span { color: var(--muted); font-size: 12px; }
.pm-arrow { color: var(--green); font-weight: 800; }

.flow-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.flow-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.flow-legend i { display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 3px; }
.lg-end { background: #1c473a; } .lg-p { background: #fff; border: 1.6px solid #176141; } .lg-d { background: #fff6df; border: 1.6px solid #c48a00; } .lg-s { background: #fbeceb; border: 1.2px dashed #d9534f; }
.lg-on { background: #176141; } .lg-on2 { background: #3c8dbc; } .lg-on3 { background: #d99a1e; }
.flow-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.flow-actions { display: flex; gap: 8px; }
.flow-actions .button { min-height: 36px; }
.flow-svg { padding: 12px; overflow-x: auto; }
.flow-svg svg { display: block; width: 100%; min-width: 680px; max-width: 900px; height: auto; margin: auto; }

.cal2 { display: grid; grid-template-columns: minmax(180px,240px) repeat(12,minmax(26px,1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: auto; font-size: 13px; }
.cal2 > div { padding: 7px 6px; border-bottom: 1px solid #eaf0ea; border-right: 1px solid #eaf0ea; }
.cal-h { background: #f5f8f3; color: #4a6157; font-weight: 700; text-align: center; font-size: 12px; }
.cal-h:first-child { text-align: left; }
.cal-a { font-weight: 650; } .cal-a .sub { font-size: 11.5px; margin-top: 1px; }
.cal-c.on { background: #176141; } .cal-c.on2 { background: #3c8dbc; } .cal-c.on3 { background: #d99a1e; }
.cal2 .cur { box-shadow: inset 0 0 0 2px #e07a2f; }

@media (max-width: 1060px) { .risk-grid { grid-template-columns: 1fr; } .pmap2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .proc-ctrl { grid-template-columns: 1fr 1fr; } .docs-body { padding: 14px 13px; } .policy footer .button { margin-left: 0; } }

/* ---------- Seções do portal do SG (Documentação do SG) ---------- */
.legacy { font-size: 14.5px; line-height: 1.5; }
.legacy .lead { color: var(--muted); margin: 0 0 16px; }
.legacy h3 { margin: 22px 0 10px; font-size: 16px; letter-spacing: -.02em; }
.legacy .legacy-sep { padding-top: 18px; border-top: 1px solid var(--line); font-size: 18px; }
.legacy .note { margin: 14px 0; padding: 12px 15px; border-left: 4px solid #4f9a6c; border-radius: 8px; background: #eef6ec; color: var(--ink); font-size: 14px; }
.legacy .warn { margin: 14px 0; padding: 12px 15px; border-left: 4px solid #b9821f; border-radius: 8px; background: #fbf2dd; font-size: 14px; }
.legacy .grid { display: grid; gap: 13px; }
.legacy .g2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.legacy .g3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.legacy .g4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.legacy .card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fcfdfb; }
.legacy .card h4 { margin: 0 0 6px; font-size: 15px; }
.legacy .card p { margin: 0; color: var(--muted); font-size: 14px; }
.legacy .field { display: grid; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 650; }
.legacy .types { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.legacy .type { position: relative; padding: 15px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.legacy .type:hover { border-color: #9fbea5; }
.legacy .type.sel { border-color: var(--green); background: #f2f8ef; }
.legacy .type.sel::after { content: "✓ Tipo declarado"; position: absolute; top: 12px; right: 12px; color: var(--green); font-size: 11px; font-weight: 760; }
.legacy .type h4 { margin: 0 0 6px; }
.legacy .type ul, .legacy ul.clean { margin: 6px 0 0; padding-left: 18px; }
.legacy .type li, .legacy ul.clean li { margin: 3px 0; }
.legacy .tw, .legacy .tblwrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.legacy td.code { font-family: ui-monospace,Consolas,monospace; font-weight: 700; color: var(--green); white-space: nowrap; }
.legacy .pyr { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.legacy .pyr div { padding: 10px; border-radius: 8px; color: #fff; text-align: center; font-size: 13px; }
.legacy .l1 { width: 36%; background: #102a23; } .legacy .l2 { width: 54%; background: #1c473a; } .legacy .l3 { width: 72%; background: #2c6b50; } .legacy .l4 { width: 90%; background: #4f9a6c; }
.legacy .flow { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); margin-top: 6px; }
.legacy .step { position: relative; padding: 0 6px; text-align: center; }
.legacy .step .n { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 760; }
.legacy .step:not(:last-child)::after { content: ""; position: absolute; top: 20px; left: 50%; width: 100%; height: 2px; background: #bcd6c3; }
.legacy .step b { display: block; font-size: 13.5px; }
.legacy .step span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.legacy .step em { display: inline-block; margin-top: 5px; padding: 1px 8px; border-radius: 10px; background: #e8f2e3; color: var(--green); font-size: 11px; font-style: normal; font-weight: 700; }
.legacy .gate { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.legacy .gate .card { border-left: 4px solid var(--green); }
@media (max-width: 1060px) { .legacy .g4,.legacy .g3,.legacy .types,.legacy .gate { grid-template-columns: repeat(2,minmax(0,1fr)); } .legacy .flow { grid-template-columns: repeat(4,minmax(0,1fr)); row-gap: 14px; } .legacy .step::after { display: none; } }
@media (max-width: 640px) { .legacy .g4,.legacy .g3,.legacy .g2,.legacy .types,.legacy .gate,.legacy .flow { grid-template-columns: 1fr; } }

/* ---------- Requisitos da norma ---------- */
.req-chapter { margin-top: 16px; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 11px; padding: 16px 18px; }
.req-card { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fcfdfb; }
.req-card:hover { border-color: #9fbea5; background: #f5faf2; }
.req-card strong { font-size: 15px; line-height: 1.3; }
.req-card .bar { margin-top: 2px; }
.req-crumb { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.req-crumb a { color: #216341; font-weight: 700; }
.req-head { padding: 22px 24px; margin-bottom: 15px; }
.req-head-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.req-tag { color: var(--green); margin-bottom: 6px; }
.req-title { font-size: clamp(24px,2.6vw,34px); letter-spacing: -.045em; }
.req-head > p { margin: 12px 0 0; color: var(--muted); line-height: 1.55; font-size: 15.5px; }
.req-score { display: grid; justify-items: end; flex: none; padding: 10px 14px; border-radius: 12px; background: #eef6ec; }
.req-score strong { font-size: 26px; color: var(--green); letter-spacing: -.04em; }
.req-score span { color: var(--muted); font-size: 12.5px; }
.req-head + .panel, .req-head ~ .panel { margin-bottom: 15px; }
.req-acts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px 18px; }
.req-act { padding: 14px 16px; border-radius: 12px; background: #eef6ec; }
.req-act h4 { margin: 0 0 6px; color: #1f5a3b; font-size: 15px; }
.req-act p { margin: 0; font-size: 14px; line-height: 1.5; }
.req-docs { list-style: none; margin: 0; padding: 6px 18px 12px; }
.req-docs li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.req-docs li:last-child { border-bottom: 0; }
.req-docs li .sub { grid-column: 1 / -1; margin-top: 0; }
.doc-ref { font-weight: 650; color: #216341; text-align: left; }
.req-boxes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px 18px; }
.req-box { padding: 14px 16px; border-radius: 12px; }
.req-box h3 { margin: 0 0 6px; font-size: 15px; }
.req-box p { margin: 0; font-size: 14px; line-height: 1.5; }
.req-box.how { background: #e4f0f8; color: #1d4560; }
.req-box.who { background: #f1f3f0; }
.req-pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.req-pager .button { white-space: normal; text-align: center; }
.sim-link { font-family: ui-monospace,Consolas,monospace; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) { .req-acts,.req-boxes { grid-template-columns: 1fr; } .req-head-top { flex-direction: column; } .req-score { justify-items: start; } }
.req-approach { padding: 18px 22px 20px; }
.req-approach p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--ink); border-left: 4px solid #4f9a6c; padding-left: 14px; }
.req-items { list-style: none; margin: 0; padding: 6px 18px 14px; counter-reset: none; }
.req-items li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.req-items li:last-child { border-bottom: 0; }
.req-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req-item-head h4 { margin: 0; font-size: 15px; flex: 1; min-width: 180px; }
.req-ref { font-family: ui-monospace,Consolas,monospace; font-size: 12.5px; font-weight: 760; color: #fff; background: var(--green); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.req-items p { margin: 7px 0 8px; font-size: 14.5px; line-height: 1.55; }
.req-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.req-chip { padding: 3px 9px; border: 1px solid #cfe0d2; border-radius: 99px; background: #f3f8f1; color: #216341; font-family: ui-monospace,Consolas,monospace; font-size: 12px; font-weight: 700; }
.req-chip:hover { background: #e3f1df; }

/* ---------- v3 ---------- */
.month-bars { display: flex; gap: 10px; align-items: flex-end; height: 190px; padding: 18px 20px 6px; }
.mb { flex: 1; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; height: 100%; }
.mb-bar { display: flex; align-items: flex-end; width: 100%; max-width: 44px; background: #eef3ee; border-radius: 8px; overflow: hidden; }
.mb-bar span { display: block; width: 100%; min-height: 2px; background: #399063; border-radius: 8px 8px 0 0; }
.mb-n { font-weight: 760; font-size: 14px; } .mb-l { color: var(--muted); font-size: 12px; }
.gs-results h3 { margin: 14px 0 4px; font-size: 14px; color: var(--green); }
.gs-list { list-style: none; margin: 0; padding: 0; }
.gs-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
#search-dialog .search-field { width: 100%; margin-bottom: 6px; }
@media print { .side, .top, .demo-banner, #toast { display: none !important; } .layout { display: block; } }

/* v3 · fotos de perfil e utilizadores */
.member-avatar.has-photo{padding:0;overflow:hidden;background:#fff}
.member-avatar.has-photo img{width:100%;height:100%;object-fit:cover;display:block}
.account-avatar .member-avatar.has-photo{border-radius:50%}
.member-cargo{color:var(--green);font-weight:650;font-size:13px}
.photo-block{display:flex;gap:18px;align-items:center;padding:14px;border:1px solid var(--line,#dfe8df);border-radius:16px;margin-bottom:16px;background:#fafcf8}
.photo-preview .member-avatar{width:84px;height:84px;border-radius:50%;font-size:26px}
.photo-preview .member-avatar svg{width:34px;height:34px}
.photo-actions{display:grid;gap:5px}
.photo-buttons{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.photo-pick{cursor:pointer}
.brand-logo{width:150px;max-width:100%;background:#fff;border-radius:10px;padding:7px 10px;display:block}
.brand.has-logo{display:block}
.brand.has-logo small{margin-top:9px}
.sgi-grid,.norm-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin:6px 0 18px}
.norm-card{display:block;border:1px solid var(--line,#dfe8df);border-left:4px solid var(--green);border-radius:14px;padding:16px 18px;background:#fff;text-decoration:none;color:inherit}
.norm-card:hover{box-shadow:0 4px 16px rgba(30,60,40,.1)}
.norm-card h3{margin:0 0 5px;font-size:16px}
.norm-card p{margin:0;color:#4b5f54;font-size:13.5px}
.norm-card .go{display:inline-block;margin-top:10px;font-weight:700;color:var(--green);font-size:13px}
.sgi-group{margin:20px 0 6px;display:flex;gap:10px;align-items:baseline}
.sgi-group h3{margin:0;font-size:16px}
.folder-icons{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:10px 0 22px}
.folder-icons a{display:grid;gap:6px;justify-items:center;text-align:center;padding:18px 10px;border:1px solid var(--line,#dfe8df);border-radius:14px;background:#fff;color:inherit;text-decoration:none;font-weight:650}
.folder-icons a:hover{box-shadow:0 4px 16px rgba(30,60,40,.1)}

/* v3.1 · refinamentos de interface */
.norm-grid { margin-top: 16px; }
.top-actions { gap: 10px; }
@media (max-width: 760px) {
  #backup span:last-child { display: none; }
  #backup { padding-inline: 10px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric strong { font-size: 1.6rem; }
  .metric-label { font-size: .85rem; }
}
:focus-visible { outline: 3px solid #7cc68f; outline-offset: 2px; }
@media print {
  main { padding: 0 !important; }
  .hero { background: #fff !important; color: #000 !important; border: 1px solid #999; box-shadow: none; min-height: 0; }
  .hero * { color: #000 !important; } .hero-art, .hero .button, .norm-grid, .tools, button.icon-button { display: none !important; }
  .panel { break-inside: avoid; box-shadow: none; border: 1px solid #bbb; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75em; }
}
.password-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 14px 0 0; }
.password-box legend { font-weight: 700; padding: 0 6px; color: var(--green); }
.records td:nth-child(n+3), .records th { white-space: nowrap; }
.records td:nth-child(2) { min-width: 220px; }
