:root {
  color-scheme: light;
  --navy:#122b49; --deep:#0b1c32; --gold:#e2bb70; --ink:#14283f;
  --muted:#53637a; --line:#dbe3ee; --canvas:#f3f6f9; --white:#fff; --blue:#1d4b83;
  font: 16px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
* { box-sizing:border-box }
body { margin:0; color:var(--ink); background:var(--canvas) }
a { color:var(--blue); text-underline-offset:.2em }
:focus-visible { outline:3px solid #bf8627; outline-offset:3px }
.skip { position:absolute; left:-100vw; z-index:9; background:#fff; padding:12px }
.skip:focus { left:12px; top:12px }
h1,h2,h3,p { margin:0 0 .7rem }
h1 { font-size:clamp(1.65rem,3vw,2.6rem); line-height:1.15; letter-spacing:-.035em }
h2 { font-size:1.25rem }
h3 { font-size:1rem }
p:last-child { margin-bottom:0 }
small { font-size:.82rem }
.entry-card > p { color:var(--muted) }
.eyebrow { font-size:.71rem; font-weight:800; color:#735022!important; letter-spacing:.16em; margin-bottom:9px }
.workspace { min-width:0 }
.content { max-width:1300px; margin:auto; padding:clamp(18px,4vw,44px) }
.page-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px }
.page-head h1 { margin:0 }
.intro,.muted { color:var(--muted) }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin:20px 0 }
.metric,.card { background:var(--white); border:1px solid var(--line); border-radius:12px; box-shadow:0 2px 5px #17274009 }
.card { padding:clamp(15px,2.5vw,25px); margin-bottom:16px; min-width:0 }
.narrow { max-width:690px }
.fields,.filters,.metadata,.team { display:flex; gap:12px 16px; flex-wrap:wrap; align-items:end }
.fields > label,.filters > label:not(.check),.metadata > div { flex:1 1 170px }
.filters { margin-bottom:16px }
form > label,form > fieldset { display:block; margin:0 0 12px }
label,legend,dt { font-size:.83rem; font-weight:690 }
input:not([type=checkbox]),select,textarea { display:block; width:100%; min-width:0; border:1px solid #aebbd0; border-radius:7px; padding:8px 10px; background:#fff; color:var(--ink); font:inherit; font-weight:450; margin-top:4px }
textarea { resize:vertical }
fieldset { border:1px solid var(--line); border-radius:8px; margin-top:12px!important }
.check { display:flex; gap:8px; align-items:center }
input[type=checkbox] { width:16px; height:16px; accent-color:var(--blue) }
button,.button { display:inline-block; border:1px solid transparent; padding:9px 15px; color:#fff; background:var(--blue); border-radius:8px; cursor:pointer; text-decoration:none; font:inherit; font-size:.85rem; font-weight:750; line-height:1.5 }
button:hover,.button:hover { filter:brightness(1.15) }
.secondary { background:#e9eff7; color:#1b385c; border-color:#c4d2e4 }
.fields button,.filters button { margin-bottom:12px }
.notice { background:#e6f3ed; color:#124830; border:1px solid #adceb9; padding:10px 13px; border-radius:8px }
.notice.error { background:#fff0ef; color:#78251e; border-color:#ecc6c2 }
.table-wrap { overflow-x:auto }
table { width:100%; border-collapse:collapse; font-size:.91rem; text-align:left }
th { background:#edf2f8; color:#465772; font-size:.74rem; text-transform:uppercase; letter-spacing:.04em }
th,td { padding:11px; border-bottom:1px solid var(--line); vertical-align:top }
td { min-width:110px; overflow-wrap:anywhere }
.protocol { font-weight:800 }
.pill { display:inline-block; background:#eaf0f9; border-radius:20px; padding:3px 9px; font-size:.78rem; font-weight:720; color:#234771 }
.gold { background:#fff1d8; color:#684618 }
.overdue { color:#a92c21; font-weight:750 }
.pagination,.tags { display:flex; flex-wrap:wrap; gap:10px }
.pagination:not(:empty) { padding-top:14px }
.tags { margin-bottom:12px }
.metadata { align-items:start; background:#f3f6fb; border-radius:8px; padding:12px; margin:12px 0 16px }
dd { margin:2px 0 0; overflow-wrap:anywhere }
.preserve { white-space:pre-wrap; overflow-wrap:anywhere }
.split { display:grid; grid-template-columns:1.25fr 1fr; gap:16px }
.timeline { padding-left:20px }
.timeline li { margin-bottom:13px }
.timeline small { display:block; color:var(--muted) }
.files { padding-left:18px; overflow-wrap:anywhere }
details { border-top:1px solid var(--line); padding:10px 0 }
details form { margin-top:12px }
summary { color:var(--blue); font-weight:750; cursor:pointer }
.record { padding:13px 0; border-bottom:1px solid var(--line); display:flex; gap:12px; justify-content:space-between; align-items:start }
.record details { border-top:0; padding:0 }
footer { margin-top:21px; color:var(--muted); font-size:.77rem }
@media (max-width:600px) {
  .split { grid-template-columns:1fr; gap:0 }
  .record { display:block }
}

/* Estrutura do portal */
.ui-icon { width:20px; height:20px; flex:none; vertical-align:middle }
.masthead { grid-area:header; background:var(--navy); color:#fff; border-bottom:4px solid var(--gold) }
.institutional-strip,.masthead-inner { display:flex; align-items:center; justify-content:space-between; gap:12px 20px; padding-inline:clamp(16px,4vw,50px) }
.institutional-strip { padding-block:8px; background:var(--deep); color:#dce8f5; font-size:.66rem; font-weight:750; letter-spacing:.09em; flex-wrap:wrap }
.masthead-inner { min-height:82px; padding-block:12px }
.brand { display:flex; align-items:center; gap:13px; text-decoration:none; color:#fff; font-size:clamp(1rem,3vw,1.35rem); font-weight:780; line-height:1.2 }
.brand img { flex:none }
.brand small { display:block; margin-top:5px; font-size:.62rem; letter-spacing:.16em; color:#e2bb70 }
.access-tag { display:flex; align-items:center; gap:7px; border:1px solid #ffffff45; border-radius:6px; padding:6px 10px; color:#f5f8fb; font-size:.77rem; font-weight:700; white-space:nowrap }
.access-tag .ui-icon { width:15px; height:15px }
.public { min-height:100vh; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto 1fr auto; grid-template-areas:"header" "entry" "footer" }
.entry { grid-area:entry; display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); align-items:center; gap:clamp(20px,4vw,52px); width:min(1040px,100%); margin:auto; padding:clamp(20px,5vw,55px) }
.entry-intro { position:relative; overflow:hidden; isolation:isolate; min-height:300px; display:flex; flex-direction:column; justify-content:center; border-radius:14px; padding:clamp(24px,4vw,48px); background:linear-gradient(140deg,#1b4167,var(--deep)); color:#e1edf8; border-bottom:5px solid var(--gold) }
.entry-intro::after { content:""; position:absolute; z-index:-1; width:290px; height:320px; right:-78px; bottom:-125px; background:url("logo-cgcor.png") center/contain no-repeat; mix-blend-mode:screen; opacity:.08; transform:rotate(-12deg) }
.entry-intro .eyebrow { color:#f1cd83!important }
.entry-title { color:#fff; font-size:clamp(2rem,5vw,3.4rem); font-weight:800; line-height:1.04; letter-spacing:-.055em }
.entry-card { background:#fff; border:1px solid var(--line); border-top:4px solid var(--gold); border-radius:14px; padding:clamp(20px,4vw,34px); box-shadow:0 12px 35px #112c4a12 }
.entry-card h1 { font-size:clamp(1.55rem,3vw,2rem) }
.portal-footer { grid-area:footer; margin:0; padding:15px clamp(16px,4vw,50px); border-top:1px solid var(--line); background:#fff }

.private { min-height:100vh; display:grid; grid-template-columns:248px minmax(0,1fr); grid-template-rows:auto 1fr; grid-template-areas:"header header" "sidebar content" }
.sidebar { grid-area:sidebar; min-width:0; background:#fff; border-right:1px solid var(--line); display:flex; flex-direction:column; gap:24px; padding:22px 15px }
.sidebar nav p,.profile > p { color:#52657d; margin:12px 0 7px 10px; font-size:.66rem; font-weight:800; letter-spacing:.11em }
.sidebar nav p:first-child { margin-top:0 }
.sidebar nav a { display:flex; align-items:center; gap:10px; color:#233c57; padding:10px 11px; margin:3px 0; border-radius:7px; text-decoration:none; font-weight:660; font-size:.89rem }
.sidebar nav a:hover { background:#f0f4fa }
.sidebar nav a[aria-current],.sidebar nav a.nav-selected { background:#e7eff9; color:#153f70; box-shadow:inset 3px 0 #a77424 }
.sidebar nav .ui-icon { width:18px; height:18px }
.profile { margin-top:auto; padding:10px; background:#f2f5f9; border:1px solid #e2e9f1; border-radius:9px; overflow-wrap:anywhere }
.profile > p { margin:0 0 7px }
.profile small { display:block; color:var(--muted); margin:2px 0 9px }
.profile-actions { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:.8rem }
.profile .quiet { background:#fff; border:1px solid #becbdb; color:var(--blue); padding:4px 11px }
.workspace { grid-area:content }
.content { padding-top:23px }
.breadcrumb { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:14px; color:var(--muted); font-size:.78rem }
.page-head { align-items:center; padding:clamp(18px,3vw,27px); border:1px solid var(--line); border-left:4px solid #bb914a; border-radius:10px; background:#fff; margin-bottom:18px }
.page-head .intro { margin:8px 0 0; max-width:65ch }
.primary-action span { font-size:1rem; margin-right:2px }
.section-heading p { color:var(--muted); margin-top:-4px; font-size:.86rem }
.metric { display:flex; gap:10px; align-items:center; padding:clamp(10px,2vw,17px); min-height:86px }
.metric strong { display:block; line-height:1.1; font-size:clamp(1.25rem,2.5vw,1.85rem) }
.metric span:not(.metric-icon) { display:block; margin-top:3px; color:var(--muted); font-size:.78rem; font-weight:690 }
.metric-icon { display:grid; place-items:center; width:36px; height:36px; flex:none; border-radius:8px; background:#e8eff9; color:var(--blue) }
.metric-proximos .metric-icon,.status-triagem { background:#fff1d7; color:#694818 }
.metric-vencidos .metric-icon { background:#fbe9e7; color:#9a3529 }
.status-decidido { background:#e6f3ea; color:#1c5b40 }
.status-arquivado { background:#edf0f3; color:#475465 }
tbody tr:hover { background:#f6f9fd }
.empty { display:grid; justify-items:center; gap:5px; padding:24px 14px; text-align:center; border:1px dashed #bacbdd; border-radius:9px; color:var(--muted) }
.empty .ui-icon { width:25px; height:25px; color:var(--blue) }
.empty span { font-size:.88rem }
.case-nav { display:flex; flex-wrap:wrap; gap:4px 8px; margin-bottom:16px; padding:5px; background:#fff; border:1px solid var(--line); border-radius:9px }
.case-nav a { padding:8px 10px; font-size:.86rem; font-weight:700; border-radius:5px; text-decoration:none }
.case-nav a:hover { background:#e7eff9 }
.case-nav span { margin-left:3px; font-size:.74rem; color:#405773 }
.card[id] { scroll-margin-top:14px }
.card:target { border-color:#a77c32; box-shadow:0 0 0 2px #e2bb7052 }
.workspace-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:5px 12px; border-top:1px solid var(--line); padding-top:12px }
@media (max-width:960px) {
  .private { grid-template-columns:208px minmax(0,1fr) }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)) }
}
@media (max-width:750px) {
  .private { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto 1fr; grid-template-areas:"header" "sidebar" "content" }
  .sidebar { border-right:0; border-bottom:1px solid var(--line); padding:10px 15px; gap:8px }
  .sidebar nav { display:flex; flex-wrap:wrap; align-items:center; gap:3px }
  .sidebar nav p { display:none }
  .sidebar nav a { margin:0; padding:8px }
  .profile { display:flex; align-items:center; flex-wrap:wrap; gap:5px 12px; padding:7px 9px }
  .profile > p { display:none }
  .profile small { margin:0 }
  .profile-actions { margin-left:auto }
  .entry { grid-template-columns:minmax(0,1fr); gap:16px; max-width:530px }
  .entry-intro { min-height:0 }
  .entry-title { font-size:clamp(1.75rem,7vw,2.65rem) }
}
@media (max-width:420px) {
  .access-tag { border:0; padding:0; white-space:normal; font-size:.7rem }
  .access-tag .ui-icon { display:none }
  .brand { gap:8px }
  .brand img { width:35px; height:39px }
}

.deletion-card { border-left:4px solid #b4372d }
.deletion-card form { max-width:42rem }
.danger,.danger:hover { color:#fff; background:#a32b24 }
.danger-link,.case-nav .danger-link { color:#9a2a24; font-weight:750 }

.brand img { object-fit:contain; background:#fff; border-radius:6px; padding:3px }

.document-record { align-items:center }
.document-record .button { white-space:nowrap }
.document-issue { margin-top:14px; padding:12px 15px; border:1px solid var(--line); border-radius:9px; background:#f7f9fc }
.document-issue form { max-width:46rem }
.signature-preview { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 20px; background:#fff; border:1px solid var(--line); border-left:3px solid #bb914a; border-radius:7px; padding:10px 12px; margin:12px 0 14px }
.signature-preview strong { display:block; margin-bottom:3px }
.profile-actions a[aria-current] { font-weight:800 }
