:root {
  --cream: #f3ead8;
  --paper: #faf6ee;
  --ink: #1c1915;
  --pine: #1b3d32;
  --sage: #3d6b54;
  --butter: #d4a017;
  --brick: #9a3b2f;
  --muted: #6b6459;
  --line: rgba(27, 61, 50, .1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

h1,
h2,
.font-display {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

a {
  color: var(--pine);
  font-weight: 700;
  text-decoration: none;
}

button,
.button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--sage);
  color: var(--cream);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: .55rem 1rem;
}

button:hover,
.button:hover {
  filter: brightness(.96);
}

button.primary,
.primary {
  background: var(--pine);
  color: var(--cream);
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(27, 61, 50, .18);
  color: var(--pine);
}

.yellow {
  background: rgba(212, 160, 23, .25);
  color: #6d4c00;
}

.danger {
  background: var(--brick);
  color: #fff;
}

.big {
  width: 100%;
  min-height: 52px;
}

.update-strip {
  background: var(--paper);
  color: var(--muted);
  font-size: .82rem;
  padding: .65rem .55rem .35rem;
}

.alert-action {
  border: 0;
  cursor: pointer;
  display: block;
  font: inherit;
  min-height: 44px;
  margin: 0 .55rem .75rem;
  border-radius: 14px;
  background: var(--sage);
  color: #fff7c9;
  font-weight: 700;
  padding: .8rem 1rem;
  text-align: center;
  width: calc(100% - 1.1rem);
}

.alert-action.active {
  background: var(--pine);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--paper);
  border-bottom: 1px solid rgba(27, 61, 50, .08);
  padding: 1.05rem .85rem 1.1rem;
}

.brand {
  min-width: 230px;
}

.eyebrow {
  color: var(--sage);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.topbar h1 {
  color: var(--pine);
  font-size: clamp(1.65rem, 2.2vw, 2rem);
  line-height: 1.08;
  margin: .12rem 0 .15rem;
}

.topbar p {
  color: var(--muted);
  margin: 0;
}

.topnav {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(243, 234, 216, .72);
  border-radius: 12px;
  padding: .25rem;
}

.topnav a {
  border-radius: 8px;
  color: var(--pine);
  font-size: .9rem;
  padding: .65rem .95rem;
}

.topnav a.active {
  background: var(--pine);
  color: var(--cream);
}

.topnav form {
  margin: 0 0 0 .25rem;
}

.topnav .ghost {
  background: var(--paper);
  min-height: 40px;
}

.page {
  width: min(1114px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.55rem 0 2.2rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(28, 25, 21, .06);
  margin-bottom: 1rem;
  padding: 1.05rem 1.25rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.45rem;
}

.kpi {
  min-height: 88px;
}

.kpi span {
  color: var(--muted);
  display: block;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kpi strong {
  color: var(--pine);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.05rem;
  font-weight: 500;
  line-height: 1;
  margin-top: .4rem;
}

.upload-card {
  border-style: dashed;
  box-shadow: none;
  margin: 0 auto 1.45rem;
  max-width: 100%;
  padding: 1.35rem;
}

.upload-card h2,
.section-head h2 {
  color: var(--pine);
  font-size: 1.45rem;
  margin: 0 0 .3rem;
}

.upload-card input[type="file"] {
  width: auto;
}

input::file-selector-button {
  border: 0;
  border-radius: 12px;
  background: var(--pine);
  color: var(--cream);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-right: .8rem;
  padding: .75rem 1rem;
}

.section-head {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 0 .75rem;
}

.section-head form {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: flex-end;
}

.inline,
.actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(27, 61, 50, .2);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  padding: .55rem .75rem;
}

input[type="checkbox"] {
  min-height: auto;
  accent-color: var(--pine);
}

label {
  color: var(--pine);
  display: grid;
  font-weight: 700;
  gap: .35rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: .25rem;
}

.table-wrap table {
  min-width: 980px;
}

#lines {
  table-layout: fixed;
}

#lines th:nth-child(1),
#lines td:nth-child(1) {
  width: 260px;
}

#lines th:nth-child(2),
#lines td:nth-child(2) {
  width: 180px;
}

#lines th:nth-child(3),
#lines td:nth-child(3),
#lines th:nth-child(5),
#lines td:nth-child(5) {
  width: 110px;
}

#lines th:nth-child(4),
#lines td:nth-child(4),
#lines th:nth-child(6),
#lines td:nth-child(6) {
  width: 150px;
}

#lines th:nth-child(7),
#lines td:nth-child(7) {
  width: 105px;
}

#lines input {
  min-width: 0;
}

#lines td:nth-child(1) input {
  text-overflow: ellipsis;
}

#lines td:last-child {
  text-align: right;
}

thead {
  background: rgba(243, 234, 216, .8);
}

th {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

td,
th {
  border-top: 1px solid var(--line);
  padding: .8rem 1rem;
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(243, 234, 216, .5);
}

td:nth-child(3) {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: .72rem;
  font-weight: 800;
  margin: .1rem .18rem .1rem 0;
  min-height: 24px;
  padding: .22rem .62rem;
  background: rgba(27, 61, 50, .1);
  color: var(--pine);
}

.badge.area {
  background: rgba(212, 160, 23, .25);
  color: #6d4c00;
}

.badge.warn,
.flash.error {
  background: rgba(154, 59, 47, .12);
  color: var(--brick);
}

.flash {
  border-radius: 8px;
  font-weight: 800;
  margin-bottom: .85rem;
  padding: .8rem 1rem;
}

.flash.ok {
  background: rgba(61, 107, 84, .12);
  color: var(--pine);
}

.notice {
  display: block;
  background: rgba(154, 59, 47, .06);
  border: 1px solid rgba(154, 59, 47, .25);
  border-radius: 16px;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}

.muted,
small {
  color: var(--muted);
}

.empty {
  color: var(--muted);
  padding: 2.5rem;
  text-align: center;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin: 0 auto 1rem;
  max-width: 36rem;
}

.tabs a {
  background: var(--paper);
  border-radius: 12px;
  color: var(--pine);
  padding: .75rem .7rem;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(27, 61, 50, .15) inset;
}

.tabs a.active {
  background: var(--pine);
  color: var(--cream);
}

.tabs strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.mobile-list {
  display: grid;
  gap: .75rem;
  margin: 0 auto;
  max-width: 36rem;
}

.pick-card {
  display: block;
  padding: 1.25rem;
}

.pick-card span {
  color: var(--sage);
  display: block;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pick-card strong {
  color: var(--pine);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
  margin-top: .15rem;
}

.pick-card em {
  float: right;
  border-radius: 999px;
  background: rgba(212, 160, 23, .25);
  color: #6d4c00;
  font-size: .72rem;
  font-style: normal;
  font-weight: 800;
  padding: .22rem .62rem;
}

.login {
  min-height: 78vh;
  display: grid;
  place-content: center;
}

.login h1 {
  color: var(--pine);
  font-size: 2rem;
  margin: 0 0 1rem;
  text-align: center;
}

.login form {
  width: min(390px, 92vw);
}

.form {
  display: grid;
  gap: 1rem;
}

dl.grid {
  margin: 0 0 1rem;
}

dt {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: .15rem 0 0;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
  }

  .page {
    width: min(100% - 1rem, 1114px);
    padding-top: 1rem;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head form,
  .inline {
    display: grid;
    justify-content: stretch;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 720px;
  }
}
