:root {
  color-scheme: light dark;
  --background: #f8f7f4;
  --foreground: #242320;
  --card: #fff;
  --muted: #686761;
  --border: #e4e2dc;
  --input: #fff;
  --primary: #f15d22;
  --primary-hover: #df5019;
  --primary-foreground: #1f0b04;
  --brand-ink: #7f2f12;
  --surface: #f4f3ef;
  --success-bg: #eaf4ed;
  --success: #28613a;
  --warning-bg: #fff4dc;
  --warning: #78531a;
  --danger-bg: #fff0ed;
  --danger: #8b3025;
  --radius: 9px;
  --focus: #b54418;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #171716;
    --foreground: #efeeeb;
    --card: #222221;
    --muted: #aaa9a3;
    --border: #41413e;
    --input: #292928;
    --brand-ink: #ffb088;
    --surface: #2d2d2b;
    --success-bg: #203c2a;
    --success: #a6dbb4;
    --warning-bg: #42341c;
    --warning: #f1d08b;
    --danger-bg: #462721;
    --danger: #ffb4a5;
    --focus: #ffb088;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
}
a {
  color: var(--brand-ink);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
}
.skip {
  position: absolute;
  left: -9999px;
  z-index: 10;
  background: var(--card);
  padding: 12px;
}
.skip:focus {
  left: 12px;
  top: 12px;
}
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1440px;
  margin: auto;
  min-height: 60px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  color: var(--foreground);
  display: flex;
  gap: 9px;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-foreground);
  width: 27px;
  height: 27px;
  border-radius: 7px;
  font-size: 15px;
}
.topbar-title {
  border-left: 1px solid var(--border);
  padding-left: 20px;
  color: var(--muted);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-actions form {
  margin: 0;
}
.nav-link {
  color: var(--foreground);
  text-decoration: none;
  padding: 8px;
}
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
h2 {
  font-size: 16px;
  line-height: 1.35;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.muted,
.cell-secondary,
.field-hint {
  color: var(--muted);
}
.summary {
  display: flex;
  gap: 32px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.summary-label,
.summary-hint {
  display: block;
}
.summary-label {
  font-weight: 650;
}
.summary-hint {
  font-size: 12px;
  color: var(--muted);
}
.summary-values {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 19px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.section-heading {
  padding: 20px 20px 0;
}
.section-heading p {
  font-size: 13px;
  margin-top: 4px;
}
.filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
}
.filters label {
  flex: 1 1 130px;
}
.filter-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 650;
}
input,
select {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  color: var(--foreground);
  padding: 8px 10px;
}
input[type="file"] {
  height: auto;
  min-height: 38px;
  padding: 6px;
  font-size: 12px;
}
input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 4px;
  padding: 5px 8px;
  margin-right: 8px;
  background: var(--surface);
  color: var(--foreground);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover {
  background: var(--surface);
  text-decoration: none;
}
.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.button-primary:hover {
  background: var(--primary-hover);
}
.button-secondary {
  background: var(--card);
  border-color: var(--border);
}
.button-quiet {
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}
th,
td {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
td {
  font-size: 13px;
}
tbody tr:hover {
  background: var(--surface);
}
.numeric {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.entry-link {
  font-weight: 650;
  color: var(--foreground);
}
.cell-secondary {
  font-size: 12px;
  margin-top: 3px;
}
.document-link {
  display: block;
  min-width: 100px;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-block;
  white-space: nowrap;
  border-radius: 100px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  background: var(--surface);
  color: var(--muted);
}
.badge-paid {
  background: var(--success-bg);
  color: var(--success);
}
.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
}
.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.empty strong {
  display: block;
  color: var(--foreground);
  margin-bottom: 4px;
}
.upload-panel {
  padding: 20px;
}
.upload-panel p {
  font-size: 13px;
  margin-top: 4px;
}
.upload-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}
.upload-form label {
  flex: 1;
}
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 13px;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
}
.detail-form,
.attachments,
.stack-form {
  padding: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-actions {
  margin-top: 22px;
}
.attachments {
  padding-bottom: 0;
}
.attachment {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  overflow-wrap: anywhere;
}
.attachment:first-child {
  padding-top: 0;
}
.attachment span {
  font-size: 12px;
}
.stack-form {
  display: grid;
  gap: 14px;
}
.stack-form .button {
  justify-self: start;
}
.field-hint {
  font-size: 12px;
  margin-top: -10px;
}
.notice {
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 20px;
}
.notice-error {
  background: var(--danger-bg);
  color: var(--danger);
}
.auth-panel {
  max-width: 480px;
  margin: 50px auto;
  padding: 28px;
}
.auth-panel p:not(.eyebrow) {
  margin-bottom: 24px;
}
.access-form {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border);
}
.access-form label {
  max-width: 300px;
  flex: 1;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 700px) {
  .topbar-inner {
    padding: 0 16px;
    gap: 10px;
  }
  .topbar-title {
    display: none;
  }
  .container {
    padding: 28px 16px 60px;
  }
  .page-header {
    flex-direction: column;
  }
  .summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .upload-form,
  .access-form {
    align-items: stretch;
    flex-direction: column;
  }
  .access-form label {
    max-width: none;
  }
  .filters label {
    flex-basis: 42%;
  }
  th,
  td {
    padding: 12px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
