:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --surface: #fffdf8;
  --ink: #203830;
  --soft: #4b5b53;
  --line: #dcd5c7;
  --pine: #15392f;
  --pale: #ecf0e6;
  --gold: #eed8ab;
  --wine: #6e292f;
  font: 16px/1.55 "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 15.75rem minmax(0, 1fr); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--pine); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #b86b27; outline-offset: 3px; }
.skip { position: fixed; top: .7rem; left: .7rem; z-index: 4; padding: .7rem 1rem; background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; }
h1 { margin-bottom: .55rem; font: 400 clamp(2.15rem, 4.2vw, 3.6rem)/1.05 Georgia, serif; letter-spacing: -.045em; }
h2 { font: 400 1.62rem/1.14 Georgia, serif; margin-bottom: .75rem; }
h3 { margin-bottom: .55rem; font-size: 1.03rem; }
.sidebar { background: var(--pine); color: white; display: flex; flex-direction: column; min-height: 100vh; padding: 1.4rem 1rem 1.2rem; }
.sidebar a { color: #f6f6ed; text-decoration: none; }
.identity { padding: .5rem .55rem 1.5rem; display: flex; gap: .85rem; align-items: center; }
.identity img { border-radius: 50%; background: var(--surface); }
.identity strong { display: block; font: 400 1.45rem Georgia, serif; letter-spacing: .065em; }
.identity small { display: block; color: #cfdbce; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a { display: block; border-radius: .45rem; padding: .66rem .75rem; }
.sidebar nav a[aria-current="page"] { background: #345749; color: #fff; font-weight: 650; }
.sidebar nav a:hover { background: #345749; }
.return-link { padding: .85rem .75rem 0; margin-top: auto; align-self: start; }
.statusbar { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .85rem clamp(1rem, 4vw, 2.8rem); border-bottom: 1px solid var(--line); background: var(--surface); font-size: .86rem; color: var(--soft); }
.preview-label { border-radius: 2rem; padding: .22rem .58rem; background: var(--gold); color: #342914; flex-shrink: 0; font-weight: 650; }
.page { max-width: 92rem; margin-inline: auto; padding: clamp(1.3rem, 4vw, 2.7rem); }
.subtitle, .muted { color: var(--soft); }
.subtitle { margin-bottom: 1.35rem; }
.panel, .stat, .tool { background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; }
.panel { padding: clamp(.85rem, 2.5vw, 1.45rem); margin-bottom: 1rem; }
.overview-grid, .tool-grid, .stat-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.stat-grid { margin-block: 1rem 1.35rem; }
.stat { display: grid; gap: .3rem; padding: 1rem; text-decoration: none; }
.stat:hover, .tool:hover { border-color: #91a596; background: white; }
.stat strong { font: 400 2rem Georgia, serif; }
.stat span { font-size: .86rem; }
.overview-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.tool { display: grid; align-content: start; padding: 1rem; gap: .3rem; text-decoration: none; }
.tool strong { font-size: 1.02rem; }
.tool span { color: var(--soft); font-size: .88rem; }
.actions, .filters, .section-nav, .dialog-head, .form-actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.section-nav, .filters { margin-bottom: 1rem; }
.filters { align-items: end; }
.filters label { min-width: 9rem; }
.filters label:first-child { flex: 1 1 12rem; }
.button { border: 1px solid var(--pine); color: white; background: var(--pine); padding: .48rem .75rem; border-radius: .4rem; font-weight: 650; min-height: 2.45rem; cursor: pointer; text-decoration: none; }
.button:hover { background: #285447; color: white; }
.secondary { background: var(--surface); color: var(--pine); border-color: #a9b1a1; }
.secondary[aria-pressed="true"] { background: var(--pale); border-color: #798f7e; color: var(--pine); }
.secondary:hover { background: var(--pale); color: var(--pine); }
.small { min-height: 2.15rem; padding: .34rem .55rem; font-size: .86rem; }
button:disabled { opacity: .65; cursor: wait; }
label { display: grid; gap: .23rem; font-weight: 625; font-size: .9rem; }
input, select, textarea { width: 100%; border: 1px solid #a8ac9f; border-radius: .35rem; background: white; color: var(--ink); padding: .48rem .55rem; min-height: 2.45rem; font-weight: 400; }
textarea { min-height: 6rem; resize: vertical; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th { color: var(--soft); font-size: .83rem; font-weight: 650; text-align: start; }
td, th { padding: .64rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.record-detail { display: block; color: var(--soft); font-size: .84rem; }
.chip { display: inline-block; border-radius: 1rem; padding: .1rem .48rem; background: #eee8dc; color: #524634; font-size: .8rem; white-space: nowrap; }
.chip.active { background: #e3eee4; color: #21492c; }
.chip.waiting { background: #f3e4be; color: #57431f; }
.list { margin: 0; padding-left: 1.2rem; }
.list li + li { margin-top: .55rem; }
.message { margin: .65rem 0; color: var(--soft); }
.error { color: #922830; }
.note { margin-bottom: 1rem; padding: .75rem .9rem; border-inline-start: 3px solid #9f8153; background: #eee7d7; border-radius: .25rem; }
dialog { background: var(--surface); color: var(--ink); width: min(94vw, 47rem); max-height: 90dvh; padding: 0; border: 1px solid var(--line); border-radius: .9rem; box-shadow: 0 22px 75px #142b2552; }
dialog::backdrop { background: #12261eb0; }
#record-content { padding: 1.25rem; }
.dialog-head { justify-content: space-between; align-items: start; }
.dialog-head h2 { margin-bottom: .45rem; }
.form-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit,minmax(min(100%, 14rem),1fr)); margin-block: .75rem; }
.wide { grid-column: 1 / -1; }
dl { display: grid; grid-template-columns: minmax(7rem,auto) 1fr; gap: .38rem .8rem; }
dt { color: var(--soft); }
dd { margin: 0; }
@media (max-width: 760px) {
  body { grid-template-columns: minmax(0,1fr); }
  .sidebar { min-height: 0; padding: .6rem .75rem; }
  .identity { padding: .35rem .45rem .65rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .15rem; }
  .sidebar nav a { padding: .4rem .52rem; }
  .return-link { display: none; }
  .statusbar { padding: .6rem .9rem; }
  .page { padding: 1rem; }
}
