:root {
  --blue: #00267f; --blue-2: #1a3f99; --gold: #ffc726; --ink: #1d2433; --muted: #5b6475; --line: #dfe3ea;
  --bg: #f5f6f8; --card: #fff; --ok: #1f7a43; --okbg: #e8f5ec; --warn: #8a5a00; --warnbg: #fff6dc; --err: #b42318; --errbg: #fdecea;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Arial, "Helvetica Neue", Helvetica, sans-serif; }
a { color: var(--blue); }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 820px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--blue); color: #fff; padding: 10px 20px; flex-wrap: wrap; }
.top a, .top .link { color: #fff; margin-left: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 17px; } .brand small { display: block; opacity: .85; font-size: 12.5px; }
.brand.big { color: var(--ink); margin-bottom: 18px; align-items: flex-start; } .brand.big small { color: var(--muted); }
.who { font-size: 14px; }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 54px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 14px 0; }
.side a { display: block; padding: 8px 18px; text-decoration: none; color: var(--ink); border-left: 4px solid transparent; }
.side a:hover { background: var(--bg); }
.side a.on { border-left-color: var(--gold); background: #eef2fb; font-weight: bold; color: var(--blue); }
.main { padding: 22px 26px 60px; min-width: 0; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .side { display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; } .side a { border-left: 0; padding: 6px 10px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px; }
.card.narrow { max-width: 520px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.center .card { width: 100%; }
details > summary { cursor: pointer; font-weight: bold; color: var(--blue); }
details[open] > summary { margin-bottom: 12px; }

.field { margin: 0 0 14px; }
.field label, legend { display: block; font-weight: bold; margin-bottom: 4px; }
.field .opt { font-weight: normal; color: var(--muted); }
.hint { color: var(--muted); font-size: 13.5px; margin: -2px 0 6px; }
input, select, textarea { font: inherit; width: 100%; max-width: 560px; padding: 8px 10px; border: 1px solid #b9c0cc; border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.field.check { display: flex; gap: 8px; align-items: center; } .field.check input { width: auto; } .field.check label { margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; } .checks label { font-weight: normal; } .checks input, label.check input { width: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.err { color: var(--err); font-weight: bold; min-height: 0; margin: 4px 0; }
.err:empty { display: none; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
button, .btn { font: inherit; padding: 8px 16px; border-radius: 6px; border: 1px solid #b9c0cc; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: bold; }
button.primary:hover { background: var(--blue-2); }
button.big { font-size: 18px; padding: 12px 22px; }
button.small, .btn.small { padding: 4px 10px; font-size: 13.5px; }
button.link { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.flash.ok { background: var(--okbg); color: var(--ok); } .flash.warn { background: var(--warnbg); color: var(--warn); } .flash.err { background: var(--errbg); color: var(--err); }

.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
table.list { border-collapse: collapse; width: 100%; font-size: 14.5px; }
table.list th { text-align: left; background: #eef1f6; padding: 9px 12px; font-size: 13px; }
table.list td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.list tr[data-href] { cursor: pointer; } table.list tr[data-href]:hover td { background: #f7f9fd; }
table.mini { font-size: 14px; border-collapse: collapse; } table.mini td { padding: 3px 12px 3px 0; }
.empty { color: var(--muted); padding: 16px; background: #fff; border: 1px dashed var(--line); border-radius: 10px; }
.count { display: inline-block; background: var(--blue); color: #fff; border-radius: 12px; font-size: 13px; padding: 1px 9px; vertical-align: middle; }
.tag { display: inline-block; background: #eef1f6; border-radius: 4px; padding: 0 6px; font-size: 12.5px; color: var(--ink); }
.tag.urgent { background: var(--err); color: #fff; }
.late { color: var(--err); font-weight: bold; }
.searchbar { display: flex; gap: 8px; margin-bottom: 16px; max-width: 640px; }
.narrowin { width: 80px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row input[type=text], .row input:not([type]) { max-width: 260px; }

.casehead h1 { font-size: 26px; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 20px; margin: 0; }
dl.facts dt { font-size: 12.5px; color: var(--muted); } dl.facts dd { margin: 0; }
dl.facts .wide { grid-column: 1 / -1; }
.card.facts { margin-bottom: 16px; }
.actions { border-left: 5px solid var(--gold); }
.actionbtns { display: flex; flex-wrap: wrap; gap: 8px; }
form.inline { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.person { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
ul.feed { list-style: none; padding: 0; margin: 0; } ul.feed li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
ul.feed li:first-child { border-top: 0; } ul.feed time, ol.timeline time { color: var(--muted); font-size: 13px; margin-right: 6px; }
.appeal, .award { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; } .appeal:first-of-type, .award:first-of-type { border-top: 0; margin-top: 0; }
.appeal p, .award p { margin: 4px 0; }

/* Public tracker */
.top.public { justify-content: center; }
.public-main { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; font-size: 17px; }
.public-main .card.narrow { max-width: none; }
.status-card { border-top: 6px solid var(--blue); }
h1.status { font-size: 30px; color: var(--blue); margin: 4px 0 8px; }
.next { font-size: 18px; }
.letter { border-left: 4px solid var(--gold); padding: 4px 12px; margin: 10px 0; background: #fffdf4; }
.letter p { margin: 4px 0; white-space: pre-wrap; }
ol.timeline { padding-left: 20px; } ol.timeline li { margin: 6px 0; }
table.list.types { table-layout: fixed; }
table.list.types col:nth-child(1) { width: 10%; } table.list.types col:nth-child(3) { width: 9%; }
table.list.types col:nth-child(4) { width: 8%; } table.list.types col:nth-child(5) { width: 10%; }
table.list.types col:nth-child(6) { width: 9%; } table.list.types col:nth-child(7) { width: 11%; }
.filters .row { align-items: flex-end; } .filters label { display: flex; flex-direction: column; font-size: 13.5px; font-weight: bold; gap: 4px; }
.filters select, .filters input { min-width: 150px; max-width: 220px; }
table.audit td { font-size: 13.5px; } table.audit td.small div { margin: 1px 0; }
.govbar { display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); padding: 6px 20px; border-bottom: 3px solid var(--gold); font-size: 14px; }
.flag { width: 45px; height: 30px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.15); flex: none; }
.brand.big .flag { width: 60px; height: 40px; margin-top: 3px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 20px 24px; border-top: 1px solid var(--line); background: #fff; }
.center + .foot, .public-main + .foot { background: transparent; border-top: 0; }
.center { min-height: calc(100vh - 110px); }
.addrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } .addrow .card { margin-bottom: 16px; }
@media (max-width: 900px) { .addrow { grid-template-columns: 1fr; } }
.staffbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; } .staffbar input { max-width: 360px; }
.staffgroup h2 { margin-top: 6px; } .staffgroup.inactive h2 { color: var(--muted); } .staffgroup.inactive td { color: var(--muted); }
table.list.staff { table-layout: fixed; } table.list.staff col:nth-child(1) { width: 26%; } table.list.staff col:nth-child(2) { width: 30%; }
table.list.staff col:nth-child(3) { width: 14%; }
