:root {
  --bg: #f7f3ec;
  --card: #fffaf2;
  --ink: #16211a;
  --muted: #4d5a51;
  --accent: #0b6e4f;
  --accent-2: #d99f30;
  --line: #d8d3c8;
  --danger: #a53f2b;
  --radius: 18px;
  --shadow: 0 16px 30px rgba(11, 33, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #fce7cb, transparent 42%),
    radial-gradient(circle at 90% 10%, #cee6dd, transparent 40%),
    var(--bg);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
}

.ambient-shape {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.38;
}

.shape-a {
  width: 320px;
  height: 320px;
  top: -80px;
  right: -40px;
  background: #f6b646;
}

.shape-b {
  width: 260px;
  height: 260px;
  left: -60px;
  bottom: 10%;
  background: #2fa579;
}

.page {
  width: min(1120px, 94vw);
  margin: 34px auto;
  display: grid;
  gap: 24px;
  position: relative;
  z-index: 1;
  animation: slideIn 520ms ease-out;
}

.page.single-col {
  width: min(860px, 94vw);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-nav a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid #c8c2b5;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff8ee;
  font-weight: 500;
}

.top-nav a[aria-current='page'] {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.hero h1 {
  margin: 10px 0;
  font-family: 'Literata', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.hero p {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
}

.form-notice {
  margin: 0 0 12px;
  min-height: 1.2em;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.form-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

.form-notice[data-type='success'] {
  color: var(--accent);
}

.form-notice[data-type='error'] {
  color: var(--danger);
}

.queue-notice {
  margin: -8px 0 0;
  padding: 0;
  min-height: 0;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-weight: 600;
}

.queue-notice.visible {
  opacity: 1;
  transform: translateY(0);
  min-height: 1.4em;
}

.queue-notice[data-type='error'] {
  color: var(--danger);
}

.queue-notice[data-type='success'] {
  color: var(--accent);
}

.eyebrow {
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.cards {
  display: grid;
  gap: 18px;
}

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

.two-col {
  grid-template-columns: 1.2fr 1fr;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.metric {
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
}

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

.form-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0 14px;
  background: #fffdf9;
}

.form-section h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.approval-summary {
  background: #f8f5ee;
}

.approval-summary-text {
  margin: 0 0 8px;
  color: var(--muted);
}

.approval-summary-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.checkset {
  border: 1px dashed #c9c4b8;
  border-radius: 12px;
  padding: 10px;
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.checkset label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

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

input,
select,
textarea {
  border: 1px solid #c8c2b5;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.auto-field,
input:disabled.auto-field {
  background: #f1eee8;
  color: #6d766f;
  border-style: dashed;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

.btn {
  border: 1px solid #b9b3a8;
  border-radius: 999px;
  background: #f4f2ee;
  padding: 7px 11px;
  cursor: pointer;
}

.btn:hover {
  background: #ece8e2;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn.primary:hover {
  background: #08513a;
}

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-head {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.request-list {
  display: grid;
  gap: 10px;
  max-height: 840px;
  overflow: auto;
  padding-right: 5px;
}
.request-item {
  border: 1px solid #d5cec1;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  background: #fff;
  align-items: start;
}

.request-item.request-item-focus {
  border-color: #0b6e4f;
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.12);
}

.request-item h3 {
  margin: 0 0 8px;
}

.request-item p {
  margin: 0 0 6px;
}

.request-main {
  min-width: 0;
}

.request-main h3,
.request-main p {
  overflow-wrap: anywhere;
}

.request-main [data-field='receipt'] {
  font-size: 0.9rem;
  margin-top: 4px;
}

.request-main [data-field='receipt'] a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.request-main [data-field='receipt'] a:hover {
  text-decoration: underline;
}

.request-details-wrap {
  margin-top: 8px;
  border: 1px solid #ddd5c8;
  border-radius: 10px;
  background: #fffaf4;
  overflow: hidden;
}

.request-details-wrap summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 12px;
  font-weight: 600;
  background: #f4ede2;
}

.request-details-wrap summary::-webkit-details-marker {
  display: none;
}

.request-details-wrap summary::after {
  content: '+';
  float: right;
  font-weight: 700;
}

.request-details-wrap[open] summary::after {
  content: '-';
}

.request-details {
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
}

.details-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.details-row {
  padding: 8px;
  border: 1px solid #e1d8ca;
  border-radius: 8px;
  background: #fff;
}

.details-row dt {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5f675f;
  margin-bottom: 3px;
}

.details-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.details-row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.details-row a:hover {
  text-decoration: underline;
}

.request-details h4 {
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.history-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: #2f3831;
}

.request-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px dashed #d9d1c3;
}

.pill {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  background: #e9ece8;
  display: inline-flex;
  align-items: center;
  text-transform: capitalize;
  align-self: start;
}

.amount {
  font-weight: 700;
  margin: 0;
}

.workflow-progress {
  display: grid;
  gap: 6px;
  min-width: 280px;
}

.progress-text {
  margin: 0;
  font-size: 0.82rem;
  color: #4e5c52;
}

.progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.progress-step {
  border: 1px solid #d2cabd;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.76rem;
  color: #617064;
  background: #f7f2ea;
}

.progress-step.done {
  background: #d5efe2;
  border-color: #9fcab4;
  color: #1f5d45;
}

.progress-step.current {
  background: #f2d8aa;
  border-color: #d8a34a;
  color: #5d421a;
  font-weight: 700;
}

.progress-step.current.approved-current {
  background: #d5efe2;
  border-color: #9fcab4;
  color: #1f5d45;
}

.progress-step.blocked {
  background: #ece8df;
  color: #8a8f87;
}

.actions {
  width: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  align-self: auto;
}

.actions .btn {
  width: auto;
  text-align: center;
  padding: 8px 10px;
  line-height: 1.15;
  border-radius: 12px;
  white-space: nowrap;
}

.settings-rows {
  display: grid;
  gap: 10px;
}

.settings-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.settings-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.muted-note {
  color: var(--muted);
  min-height: 1.2em;
}

.status-draft {
  background: #e6e6e6;
}

.status-submitted {
  background: #fde1b2;
}

.status-manager_approved,
.status-pastor_approved,
.status-finance_approved {
  background: #d2f1e3;
}

.status-rejected {
  background: #f8cdc5;
  color: var(--danger);
}

.status-paid {
  background: #c6e6fa;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 15, 0.32);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 18px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 26px 50px rgba(10, 19, 14, 0.25);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.modal-card h3 {
  margin: 0;
  font-family: 'Literata', serif;
}

.modal-subtext {
  margin: 0;
  color: var(--muted);
}

.modal-label {
  margin: 0;
  font-size: 0.85rem;
  color: #4e5650;
}

.modal-error {
  margin: 0;
  min-height: 1.2em;
  color: var(--danger);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes slideIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .summary-grid,
  .two-col,
  .grid,
  .settings-row {
    grid-template-columns: 1fr;
  }

  .request-item {
    grid-template-columns: 1fr;
  }

  .request-side {
    display: grid;
    justify-items: start;
    min-width: 0;
    border-top: 0;
    padding-top: 0;
  }

  .workflow-progress {
    min-width: 0;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .actions .btn {
    width: 100%;
    white-space: normal;
  }

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