:root {
  --bg: #101a1b;
  --card: rgba(22, 37, 38, 0.92);
  --panel: rgba(224, 242, 232, 0.08);
  --border: rgba(218, 237, 224, 0.18);
  --text: #edf6ef;
  --muted: #a7bdb3;
  --accent: #f4c95d;
  --accent-strong: #e6a93d;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: rgba(5, 15, 16, 0.42);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at 10% 0%, rgba(244, 201, 93, 0.14), transparent 28rem), radial-gradient(circle at 90% 12%, rgba(88, 165, 139, 0.14), transparent 24rem), linear-gradient(155deg, #172628 0%, var(--bg) 48%, #0a1213 100%);
}

.page-shell { max-width: 1120px; margin: 0 auto; padding: 48px 24px 80px; }
.topbar, .topbar-actions, .donation-topline, .chat-header, .chat-message-header { display: flex; align-items: center; }
.topbar { justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.topbar-actions { justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.nav-button, .logout-button, .submit-button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 15px; border: 1px solid var(--border); border-radius: 9px; background: rgba(224, 242, 232, 0.07); color: var(--text); text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; }
.logout-button { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.34); }
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 5vw, 4rem); font-weight: 500; line-height: 0.98; }
h2 { margin-bottom: 18px; font-size: 1.2rem; letter-spacing: 0.01em; }
.pill { padding: 9px 12px; border: 1px solid rgba(244, 201, 93, 0.4); border-radius: 999px; background: rgba(244, 201, 93, 0.11); color: var(--accent); font-size: 0.78rem; font-weight: 700; }
.layout { display: grid; grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.3fr) minmax(180px, 0.7fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.card { border: 1px solid var(--border); border-radius: 14px; background: var(--card); box-shadow: 0 24px 60px var(--shadow); backdrop-filter: blur(12px); }
.form-card, .stats-card, .history-card, .dashboard-card { padding: 28px; }
.utility-column { display: grid; gap: 20px; }
.utility-card { padding: 22px; }
.utility-card .eyebrow { margin-bottom: 10px; }
.digital-clock { color: var(--accent); font-family: "Cascadia Mono", Consolas, monospace; font-size: clamp(1.55rem, 2.5vw, 2.15rem); font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }
.utility-meta { margin: 7px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.utility-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.utility-heading h2 { margin-bottom: 0; }
.weather-icon { font-size: 2rem; line-height: 1; }
.weather-temperature { display: block; margin-top: 18px; color: var(--text); font-size: 2.5rem; font-weight: 700; }
.weather-disclaimer { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.72rem; line-height: 1.45; }
form { display: grid; gap: 18px; }
.field-group { display: grid; gap: 8px; }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; }
label { color: var(--muted); font-size: 0.9rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 9px; background: rgba(8, 18, 19, 0.55); color: var(--text); transition: border-color 0.18s ease, box-shadow 0.18s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.14); }
textarea { min-height: 90px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 10px; color: var(--text); }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent-strong); }
button { border: 0; border-radius: 9px; padding: 14px 18px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #18200d; font-weight: 800; cursor: pointer; transition: transform 0.18s ease, filter 0.18s ease; }
button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.stats-grid { display: grid; gap: 14px; margin-top: 22px; }
.stat-label, .metric-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
#total-raised, #donor-count, #cause-count, .metric-value { font-size: clamp(1.5rem, 2vw, 2rem); }
.section-header { margin-bottom: 22px; }
.donation-list, .admin-list { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; }
.donation-item, .admin-item, .metric-card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.donation-topline { justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.amount { color: var(--accent); font-size: 1.05rem; font-weight: 800; }
.meta, .charity-link span, .payout-copy { color: var(--muted); font-size: 0.84rem; }
.cause { display: inline-block; margin-bottom: 8px; font-weight: 700; }
.message { margin: 0; color: var(--text); line-height: 1.5; }
.payout-copy { margin-bottom: 12px; line-height: 1.5; }
.venmo-link { color: var(--accent); font-weight: 800; text-decoration: none; }
.empty-state { padding: 18px 0; color: var(--muted); }
.charity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.charity-link { display: grid; gap: 8px; min-height: 108px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); text-decoration: none; transition: border-color 0.18s ease, transform 0.18s ease; }
.charity-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.admin-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin: 20px 0 24px; }
.login-shell { max-width: 520px; margin: 40px auto 0; }
.login-card { padding: 24px; }
.login-form { display: grid; gap: 18px; }
.status-badge { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.status-approved { background: rgba(52, 211, 153, 0.16); color: #76e4b0; }
.status-pending { background: rgba(251, 191, 36, 0.16); color: var(--warning); }
.status-failed { background: rgba(248, 113, 113, 0.18); color: var(--danger); }
.confirmation-card { max-width: 620px; margin: 12vh auto; padding: 48px; text-align: center; }
.button-link { display: inline-block; margin-top: 20px; }
.chat-toggle { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid rgba(244, 201, 93, 0.5); border-radius: 999px; background: var(--accent); color: #18200d; box-shadow: 0 14px 30px var(--shadow); }
.chat-panel { position: fixed; right: 24px; bottom: 84px; z-index: 20; width: min(380px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #142324; box-shadow: 0 20px 50px var(--shadow); }
.chat-header { justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--border); }
.chat-header h2 { margin: 0; font-size: 1.1rem; }
.chat-header .eyebrow { margin-bottom: 4px; }
.chat-close { padding: 8px 10px; background: transparent; color: var(--muted); font-size: 0.8rem; }
.chat-messages { display: grid; gap: 10px; max-height: 260px; overflow-y: auto; padding: 16px; }
.chat-empty { margin: 0; color: var(--muted); font-size: 0.88rem; }
.chat-message { margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); font-size: 0.9rem; line-height: 1.4; }
.chat-message-header { justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.chat-message-header time { color: var(--muted); font-size: 0.72rem; }
.chat-message p { margin: 0; overflow-wrap: anywhere; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.chat-form input:first-of-type { grid-column: 1 / -1; }
.chat-form input { min-width: 0; padding: 10px 12px; }
.chat-form button { padding: 10px 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
  .page-shell { padding: 32px 16px 72px; }
  .layout, .split, .charity-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .form-card, .stats-card, .history-card, .dashboard-card { padding: 22px; }
  .chat-toggle { right: 16px; bottom: 16px; }
  .chat-panel { right: 16px; bottom: 76px; }
}
