:root {
  color-scheme: light;
  --green-950: #102f2a;
  --green-900: #183f35;
  --green-700: #276052;
  --gold-600: #c9993a;
  --gold-500: #d9b85c;
  --cream-100: #fffaf0;
  --cream-200: #f6efe2;
  --cream-300: #eadfc8;
  --ink: #18211e;
  --muted: #68726b;
  --surface: rgba(255, 250, 240, 0.88);
  --white: #ffffff;
  --danger: #9f2f2f;
  --shadow: 0 18px 50px rgba(24, 63, 53, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream-200);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(16, 47, 42, 0.96), rgba(39, 96, 82, 0.9)) top / 100% 320px no-repeat,
    var(--cream-200);
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--green-950);
  background: var(--gold-500);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

button:hover:not(:disabled) {
  background: var(--gold-600);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.secondary {
  color: var(--green-900);
  background: var(--cream-300);
}

button.danger {
  color: var(--white);
  background: var(--danger);
}

main,
.topbar,
.nav {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  color: var(--cream-100);
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand small {
  color: rgba(255, 250, 240, 0.78);
}

.brand-mark {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--gold-500);
  box-shadow: inset 0 -12px 0 rgba(16, 47, 42, 0.16);
}

.brand-mark::before {
  position: absolute;
  inset: 8px 12px auto;
  height: 18px;
  border-radius: 20px 20px 4px 4px;
  background: var(--green-900);
  content: "";
}

.brand-mark::after {
  position: absolute;
  left: 21px;
  top: 8px;
  width: 6px;
  height: 28px;
  border-radius: 4px;
  background: var(--green-900);
  content: "";
}

.profile-switcher {
  display: grid;
  gap: 0.35rem;
  min-width: 320px;
  color: var(--cream-100);
}

.profile-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.compact-button {
  min-height: 0;
  padding-inline: 0.9rem;
}

.profile-switcher label,
form label {
  font-size: 0.8rem;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid rgba(24, 63, 53, 0.18);
  border-radius: 8px;
  padding: 0.75rem 0.8rem;
  color: var(--ink);
  background: var(--cream-100);
}

textarea {
  resize: vertical;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 10px;
  background: rgba(16, 47, 42, 0.28);
  overflow: visible;
}

.nav button {
  flex: 1 1 128px;
  min-height: 40px;
  color: var(--cream-100);
  background: transparent;
}

.nav button.active {
  color: var(--green-950);
  background: var(--cream-100);
}

main {
  padding: 1.25rem 0 4rem;
}

.landing {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  padding: 1.25rem 0 3rem;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 1.5rem;
  align-items: stretch;
  min-height: min(720px, calc(100vh - 120px));
}

.landing-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--cream-100);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(16, 47, 42, 0.38);
}

.landing-brand {
  margin-bottom: auto;
  padding-top: 0.5rem;
}

.landing-copy h1 {
  margin: 0;
  color: #fffaf0;
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: 0.9;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}

.landing-copy .lead {
  color: #fffaf0;
  font-weight: 750;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.landing-hero img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.landing-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.notice {
  margin-bottom: 1rem;
  border: 1px solid rgba(201, 153, 58, 0.45);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  color: var(--green-950);
  background: #fff3c4;
  font-weight: 800;
}

.dashboard-grid,
.prayer-first-layout,
.cards-list,
.timeline {
  display: grid;
  gap: 1rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 1.5rem;
  min-height: 360px;
  border-radius: 8px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  color: var(--cream-100);
  background:
    linear-gradient(135deg, rgba(16, 47, 42, 0.95), rgba(24, 63, 53, 0.64)),
    linear-gradient(45deg, rgba(201, 153, 58, 0.16) 25%, transparent 25% 75%, rgba(201, 153, 58, 0.16) 75%),
    var(--green-900);
  background-size: auto, 42px 42px, auto;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.prayer-hero {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  min-height: 280px;
}

.hero-panel h1,
.page-heading h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 4.8rem);
  line-height: 0.95;
}

.lead,
.page-heading p {
  max-width: 660px;
  color: rgba(255, 250, 240, 0.78);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.mosque-visual {
  position: relative;
  align-self: end;
  min-height: 260px;
  border-bottom: 12px solid rgba(255, 250, 240, 0.72);
}

.mosque-visual span {
  position: absolute;
  bottom: 0;
  display: block;
  background: linear-gradient(180deg, var(--gold-500), var(--cream-200));
}

.mosque-visual span:nth-child(1) {
  left: 8%;
  width: 20%;
  height: 54%;
  border-radius: 80px 80px 0 0;
}

.mosque-visual span:nth-child(2) {
  left: 30%;
  width: 42%;
  height: 78%;
  border-radius: 180px 180px 0 0;
}

.mosque-visual span:nth-child(3) {
  right: 3%;
  width: 16%;
  height: 95%;
  border-radius: 80px 80px 0 0;
}

.next-prayer-panel {
  align-self: center;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(255, 250, 240, 0.1);
}

.next-prayer-panel h2 {
  margin: 0 0 0.5rem;
  color: var(--cream-100);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.next-prayer-panel p:last-child {
  margin: 0;
  color: rgba(255, 250, 240, 0.78);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--gold-600);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card,
.panel,
.list-item,
.empty-state {
  border: 1px solid rgba(24, 63, 53, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(24, 63, 53, 0.08);
}

.metric-card {
  display: grid;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1rem;
}

.metric-card p,
.metric-card span,
.compact-list p,
.list-item p,
.panel p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.metric-card strong {
  color: var(--green-950);
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  overflow-wrap: anywhere;
}

.two-column,
.sadaqah-layout,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  padding: 1rem;
}

.panel.accent {
  border-color: rgba(201, 153, 58, 0.35);
  background: #fff7df;
}

.section-heading,
.split-panel,
.list-item,
.voucher {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2,
.prayer-card h2,
.voucher h2 {
  margin: 0;
  color: var(--green-950);
}

.section-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.progress {
  height: 14px;
  margin: 1rem 0;
  border-radius: 999px;
  background: var(--cream-300);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-700), var(--gold-500));
}

.compact-list {
  display: grid;
  gap: 0.75rem;
}

.compact-list p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(24, 63, 53, 0.1);
  padding-top: 0.75rem;
}

.compact-list span {
  color: var(--green-700);
  font-weight: 800;
  text-align: right;
}

.page-heading {
  margin-bottom: 1rem;
  border-radius: 8px;
  padding: 1rem;
  color: var(--cream-100);
  background: rgba(16, 47, 42, 0.72);
}

.page-heading h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.prayer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.today-prayer-board {
  padding: 1rem;
}

.dashboard-prayers .prayer-card {
  min-height: 164px;
}

.prayer-card {
  display: grid;
  gap: 0.8rem;
  min-height: 190px;
  border: 1px solid rgba(24, 63, 53, 0.12);
  border-radius: 8px;
  padding: 1rem;
  background: var(--cream-100);
}

.prayer-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 900;
}

.pill {
  justify-self: start;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  color: var(--muted);
  background: var(--cream-300);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: capitalize;
}

.pill.good {
  color: var(--cream-100);
  background: var(--green-700);
}

.pill.pending {
  color: var(--green-950);
  background: #fff3c4;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 900;
}

.location-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(24, 63, 53, 0.14);
  border-radius: 8px;
  padding: 1rem;
  background: var(--cream-100);
}

.location-gate.verified {
  border-color: rgba(39, 96, 82, 0.35);
  background: #eef7ed;
}

.location-gate h2 {
  margin: 0 0 0.35rem;
  color: var(--green-950);
}

.location-gate p:last-child {
  margin: 0;
  color: var(--muted);
}

.check-row input {
  width: 20px;
  height: 20px;
}

.big-number {
  display: block;
  color: var(--green-950);
  font-size: 4rem;
  line-height: 1;
}

.voucher.redeemed {
  opacity: 0.72;
}

.qris-panel {
  text-align: center;
}

.qris-panel img {
  display: block;
  width: min(100%, 320px);
  margin: 0 auto 1rem;
  border-radius: 8px;
}

form {
  display: grid;
  gap: 0.9rem;
}

form label {
  display: grid;
  gap: 0.35rem;
  color: var(--green-900);
}

.list-item {
  padding: 1rem;
}

.report-card {
  display: grid;
  gap: 0.85rem;
}

.report-card small {
  color: var(--muted);
  font-weight: 800;
}

.schedule-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-console {
  display: grid;
  gap: 1rem;
}

.admin-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
}

.admin-table-panel {
  overflow: hidden;
}

.console-table {
  display: grid;
  gap: 0;
  border: 1px solid rgba(24, 63, 53, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.console-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(90px, 0.7fr) minmax(120px, 0.9fr);
  gap: 0.75rem;
  margin: 0;
  border-top: 1px solid rgba(24, 63, 53, 0.08);
  padding: 0.75rem;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.72);
}

.console-row.payment-row {
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 0.72fr) minmax(80px, 0.55fr) minmax(92px, 0.45fr);
}

.console-row:first-child {
  border-top: 0;
}

.console-head {
  color: var(--green-950);
  background: var(--cream-300);
  font-weight: 900;
}

.console-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-action {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
}

.schedule-form button {
  grid-column: 1 / -1;
}

.api-source-panel {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.api-source-panel p {
  margin: 0;
}

.schedule-list {
  display: grid;
  gap: 0.5rem;
}

.schedule-list p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  border: 1px solid rgba(24, 63, 53, 0.1);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  background: var(--cream-100);
}

.schedule-list strong {
  color: var(--green-950);
}

.empty-state {
  padding: 1.2rem;
  text-align: center;
}

@media (max-width: 900px) {
  .hero-panel,
  .landing-hero,
  .prayer-hero,
  .two-column,
  .sadaqah-layout,
  .admin-main-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .landing-strip,
  .prayer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mosque-visual {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(135deg, rgba(16, 47, 42, 0.98), rgba(39, 96, 82, 0.92)) top / 100% 640px no-repeat,
      var(--cream-200);
  }

  main,
  .topbar,
  .nav {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-switcher {
    min-width: 0;
  }

  .profile-actions,
  .landing-strip {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .prayer-grid,
  .schedule-form {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .split-panel,
  .location-gate,
  .list-item,
  .voucher {
    align-items: stretch;
    flex-direction: column;
  }

  .console-row,
  .console-row.payment-row {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 0;
  }
}
