:root {
  --bg: #f4f5f2;
  --bg-strong: #333533;
  --panel: #ffffff;
  --panel-raised: #fbfbf8;
  --panel-soft: #ecece7;
  --text: #1b1d1b;
  --muted: #686c66;
  --line: #deded6;
  --line-strong: #c7c7bd;
  --accent: #303331;
  --accent-dark: #151615;
  --accent-warm: #b7ff4a;
  --warn: #8a5a00;
  --danger: #a03737;
  --shadow-sm: 0 1px 2px rgba(20, 22, 20, .08);
  --shadow-md: 0 18px 42px rgba(20, 22, 20, .12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(51, 53, 51, .08), transparent 230px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  min-height: 100vh;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--bg-strong);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 16px 36px rgba(20, 22, 20, .18);
  color: #fff;
  display: flex;
  gap: 24px;
  min-height: 72px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
}

.brand:hover,
.nav a:hover,
.link-button:hover {
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  overflow: hidden;
  width: 44px;
}

.brand-mark img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.brand-name {
  font-size: 18px;
  letter-spacing: .08em;
}

.nav {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.nav a,
.link-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 255, 255, .78);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
}

.nav a:hover,
.link-button:hover {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.nav-form {
  margin: 0;
}

.page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 34px 28px 48px;
}

.page-heading {
  align-items: flex-end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
  max-width: 820px;
}

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

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.summary-pill,
.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  white-space: nowrap;
}

.summary-pill {
  background: var(--accent-dark);
  box-shadow: var(--shadow-sm);
  color: #fff;
}

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

.metric,
.section,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric {
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.metric::before {
  background: var(--accent-dark);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.metric span,
.detail-grid span,
.record-list span,
.timeline span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1.05;
  margin-top: 8px;
}

.filters {
  align-items: flex-end;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  margin-bottom: 20px;
  padding: 16px;
}

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

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(48, 51, 49, .12);
  outline: 0;
}

.primary-button,
.secondary-button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
}

.primary-button {
  background: var(--accent-dark);
  border: 1px solid var(--accent-dark);
  color: #fff;
}

.primary-button:hover {
  background: #000;
  text-decoration: none;
}

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

.secondary-button:hover {
  border-color: var(--line-strong);
  text-decoration: none;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.section .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0 -18px -18px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

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

tbody tr:hover {
  background: #fafaf7;
}

td small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

tr:last-child td {
  border-bottom: 0;
}

.numeric {
  text-align: right;
}

.empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.status-draft,
.status-pending {
  background: #e8e8e2;
  color: #46524d;
}

.status-submitted,
.status-in_review {
  background: #fff3d8;
  color: var(--warn);
}

.status-approved,
.status-accepted {
  background: #e8f6db;
  color: #315b12;
}

.status-rejected,
.status-cancelled {
  background: #f8e2e2;
  color: var(--danger);
}

.detail-grid,
.three-column,
.two-column {
  display: grid;
  gap: 14px;
}

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

.detail-grid > div {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.detail-grid strong {
  display: block;
  font-size: 17px;
  margin-top: 7px;
}

.section {
  margin-bottom: 18px;
  padding: 18px;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline,
.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li,
.record-list li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.timeline li:last-child,
.record-list li:last-child {
  border-bottom: 0;
}

.auth-panel {
  margin: 72px auto 0;
  max-width: 440px;
  padding: 28px;
  position: relative;
}

.auth-panel::before {
  background: url("prll-logo.7695560761cf.jpg") center / cover no-repeat;
  border-radius: 50%;
  box-shadow: 0 0 0 8px #fff, var(--shadow-md);
  content: "";
  display: block;
  height: 76px;
  margin: -66px auto 22px;
  width: 76px;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

@media (max-width: 980px) {
  .metrics-grid,
  .detail-grid,
  .three-column,
  .two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
    position: static;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .page {
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .metrics-grid,
  .detail-grid,
  .three-column,
  .two-column,
  .filters {
    grid-template-columns: 1fr;
  }
}
