:root {
  --pf-primary: #80011f;
  --pf-background: #ffffff;
  --pf-text: #111827;
  --pf-muted: #6b7280;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--pf-background);
  color: var(--pf-text);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--pf-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.page { min-height: 100vh; background: var(--pf-background); }
.page--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  padding: max(2rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-left)) 0 max(1rem, env(safe-area-inset-right));
}
.header {
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
}
@media (min-width: 640px) {
  .header { padding: 1.5rem 0; }
}
.header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  margin: 0;
  font-size: .875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pf-primary);
}
.brand__link {
  color: inherit;
  text-decoration: none;
}
.brand__link:hover { text-decoration: underline; }
.title {
  margin: .25rem 0 0;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
}
.subtitle {
  margin: .25rem 0 0;
  font-size: .875rem;
  color: var(--pf-muted);
}
.main { padding: 1.25rem 0 2rem; }
@media (min-width: 640px) {
  .main { padding: 2rem 0; }
}
.main--spaced > * + * { margin-top: 1.5rem; }
@media (min-width: 640px) {
  .main--spaced > * + * { margin-top: 2rem; }
}
.card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: var(--pf-background);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card--narrow { width: 100%; max-width: 24rem; padding: 2rem 1.5rem; }
.card__header {
  border-bottom: 1px solid #e5e7eb;
  padding: .875rem 1rem;
}
@media (min-width: 640px) {
  .card__header { padding: 1rem 1.25rem; }
}
.card__title { margin: 0; font-size: .875rem; font-weight: 600; }
.grid { display: grid; gap: .875rem; }
@media (min-width: 640px) {
  .grid { gap: 1rem; }
}
.grid--4 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }
.stat-card { padding: 1rem 1.25rem; }
@media (min-width: 640px) {
  .stat-card { padding: 1.25rem; }
}
.stat-card__label { margin: 0; font-size: .875rem; color: var(--pf-muted); }
.stat-card__value {
  margin: .375rem 0 0;
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  font-weight: 700;
  line-height: 1.2;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap--scroll-hint {
  position: relative;
}
@media (max-width: 639px) {
  .table-wrap--scroll-hint::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2rem;
    pointer-events: none;
    background: linear-gradient(to left, rgba(255,255,255,.95), transparent);
  }
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  text-align: left;
}
.table--wide { min-width: 40rem; }
.table--extra-wide { min-width: 45rem; }
.table th {
  padding: .625rem 1rem;
  font-weight: 500;
  color: var(--pf-muted);
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}
.table td {
  padding: .625rem 1rem;
  border-bottom: 1px solid #f9fafb;
  vertical-align: middle;
}
@media (min-width: 640px) {
  .table th { padding: .75rem 1.25rem; }
  .table td { padding: .75rem 1.25rem; }
}
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { font-weight: 500; }
.text-muted { color: var(--pf-muted); }
@media (max-width: 639px) {
  .table--responsive { min-width: 0; }
  .table--responsive thead { display: none; }
  .table--responsive tbody tr {
    display: block;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
  }
  .table--responsive tbody tr:last-child { border-bottom: 0; }
  .table--responsive td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .375rem 0;
    border-bottom: 0;
    text-align: right;
  }
  .table--responsive td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--pf-muted);
    font-size: .75rem;
    text-align: left;
    flex: 0 0 auto;
    max-width: 45%;
  }
  .table--responsive td:first-child {
    font-weight: 600;
    font-size: .9375rem;
    padding-top: 0;
  }
  .table--responsive td:first-child::before { display: none; }
  .table--responsive td:last-child { padding-bottom: 0; }
  .table--responsive td a { word-break: break-word; }
}
.badge {
  display: inline-block;
  border-radius: 9999px;
  padding: .125rem .625rem;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge--active { background: rgba(128,1,31,.1); color: var(--pf-primary); }
.badge--pending { background: #fef3c7; color: #92400e; }
.badge--closed { background: #f3f4f6; color: var(--pf-muted); }
.nav-card {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  padding: 1rem 1.25rem;
  color: var(--pf-text);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
@media (min-width: 640px) {
  .nav-card { padding: 1.25rem; min-height: 3.5rem; }
}
.nav-card:hover {
  border-color: rgba(128,1,31,.3);
  background: rgba(128,1,31,.05);
  text-decoration: none;
}
.nav-card__label { margin: 0; font-size: .875rem; font-weight: 600; }
.field { margin-bottom: 1.25rem; }
label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
}
input {
  margin-top: .375rem;
  width: 100%;
  padding: .625rem .75rem;
  font-size: .875rem;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  color: var(--pf-text);
}
input:focus {
  outline: none;
  border-color: var(--pf-primary);
  box-shadow: 0 0 0 3px rgba(128,1,31,.15);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .625rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  border-radius: .5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 2.75rem;
}
.btn:hover { text-decoration: none; }
.btn--primary { color: #fff; background: var(--pf-primary); }
.btn--primary:hover { opacity: .9; }
.btn--block { width: 100%; }
@media (max-width: 639px) {
  .header__inner .btn { width: 100%; }
}
.back-link {
  display: block;
  margin-top: 1.5rem;
  text-align: center;
  font-size: .875rem;
  font-weight: 500;
}
