*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1b1f24;
  background: #f4f6f8;
  overflow-wrap: anywhere;
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: #14324a; color: #fff;
}
.bar h1 { margin: 0; font-size: 1.25rem; }
.badge {
  padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem;
  letter-spacing: .05em; background: #e7edf2; color: #14324a;
}
.badge.paid { background: #ffd166; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.lede { margin: 0 0 16px; }
.card {
  background: #fff; border: 1px solid #dde3e8; border-radius: 8px;
  padding: 16px; margin-bottom: 16px; min-width: 0;
}
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; min-width: 0; }
label small { font-weight: 400; color: #5a6672; font-size: .75rem; }
input, select, button { font: inherit; max-width: 100%; min-width: 0; }
input[type="text"], input[type="number"], select {
  padding: 8px; border: 1px solid #b8c2cc; border-radius: 6px; width: 100%;
}
input[type="file"] { width: 100%; }
button {
  padding: 8px 16px; border-radius: 6px; border: 1px solid #14324a;
  background: #fff; color: #14324a; cursor: pointer;
}
button.primary { background: #14324a; color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.row > input, .row > select { flex: 1 1 200px; width: auto; }
.error {
  background: #fde8e8; border: 1px solid #e0a3a3; color: #8a1c1c;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; white-space: pre-wrap;
}
.error[hidden] { display: none; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
.stats div { background: #f4f6f8; border-radius: 6px; padding: 8px 12px; min-width: 0; }
.stats dt { font-size: .75rem; color: #5a6672; }
.stats dd { margin: 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status { min-height: 1.2em; margin: 0 0 8px; color: #5a6672; }
.table-wrap { max-width: 100%; max-height: 480px; overflow: auto; margin-bottom: 12px; border: 1px solid #dde3e8; border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #eef1f4; overflow-wrap: normal; }
th { position: sticky; top: 0; background: #f4f6f8; }
td:last-child, th:last-child { text-align: right; }

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  main { padding: 24px; }
  .bar { padding: 14px 24px; }
}
