:root {
  --green-950: #09251f;
  --green-900: #103a31;
  --green-700: #25785b;
  --green-100: #e7f2ed;
  --gold: #b58a3b;
  --ink: #111817;
  --muted: #66736f;
  --line: #dfe7e3;
  --paper: #f7f9f7;
  --white: #fff;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-950);
}

.brandMark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green-950);
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.shell {
  width: min(100% - 24px, 1180px);
  margin: 18px auto 56px;
}

.heroBand,
.pageHead,
.panel,
.loginPanel,
.alert {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.heroBand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  color: var(--green-950);
  font-size: 30px;
  line-height: 1.05;
}

h2 { font-size: 18px; }

button,
.primary,
.iconText,
.buttonLink,
.cardAction {
  min-height: 42px;
  border: 1px solid var(--green-950);
  border-radius: var(--radius);
  background: var(--green-950);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

button { padding: 0 14px; }

.buttonLink,
.cardAction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0 12px;
  font-size: 12px;
}

.buttonLink.secondary {
  background: var(--white);
  color: var(--green-950);
}

.cardAction {
  width: 100%;
  margin-top: 10px;
}

.iconText {
  background: transparent;
  color: var(--green-950);
}

.flash,
.alert {
  margin-bottom: 14px;
  padding: 12px 14px;
}

.alert {
  margin-top: 14px;
  color: #7a4b00;
  background: #fff8e7;
  border-color: #efd18a;
  font-weight: 800;
}

.statusGrid,
.metricGrid,
.resultGrid,
.twoCols,
.detailGrid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.statusGrid > div,
.metric,
.remateCard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 14px;
}

.statusGrid span,
.metric span,
dt,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.statusGrid strong,
.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
}

.metric {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric strong { font-size: 34px; }
.metric.green { border-top: 4px solid var(--green-700); }
.metric.blue { border-top: 4px solid #2273a8; }
.metric.yellow { border-top: 4px solid #c49a23; }
.metric.orange { border-top: 4px solid #c8662d; }

.panel,
.pageHead,
.loginPanel {
  margin-top: 14px;
  padding: 16px;
}

.panelTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panelTitle a,
.pageHead a {
  color: var(--green-700);
  font-weight: 800;
}

.remateCard h3 {
  margin-bottom: 6px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.remateCard p {
  margin-bottom: 8px;
  color: var(--muted);
}

.cardTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-950);
  font-size: 12px;
  font-weight: 800;
}

dl {
  margin: 0;
}

.remateCard dl,
.facts,
.jobMeta {
  display: grid;
  gap: 8px;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.compactList {
  display: grid;
  gap: 8px;
}

.compactList a,
.compactList div,
.dispatchRow {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.compactList span,
.compactList small,
.dispatchRow span,
.dispatchRow small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.jobDispatches {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.supportDoc {
  border-left: 4px solid var(--green-700);
}

.docActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline article {
  border-left: 4px solid var(--green-700);
  padding: 8px 0 8px 12px;
}

.timeline span,
.timeline small {
  color: var(--muted);
  font-size: 12px;
}

.loginPanel {
  max-width: 430px;
  margin: 56px auto;
}

.loginForm {
  display: grid;
  gap: 12px;
}

.loginForm label,
.adminForm label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
}

.topNav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topNav a {
  color: var(--green-700);
  font-weight: 800;
  font-size: 13px;
}

.adminForm,
.adminUserGrid,
.actionGrid,
.inlineFilters {
  display: grid;
  gap: 10px;
}

.adminUserCard {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.adminUserCard dl {
  display: grid;
  gap: 6px;
}

.compactTable {
  display: grid;
  gap: 8px;
}

.compactTable > div {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.compactTable span,
.exportLinks a {
  color: var(--muted);
  font-size: 13px;
}

.exportLinks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.checkLine {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
}

.checkLine input {
  min-height: auto;
}

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

@media (min-width: 720px) {
  .shell { width: min(100% - 40px, 1180px); }
  .statusGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metricGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .resultGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twoCols,
  .detailGrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .adminForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adminUserGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actionGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .inlineFilters { grid-template-columns: 1fr auto auto; }
  h1 { font-size: 38px; }
}

@media (min-width: 1060px) {
  .statusGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .resultGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adminUserGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .heroBand {
    display: grid;
  }
  .primary,
  .heroBand form,
  .heroBand button {
    width: 100%;
  }
  .topbar {
    align-items: flex-start;
  }
  .brand small {
    max-width: 180px;
  }
}
