:root {
  --ink: #08283e;
  --cream: #fff2df;
  --paper: #fffaf2;
  --line: #d7cbbb;
  --muted: #52636d;
  --red: #a53420;
  color: var(--ink);
  background: #f6f0e7;
  font: 15px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
h1 { line-height: 1.12; font-size: clamp(27px, 4vw, 38px); margin: 0; }
p { margin: 0; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  font-weight: 650;
  text-align: center;
  min-height: 44px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--ink);
  color: var(--cream);
  background: var(--ink);
}
button:hover, .button:hover { background: #174460; }
.secondary { color: var(--ink); background: var(--paper); }
.secondary:hover { background: var(--cream); }
.danger { background: var(--red); border-color: var(--red); }
.danger:hover { background: #862719; }
.brand { font-weight: 820; line-height: 1.15; text-transform: uppercase; }
.entry { display: grid; min-height: 100dvh; padding: 24px; place-items: center; }
.login {
  width: min(100%, 410px);
  background: var(--paper);
  padding: clamp(20px, 5vw, 36px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 10px;
}
.login h1 { margin-block: 20px; }
.fields { display: grid; gap: 14px; }
.fields label { display: grid; gap: 4px; font-weight: 640; }
.fields label.check { display: flex; align-items: center; min-height: 44px; }
.fields input:not([type="checkbox"]), .fields select, .fields textarea {
  min-width: 0;
  min-height: 44px;
  width: 100%;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
  border: 1px solid #788792;
  border-radius: 5px;
}
.fields textarea { resize: vertical; }
.fields button { justify-self: start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--ink); color: var(--cream); padding: 22px 18px; }
.sidebar nav { display: grid; gap: 8px; margin-top: 28px; }
.sidebar a, .sidebar .quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  text-underline-offset: 4px;
}
.sidebar [aria-current] { background: #174460; border-radius: 6px; font-weight: 700; }
.sidebar :focus-visible { outline-color: var(--cream); }
.workspace main { padding: clamp(18px, 4vw, 36px); }
.heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.panel, .table-wrap {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
.panel { padding: clamp(16px, 3vw, 24px); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 740px; text-align: left; font-size: 14px; }
th, td { padding: 12px; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
thead th { background: #ece6da; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { min-width: 160px; max-width: 280px; }
.muted { color: var(--muted); font-weight: 400; }
.price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { min-width: 188px; }
.actions form { margin-bottom: 6px; }
details summary {
  min-height: 44px;
  padding: 9px 0;
  color: var(--red);
  cursor: pointer;
}
.alert, .notice { margin-block: 12px; padding: 8px 12px; border-left: 3px solid currentColor; }
.alert { color: var(--red); }
.notice { color: #216346; }
.pagination { display: flex; gap: 12px; margin-top: 14px; }
.back { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.draft-form { max-width: 820px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
dl.grid dd { margin-inline-start: 0; }
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { padding: 14px 18px; }
  .sidebar nav { display: flex; flex-wrap: wrap; justify-content: space-between; margin-top: 8px; }
}
@media (max-width: 470px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}
