.temple-overall-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8dfeb;
  border-radius: 16px;
  background: linear-gradient(155deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 26px rgba(11, 30, 54, 0.1);
  padding: 1.05rem 1.1rem;
}

.temple-overall-card::before {
  content: "";
  position: absolute;
  inset: auto -26px -30px auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.2) 0%, rgba(217, 119, 6, 0) 72%);
  pointer-events: none;
}

.temple-overall-label {
  margin: 0 0 0.55rem;
  text-align: center;
  font-size: 1.04rem;
  font-weight: 800;
  color: #0f2747;
}

.temple-progress-meter {
  width: 100%;
  height: 0.78rem;
  border-radius: 999px;
  overflow: hidden;
  background: #d8e0eb;
}

.temple-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.temple-progress-value {
  margin: 0.58rem 0 0;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #b45309;
}

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

.temple-summary-card {
  position: relative;
  border: 1px solid #d7dfea;
  border-radius: 15px;
  background: #fff;
  padding: 1.1rem 1rem;
  box-shadow: 0 10px 18px rgba(11, 30, 54, 0.06);
}

.temple-summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-radius: 15px 15px 0 0;
}

.temple-summary-card h3 {
  margin: 0;
  color: #0f2747;
  font-size: 1.02rem;
}

.temple-summary-card::after {
  position: absolute;
  right: 0.85rem;
  top: 0.7rem;
  width: 1.66rem;
  height: 1.66rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.temple-summary-card .amount {
  margin: 0.75rem 0 0;
  font-size: clamp(1.5rem, 2.2vw, 2.12rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.temple-summary-card small {
  margin-top: 0.35rem;
  display: block;
  color: #5f7188;
}

.temple-summary-card.donations::before {
  background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

.temple-summary-card.donations::after {
  content: "\2197";
  color: #15803d;
  background: #dcfce7;
}

.temple-summary-card.donations .amount {
  color: #0f9a4a;
}

.temple-summary-card.expenses::before {
  background: linear-gradient(90deg, #ef4444 0%, #fb7185 100%);
}

.temple-summary-card.expenses::after {
  content: "\24";
  color: #dc2626;
  background: #ffe4e6;
}

.temple-summary-card.expenses .amount {
  color: #dc2626;
}

.temple-summary-card.balance::before {
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.temple-summary-card.balance::after {
  content: "\20B9";
  color: #1d4ed8;
  background: #dbeafe;
}

.temple-summary-card.balance .amount {
  color: #2563eb;
}

.temple-fund-allocation {
  margin-top: 1.25rem;
  border: 1px solid #d7dfea;
  border-radius: 16px;
  background: #fff;
  padding: 1.05rem 1rem 1.2rem;
}

.temple-fund-allocation .fund-title {
  margin: 0 0 0.9rem;
  color: #0f2747;
  font-size: 1.15rem;
  font-weight: 800;
}

.temple-fund-allocation .fund-title::before {
  content: "\25F4";
  margin-right: 0.46rem;
  font-size: 0.92rem;
  color: #0f2747;
}

.temple-fund-allocation .fund-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  gap: 0.75rem;
}

.temple-fund-allocation .chart {
  width: 208px;
  height: 208px;
  border-radius: 50%;
  background: conic-gradient(#ef4444 var(--spent), #22c55e 0%);
}

.temple-fund-allocation .legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  color: #1f2937;
  font-size: 1rem;
}

.temple-fund-allocation .legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.temple-fund-allocation i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.temple-fund-allocation i.spent {
  background: #ef4444;
}

.temple-fund-allocation i.remaining {
  background: #22c55e;
}

.temple-empty {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px dashed #c7d2e2;
  border-radius: 12px;
  background: #fffdf8;
  color: #465a74;
}

.temple-privacy-note {
  margin: 0.62rem 0 0;
  color: #7c5415;
  font-size: 0.86rem;
}

.temple-blur-cell {
  display: inline-block;
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}

.temple-expense-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.82rem;
  margin-bottom: 1rem;
}

.temple-expense-groups .group-pill {
  border: 1px solid #d7dfea;
  border-radius: 13px;
  background: #fff;
  padding: 0.72rem 0.82rem;
}

.temple-expense-groups .category {
  display: block;
  color: #556981;
  font-size: 0.93rem;
}

.temple-expense-groups .value {
  color: #0f2747;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.temple-table-wrap {
  border: 1px solid #d7dfea;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.temple-table-scroll {
  overflow-x: auto;
}

.temple-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.temple-table th,
.temple-table td {
  padding: 0.78rem 0.82rem;
  border-bottom: 1px solid #e7edf5;
  text-align: left;
  vertical-align: top;
}

.temple-table th {
  background: linear-gradient(180deg, #1d355a 0%, #0f2747 100%);
  color: #fff;
}

.temple-table td {
  color: #1f2937;
}

.temple-table tbody tr:nth-child(2n) {
  background: #fbfcff;
}

.temple-table tbody tr:hover {
  background: #f3f8ff;
}

.temple-table td.is-numeric,
.temple-table td.is-amount {
  font-weight: 700;
}

.temple-table td.is-expense-amount {
  color: #dc2626;
}

.temple-table td.is-donation-amount {
  color: #0f9a4a;
}

.temple-table td a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #2563eb;
  font-weight: 700;
}

.temple-table td a::after {
  content: "\2197";
  margin-left: 0.22rem;
  font-size: 0.88rem;
}

.temple-sort-btn {
  all: unset;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  color: inherit;
  font-weight: 700;
}

.temple-sort-btn::after {
  content: "\21C5";
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.86);
}

.temple-sort-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 4px;
}

.temple-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  padding: 0.72rem;
  background: #f8fbff;
}

.temple-pagination button {
  min-width: 2rem;
  min-height: 2rem;
  border: 1px solid #c7d2e2;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.temple-pagination button[disabled],
.temple-pagination button.is-active {
  color: #fff;
  border-color: #d97706;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.temple-pagination button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.temple-category-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-size: 0.84rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

.temple-category-pill[class*="cat-material"] {
  background: #dbeafe;
  color: #1d4ed8;
}

.temple-category-pill[class*="cat-labor"] {
  background: #ede9fe;
  color: #6d28d9;
}

.temple-category-pill[class*="cat-equip"] {
  background: #ffedd5;
  color: #c2410c;
}

.temple-category-pill[class*="cat-professional"] {
  background: #d1fae5;
  color: #047857;
}

.temple-sync-note {
  margin-top: 0.88rem;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: #eaf2ff;
  color: #334155;
  padding: 0.74rem 0.85rem;
  font-size: 0.94rem;
}

.temple-timeline {
  display: grid;
  gap: 1rem;
}

.temple-timeline-item {
  border: 1px solid #d7dfea;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 2fr);
}

.temple-timeline-item .timeline-meta {
  color: #fff;
  background: linear-gradient(150deg, #d97706 0%, #ea580c 100%);
  padding: 1.12rem;
}

.temple-timeline-item .timeline-meta .date {
  margin: 0 0 0.56rem;
  font-size: 0.94rem;
  font-weight: 700;
}

.temple-timeline-item .timeline-meta .date::before {
  content: "\1F4C5";
  margin-right: 0.32rem;
  font-size: 0.84rem;
}

.temple-timeline-item .timeline-meta .meta-title {
  margin: 0;
  font-size: clamp(1.34rem, 2.1vw, 1.88rem);
  line-height: 1.14;
  color: #fff;
}

.temple-timeline-item .timeline-meta .phase {
  margin: 0.72rem 0 0;
}

.temple-timeline-item .timeline-meta .phase-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.64rem;
  background: #e0ecff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

.temple-timeline-item .timeline-meta .progress-head {
  margin-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  font-size: 0.98rem;
  font-weight: 700;
}

.temple-timeline-item .inline-progress {
  width: 100%;
  margin-top: 0.44rem;
  height: 0.54rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(6, 13, 24, 0.45);
}

.temple-timeline-item .inline-progress span {
  height: 100%;
  display: block;
  background: #08162a;
}

.temple-timeline-item .timeline-content {
  background: #f8fbff;
  padding: 1rem;
}

.temple-timeline-item .timeline-content .timeline-description {
  margin: 0;
  color: #263a55;
  font-size: 1.02rem;
}

.temple-timeline-item .timeline-content .timeline-label {
  margin: 0.95rem 0 0.6rem;
  color: #475569;
  font-size: 0.97rem;
  font-weight: 700;
}

.temple-timeline-item .timeline-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.56rem;
}

.temple-timeline-item .timeline-gallery a {
  display: block;
}

.temple-timeline-item .timeline-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
}

.temple-timeline-item .timeline-video {
  margin-top: 0.92rem;
}

.temple-timeline-item .timeline-video-player {
  margin: 0;
}

.temple-timeline-item .timeline-video-player > summary {
  list-style: none;
}

.temple-timeline-item .timeline-video-player > summary::-webkit-details-marker {
  display: none;
}

.temple-timeline-item .timeline-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  border-radius: 10px;
  border: 1px solid #d95f08;
  background: #ea580c;
  color: #fff;
  padding: 0.43rem 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.temple-timeline-item .timeline-video-btn::before {
  content: "\25B7";
  font-size: 0.79rem;
}

.temple-timeline-item .timeline-video-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.temple-timeline-item .timeline-video-player iframe {
  margin-top: 0.72rem;
  width: 100%;
  border: 0;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.temple-custom-sheet-section {
  padding-top: 1.2rem;
}

@media (max-width: 1100px) {
  .temple-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .temple-expense-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .temple-timeline-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .temple-summary-grid {
    grid-template-columns: 1fr;
  }

  .temple-fund-allocation {
    padding: 0.9rem;
  }

  .temple-fund-allocation .fund-body {
    min-height: 180px;
  }

  .temple-fund-allocation .chart {
    width: 170px;
    height: 170px;
  }

  .temple-expense-groups {
    grid-template-columns: 1fr;
  }

  .temple-table {
    min-width: 0;
  }

  .temple-table thead {
    display: none;
  }

  .temple-table tbody,
  .temple-table tr,
  .temple-table td {
    display: block;
    width: 100%;
  }

  .temple-table tbody {
    padding: 0.34rem;
  }

  .temple-table tr {
    border: 1px solid #dbe4f1;
    border-radius: 12px;
    margin-bottom: 0.6rem;
    overflow: hidden;
    background: #fff;
  }

  .temple-table td {
    border-bottom: 1px dashed #e8edf5;
    padding: 0.66rem 0.72rem;
    display: flex;
    justify-content: space-between;
    gap: 0.58rem;
    text-align: right;
  }

  .temple-table td:last-child {
    border-bottom: 0;
  }

  .temple-table td::before {
    content: attr(data-label);
    text-align: left;
    color: #425978;
    font-weight: 700;
    flex: 0 0 48%;
  }
}

@media (max-width: 560px) {
  .temple-summary-card {
    padding: 1rem 0.92rem;
  }

  .temple-summary-card .amount {
    font-size: 1.7rem;
  }

  .temple-timeline-item .timeline-meta,
  .temple-timeline-item .timeline-content {
    padding: 0.9rem;
  }

  .temple-timeline-item .timeline-gallery {
    grid-template-columns: 1fr;
  }
}
