:root {
  --bg: #f5f3ee;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #66716c;
  --line: #d9ddd5;
  --brand: #155b4f;
  --accent: #b64f32;
  --soft: #e8efe9;
  --danger: #a03131;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(21, 91, 79, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(182, 79, 50, 0.10), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar,
.summary,
.layout,
.filters,
.actions {
  display: flex;
  gap: 16px;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
}

button,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

button {
  width: auto;
  min-height: 42px;
  padding: 0 16px;
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  color: var(--brand);
  background: #fff;
}

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

input,
select,
textarea {
  min-height: 42px;
  padding: 9px 11px;
  background: #fff;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.summary article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(20, 33, 30, 0.08);
}

.summary article {
  padding: 18px;
}

.summary span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.layout {
  align-items: flex-start;
}

.panel {
  padding: 18px;
}

form.panel {
  flex: 0 0 380px;
}

.layout > .panel:last-child {
  flex: 1 1 auto;
  min-width: 0;
}

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

.actions {
  margin-top: 14px;
  flex-wrap: wrap;
}

.filters {
  margin-bottom: 14px;
}

.filters input {
  flex: 1 1 340px;
}

.filters select {
  flex: 0 0 210px;
}

.tableWrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td.amount {
  font-weight: 900;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.rowActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.rowActions button {
  min-height: 34px;
  padding: 0 10px;
}

.docLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.docLink img {
  width: 44px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

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

@media (max-width: 980px) {
  .topbar,
  .layout,
  .filters {
    flex-direction: column;
  }

  form.panel,
  .filters select {
    flex-basis: auto;
    width: 100%;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding: 16px 0;
  }

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

  button {
    width: 100%;
  }
}
