:root {
  --bg: #f3fbf7;
  --bg-warm: #fffaf4;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #24313d;
  --muted: #6f7d86;
  --line: #dcece6;
  --primary: #2aa889;
  --primary-dark: #1e7e6b;
  --coral: #f08a7d;
  --yellow: #f6c85f;
  --soft: #eef9f4;
  --ring: rgba(42, 168, 137, 0.18);
  --shadow: 0 18px 46px rgba(36, 49, 61, 0.09);
  --shadow-soft: 0 8px 24px rgba(36, 49, 61, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #edf9f4 0, #f8fbf9 42%, #fffaf4 100%);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  color: #fff;
  background: var(--primary);
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px max(26px, env(safe-area-inset-bottom));
}

.top-card,
.card,
.stat-card,
.story-card,
.message-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.top-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: rgba(246, 253, 249, 0.95);
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  padding: 14px 16px;
  backdrop-filter: blur(18px);
}

.hero-card {
  margin-top: 14px;
}

.compact-hero h1 {
  max-width: 780px;
}

.top-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(42, 168, 137, 0.12), transparent 44%),
    linear-gradient(135deg, transparent 66%, rgba(240, 138, 125, 0.12));
  pointer-events: none;
}

.top-card > * {
  position: relative;
  z-index: 1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  box-shadow: inset 0 -10px 18px rgba(30, 126, 107, 0.22);
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-note {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-actions::-webkit-scrollbar {
  display: none;
}

.logout-form {
  display: flex;
}

.text-button {
  min-height: 44px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--primary-dark);
}

.profile-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(42, 168, 137, 0.28);
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.profile-link:hover,
.profile-link:focus-visible,
.profile-link.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  transform: translateY(-1px);
}

.quick-card {
  display: grid;
  gap: 10px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin: 26px 0 10px;
  font-size: 29px;
  line-height: 1.28;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.35;
}

.subtitle,
.card-text {
  color: var(--muted);
  font-size: 16px;
}

.subtitle {
  max-width: 42rem;
  margin-bottom: 0;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 10px;
  border: 1px solid rgba(220, 236, 230, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 18px rgba(36, 49, 61, 0.05);
}

.user-pill strong,
.warm-chip {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  background: #dff5ee;
}

.blur-avatar {
  filter: blur(1.7px);
  transform: scale(1.02);
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.flash {
  position: relative;
  padding: 12px 14px;
  border: 1px solid #d9eee7;
  border-radius: 14px;
  color: var(--primary-dark);
  background: #eef9f4;
  font-size: 16px;
  box-shadow: var(--shadow-soft);
  animation: floatIn 0.22s ease-out;
}

.flash.success {
  color: #7a5a14;
  border-color: #f4df9f;
  background: #fff8dc;
}

.card {
  margin-top: 14px;
  padding: 18px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.action-card,
.paid-card,
.profile-card {
  border-color: rgba(42, 168, 137, 0.18);
}

.section-kicker {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
}

.button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button:focus-visible,
.profile-link:focus-visible,
.text-button:focus-visible,
.small-action:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 26px rgba(42, 168, 137, 0.22);
}

.button.primary:hover,
.button.primary:focus {
  background: linear-gradient(135deg, #31b996, var(--primary-dark));
  box-shadow: 0 16px 30px rgba(42, 168, 137, 0.26);
}

.button.secondary {
  color: var(--primary-dark);
  border: 1px solid rgba(42, 168, 137, 0.38);
  background: #f5fffb;
}

.button.secondary:hover,
.button.secondary:focus {
  border-color: var(--primary);
  background: #effcf7;
  box-shadow: 0 10px 22px rgba(42, 168, 137, 0.12);
}

.meal-button {
  margin-top: 4px;
}

.under-note,
.mini-note,
.gentle-reminder,
.thank-text {
  color: var(--muted);
  font-size: 15px;
}

.under-note {
  margin: 12px 0 0;
  text-align: center;
}

.warm-chip {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: #e8f8f1;
  text-align: center;
}

.loading-line {
  overflow: hidden;
  height: 9px;
  margin-top: 16px;
  border-radius: 999px;
  background: #dff5ee;
}

.loading-line span {
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  animation: loading 1.2s infinite ease-in-out;
}

@keyframes loading {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(220%);
  }
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-frame {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: #e7f6f1;
}

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

.file-label {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.file-label input,
.amount-label input,
.application-form input,
.admin-login-form input,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfded8;
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.file-label input:focus,
.amount-label input:focus,
.application-form input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  background: #fbfffd;
}

textarea {
  resize: vertical;
}

.upload-form,
.goodwill-form,
.application-form {
  display: grid;
  gap: 12px;
}

.application-box {
  display: grid;
  gap: 12px;
}

.application-box summary {
  list-style: none;
  position: relative;
}

.application-box summary::-webkit-details-marker {
  display: none;
}

.application-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: floatIn 0.22s ease-out;
}

.application-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.application-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: #eef9f4;
}

.application-steps span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.stat-card {
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 12px 6px;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stat-card:hover {
  border-color: rgba(42, 168, 137, 0.28);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.stat-card strong {
  color: var(--primary-dark);
  font-size: 27px;
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
}

.profile-card {
  scroll-margin-top: 18px;
}

.record-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.record-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffd;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.record-head h3 {
  margin: 0;
  font-size: 18px;
}

.record-head span,
.empty-text {
  color: var(--muted);
  font-size: 14px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-item {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #e6f1ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(36, 49, 61, 0.04);
}

.record-item > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-item strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.record-item span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.record-item dl {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
}

.record-item dt {
  color: var(--muted);
  font-size: 14px;
}

.record-item dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #f5fbf8;
}

.progress-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.progress-step::before {
  content: "";
  position: absolute;
  top: 8px;
  right: calc(50% + 11px);
  width: calc(100% - 14px);
  height: 2px;
  border-radius: 999px;
  background: #d9e9e3;
}

.progress-step:first-child::before {
  display: none;
}

.progress-step i {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: block;
  border: 2px solid #cfded8;
  border-radius: 999px;
  background: #fff;
}

.progress-step.done {
  color: var(--primary-dark);
  font-weight: 800;
}

.progress-step.done i {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(42, 168, 137, 0.12);
}

.progress-step.done::before {
  background: rgba(42, 168, 137, 0.55);
}

.progress-step.active {
  color: #8a6417;
  font-weight: 800;
}

.progress-step.active i {
  border-color: var(--yellow);
  background: #fff8dc;
  box-shadow: 0 0 0 4px rgba(246, 200, 95, 0.18);
}

.goodwill-form + .goodwill-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.profile-actions-grid {
  display: grid;
  gap: 12px;
}

.form-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: #f5fbf8;
  font-size: 15px;
}

.form-hint.strong {
  color: var(--primary-dark);
  background: #e8f8f1;
  font-weight: 800;
}

.settled-note {
  padding: 12px;
  border: 1px solid #d9eee7;
  border-radius: 12px;
  color: var(--primary-dark);
  background: #e8f8f1;
  font-weight: 800;
}

.cap-meter {
  overflow: hidden;
  height: 10px;
  margin: 14px 0 2px;
  border-radius: 999px;
  background: #e5f3ee;
}

.cap-meter span {
  display: block;
  width: min(var(--used), 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--yellow));
  transition: width 0.24s ease;
}

.settled-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffd;
}

.amount-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.story-section,
.message-section {
  margin-top: 24px;
}

.story-section > h2,
.message-section > h2 {
  padding: 0 4px;
}

.story-list {
  display: grid;
  gap: 14px;
}

.story-card,
.message-card {
  padding: 14px;
}

.story-card p,
.message-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.empty-story {
  min-height: 100px;
  display: grid;
  place-items: center;
  text-align: center;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.message-card + .message-card {
  margin-top: 12px;
}

.message-card small {
  display: block;
  margin-top: 8px;
  color: #8da099;
  font-size: 13px;
}

footer {
  padding: 28px 8px 10px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

@media (min-width: 420px) {
  .app-shell {
    padding-inline: 18px;
  }

  h1 {
    font-size: 32px;
  }
}

@media (max-width: 420px) {
  .site-header {
    top: 6px;
    padding: 12px;
  }

  .brand-row {
    gap: 8px;
  }

  .brand-note {
    display: none;
  }

  .profile-link {
    padding: 0 10px;
    font-size: 14px;
  }

  .application-steps {
    border-radius: 14px;
  }

  .application-steps span {
    min-height: 38px;
    border-radius: 12px;
    font-size: 12px;
  }

  .record-item > div {
    display: grid;
    gap: 4px;
  }

  .record-item span {
    text-align: left;
  }

  .admin-search-form {
    grid-template-columns: 1fr;
  }

  .user-profile-stats {
    grid-template-columns: 1fr;
  }
}

.admin-page {
  background:
    linear-gradient(180deg, #effaf6 0, #f8fbf9 42%, #fffaf4 100%);
}

.admin-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.admin-top,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tabs {
  position: sticky;
  top: 12px;
  z-index: 12;
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-top: 14px;
  padding: 0 0 8px;
  background: linear-gradient(180deg, rgba(239, 250, 246, 0.96), rgba(239, 250, 246, 0.78));
  backdrop-filter: blur(14px);
}

.admin-tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-tabs a.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.admin-login-card {
  width: min(100%, 460px);
  margin: 22px auto 0;
}

.admin-login-form {
  display: grid;
  gap: 12px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pool-card {
  border-color: rgba(42, 168, 137, 0.32);
  background: linear-gradient(180deg, #f5fffb, #ffffff);
}

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

.admin-panel {
  min-width: 0;
  padding: 14px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.admin-panel-head span {
  color: var(--muted);
  font-size: 14px;
}

.admin-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffd;
}

.admin-search-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfded8;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  background: #fff;
  font-size: 15px;
}

.admin-search-form .ghost {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}

.user-profile-list {
  display: grid;
  gap: 14px;
}

.user-profile-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.user-profile-head {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.user-profile-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.user-profile-head .mono {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.user-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.user-profile-stats span {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 14px;
  color: var(--muted);
  background: #f5fbf8;
  font-size: 13px;
  text-align: center;
}

.user-profile-stats strong {
  display: block;
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1;
}

.user-profile-grid {
  display: grid;
  gap: 12px;
}

.user-subpanel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6f1ec;
  border-radius: 14px;
  background: #fbfffd;
}

.admin-detail-list {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.admin-detail-list dt {
  color: var(--muted);
  font-size: 14px;
}

.admin-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.compact-user-edit {
  grid-template-columns: minmax(120px, 1fr);
}

.mini-record-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.mini-record-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #e6f1ec;
  border-radius: 12px;
  background: #fff;
}

.mini-record-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-record-item strong {
  color: var(--primary-dark);
}

.mini-record-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mini-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  white-space: nowrap;
}

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

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #fbfffd;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e8f8f1;
  font-size: 13px;
  font-weight: 700;
}

.admin-badge.pending {
  color: #8a6417;
  background: #fff4d6;
}

.admin-badge.pending_review {
  color: #7a5a14;
  background: #fff8dc;
}

.admin-badge.pending_pay {
  color: #8a6417;
  background: #fff4d6;
}

.admin-badge.paid {
  color: var(--primary-dark);
  background: #e8f8f1;
}

.admin-badge.rejected {
  color: #b42318;
  background: #fff4f2;
}

.admin-op-cell {
  min-width: 210px;
}

.admin-op-cell.wide {
  min-width: 420px;
}

.inline-edit-form {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(92px, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}

.grant-edit-form {
  grid-template-columns: minmax(68px, 0.6fr) minmax(120px, 1fr) minmax(64px, 0.5fr) minmax(120px, 1fr);
}

.grant-edit-form textarea,
.grant-edit-form button {
  grid-column: span 2;
}

.user-edit-form {
  grid-template-columns: minmax(110px, 1fr) 92px minmax(170px, 1.2fr) auto;
}

.inline-edit-form input,
.inline-edit-form select,
.inline-edit-form textarea,
.review-form input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #cfded8;
  border-radius: 9px;
  padding: 6px 8px;
  color: var(--text);
  background: #fff;
  font-size: 13px;
}

.inline-edit-form textarea {
  resize: vertical;
}

.review-form {
  display: grid;
  gap: 6px;
  margin-bottom: 7px;
}

.application-cell {
  min-width: 260px;
}

.application-cell strong,
.application-cell span {
  display: block;
  max-width: 320px;
  overflow-wrap: anywhere;
}

.application-cell span {
  color: var(--muted);
  font-size: 13px;
}

.small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(42, 168, 137, 0.34);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--primary-dark);
  background: #f5fffb;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.small-action:hover,
.small-action:focus-visible {
  border-color: var(--primary);
  background: #effcf7;
}

.small-action:active {
  transform: translateY(1px);
}

.small-action.danger {
  color: #b42318;
  border-color: #f1c2bd;
  background: #fff4f2;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.mini-check input {
  width: auto;
  min-height: auto;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-photo {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.admin-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  object-fit: cover;
  background: #e7f6f1;
}

@media (min-width: 760px) {
  .app-shell {
    width: min(100%, 1080px);
    padding: 24px 22px 34px;
  }

  .top-card {
    padding: 28px;
  }

  .site-header {
    padding: 16px 20px;
  }

  h1 {
    font-size: 40px;
    max-width: 720px;
  }

  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 16px;
    align-items: start;
    margin-top: 16px;
  }

  .card:hover,
  .top-card:hover {
    box-shadow: 0 20px 50px rgba(36, 49, 61, 0.11);
  }

  .home-main .card:first-child,
  .home-side .stats-grid {
    margin-top: 0;
  }

  .home-side {
    position: sticky;
    top: 18px;
  }

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

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

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

  .profile-actions-grid .goodwill-form + .goodwill-form {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .message-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .message-section h2 {
    grid-column: 1 / -1;
  }

  .message-card + .message-card {
    margin-top: 0;
  }

  .admin-shell {
    padding: 24px 22px 34px;
  }

  .admin-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-search-form {
    grid-template-columns: minmax(320px, 1fr) auto auto;
  }

  .user-profile-head {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
    align-items: start;
  }

  .user-profile-grid {
    grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1fr) minmax(300px, 0.95fr);
    align-items: start;
  }

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

  .admin-panel:first-child,
  .admin-panel:nth-child(2),
  .admin-panel:nth-child(4) {
    grid-column: 1 / -1;
  }

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

@media (min-width: 1100px) {
  .story-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
