:root {
  --ink: #142321;
  --muted: #61706d;
  --line: #d9e2df;
  --panel: #ffffff;
  --bg: #f3f7f5;
  --brand: #183a37;
  --brand-2: #276b5f;
  --accent: #c88a2c;
  --danger: #a33b3b;
  --ok: #28724f;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  background: var(--brand);
  color: white;
}

.eyebrow {
  margin: 0 0 4px;
  color: #b7d8d1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

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

.layout {
  width: min(1160px, calc(100% - 24px));
  margin: 18px auto 40px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tab,
.button,
.file-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  color: white;
  background: var(--brand-2);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.file-button {
  display: inline-flex;
  align-items: center;
}

.file-button input {
  display: none;
}

.tab {
  background: white;
  color: var(--brand);
  border: 1px solid var(--line);
}

.tab.active {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

.button.secondary {
  background: #eef5f2;
  color: var(--brand);
  border: 1px solid var(--line);
}

.button.danger,
.button.secondary.danger {
  color: var(--danger);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.form,
.tools,
.item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  font-size: 34px;
  font-weight: 800;
  color: var(--brand);
}

.metric p,
.item p,
.tools p {
  color: var(--muted);
  margin-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 12px;
}

.form {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

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

.list {
  display: grid;
  gap: 10px;
}

.item {
  padding: 14px;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  background: #eef5f2;
  color: var(--brand);
}

.status.pending {
  background: #fff3d9;
  color: #805a13;
}

.status.approved {
  background: #e0f3e9;
  color: var(--ok);
}

.status.rejected {
  background: #f7e2e2;
  color: var(--danger);
}

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

.tools {
  padding: 16px;
  margin-top: 18px;
}

.qr-box {
  margin-top: 12px;
  min-height: 0;
}

.qr-box img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  opacity: 0;
  transform: translateY(8px);
  transition: .2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .app-header,
  .item-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .split {
    grid-template-columns: 1fr;
  }

  .header-actions .button {
    flex: 1;
  }
}
