:root {
  --bg: #0f1d18;
  --panel: #172823;
  --accent: #c46a4a;
  --accent-dark: #91402e;
  --text: #f2efe6;
  --muted: #c8c1b1;
  --border: rgba(245, 199, 106, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --radius: 18px;
  --font-display: "Playfair Display", serif;
  --font-body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(196, 106, 74, 0.14) 0%, rgba(196, 106, 74, 0) 35%),
    radial-gradient(circle at 80% 0%, rgba(120, 180, 160, 0.18) 0%, rgba(15, 29, 24, 0) 40%),
    linear-gradient(180deg, #12261f 0%, #0f1d18 55%, #0b1511 100%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 10px);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  padding: 28px 20px 80px;
  max-width: 1160px;
  margin: 0 auto;
}

.page.narrow {
  max-width: 700px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}

.logo {
  width: 96px;
  height: auto;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.hero-content {
  margin-top: -48px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 29, 24, 0.6);
  font-size: 0.85rem;
  color: var(--muted);
}

.brand-badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(196, 106, 74, 0.6);
  display: inline-block;
}

.hero-content h1,
h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0 0 12px;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  line-height: 1.2;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}

.eyebrow.small {
  font-size: 0.68rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #1b1b1b;
  border-color: transparent;
}

.btn.primary:hover {
  background: #d97b5a;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
}

.btn.danger {
  border-color: rgba(239, 84, 84, 0.4);
  color: #ffb3b3;
}

.btn.danger:hover {
  background: rgba(239, 84, 84, 0.2);
  border-color: rgba(239, 84, 84, 0.9);
  color: #ffffff;
}

.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.giving-details .muted {
  margin: 6px 0 0;
}

.giving-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.giving-details {
  border-color: rgba(87, 170, 117, 0.35);
  background: linear-gradient(135deg, rgba(20, 72, 44, 0.7), rgba(15, 29, 24, 0.9));
}

.giving-badge {
  background: rgba(87, 170, 117, 0.2);
  border: 1px solid rgba(87, 170, 117, 0.5);
  color: #cce7d6;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.giving-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.giving-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: rgba(11, 32, 22, 0.8);
  display: grid;
  gap: 4px;
}

.giving-item .label {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.giving-item .desc {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--muted);
}

.footer-global {
  padding: 24px;
  background: rgba(15, 29, 24, 0.6);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-brand {
  display: grid;
  gap: 6px;
}

.footer-title {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  max-width: 320px;
  text-align: right;
}

.footer-bottom {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-meta {
    text-align: left;
  }
}

.hero-qr img {
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 16px auto;
}

.hero-qr {
  text-align: center;
}

.paybill-number {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 8px 0 16px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: fit-content;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.on {
  color: #7ad19a;
  background: rgba(87, 170, 117, 0.12);
  border-color: rgba(87, 170, 117, 0.35);
}

.status-pill.off {
  color: #f3a8a8;
  background: rgba(239, 84, 84, 0.12);
  border-color: rgba(239, 84, 84, 0.35);
}

.form-card form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select,
textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f1d18;
  color: var(--text);
  font-family: var(--font-body);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(245, 199, 106, 0.4);
  border-color: rgba(245, 199, 106, 0.6);
}

.status {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.dashboard {
  display: grid;
  gap: 24px;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.user-badge {
  font-size: 0.9rem;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card h3 {
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
}

#system-status .stat-card {
  background: #0f1d18;
}

.grid-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 980px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 220px;
  padding: 12px 4px 20px;
  background: rgba(15, 29, 24, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-bar {
  background: linear-gradient(180deg, #c46a4a 0%, #91402e 100%);
  border-radius: 10px 10px 6px 6px;
  position: relative;
}

.chart-bar span {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.totals-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.treasurer-hero {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: center;
}

.treasurer-hero .hero-meta {
  display: grid;
  gap: 10px;
}

.treasurer-hero .actions {
  margin: 0;
  justify-content: flex-end;
}

.pill-row.tight .pill {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.insight-card {
  background: rgba(196, 106, 74, 0.08);
  border: 1px solid rgba(196, 106, 74, 0.2);
  padding: 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.section-subtitle {
  color: var(--muted);
  margin: 0 0 10px;
}

@media (max-width: 600px) {
  .page {
    padding: 32px 16px 60px;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    text-align: center;
  }
}


.dashboard,
.card {
  min-width: 0;
}

#giving-section .table-wrap {
  max-width: calc(100vw - 48px);
}
