﻿/* 06_VIEW-TREASURY.CSS — Kas, Infaq & Pinjaman Anggota */

/* Summary & Wealth Grid */
.treasury-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.money-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.money-card.balance {
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  color: #FFFFFF;
  border-color: transparent;
}
.money-label { font-size: 0.8rem; opacity: 0.85; margin-bottom: 4px; }
.money-amount { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  padding: 13px 16px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.amt-in { color: var(--emerald-700); font-weight: 700; }
.amt-out { color: var(--danger); font-weight: 700; }

/* Sub-tabs */
.subtabs {
  display: inline-flex;
  gap: 6px;
  background: var(--bg-soft);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.subtab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.subtab-btn.active {
  background: var(--surface);
  color: var(--emerald-800);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .subtab-btn.active { color: #7EE0C3; }

/* Grid Rekap Kekayaan & Infaq Luxe */
.wealth-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.wealth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.wealth-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Saldo Kas Tunai (Primary Luxe) */
.wealth-card.primary {
  background: linear-gradient(135deg, #064E3B 0%, #075E47 60%, #0F766E 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 20px rgba(6, 78, 59, 0.2);
}
.wealth-card.primary .wealth-label { color: #A7F3D0; }
.wealth-card.primary .wealth-sub { color: rgba(255, 255, 255, 0.82); }

/* Akumulasi Infaq Jamaah (Infaq Luxe Hijau Zamrud Emas) */
.wealth-card.infaq-highlight {
  background: linear-gradient(135deg, #064E3B 0%, #047857 55%, #059669 100%);
  color: #FFFFFF;
  border: 1px solid rgba(253, 230, 138, 0.35);
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.22);
  cursor: pointer;
}
.wealth-card.infaq-highlight::after {
  content: "🕌";
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 2.2rem;
  opacity: 0.18;
  pointer-events: none;
}
.wealth-card.infaq-highlight .wealth-label {
  color: #FDE68A;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wealth-card.infaq-highlight .wealth-val {
  color: #FFFFFF;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.18);
}
.wealth-card.infaq-highlight .wealth-sub {
  color: #D1FAE5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.infaq-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  color: #FDE68A;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(253, 230, 138, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.infaq-quick-link:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Piutang Anggota */
.wealth-card.gold {
  background: linear-gradient(135deg, var(--gold-100), var(--surface));
  border-color: var(--gold-200);
}
.wealth-card.gold .wealth-label { color: var(--gold-600); }

.wealth-label { font-size: 0.78rem; font-weight: 700; opacity: 0.9; margin-bottom: 4px; }
.wealth-val { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.wealth-sub { font-size: 0.74rem; opacity: 0.8; margin-top: 4px; }

/* Responsive Wealth Grid di Tablet & HP */
@media (max-width: 960px) {
  .wealth-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .wealth-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }
  .wealth-card {
    padding: 12px 14px;
    border-radius: 12px;
  }
  .wealth-card.primary,
  .wealth-card.infaq-highlight {
    grid-column: span 1;
  }
  .wealth-card.primary .wealth-val,
  .wealth-card.infaq-highlight .wealth-val {
    font-size: 1.12rem;
  }
  .wealth-val {
    font-size: 1.05rem;
  }
  .wealth-label {
    font-size: 0.72rem;
  }
  .wealth-sub {
    font-size: 0.68rem;
  }
  .infaq-quick-link {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
}
@media (max-width: 360px) {
  .wealth-grid {
    grid-template-columns: 1fr;
  }
}

/* Tombol Preset Cepat Pecahan / Preset Nominal */
.preset-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.preset-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.preset-pill:hover {
  border-color: var(--emerald-600);
  background: var(--emerald-50);
  color: var(--emerald-800);
}
.preset-pill:active {
  transform: scale(0.95);
}
.preset-pill.reset {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.05);
}
.preset-pill.reset:hover {
  background: rgba(220, 38, 38, 0.12);
}

/* Modal Catat Infaq Kilat (Express Infaq Bendahara) */
.quick-infaq-form {
  display: flex;
  flex-direction: column;
}
.infaq-modal-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #D97706;
  background: #FEF3C7;
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 12px;
}
[data-theme="dark"] .infaq-modal-badge {
  background: rgba(217, 119, 6, 0.2);
  color: #FDE68A;
}

.infaq-amount-card {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.06), rgba(242, 220, 164, 0.12)) !important;
  border: 1.5px solid rgba(6, 78, 59, 0.25) !important;
  border-radius: var(--radius-md, 14px);
  padding: 16px;
  margin-bottom: 14px;
}
.infaq-big-input {
  color: var(--emerald-800) !important;
  border-color: var(--emerald-600) !important;
}
[data-theme="dark"] .infaq-big-input {
  color: #A7F3D0 !important;
}

/* Quick Source Selector Grid */
.quick-source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 520px) {
  .quick-source-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.quick-source-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.quick-source-chip:hover {
  border-color: var(--emerald-600);
}
.quick-source-chip.active {
  background: var(--emerald-50);
  border-color: var(--emerald-700);
  box-shadow: 0 0 0 2px var(--emerald-100);
}
[data-theme="dark"] .quick-source-chip.active {
  background: rgba(6, 78, 59, 0.28);
  border-color: #34D399;
}
.quick-source-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.quick-source-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

/* Modal Catat Kas Umum */
.tx-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 520px) {
  .tx-type-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}
.tx-type-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: var(--radius-md, 12px);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
}
.tx-type-chip:hover {
  border-color: var(--emerald-600);
}
.tx-type-chip.active-in {
  background: var(--emerald-100);
  border-color: var(--emerald-700);
  color: var(--emerald-800);
  box-shadow: 0 0 0 2px var(--emerald-100);
}
[data-theme="dark"] .tx-type-chip.active-in {
  color: #7EE0C3;
}
.tx-type-chip.active-out {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger-bg);
}

.amount-input-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.amount-display-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.amount-rp-prefix {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-muted);
}
.amount-big-input {
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  padding: 10px 14px !important;
}

/* Jurnal Kas: Sticky Toolbar, Sticky Table Header & Compact Kode Stack */
.jurnal-sticky-toolbar {
  position: sticky;
  top: 64px;
  z-index: 15;
  background: var(--bg);
  padding: 10px 0 8px;
  margin-bottom: 10px !important;
  border-bottom: 1px solid var(--border-soft);
}

.jurnal-table-wrap {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.jurnal-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-soft);
  box-shadow: 0 1px 0 var(--border);
}

.tx-code-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.tx-code-sub {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.1;
  white-space: nowrap;
}
