:root {
  --paper: #f5f1e9;
  --paper-deep: #ebe5d9;
  --surface: #fffdf9;
  --ink: #222321;
  --muted: #595b51;
  --green: #31583b;
  --green-dark: #1e3c2c;
  --line: #d8d3c9;
  --danger: #842f32;
  --sans: Inter, 'Aptos', 'Segoe UI', Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.55 var(--sans);
}
a { color: var(--green-dark); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid #995538; outline-offset: 4px; }
.wrap { width: min(960px, calc(100% - 3rem)); margin-inline: auto; }
.skip-link { position: absolute; top: -6rem; left: 1rem; padding: .75rem 1rem; background: var(--surface); z-index: 2; }
.skip-link:focus { top: 1rem; }
.site-header { border-bottom: 1px solid var(--line); }
.header-row { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; color: var(--ink); text-decoration: none; line-height: 1.15; }
.brand-mark { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--surface); background: var(--green); font: 1rem var(--serif); }
.brand-name { display: block; font: 1.08rem var(--serif); }
.brand-caption { display: block; margin-top: .2rem; color: var(--muted); font-size: .59rem; letter-spacing: .14em; text-transform: uppercase; }
.back-link { text-underline-offset: .25em; font-size: .825rem; }
main { flex: 1; padding-block: clamp(2.5rem, 6vw, 5.5rem); }
.page-heading { margin-bottom: 1.85rem; }
.eyebrow { display: flex; align-items: center; gap: .65rem; color: var(--green); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 1.5rem; height: 1px; background: currentColor; }
h1, h2, h3 { margin: 0; font-weight: 400; font-family: var(--serif); line-height: 1.13; letter-spacing: -.025em; }
h1 { font-size: clamp(2.5rem, 6.5vw, 4.25rem); }
h2 { font-size: clamp(1.65rem, 4vw, 2.1rem); }
h3 { font-size: clamp(1.28rem, 4vw, 1.62rem); overflow-wrap: anywhere; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; padding: clamp(1rem, 3.5vw, 1.75rem); }
.login { max-width: 31rem; }
.login form { display: grid; gap: .45rem; margin-top: 1.3rem; }
.login .button { justify-self: start; margin-top: .65rem; }
label { color: var(--ink); font-size: .88rem; font-weight: 700; }
input, select { width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid #8e8e82; border-radius: .45rem; color: var(--ink); background: var(--surface); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .5rem 1.05rem; border: 1px solid transparent; border-radius: 999px; font-size: .85rem; font-weight: 650; cursor: pointer; text-align: center; }
.primary { color: var(--surface); background: var(--green); }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { border-color: var(--green); color: var(--green-dark); background: transparent; }
.secondary:hover:not(:disabled) { background: #e5eadf; }
.danger { color: var(--surface); background: var(--danger); }
.button:disabled { color: #555a50; background: #e1e0d7; border-color: #b5b4aa; cursor: default; }
.notice { max-width: 42rem; margin: 0 0 1.2rem; padding: .75rem 1rem; border-left: 3px solid var(--green); background: #e6ebe0; color: var(--green-dark); }
.notice:empty, .record-feedback:empty { display: none; }
.notice[data-kind="error"] { border-color: var(--danger); background: #f3e2e1; color: var(--danger); }
.toolbar, .request-heading, .request-controls, .pagination { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.toolbar { align-items: center; margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.requests { display: grid; gap: .8rem; list-style: none; padding: 0; margin: 0; }
.protocol, time { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.protocol { margin: 0 0 .2rem; font-family: ui-monospace, Menlo, monospace; }
.status-badge { flex: none; padding: .28rem .6rem; border-radius: 999px; background: #e7ede3; color: var(--green-dark); font-size: .78rem; }
.status-badge[data-status="em_analise"] { background: #f2e8ce; color: #5f481a; }
.status-badge[data-status="contatado"] { background: #e4ebf0; color: #243e53; }
.status-badge[data-status="encerrado"] { background: #ece9e2; color: #4a473f; }
details { margin-top: .75rem; border-top: 1px solid var(--line); }
summary { padding-top: .75rem; color: var(--green-dark); font-size: .875rem; font-weight: 650; cursor: pointer; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; margin-block: 1rem 1.4rem; }
dt { margin: 0 0 .18rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.document-list { margin: 0; padding-left: 1.1rem; }
.attachments { grid-column: 1 / -1; }
.attachment-list { display: grid; gap: .35rem; margin: 0; padding-left: 1.1rem; }
.attachment-list a { font-weight: 650; text-underline-offset: .2em; }
.attachment-list span { color: var(--muted); font-size: .8rem; }
.request-controls { align-items: end; padding-top: 1rem; border-top: 1px solid var(--line); }
.status-form { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
.status-form label { display: block; margin-bottom: .2rem; }
.delete-button { min-height: 44px; padding: .35rem .2rem; border: 0; color: var(--danger); background: transparent; text-decoration: underline; text-underline-offset: .2em; font-size: .8rem; cursor: pointer; }
.delete-button:disabled { color: var(--muted); cursor: default; }
.record-feedback { margin: .7rem 0 0; color: var(--green-dark); font-size: .87rem; }
.record-feedback[data-kind="error"] { color: var(--danger); }
.pagination { justify-content: center; align-items: center; margin-top: 1.25rem; }
.pagination span { color: var(--muted); font-size: .84rem; }
dialog { width: min(29rem, calc(100% - 2rem)); padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgb(26 30 23 / .55); }
dialog p { overflow-wrap: anywhere; }
.site-footer { padding: 1.1rem 0 1.55rem; background: var(--paper-deep); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; }
.footer-row strong { color: var(--ink); }

@media (max-width: 480px) {
  .wrap { width: calc(100% - 2rem); }
  .header-row { min-height: 70px; }
  .toolbar, .request-controls, .request-heading { flex-wrap: wrap; }
  .request-heading { row-gap: .5rem; }
  .details-grid { grid-template-columns: 1fr; }
  .pagination { gap: .5rem; }
  .button { padding-inline: .8rem; }
}
