/* ==========================================================================
   LAPORAN KEUANGAN & TRANSPARANSI DONASI - STYLESHEET
   Masjid Jami' Al-Huda Puri Harmoni Jonggol
   ========================================================================== */

/* Page Header & Breadcrumb */
.page-hero-keuangan {
  background: linear-gradient(135deg, #070D1E 0%, #0F1C3F 60%, #15274D 100%);
  position: relative;
  padding: 8.5rem 0 3.5rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.page-hero-keuangan::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(212, 175, 55, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  pointer-events: none;
}

.keuangan-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

.keuangan-breadcrumb a {
  color: var(--gold-light);
  transition: var(--transition);
}

.keuangan-breadcrumb a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.keuangan-breadcrumb span.separator {
  color: rgba(255, 255, 255, 0.3);
}

.keuangan-breadcrumb span.current {
  color: #FFFFFF;
  font-weight: 600;
}

.keuangan-hero-content {
  position: relative;
  z-index: 2;
}

.keuangan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.keuangan-hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.keuangan-hero-title .text-gold {
  color: var(--gold-light);
  background: linear-gradient(135deg, #FFE79A 0%, #D4AF37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.keuangan-hero-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.keuangan-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.btn-download-excel {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #107C41 0%, #185A37 100%);
  color: #FFFFFF;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(16, 124, 65, 0.35);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-download-excel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 124, 65, 0.45);
  color: #FFFFFF;
}

/* Financial KPI Summary Cards */
.keuangan-kpi-section {
  margin-top: -2.5rem;
  position: relative;
  z-index: 10;
  margin-bottom: 3rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.kpi-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.kpi-card.kpi-inflow::before { background: var(--emerald-primary); }
.kpi-card.kpi-outflow::before { background: #E11D48; }
.kpi-card.kpi-surplus::before { background: var(--gold-primary); }
.kpi-card.kpi-balance::before { background: linear-gradient(90deg, #10B981, #D4AF37); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-inflow .kpi-icon { background: rgba(16, 185, 129, 0.12); color: var(--emerald-primary); }
.kpi-outflow .kpi-icon { background: rgba(225, 29, 72, 0.12); color: #E11D48; }
.kpi-surplus .kpi-icon { background: rgba(212, 175, 55, 0.15); color: #B48E19; }
.kpi-balance .kpi-icon { background: rgba(15, 28, 63, 0.1); color: var(--slate-dark); }

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--slate-dark);
  line-height: 1.2;
  margin-bottom: 0.35rem;
  font-family: var(--font-heading);
}

.kpi-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Account Balance Breakdown Bar */
.accounts-breakdown-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.accounts-label-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accounts-label-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.accounts-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--slate-dark);
}

.accounts-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.accounts-pills-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.account-pill {
  background: var(--bg-main);
  border: 1px solid rgba(0, 0, 0, 0.07);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.account-badge-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.tag-bsi { background: #00A39D; color: #FFFFFF; }
.tag-baitulmaal { background: #D4AF37; color: #070D1E; }
.tag-cash { background: #475569; color: #FFFFFF; }

.account-pill-nominal {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--slate-dark);
}

/* Chart & Monthly Summary Grid */
.keuangan-analysis-section {
  margin-bottom: 3.5rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.chart-card,
.summary-table-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.card-title-group h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--slate-dark);
  margin-bottom: 0.25rem;
}

.card-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-color.color-inflow { background: #10B981; }
.legend-color.color-outflow { background: #E11D48; }

/* SVG / HTML Visual Bar Chart */
.monthly-chart-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0.5rem;
}

.chart-month-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chart-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-dark);
}

.chart-row-bars {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bar-track {
  height: 14px;
  background: #F1F5F9;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  display: flex;
}

.bar-fill-in {
  background: linear-gradient(90deg, #10B981, #059669);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.bar-fill-out {
  background: linear-gradient(90deg, #F43F5E, #E11D48);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.chart-row-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.val-in { color: #059669; font-weight: 700; }
.val-out { color: #E11D48; font-weight: 700; }

/* Summary Table */
.summary-table-wrapper {
  overflow-x: auto;
}

.keuangan-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.keuangan-table th {
  background: var(--bg-main);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--slate-dark);
  text-align: left;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.keuangan-table th.text-right,
.keuangan-table td.text-right {
  text-align: right;
}

.keuangan-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
  vertical-align: middle;
}

.keuangan-table tr:hover td {
  background-color: rgba(212, 175, 55, 0.04);
}

.keuangan-table tr.total-row td {
  background-color: #F8FAFC;
  font-weight: 800;
  border-top: 2px solid rgba(0, 0, 0, 0.1);
  color: var(--slate-dark);
}

.badge-surplus {
  color: #059669;
  font-weight: 700;
}

.badge-defisit {
  color: #E11D48;
  font-weight: 700;
}

/* Detailed Transaction Explorer Section */
.transactions-section {
  margin-bottom: 4rem;
}

.explorer-header {
  margin-bottom: 1.5rem;
}

/* Controls Toolbar */
.explorer-controls-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Month Filter Pills */
.month-pills-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.month-pills-scroll::-webkit-scrollbar {
  display: none;
}

.month-pill-btn {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-main);
  border: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.month-pill-btn:hover {
  color: var(--slate-dark);
  border-color: rgba(0, 0, 0, 0.15);
}

.month-pill-btn.active {
  background: var(--slate-dark);
  color: #FFFFFF;
  border-color: var(--slate-dark);
  box-shadow: var(--shadow-sm);
}

/* Secondary Controls Row (Type tabs, Method select, Search input) */
.controls-secondary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-type-tabs {
  display: inline-flex;
  background: var(--bg-main);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  gap: 0.25rem;
}

.type-tab-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.type-tab-btn.active {
  background: #FFFFFF;
  color: var(--slate-dark);
  box-shadow: var(--shadow-sm);
}

.filter-inputs-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-grow: 1;
  justify-content: flex-end;
}

.search-input-wrapper {
  position: relative;
  min-width: 260px;
  max-width: 380px;
  flex-grow: 1;
}

.search-input-wrapper svg.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.keuangan-search-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.35rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  background: #FFFFFF;
  transition: var(--transition);
}

.keuangan-search-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: none;
}

.search-clear-btn.visible {
  display: block;
}

/* Live Filter Summary Strip */
.filter-summary-strip {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.filter-count-badge {
  color: var(--slate-dark);
  font-weight: 700;
}

.filter-calc-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.calc-in { color: #059669; font-weight: 700; }
.calc-out { color: #E11D48; font-weight: 700; }
.calc-diff { font-weight: 800; color: var(--slate-dark); }

/* Transactions Table Card */
.transactions-table-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.tx-desktop-table {
  width: 100%;
}

.tx-desktop-table td.tx-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tx-desktop-table td.tx-desc {
  font-weight: 600;
  color: var(--slate-dark);
}

.tx-method-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.method-bsi { background: rgba(0, 163, 157, 0.12); color: #008782; }
.method-qris { background: rgba(124, 58, 237, 0.12); color: #7C3AED; }
.method-cash { background: rgba(71, 85, 105, 0.12); color: #475569; }
.method-baitulmaal { background: rgba(212, 175, 55, 0.2); color: #9A7709; }
.method-rab { background: rgba(239, 68, 68, 0.12); color: #DC2626; }
.method-default { background: #F1F5F9; color: #64748B; }

.tx-amount-in {
  color: #059669;
  font-weight: 700;
  font-family: var(--font-heading);
}

.tx-amount-out {
  color: #E11D48;
  font-weight: 700;
  font-family: var(--font-heading);
}

.tx-balance {
  font-weight: 700;
  color: var(--slate-dark);
  font-family: var(--font-heading);
}

/* Mobile Transaction Cards Container (Hidden on Desktop) */
.tx-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.tx-mobile-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.tx-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tx-mobile-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.tx-mobile-card-desc {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate-dark);
  line-height: 1.4;
}

.tx-mobile-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  margin-top: 0.25rem;
}

.tx-mobile-card-amount {
  font-size: 0.95rem;
  font-weight: 800;
}

.tx-mobile-card-balance {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pagination Controls */
.keuangan-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-main);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #FFFFFF;
  color: var(--slate-dark);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.page-btn.active {
  background: var(--slate-dark);
  color: #FFFFFF;
  border-color: var(--slate-dark);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Empty State */
.tx-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
}

.tx-empty-state svg {
  color: rgba(212, 175, 55, 0.4);
  margin-bottom: 0.75rem;
}

.tx-empty-state h4 {
  font-size: 1.1rem;
  color: var(--slate-dark);
  margin-bottom: 0.35rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-hero-keuangan {
    padding: 7rem 0 2.5rem;
  }

  .keuangan-hero-title {
    font-size: 1.85rem;
  }

  .keuangan-hero-desc {
    font-size: 0.95rem;
  }

  .keuangan-kpi-section {
    margin-top: -1.75rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .kpi-value {
    font-size: 1.4rem;
  }

  .accounts-breakdown-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
  }

  .accounts-pills-row {
    width: 100%;
  }

  .account-pill {
    flex-grow: 1;
    justify-content: space-between;
  }

  .controls-secondary-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-type-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .type-tab-btn {
    flex-grow: 1;
    text-align: center;
  }

  .filter-inputs-group {
    width: 100%;
    justify-content: stretch;
  }

  .search-input-wrapper {
    max-width: 100%;
    width: 100%;
  }

  /* Switch from table to mobile cards on screens <= 768px */
  .tx-desktop-table {
    display: none;
  }

  .tx-mobile-cards {
    display: flex;
  }

  .keuangan-pagination {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .keuangan-hero-title {
    font-size: 1.6rem;
  }

  .btn-download-excel {
    width: 100%;
    justify-content: center;
  }

  .filter-summary-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-calc-row {
    gap: 0.75rem;
  }
}

/* ==========================================================================
   DONATION SECTION COLOR CONTRAST GUARANTEE
   ========================================================================== */
.donation-section,
.infaq-section {
  background: linear-gradient(145deg, #070D1E 0%, #0F1B38 50%, #070D1E 100%) !important;
  color: #FFFFFF !important;
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
}

.donation-section .section-title,
.donation-section .bank-name,
.donation-section .qris-text,
.donation-section .rek-number {
  color: #FFFFFF !important;
}

.donation-section .section-subtitle,
.donation-section .bank-branch,
.donation-section .rek-owner,
.donation-section .donation-steps ol {
  color: var(--text-cream) !important;
}

