:root {
  --bg: #0d1117;
  --panel: #161b22;
  --accent: #f59e0b;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #111827, #0b0f16 50%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.shell {
  width: min(1100px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: #0b1220;
  border: 1px solid var(--border);
  padding: 4px;
}

h1 {
  font-size: clamp(28px, 4vw, 36px);
  margin: 0;
  letter-spacing: -0.01em;
}

p.lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 700px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: #0f172a;
  border: 1px solid #24344f;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  transition: transform 150ms ease, border-color 150ms ease;
}

.card.card-accent,
.card.card-secondary,
.card.card-tertiary,
.card.card-quaternary,
.card.card-quinary,
.card.card-senary {
  background: #0f172a;
  border-color: #24344f;
}

.card.card-breakdown {
  background: #0b1324;
  border-color: #1c2a40;
}

.stat-card {
  padding: 24px;
}

.stat-label {
  color: var(--muted);
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.stat-value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrapper {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.stats-table th,
.stats-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chart-wrapper {
  margin-top: 20px;
}

.hidden {
  display: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.4);
}

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

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.btn.primary {
  background: linear-gradient(120deg, #fbbf24, #f59e0b);
  color: #0f172a;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35);
}

.btn.secondary {
  background: linear-gradient(120deg, #34d399, #10b981);
  color: #0b1324;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.modal .btn.ghost {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
}

.devotional {
  background: #0b1220;
  border: 1px solid #111827;
  border-radius: 14px;
  padding: 16px;
  margin-top: 20px;
  min-height: 160px;
  overflow: hidden;
  position: relative;
}

.devotional h4 {
  margin: 0 0 6px;
  color: #fbbf24;
  text-align: center;
}

.devotional #devotional-meta {
  text-align: center;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.muted {
  color: var(--muted);
}

.status {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  width: min(420px, 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal h2 {
  margin: 0;
  font-size: 20px;
}

.close-btn {
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.modal-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.modal-form label {
  font-size: 13px;
  color: #4b5563;
}

.modal-form input {
  background: #f9fafb;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

.spinner {
  display: none;
  color: #0f172a;
  font-size: 14px;
  align-items: center;
  gap: 6px;
}

.spinner.show {
  display: inline-flex;
}

.extra {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.extra-title {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
}

.stacked {
  display: grid;
  gap: 6px;
}

.date-picker {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="date"] {
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
}

@media (max-width: 600px) {
  body { padding: 16px; }
  .shell { padding: 22px; }
}

#google_translate_element {
  display: none;
}

iframe.skiptranslate {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal-backdrop.show {
  display: flex;
}
