/* ============================================================
   Nasr — Campaign Ledger
   Editorial, finance-grade aesthetic: warm paper, pine ink,
   serif display (Fraunces) + humanist body (Karla).
   ============================================================ */

:root {
  --paper: #f3eee3;
  --card: #fffdf7;
  --ink: #1d2a24;
  --ink-soft: #5c6660;
  --ink-faint: #8b9189;
  --pine: #1e5a45;
  --pine-deep: #143d2f;
  --pine-wash: #e7efe9;
  --gold: #b07d2c;
  --hairline: #e3dac5;
  --hairline-strong: #cfc4a8;
  --danger: #a23b2e;
  --danger-wash: #f7e8e4;
  --success-wash: #e6f0e9;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(29, 42, 36, 0.06), 0 16px 48px -16px rgba(29, 42, 36, 0.18);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Karla", "Gill Sans", "Segoe UI", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--pine);
  color: var(--card);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(30, 90, 69, 0.08), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px 72px;
}

/* ---------- Card ---------- */

.container {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-top: 4px solid var(--pine);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 52px 44px;
  max-width: 640px;
  width: 100%;
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered reveal for direct sections of the card */
.container > * {
  animation: section-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.container > *:nth-child(1) { animation-delay: 0.05s; }
.container > *:nth-child(2) { animation-delay: 0.12s; }
.container > *:nth-child(3) { animation-delay: 0.19s; }
.container > *:nth-child(4) { animation-delay: 0.26s; }
.container > *:nth-child(5) { animation-delay: 0.33s; }
.container > *:nth-child(6) { animation-delay: 0.40s; }
.container > *:nth-child(7) { animation-delay: 0.47s; }

@keyframes section-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Brand ---------- */

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--hairline);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--pine-deep);
  text-decoration: none;
}

.brand-mark em {
  font-style: italic;
  color: var(--gold);
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Typography ---------- */

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 10px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}

.lede {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 46ch;
}

.campaign-header {
  text-align: center;
  margin-bottom: 30px;
}

.campaign-header .lede {
  margin: 0 auto;
}

/* Small-caps section label with rule, e.g. "Donation ledger" */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ---------- Forms ---------- */

.form-group {
  margin-bottom: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6660' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Target amount + currency: amount gets the wider column */
.form-row--amount {
  grid-template-columns: 1.6fr 1fr;
}

input::placeholder,
textarea::placeholder {
  color: #b3ac99;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(30, 90, 69, 0.14);
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- Buttons ---------- */

button {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--card);
  background: var(--pine);
  border: 1px solid var(--pine-deep);
  border-radius: 4px;
  padding: 13px 26px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover {
  background: var(--pine-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px rgba(20, 61, 47, 0.45);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

.block-btn {
  width: 100%;
  display: block;
}

.secondary-btn {
  background: transparent;
  color: var(--pine-deep);
  border: 1px solid var(--hairline-strong);
  margin-top: 10px;
  width: 100%;
}

.secondary-btn:hover {
  background: var(--pine-wash);
  border-color: var(--pine);
  box-shadow: none;
}

.delete-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
}

.delete-btn:hover {
  background: var(--danger-wash);
  border-color: var(--danger);
  transform: none;
  box-shadow: none;
}

/* ---------- Campaign stats ---------- */

.amount-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--pine-deep);
  font-variant-numeric: tabular-nums;
  margin: 26px 0 6px;
}

.amount-target {
  font-size: 15px;
  color: var(--ink-soft);
}

.amount-target strong,
.amount-target span {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e9e2d0;
  border-radius: 99px;
  overflow: hidden;
  margin: 24px 0 10px;
  box-shadow: inset 0 1px 2px rgba(29, 42, 36, 0.12);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pine) 0%, var(--pine-deep) 100%);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 0;          /* hides any percentage text injected into the bar */
  color: transparent;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.progress-meta .funded {
  color: var(--pine);
}

/* ---------- Home register: new-campaign CTA ---------- */

/* The call to open a campaign, set as a filing card with a gold spine —
   echoing the bank slips and drawer so the home reads as the same ledger. */
.new-campaign-cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px 18px 26px;
  margin-bottom: 36px;
  background: #faf6ec;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.new-campaign-cta::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(180deg, var(--gold) 0 8px, transparent 8px 13px);
}

.new-campaign-cta:hover,
.new-campaign-cta:focus-visible {
  border-color: var(--pine);
  box-shadow: 0 14px 30px -16px rgba(20, 61, 47, 0.45);
  transform: translateY(-2px);
  outline: none;
}

.new-campaign-cta-mark {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--card);
  background: var(--pine);
  border: 1px solid var(--pine-deep);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.new-campaign-cta:hover .new-campaign-cta-mark {
  background: var(--pine-deep);
  transform: rotate(90deg);
}

.new-campaign-cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.new-campaign-cta-text strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--pine-deep);
}

.new-campaign-cta-text small {
  font-size: 13px;
  color: var(--ink-soft);
}

.new-campaign-cta-arrow {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--gold);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.new-campaign-cta:hover .new-campaign-cta-arrow {
  transform: translateX(4px);
}

/* ---------- Home register: campaign cards ---------- */

.campaign-index {
  list-style: none;
  display: grid;
  gap: 16px;
}

/* Each campaign rendered as a ledger entry: paper card, name in the
   display serif, raised/goal set in tabular figures, a mini progress rule. */
.campaign-card {
  display: block;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--hairline-strong);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
  animation: section-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.campaign-index li:nth-child(2) .campaign-card { animation-delay: 0.05s; }
.campaign-index li:nth-child(3) .campaign-card { animation-delay: 0.10s; }
.campaign-index li:nth-child(4) .campaign-card { animation-delay: 0.15s; }
.campaign-index li:nth-child(5) .campaign-card { animation-delay: 0.20s; }
.campaign-index li:nth-child(n+6) .campaign-card { animation-delay: 0.24s; }

.campaign-card:hover,
.campaign-card:focus-visible {
  border-color: var(--hairline-strong);
  border-left-color: var(--pine);
  box-shadow: 0 14px 30px -18px rgba(29, 42, 36, 0.4);
  transform: translateY(-2px);
  outline: none;
}

.campaign-card--funded {
  border-left-color: var(--gold);
}

.campaign-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.campaign-card-head h2 {
  font-size: 20px;
  margin: 0;
  line-height: 1.2;
}

.campaign-card-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine);
  background: var(--pine-wash);
  border-radius: 99px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}

.campaign-card--funded .campaign-card-badge {
  color: var(--gold);
  background: rgba(176, 125, 44, 0.12);
}

.campaign-card-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.campaign-card-amount .raised {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: var(--pine-deep);
  font-variant-numeric: tabular-nums;
}

.campaign-card-amount .goal {
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.progress-bar--mini {
  height: 7px;
  margin: 0 0 14px;
}

.campaign-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.campaign-card-cur {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.campaign-card-open {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pine);
  transition: transform 0.2s ease;
}

.campaign-card:hover .campaign-card-open {
  transform: translateX(3px);
}

/* ---------- Home register: empty state ---------- */

.register-empty {
  text-align: center;
  padding: 36px 20px 40px;
  background: #faf6ec;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius);
}

.register-empty-glyph {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 40px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 12px;
}

.register-empty p {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
  margin: 0 0 4px;
}

.register-empty small {
  font-size: 13.5px;
  color: var(--ink-faint);
}

/* ---------- Back link ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--pine);
}

/* ---------- Bank transfer details ---------- */

.bank-section { margin-top: 38px; }

.bank-list {
  display: grid;
  gap: 12px;
}

/* Each account rendered as a remittance slip: paper card,
   gold filing edge, account number set like a ledger entry. */
.bank-slip {
  position: relative;
  padding: 16px 18px 14px 22px;
  background: #faf6ec;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  animation: section-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bank-slip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(
    180deg,
    var(--gold) 0 8px,
    transparent 8px 13px
  );
}

.bank-slip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bank-slip-bank {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pine);
}

.bank-slip-holder {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin: 4px 0 8px;
}

.bank-slip-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--hairline-strong);
}

.bank-slip-number .account-number {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.copy-btn {
  flex-shrink: 0;
  background: transparent;
  color: var(--pine-deep);
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.copy-btn:hover {
  background: var(--pine-wash);
  border-color: var(--pine);
  transform: none;
  box-shadow: none;
}

.copy-btn.copied {
  color: var(--gold);
  border-color: var(--gold);
  background: transparent;
}

/* ---------- Donations ledger ---------- */

.donations-list {
  margin-top: 38px;
}

/* Toolbar: search + sort */
.donations-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.donations-search-wrap {
  flex: 1;
  position: relative;
}

.donations-search-wrap input[type="search"] {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.donations-search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(30, 90, 69, 0.14);
}

.donations-search-wrap input[type="search"]::placeholder {
  color: #b3ac99;
}

.donations-sort {
  flex-shrink: 0;
  width: auto;
  padding: 9px 32px 9px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--ink-soft);
  background-color: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6660' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.donations-sort:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(30, 90, 69, 0.14);
}

.donation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s ease;
}

.donation-item:last-child {
  border-bottom: none;
}

/* Drag-over highlight when admin drops a proof file */
.donation-item--proof-dragover {
  background: var(--pine-wash);
  border-radius: 4px;
  outline: 2px dashed var(--pine);
  outline-offset: -2px;
}

.donation-item--uploading {
  opacity: 0.6;
  pointer-events: none;
}

.donation-info h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 2px;
}

.donation-info p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* Right-side wrapper: amount + proof icon + admin buttons */
.donation-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.donation-amount {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--pine-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Proof icon: view proof (public + admin) */
.proof-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  background: transparent;
  color: var(--pine);
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.proof-icon:hover {
  background: var(--pine-wash);
  border-color: var(--pine);
  transform: none;
  box-shadow: none;
}

/* Proof add: admin label wrapping hidden file input */
.proof-add {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  background: transparent;
  color: var(--ink-faint);
  border: 1px dashed var(--hairline-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.proof-add:hover {
  background: var(--pine-wash);
  border-color: var(--pine);
  color: var(--pine);
}

.proof-add input[type="file"] {
  display: none;
}

/* Edit button */
.edit-btn {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid transparent;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
}

.edit-btn:hover {
  background: #f0ece0;
  border-color: var(--hairline-strong);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

/* Inline donation edit form */
.donation-edit-form {
  width: 100%;
  padding: 14px 2px;
}

.donation-edit-fields {
  display: grid;
  grid-template-columns: 1fr 140px 180px;
  gap: 10px;
  margin-bottom: 10px;
}

.donation-edit-fields label {
  font-size: 10px;
  margin-bottom: 4px;
}

.donation-edit-fields input {
  padding: 8px 10px;
  font-size: 13.5px;
}

.donation-edit-btns {
  display: flex;
  gap: 8px;
}

.edit-save-btn {
  padding: 8px 20px;
  font-size: 13px;
}

.edit-cancel-btn {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--hairline-strong);
  padding: 8px 16px;
  font-size: 13px;
  margin-top: 0;
  width: auto;
}

.edit-cancel-btn:hover {
  background: #f0ece0;
  border-color: var(--hairline-strong);
  transform: none;
  box-shadow: none;
}

/* Organizer proof tip note */
.proof-tip {
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
  margin: 12px 0 0;
}

.empty-note {
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
  padding: 18px 0;
}

.donations-pagination {
  margin-top: 4px;
}

.donations-pagination button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.pagination-meta {
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 0;
}

/* ---------- Admin / organizer sections ---------- */

.admin-section {
  margin-top: 38px;
  padding: 28px;
  background: #faf6ec;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.admin-section h2 {
  margin-bottom: 4px;
}

.admin-section .lede {
  font-size: 14px;
  margin-bottom: 22px;
}

/* ---------- Messages ---------- */

.error,
.success {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  animation: section-rise 0.3s ease both;
}

.error {
  color: var(--danger);
  background: var(--danger-wash);
  border: 1px solid #e4c4bc;
  border-left: 3px solid var(--danger);
}

.success {
  color: var(--pine-deep);
  background: var(--success-wash);
  border: 1px solid #c4d8ca;
  border-left: 3px solid var(--pine);
}

/* ---------- Footer ---------- */

.page-foot {
  text-align: center;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

.page-foot a {
  color: var(--pine);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.page-foot a:hover {
  color: var(--pine-deep);
  border-bottom-color: var(--pine-deep);
}

a {
  color: var(--pine);
}

/* ---------- Utilities ---------- */

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ---------- Documents: archive gallery ---------- */

.documents-section { margin-top: 38px; }

.doc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 14px;
}

/* A thumbnail rendered as an archival photo plate: paper mat,
   hairline frame, lifts off the ledger on hover. */
.doc-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(29, 42, 36, 0.1);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease, border-color 0.25s ease;
  animation: section-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.doc-tile:nth-child(odd)  { animation-delay: 0.04s; }
.doc-tile:nth-child(3n)   { animation-delay: 0.09s; }

.doc-tile:hover,
.doc-tile:focus-visible {
  transform: translateY(-3px) rotate(-0.6deg);
  border-color: var(--pine);
  box-shadow: 0 14px 28px -12px rgba(20, 61, 47, 0.4);
  outline: none;
}

.doc-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  background: #f1ecdf;
  display: block;
  filter: saturate(0.96);
  transition: filter 0.25s ease;
}

.doc-tile:hover img { filter: saturate(1.05); }

/* Video tile: first-frame thumbnail with a play overlay; opens the slider on click. */
.doc-tile--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  background: #0d1411;
  display: block;
  pointer-events: none; /* clicks fall through to the figure → openLightbox */
}

.doc-tile--video .doc-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(13, 20, 17, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

/* play triangle */
.doc-tile--video .doc-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
}

.doc-tile--video:hover .doc-play,
.doc-tile--video:focus-visible .doc-play {
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(20, 61, 47, 0.8);
}

/* PDF tile: a stamped document card rather than a photo plate */
.doc-tile--pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(30, 90, 69, 0.05) 9px 10px),
    #faf6ec;
  text-decoration: none;
}

.doc-tile--pdf .doc-stamp {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: var(--card);
  background: var(--pine);
  border: 1px solid var(--pine-deep);
  border-radius: 2px;
  padding: 3px 10px;
  transform: rotate(-3deg);
}

.doc-tile--pdf .doc-tile-name {
  max-width: 92%;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-tile-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  color: var(--card);
  background: var(--danger);
  border: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.doc-tile:hover .doc-tile-delete,
.doc-tile-delete:focus-visible { opacity: 1; }
.doc-tile-delete:hover { background: #872f24; transform: scale(1.08); }

/* Organizer reordering */
.doc-reorder-hint {
  margin: -6px 0 14px;
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

.doc-gallery.reorderable .doc-tile { cursor: grab; }
.doc-gallery.reorderable .doc-tile:active { cursor: grabbing; }

.doc-tile.dragging {
  opacity: 0.45;
  transform: scale(0.96) rotate(0.6deg);
  border-style: dashed;
}

/* ---------- Organizer upload (drag & drop) ---------- */

.drag-drop-area {
  border: 1.5px dashed var(--hairline-strong);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  margin-bottom: 14px;
}

.drag-drop-area:hover,
.drag-drop-area:focus-visible {
  border-color: var(--pine);
  background: var(--pine-wash);
  outline: none;
}

.drag-drop-area.dragover {
  border-color: var(--pine);
  border-style: solid;
  background: var(--pine-wash);
  transform: scale(1.01);
}

.drag-drop-area p {
  color: var(--pine-deep);
  margin: 6px 0 0;
  font-weight: 700;
}

.drag-drop-area small {
  color: var(--ink-faint);
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
}

.drag-drop-glyph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  color: var(--gold);
  line-height: 1;
}

#fileInput { display: none; }

.upload-queue { margin-bottom: 14px; }

.upload-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 13px;
  animation: section-rise 0.3s ease both;
}

.upload-queue-item .name {
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-queue-item .size { color: var(--ink-faint); font-size: 12px; white-space: nowrap; }

.upload-queue-item.uploading .size { color: var(--gold); }

/* ---------- Lightbox: the plate viewer ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 40%, rgba(30, 90, 69, 0.22), transparent 70%),
    rgba(13, 20, 17, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  position: relative;
  max-width: min(1100px, calc(100vw - 32px));
  max-height: calc(100dvh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  background: #0d1411;
  border: 6px solid var(--card);
  border-radius: 2px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

/* fill-mode deliberately left at none — a persistent fill would pin
   opacity/transform and break the slide-left/right navigation classes */
.lightbox.open .lightbox-stage img { animation: plate-in 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes plate-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-stage img.slide-left  { opacity: 0; transform: translateX(-28px); transition: none; }
.lightbox-stage img.slide-right { opacity: 0; transform: translateX(28px);  transition: none; }

.lightbox-stage video {
  max-width: 100%;
  max-height: calc(100dvh - 150px);
  background: #0d1411;
  border: 6px solid var(--card);
  border-radius: 2px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.lightbox-stage video[hidden] { display: none; }

/* Top chrome: counter centered, close at right */
.lightbox-counter {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.lightbox-counter span { color: rgba(243, 238, 227, 0.55); }

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(620px, calc(100vw - 120px));
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(243, 238, 227, 0.75);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(243, 238, 227, 0.3);
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(243, 238, 227, 0.12);
  transform: rotate(90deg);
  box-shadow: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: var(--paper);
  background: rgba(30, 90, 69, 0.55);
  border: 1px solid rgba(243, 238, 227, 0.2);
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.15s ease;
  z-index: 2;
}

.lightbox-nav:hover {
  background: var(--pine);
  transform: translateY(-50%) scale(1.06);
  box-shadow: none;
}

.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

body.lightbox-open { overflow: hidden; }

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  body { padding: 24px 14px 48px; }

  .container { padding: 30px 24px 28px; }

  h1 { font-size: 28px; }

  .amount-display { font-size: 42px; }

  .form-row { grid-template-columns: 1fr; gap: 0; }

  .drag-drop-area { padding: 20px 14px; }

  .doc-gallery {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
  }

  /* Touch devices: keep delete reachable without hover */
  .doc-tile-delete { opacity: 1; width: 26px; height: 26px; }

  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }

  .lightbox-stage { max-height: calc(100dvh - 120px); }
  .lightbox-stage img,
  .lightbox-stage video { max-height: calc(100dvh - 120px); border-width: 4px; }

  .lightbox-caption { max-width: calc(100vw - 32px); bottom: 14px; }

  .donations-toolbar { flex-wrap: wrap; }
  .donations-sort { width: 100%; }

  .donation-edit-fields {
    grid-template-columns: 1fr;
  }
}

/* ---------- Organizer drawer ---------- */

.drawer-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 90;
  display: none;
  align-items: center;
  gap: 12px;
  writing-mode: vertical-rl;
  padding: 20px 11px;
  font-family: "Karla", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--pine);
  border: 1px solid var(--pine-deep);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: -8px 8px 28px -10px rgba(20, 61, 47, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

body.admin-mode .drawer-tab { display: inline-flex; }

.drawer-tab:hover,
.drawer-tab:focus-visible {
  background: var(--pine-deep);
  transform: translateY(-50%) translateX(-3px);
}

.drawer-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 125, 44, 0.3);
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(13, 20, 17, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.drawer-scrim.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 96;
  width: min(460px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-left: 1px solid var(--hairline-strong);
  box-shadow: -28px 0 72px -28px rgba(13, 20, 17, 0.5);
  transform: translateX(calc(100% + 48px));
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
}

.drawer.open {
  transform: translateX(0);
  visibility: visible;
}

/* Gold filing edge along the drawer's spine, echoing the bank slips */
.drawer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(
    180deg,
    var(--gold) 0 8px,
    transparent 8px 13px
  );
}

body.drawer-open { overflow: hidden; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 28px 18px;
  border-bottom: 1px dashed var(--hairline-strong);
}

.drawer-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

.drawer-title {
  font-family: "Fraunces", serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--pine-deep);
  margin: 0;
}

.drawer-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 15px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.3s ease;
}

.drawer-close:hover,
.drawer-close:focus-visible {
  background: var(--pine-wash);
  color: var(--pine-deep);
  transform: rotate(90deg);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 28px 20px;
}

.drawer-body .form-row {
  grid-template-columns: 1fr;
  gap: 0;
}

.drawer-section {
  border-bottom: 1px solid var(--hairline);
}

.drawer.open .drawer-section {
  animation: section-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.drawer.open .drawer-section:nth-child(2) { animation-delay: 0.08s; }
.drawer.open .drawer-section:nth-child(3) { animation-delay: 0.14s; }
.drawer.open .drawer-section:nth-child(4) { animation-delay: 0.20s; }
.drawer.open .drawer-section:nth-child(5) { animation-delay: 0.26s; }
.drawer.open .drawer-section:nth-child(6) { animation-delay: 0.32s; }

.drawer-section summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 2px;
  cursor: pointer;
  user-select: none;
}

.drawer-section summary::-webkit-details-marker { display: none; }

.drawer-section summary:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
  border-radius: 3px;
}

.drawer-section-no {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  color: var(--gold);
}

.drawer-section-title {
  flex: 1;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.drawer-section summary:hover .drawer-section-title,
.drawer-section[open] .drawer-section-title {
  color: var(--pine-deep);
}

.drawer-section-marker {
  align-self: center;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.drawer-section-marker::before {
  content: "+";
  font-family: "Fraunces", serif;
  font-size: 19px;
  line-height: 1;
  color: var(--ink-faint);
  transition: transform 0.25s ease, color 0.25s ease;
}

.drawer-section[open] .drawer-section-marker::before {
  transform: rotate(45deg);
  color: var(--gold);
}

.drawer-section-body {
  padding: 4px 2px 26px;
  animation: section-rise 0.35s ease both;
}

.drawer-note {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 28px;
  border-top: 1px dashed var(--hairline-strong);
  background: var(--card);
}

.drawer-foot-note {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.drawer-foot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-foot .secondary-btn {
  margin-top: 0;
  width: auto;
  padding-left: 22px;
  padding-right: 22px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.danger-btn {
  background: var(--danger);
  border-color: var(--danger);
}

.danger-btn:hover,
.danger-btn:focus-visible {
  background: #8a2f24;
  box-shadow: 0 6px 18px -6px rgba(162, 59, 46, 0.45);
}

@media (max-width: 768px) {
  .drawer {
    width: 100%;
    border-left: none;
  }

  .drawer-tab {
    top: auto;
    bottom: 18px;
    right: 16px;
    transform: none;
    writing-mode: horizontal-tb;
    padding: 13px 22px;
    border-right: 1px solid var(--pine-deep);
    border-radius: 999px;
    box-shadow: 0 12px 32px -10px rgba(20, 61, 47, 0.6);
  }

  .drawer-tab:hover,
  .drawer-tab:focus-visible {
    transform: translateY(-2px);
  }

  .drawer-head,
  .drawer-body,
  .drawer-foot {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ==================== Blocking overlay / ledger seal spinner ==================== */
.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: radial-gradient(120% 120% at 50% 38%, rgba(243, 238, 227, 0.82), rgba(20, 61, 47, 0.34));
  backdrop-filter: blur(6px) saturate(0.95);
  -webkit-backdrop-filter: blur(6px) saturate(0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.app-overlay.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease;
}

.app-overlay__seal {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 14px 28px rgba(20, 61, 47, 0.28));
}

/* concentric counter-rotating arcs */
.app-overlay__seal::before,
.app-overlay__seal::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2.5px solid transparent;
}

.app-overlay__seal::before {
  inset: 0;
  border-top-color: var(--pine);
  border-right-color: var(--pine);
  animation: seal-spin 1.15s cubic-bezier(0.62, 0.04, 0.34, 0.97) infinite;
}

.app-overlay__seal::after {
  inset: 16px;
  border-bottom-color: var(--gold);
  border-left-color: var(--gold);
  animation: seal-spin 1.5s cubic-bezier(0.62, 0.04, 0.34, 0.97) infinite reverse;
}

/* monogram core that gently pulses */
.app-overlay__mark {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--pine-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  animation: seal-pulse 1.5s ease-in-out infinite;
}

.app-overlay__mark em { font-style: normal; color: var(--gold); }

.app-overlay__caption {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--pine-deep);
  text-align: center;
}

.app-overlay__caption::after {
  content: "";
  animation: seal-ellipsis 1.4s steps(4, end) infinite;
}

@keyframes seal-spin { to { transform: rotate(360deg); } }

@keyframes seal-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}

@keyframes seal-ellipsis {
  0% { content: ""; }
  25% { content: "·"; }
  50% { content: "··"; }
  75% { content: "···"; }
}

@media (prefers-reduced-motion: reduce) {
  .app-overlay__seal::before,
  .app-overlay__seal::after { animation-duration: 2.4s; animation-timing-function: linear; }
  .app-overlay__mark,
  .app-overlay__caption::after { animation: none; }
}

/* ==================== Organizer sign-in key (header affordance) ==================== */
.brand-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.organizer-key {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 11px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pine-deep);
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(29, 42, 36, 0.05);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.organizer-key__label { white-space: nowrap; }
.organizer-key__label span { color: var(--gold); }

/* wax-seal dot with a soft pulsing halo */
.organizer-key__seal {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 0 0 1.5px rgba(255, 253, 247, 0.55);
  flex: none;
}

.organizer-key__seal::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.5;
  animation: key-halo 2.4s ease-out infinite;
}

@keyframes key-halo {
  0% { transform: scale(0.7); opacity: 0.55; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

.organizer-key:hover,
.organizer-key:focus-visible {
  color: var(--paper);
  background: var(--pine);
  border-color: var(--pine-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(20, 61, 47, 0.6);
}

.organizer-key:hover .organizer-key__label span,
.organizer-key:focus-visible .organizer-key__label span { color: var(--paper); }

.organizer-key:hover .organizer-key__seal,
.organizer-key:focus-visible .organizer-key__seal {
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--pine);
}

/* Once signed in, the side tab takes over — hide the header key */
body.admin-mode .organizer-key { display: none; }

@media (prefers-reduced-motion: reduce) {
  .organizer-key__seal::after { animation: none; opacity: 0; }
}

@media (max-width: 540px) {
  .organizer-key { padding: 6px 12px; font-size: 11px; }
  .organizer-key__label span { display: inline; }
}

/* ==================== Drawer sign-in pane ==================== */
.drawer-login__lede {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

/* Swap drawer contents based on auth state */
.drawer-section,
.drawer-foot { display: none; }

body.admin-mode .drawer-login { display: none; }
body.admin-mode .drawer-section { display: block; }
body.admin-mode .drawer-foot { display: flex; }

/* Drawer title swaps with auth state */
.drawer-title--in { display: none; }
body.admin-mode .drawer-title--out { display: none; }
body.admin-mode .drawer-title--in { display: inline; }

/* ============================================================
   Zakat flag · goal achieved · goal extension
   Gold is the house "achievement / extra" accent — it carries
   the Zakat badge, the goal-met seal, and the extra-mile run.
   ============================================================ */

/* ---------- Header badges ---------- */
.campaign-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.campaign-badges:empty {
  display: none;
}

.zakat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(176, 125, 44, 0.12);
  border: 1px solid rgba(176, 125, 44, 0.32);
  border-radius: 99px;
  padding: 5px 12px 5px 10px;
}

.zakat-badge__glyph {
  font-size: 13px;
  line-height: 1;
  transform: translateY(0.5px);
}

/* ---------- Ledger checkbox (custom) ---------- */
.ledger-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}

.ledger-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ledger-check__box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 5px;
  background: var(--card);
  position: relative;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ledger-check__box::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid var(--card);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.ledger-check input:checked + .ledger-check__box {
  background: var(--pine);
  border-color: var(--pine);
}

.ledger-check input:checked + .ledger-check__box::after {
  transform: rotate(45deg) scale(1);
}

.ledger-check input:focus-visible + .ledger-check__box {
  box-shadow: 0 0 0 3px rgba(30, 90, 69, 0.18);
}

.ledger-check__text {
  display: block;
}

.ledger-check__title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.ledger-check__hint {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-faint);
  line-height: 1.45;
}

/* ---------- Progress track + original-goal marker ---------- */
.progress-track {
  position: relative;
  margin: 24px 0 10px;
}

.progress-track .progress-bar {
  margin: 0;
}

.progress-marker {
  position: absolute;
  top: -7px;
  bottom: -7px;
  width: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.progress-marker__flag {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--paper);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Goal achieved / extra-mile banner ---------- */
.goal-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  margin: 20px 0 4px;
  padding: 16px 20px;
  background: var(--pine-wash);
  border: 1px solid #c7dbcf;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.goal-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--pine);
}

.goal-banner--extra {
  background: rgba(176, 125, 44, 0.08);
  border-color: rgba(176, 125, 44, 0.34);
}

.goal-banner--extra::before {
  background: var(--gold);
}

.goal-banner__seal {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pine);
  color: var(--card);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(30, 90, 69, 0.55);
}

.goal-banner--extra .goal-banner__seal {
  background: var(--gold);
  box-shadow: 0 4px 12px -4px rgba(176, 125, 44, 0.55);
}

.goal-banner__text {
  display: block;
}

.goal-banner__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 19px;
  line-height: 1.2;
  color: var(--pine-deep);
}

.goal-banner--extra .goal-banner__title {
  color: #7c5715;
}

.goal-banner__sub {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ---------- Drawer sub-section (goal extension) ---------- */
.drawer-subsection {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--hairline-strong);
}

.drawer-subsection-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.extension-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}

.member-row:last-of-type {
  border-bottom: none;
}

.member-email {
  font-size: 0.9rem;
  color: var(--pine-deep);
  word-break: break-all;
  flex: 1;
}

.remove-member-btn {
  flex-shrink: 0;
  width: auto;
  margin-top: 0;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: var(--danger);
  border-color: var(--danger);
}

.remove-member-btn:hover {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-color: var(--danger);
  box-shadow: none;
}
