:root { font: 16px/1.5 system-ui, sans-serif; color: #182331; background: #f1f4f7; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 14rem minmax(0, 1fr); }
aside { background: #142638; color: white; padding: 2rem 1.25rem; }
.brand { font-size: 1.65rem; font-weight: 800; letter-spacing: -.06em; margin: 0 .65rem 2rem; }
.brand span { color: #67e0c3; }
nav { display: grid; gap: .4rem; }
button, input, select { font: inherit; color: inherit; border: 1px solid #c6d0da; border-radius: .55rem; padding: .6rem .85rem; background: white; }
button { cursor: pointer; }
nav button { color: #e2ebf3; border-color: transparent; background: transparent; text-align: left; }
nav button[aria-current], nav button:hover { background: #284257; color: white; }
main { width: 100%; max-width: 90rem; padding: clamp(1.2rem, 4vw, 4rem); }
header p { color: #526477; font-size: .9rem; margin: 0 0 .6rem; }
.heading, .actions, .filters { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.heading { justify-content: space-between; margin-bottom: 1.5rem; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.055em; }
.primary { background: #00715c; color: white; border-color: #00715c; font-weight: 650; }
.panel { background: white; border: 1px solid #dce4eb; border-radius: .9rem; overflow: hidden; }
.filters { padding: 1rem; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .85rem 1rem; border-top: 1px solid #e7edf2; overflow-wrap: anywhere; }
th { background: #f7f9fb; color: #42556a; font-size: .9rem; }
#empty { padding: 1.5rem; margin: 0; color: #526477; }
dialog { width: min(92vw, 32rem); padding: 1.5rem; border: 1px solid #dce4eb; border-radius: 1rem; color: inherit; }
dialog::backdrop { background: #14263888; }
#fields { display: grid; gap: .8rem; margin: 1rem 0; }
#fields label { display: grid; gap: .25rem; }
.actions { justify-content: flex-end; }
#error { color: #9f2626; }
@media (max-width: 720px) {
  body { grid-template-columns: minmax(0, 1fr); }
  aside { padding: 1rem; }
  .brand { margin: 0 0 .5rem; }
  nav { display: flex; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  body { display: block; }
  nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 1rem; }
  button, input, select { min-height: 44px; min-width: 0; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; gap: .45rem; padding: 1rem; border-top: 1px solid #dce4eb; }
  tbody td { display: grid; grid-template-columns: minmax(5rem, 36%) minmax(0, 1fr); gap: .55rem; padding: 0; border: 0; }
  td[data-label]::before { content: attr(data-label); color: #526477; }
  tbody td:first-child { display: block; font-size: 1.15rem; font-weight: 650; }
  td:first-child::before, tbody .empty-field { display: none; }
  tbody td:last-child { display: block; margin-top: .35rem; }
  td button { width: 100%; }
  dialog { padding: 1rem; max-height: 90dvh; overflow-y: auto; }
  #fields, #fields label { grid-template-columns: minmax(0, 1fr); }
  #fields input, #fields select { width: 100%; }
}
[hidden], .signed-out aside, .signed-out main { display: none !important; }
html[data-server] body:not(:has(#login[hidden])) { display: block; }
#login { margin: 8vh auto; width: min(92vw, 26rem); background: white; padding: 1.5rem; border-radius: 1rem; }
#loginForm, #loginForm label { display: grid; gap: .6rem; }
#loginForm { gap: 1rem; }
#logout { margin-bottom: 1rem; }
