:root {
  --ink: #202224;
  --muted: #666e75;
  --line: #d7dbdf;
  --paper: #f6f7f8;
  --white: #ffffff;
  --sav: #1f5b4a;
  --gold: #b98d3d;
  --blue: #2f6f9f;
  --red: #a64236;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.logo-upload {
  width: 104px;
  height: 64px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}

.logo-upload input {
  display: none;
}

#logoImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

#logoFallback {
  display: none;
  gap: 1px;
  text-align: center;
  color: var(--sav);
  letter-spacing: 0;
}

#logoFallback strong {
  font-size: 20px;
  line-height: 1;
}

#logoFallback small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.header-actions,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  border: 1px solid var(--sav);
  color: #fff;
  background: var(--sav);
  padding: 10px 14px;
  cursor: pointer;
}

button.ghost {
  color: var(--sav);
  background: #fff;
}

main {
  padding: 22px 28px 48px;
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-wrap,
.filter-wrap {
  display: grid;
  gap: 5px;
}

.search-wrap {
  min-width: min(420px, 100%);
  flex: 1;
}

.toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.35;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary div {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px;
}

.summary strong {
  display: block;
  font-size: 24px;
}

.summary span {
  color: var(--muted);
  font-size: 13px;
}

.table-shell {
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 109px;
  z-index: 3;
  background: #edf1f0;
  padding: 11px 10px;
  color: #25312e;
  font-size: 13px;
}

td {
  padding: 8px;
}

td input,
td select,
td textarea {
  border: 0;
  padding: 6px;
  background: transparent;
}

td input:focus,
td select:focus,
td textarea:focus {
  outline: 2px solid rgba(47, 111, 159, 0.25);
  background: #fff;
}

.number-col,
.number-cell {
  width: 58px;
  text-align: center;
  font-weight: 700;
}

.party-col {
  width: 120px;
}

.status-col {
  width: 140px;
}

.notes-col {
  width: 210px;
}

tr.section-row td {
  background: #20382f;
  color: #fff;
  font-weight: 700;
  padding: 12px;
}

tr.heading-row td {
  background: #f4efe6;
}

tr.status-open {
  border-left: 4px solid var(--red);
}

tr.status-addressed {
  border-left: 4px solid var(--sav);
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .app-header {
    position: static;
    display: grid;
    padding: 18px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions button {
    flex: 1;
  }

  main {
    padding: 18px;
  }

  .summary {
    grid-template-columns: repeat(2, 1fr);
  }

  th {
    top: 0;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0.42in;
  }

  body {
    background: #fff;
    font-size: 10px;
  }

  .no-print {
    display: none !important;
  }

  .app-header {
    position: static;
    padding: 0 0 14px;
    border-bottom: 2px solid #222;
  }

  .logo-upload {
    border: 0;
  }

  main {
    padding: 14px 0 0;
  }

  .summary {
    grid-template-columns: repeat(4, 1fr);
  }

  .summary div {
    padding: 8px;
  }

  .summary strong {
    font-size: 16px;
  }

  .table-shell {
    overflow: visible;
    border: 0;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th {
    position: static;
    background: #e8e8e8 !important;
  }

  th,
  td {
    border: 1px solid #999;
    padding: 5px;
  }

  textarea,
  input,
  select {
    appearance: none;
    border: 0;
    padding: 0;
    min-height: 0;
    resize: none;
    overflow: visible;
    white-space: pre-wrap;
  }

  .notes-col,
  td:last-child {
    display: none;
  }
}
