body.portal-page {
  background: #f7f4ee;
  color: #27302a;
}

.portal-shell {
  width: min(960px, calc(100% - 32px));
  margin: 110px auto 60px;
}

.portal-card {
  background: #fff;
  border: 1px solid #e3e9e4;
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(31, 55, 40, 0.08);
  padding: clamp(24px, 5vw, 48px);
}

.portal-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e3e9e4;
}

.portal-heading h1 { margin: 0 0 8px; }
.portal-kicker { color: #557761; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.reference { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff3cd;
  color: #6a5310;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.paid { background: #dff3e5; color: #225f35; }
.status-pill.error { background: #fbe2e2; color: #8b2929; }

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.detail-block {
  padding: 20px;
  background: #f8faf8;
  border-radius: 14px;
}
.detail-block.full { grid-column: 1 / -1; }
.detail-block h2 { font-size: 1.08rem; margin: 0 0 14px; }
.detail-list { display: grid; gap: 10px; margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(115px, 34%) 1fr; gap: 14px; }
.detail-row dt { color: #667269; }
.detail-row dd { margin: 0; overflow-wrap: anywhere; }

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid #e3e9e4;
}
.item-row.total { border: 0; padding-top: 16px; font-size: 1.15rem; font-weight: 700; }

.portal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.portal-note { margin-top: 22px; padding: 16px; border-left: 4px solid #7a9e7e; background: #f4f8f5; }
.portal-error { text-align: center; padding: 50px 20px; }
.portal-error h1 { margin-bottom: 12px; }
.muted { color: #68736b; }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.admin-toolbar input, .admin-toolbar select {
  min-height: 44px;
  border: 1px solid #ccd8cf;
  border-radius: 8px;
  padding: 9px 12px;
}
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #e3e9e4; vertical-align: top; }
.admin-table td { white-space: pre-line; }
.admin-table th { background: #f4f8f5; white-space: nowrap; }

@media (max-width: 700px) {
  .portal-shell { margin-top: 90px; }
  .portal-heading { display: block; }
  .portal-heading .status-pill { margin-top: 12px; }
  .portal-grid { grid-template-columns: 1fr; }
  .detail-block.full { grid-column: auto; }
  .detail-row { grid-template-columns: 1fr; gap: 2px; }
}

@media print {
  .header, .footer, .portal-actions, .no-print { display: none !important; }
  body.portal-page { background: #fff; }
  .portal-shell { width: 100%; margin: 0; }
  .portal-card { border: 0; box-shadow: none; padding: 0; }
}
