:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #203b37;
  background: #f4f5f0;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: grid;
  grid-template-columns: 235px 1fr;
  min-height: 100vh;
}
aside {
  background: #193e36;
  color: #fff;
  padding: 34px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand span {
  font-weight: 350;
  color: #bed1b9;
}
.caption {
  font-size: 12px;
  color: #c1d0c6;
  margin: 15px 0 40px;
}
nav {
  flex-shrink: 0;
  display: grid;
  gap: 7px;
}
nav button {
  background: transparent;
  color: #d0e0d6;
  text-align: left;
  border: 0;
  padding: 13px 15px;
  font-size: 14px;
}
nav button.active,
nav button:hover {
  background: #30564b;
  color: white;
}
.aside-bottom {
  position: static;
  margin-top: auto;
  padding-top: 24px;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.8;
  color: #b0c8b8;
}
main {
  padding: 42px 5%;
  min-width: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
header small {
  font-size: 10px;
  letter-spacing: 2px;
  color: #71877b;
}
h1 {
  font-size: 33px;
  letter-spacing: -1px;
  margin: 8px 0;
  font-weight: 600;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: #718077;
}
button,
.button {
  cursor: pointer;
  border: 1px solid #244b40;
  background: #244b40;
  color: white;
  border-radius: 7px;
  padding: 10px 15px;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.quiet {
  background: #fff;
  color: #244b40;
  border-color: #d9e0d7;
}
button:hover,
.button:hover {
  filter: brightness(0.94);
}
input,
select {
  font: inherit;
  border: 1px solid #d6ded4;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  max-width: 100%;
  min-width: 0;
}
label {
  display: grid;
  gap: 6px;
  color: #607066;
  font-size: 12px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  background: white;
  border: 1px solid #e2e7dc;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.filters label {
  flex: 1 1 125px;
}
.panel {
  background: white;
  border: 1px solid #e1e6dc;
  border-radius: 13px;
  padding: 24px;
  margin-bottom: 22px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.card {
  background: white;
  border: 1px solid #e1e6dc;
  border-radius: 12px;
  padding: 23px;
}
.card strong {
  display: block;
  font-size: 28px;
  margin: 12px 0;
  color: #214f40;
  font-weight: 600;
}
.card small {
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-size: 13px;
}
th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #e9ede5;
}
th {
  color: #708375;
  font-size: 11px;
  font-weight: 600;
  background: #f7f9f3;
}
td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0;
}
.badge {
  font-size: 11px;
  border-radius: 20px;
  background: #edf2df;
  padding: 5px 9px;
}
.warning {
  color: #8a5822;
  background: #fbf3df;
  border-radius: 8px;
  padding: 13px;
}
.error {
  color: #9a3333;
  background: #ffebeb;
  border-radius: 8px;
  padding: 13px;
}
#notice:not(:empty) {
  margin-bottom: 20px;
}
.empty {
  padding: 50px;
  text-align: center;
  color: #697e72;
}
.form-grid {
  display: grid;
  gap: 16px;
  max-width: 550px;
}
dialog {
  width: min(1000px, 95vw);
  border: 0;
  border-radius: 15px;
  padding: 26px;
  max-height: 90vh;
}
dialog::backdrop {
  background: #102d2380;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}
.bar {
  height: 7px;
  border-radius: 5px;
  background: #88a66d;
  min-width: 2px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
a {
  color: #286047;
}
@media (max-width: 850px) {
  body {
    display: block;
  }
  aside {
    position: static;
    height: auto;
    padding: 18px;
  }
  .caption,
  .aside-bottom {
    display: none;
  }
  .brand {
    font-size: 22px;
  }
  nav {
    display: flex;
    overflow: auto;
    margin-top: 16px;
  }
  nav button {
    white-space: nowrap;
  }
  main {
    padding: 24px 16px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .split {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 28px;
  }
  .filters {
    padding: 14px;
  }
  .panel {
    padding: 17px;
  }
}
#pdf-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 16px;
}
#pdf-image[hidden] {
  display: none;
}

[hidden] { display: none !important; }
#dialog-notice { position: sticky; top: 0; z-index: 2; padding: 16px; }
#review-lines input { min-width: 95px; }
#review-lines [data-field="name"] { min-width: 180px; }
#review-totals { margin: 16px 0; padding: 14px; }

summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.needs-attention td { background: #fff4d9; }
#dialog-content small { display: block; font-size: 12px; color: #536960; }
#dialog-content > .actions:first-child { position: sticky; top: 0; background: white; padding: 10px 0; z-index: 2; }
