:root {
  font: 15px/1.5 Inter, system-ui, sans-serif;
  color: #101d33;
  background: #eff3f8;
  color-scheme: light;
  --blue: #0056df;
  --navy: #071e42;
  --line: #d7e0eb;
  --muted: #51617a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; margin: 0; }
.sidebar { display: flex; flex-direction: column; gap: 38px; padding: 31px 13px 20px; color: #fff; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 14px; margin: 0 13px; color: inherit; font-size: 22px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 23px; height: 27px; border: 2px solid; border-radius: 4px; position: relative; }
.brand-mark::before { content: ''; position: absolute; top: 5px; left: 4px; width: 11px; height: 2px; background: currentColor; box-shadow: 0 5px currentColor, 0 10px currentColor; }
nav a { display: block; padding: 11px 16px; border-radius: 7px; color: #fff; background: #0844a5; text-decoration: none; font-weight: 600; }
.account { margin-top: auto; display: grid; gap: 8px; padding: 10px; }
.account span { overflow-wrap: anywhere; }
.account button { color: #fff; background: transparent; border-color: #5e7597; }
main { min-width: 0; padding: 44px 26px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 30px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3vw, 40px); line-height: 1.2; letter-spacing: -.025em; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 17px; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 16px; margin-bottom: 8px; }
button, input, select { font: inherit; }
button, input, select { min-height: 42px; border: 1px solid #bfcbdc; border-radius: 7px; }
input, select { width: 100%; padding: 8px 12px; color: inherit; background: #fff; }
button { cursor: pointer; padding: 8px 14px; color: inherit; background: #fff; white-space: nowrap; font-weight: 600; }
button:disabled { cursor: default; opacity: .5; }
button:hover:not(:disabled) { border-color: #6a89b6; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover:not(:disabled) { background: #034ab9; border-color: #034ab9; }
:focus-visible { outline: 3px solid #699df6; outline-offset: 2px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.filters { display: grid; grid-template-columns: minmax(160px, 1.7fr) minmax(130px, 1fr) minmax(145px, 1fr); gap: 14px; padding: 22px 14px; }
.search { position: relative; }
.search::before { content: ''; position: absolute; top: 13px; left: 13px; width: 10px; height: 10px; border: 2px solid #67778c; border-radius: 50%; pointer-events: none; }
.search::after { content: ''; position: absolute; width: 7px; height: 2px; background: #67778c; top: 26px; left: 23px; transform: rotate(45deg); pointer-events: none; }
.search input { padding-left: 36px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--line); }
th { background: #eaf0f7; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faff; }
td:first-child, td:nth-child(2), td:nth-child(4), .money { white-space: nowrap; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
td a, .file-list a { color: #004cbf; font-weight: 600; text-underline-offset: 3px; }
.table-status { padding: 24px 18px; color: var(--muted); }
.paging, .actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.paging { padding: 12px 15px; border-top: 1px solid var(--line); }
.notice { padding: 10px 14px; margin-bottom: 16px; background: #e5efff; border-radius: 6px; }
.notice.error { background: #fff1ee; color: #922525; }
.sign-in { max-width: 430px; padding: 23px; }
.sign-in form { display: grid; gap: 12px; margin: 15px 0 0; }
dialog { width: min(730px, calc(100% - 24px)); max-height: calc(100vh - 40px); padding: 24px; border: 1px solid var(--line); border-radius: 10px; color: inherit; box-shadow: 0 15px 55px #071e4236; }
dialog::backdrop { background: #06193670; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.form-grid, .detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
form label { display: grid; gap: 4px; font-weight: 550; }
fieldset { margin: 16px 0; border: 1px solid var(--line); border-radius: 7px; }
fieldset p { margin-top: 8px; color: var(--muted); }
.line-editor { display: grid; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.line-editor button { justify-self: end; }
#items-section th, #items-section td { padding: 8px; font-size: 13px; }
dialog section, .actions { margin-top: 18px; }
.detail-fields { margin: 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; overflow-wrap: anywhere; }
.file-list { padding-left: 20px; }
summary { cursor: pointer; color: var(--muted); overflow-wrap: anywhere; }
#history details { margin: 6px 0; }
#history dl { margin: 6px 0 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 880px) {
  body { grid-template-columns: 175px minmax(0, 1fr); }
  .brand { font-size: 16px; gap: 8px; margin: 0 5px; }
  .sidebar { padding-inline: 9px; }
  main { padding: 29px 17px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
}
@media (max-width: 630px) {
  body { display: block; }
  .sidebar { flex-direction: row; align-items: center; gap: 8px; padding: 10px; }
  .sidebar nav { display: none; }
  .account { margin: 0 0 0 auto; padding: 0; }
  .account span { display: none; }
  main { padding: 21px 12px; }
  .page-heading { align-items: flex-start; margin-bottom: 18px; }
  .page-heading p { font-size: 14px; }
  .page-heading button { font-size: 13px; padding-inline: 9px; }
  .form-grid, .detail-fields { grid-template-columns: 1fr; }
  dialog { padding: 16px; }
  th, td { padding: 10px 12px; }
}
