* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f7fa;
  color: #152f46;
  font:
    16px/1.5 "Segoe UI",
    sans-serif;
}
header,
.bar,
footer,
.row,
nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
header,
.bar {
  justify-content: space-between;
}
header {
  background: #132e45;
  color: white;
  padding: 20px max(5%, calc((100% - 1080px) / 2));
  font-size: 21px;
}
b {
  display: inline-block;
  background: #83e3cc;
  color: #153a44;
  border-radius: 10px;
  padding: 2px 11px;
  margin-right: 7px;
}
main {
  width: min(90%, 1080px);
  margin: 28px auto;
}
nav,
.bar,
.row {
  flex-wrap: wrap;
}
button,
input,
select {
  font: inherit;
  border-radius: 8px;
  padding: 10px 15px;
}
button {
  border: 0;
  background: #006c61;
  color: white;
  font-weight: 600;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.92);
}
nav button,
.light {
  background: #e5eef1;
  color: #154955;
}
nav button[aria-pressed="true"] {
  background: #193e58;
  color: white;
}
#metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 30px 0;
}
#metrics div,
article,
dialog {
  background: white;
  border: 1px solid #dbe4eb;
  border-radius: 14px;
  padding: 22px;
}
#metrics strong {
  display: block;
  font-size: clamp(20px, 3vw, 29px);
  margin-top: 5px;
}
#metrics div:last-child strong,
.late,
[role="alert"] {
  color: #aa4226;
}
input,
select {
  width: 100%;
  border: 1px solid #abbecb;
  background: white;
  color: inherit;
}
#search {
  max-width: 370px;
}
label {
  display: block;
  margin: 15px 0;
}
dialog {
  width: min(460px, 94%);
  color: inherit;
}
dialog::backdrop {
  background: #152f4677;
}
footer {
  justify-content: flex-end;
}
.row {
  padding: 18px 0;
  overflow-wrap: anywhere;
}
.row + .row {
  border-top: 1px solid #dde6ec;
}
.row div {
  flex: 1;
  min-width: 180px;
}
.row small {
  display: block;
  color: #526778;
  margin-top: 4px;
}
span {
  font-weight: 600;
  color: #006c61;
}
h1 {
  margin: 12px 0;
}
.bar {
  margin-bottom: 16px;
}
@media (max-width: 650px) {
  #metrics {
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 18px 0;
  }
  #metrics div {
    padding: 10px 14px;
  }
  nav {
    gap: 5px;
  }
  nav button {
    flex: 1;
    padding: 8px;
  }
  header small {
    font-size: 13px;
  }
  .row div {
    min-width: 100%;
  }
}
#filter {
  max-width: 270px;
  margin: 8px 0;
}
textarea {
  display: block;
  width: 100%;
  min-height: 85px;
  border: 1px solid #abbecb;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}
details {
  margin-top: 8px;
  font-size: 14px;
}
summary {
  cursor: pointer;
  color: #006c61;
}
details p,
.row small {
  white-space: pre-line;
}
.row .express {
  color: #934600;
}
dialog {
  max-height: 90vh;
  overflow: auto;
}
footer {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 8px 0;
}
@media (max-width: 650px) {
  #filter {
    max-width: 100%;
  }
  .row span {
    width: 100%;
  }
}
#trade {
  width: min(780px, 96vw);
  overflow-wrap: anywhere;
}
#trade input[type="checkbox"] {
  width: auto;
}
#trade fieldset {
  border: 1px solid #cddbe1;
  border-radius: 12px;
  margin: 12px 0;
  padding: 12px;
  min-width: 0;
}
.cards,
.lists,
.parties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.cards button {
  text-align: left;
  background: #e5f4ef;
  color: #15594e;
  padding: 18px;
}
.cards strong {
  display: block;
  font-size: 22px;
}
.lists section {
  border-top: 3px solid #6bbcac;
}
.scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
td,
th {
  padding: 9px;
  border-bottom: 1px solid #cedadd;
}
.note {
  white-space: pre-wrap;
}
#paper {
  display: none;
}
@media (min-width: 700px) {
  #trade fieldset {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: center;
    gap: 10px;
  }
  fieldset label {
    min-width: 0;
  }
}
@media print {
  body {
    background: white;
    color: black;
    font: 10pt sans-serif;
  }
  body > header,
  main,
  dialog {
    display: none !important;
  }
  #paper {
    display: block;
    overflow-wrap: anywhere;
  }
  .scroll {
    overflow: visible;
  }
  tr {
    break-inside: avoid;
  }
  td,
  th {
    padding: 5px;
  }
  .parties {
    grid-template-columns: 1fr 1fr;
  }
}
#finance {
  width: min(680px, 96vw);
  overflow-wrap: anywhere;
}
#finance pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f4f7fa;
  padding: 12px;
}
#finance footer {
  flex-wrap: wrap;
}
#finance input[type="file"] {
  padding: 10px;
}
.row a {
  color: #075951;
}
.row details button {
  margin: 4px 8px;
}
.timeFilters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(195px, 100%), 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.timeFilters label {
  min-width: 0;
}
#staff {
  width: min(560px, 96vw);
  overflow-wrap: anywhere;
}
#staff fieldset,
.adjustment {
  border: 1px solid #dbe4eb;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  min-width: 0;
}
.adjustment {
  background: #f5f9fa;
}
.adjustment button {
  margin: 8px 6px 0 0;
}
nav {
  gap: 6px;
}
nav button {
  padding: 9px 13px;
}
[hidden] {
  display: none !important;
}
header,
#identity {
  flex-wrap: wrap;
}
#identity {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  overflow-wrap: anywhere;
}
#identity button {
  background: #e3f5f0;
  color: #153a44;
}
#gate:not(:empty) {
  max-width: 440px;
  margin: 7vh auto;
  padding: 28px;
  background: white;
  border: 1px solid #d5e0ea;
  border-radius: 14px;
}
#gate form,
#accountDialog form {
  display: grid;
  gap: 14px;
}
#gate [role="alert"],
#accountDialog [role="alert"] {
  color: #982727;
}
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
.choice input {
  width: auto;
  min-width: 0;
}
#accountDialog fieldset {
  min-width: 0;
}
@media print {
  #gate {
    display: none;
  }
}
#companyPicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: min(90%, 1080px);
  margin: 18px auto;
}
#companyPicker label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
#companyPicker select {
  max-width: min(65vw, 320px);
  margin: 0;
}
#accountDialog form + form {
  border-top: 1px solid #ccd9df;
  margin: 18px 0;
  padding-top: 14px;
}
#brandPreview {
  border: 1px solid #ccd9df;
  padding: 18px;
  background: white;
}
.sheet {
  --ink: #183956;
  overflow-wrap: anywhere;
}
.sheet.green {
  --ink: #106048;
}
.sheet.wine {
  --ink: #802642;
}
.sheet.black {
  --ink: #111;
}
.letterhead {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  padding: 12px 0;
  font-size: 1.2em;
  color: var(--ink);
}
.brandLogo {
  max-width: 155px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sheet h2,
.sheet h3,
.sheet th {
  color: var(--ink);
}
.imprint {
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
  font-size: 0.9em;
  white-space: pre-wrap;
  break-inside: avoid;
}
.modern .letterhead {
  border: 0;
  border-left: 7px solid var(--ink);
  padding-left: 16px;
  font-size: 1.45em;
}
.modern th {
  background: #edf2f5;
}
.compact {
  font-size: 0.92em;
  line-height: 1.3;
}
.compact p,
.compact h3 {
  margin: 5px 0;
}
.compact td,
.compact th {
  padding: 4px;
}
.compact .brandLogo {
  max-height: 36px;
}
@media print {
  #companyPicker {
    display: none;
  }
  .sheet tr {
    break-inside: avoid;
  }
}
.verification {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  break-inside: avoid;
  margin: 16px 0;
}
.verification figure {
  margin: 0;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
  break-inside: avoid;
}
.verification img {
  width: 46mm;
  height: 46mm;
  max-width: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.verification figcaption {
  font-size: 10pt;
  font-weight: 600;
}
.syncPanel {
  border: 1px solid #cbd8e0;
  background: white;
  padding: 16px;
  margin: 16px 0;
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.exchangeFilters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(205px, 100%), 1fr));
  gap: 12px;
}
.exchangeFilters label, .exchangeFilters input, .exchangeFilters select {
  min-width: 0;
  width: 100%;
}
.syncPanel button {
  margin: 4px;
}
