/* ═══════════════════════════════════════════════════
   table-ui.css — Main Content, Table, Pagination,
                  Footer, Toast, Modal & Responsive
   KIBAID Direktori Sejarah Gereja
═══════════════════════════════════════════════════ */

/* ══ MAIN CONTENT ══ */
.main-content { max-width: 1140px; margin: 0 auto; padding: 32px 28px 80px; }

/* ── Stats Bar ── */
.stats-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.results-count { font-size: 14px; color: var(--muted); }
.results-count strong { color: var(--ink); font-weight: 600; }
.query-chip {
  display: inline-block; background: var(--amber-pale); color: var(--amber);
  font-weight: 600; padding: 1px 8px; border-radius: 6px; font-size: 13.5px;
}

/* Sort buttons */
.sort-controls { display: flex; align-items: center; gap: 6px; }
.sort-btn {
  font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); padding: 5px 13px; border-radius: 20px;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: all var(--t); white-space: nowrap;
}
.sort-btn:hover,
.sort-btn.active {
  border-color: var(--blue-mid); color: var(--blue-mid);
  background: var(--blue-pale); font-weight: 600;
}

/* ══ TABLE CARD ══ */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-md); transition: opacity .2s;
}
.table-card.searching { opacity: .5; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: #F7F8FB; border-bottom: 1.5px solid var(--border-soft); }
.data-table thead th {
  padding: 13px 20px; text-align: left;
  font-size: 10.5px; font-weight: 700; color: var(--subtle);
  letter-spacing: .9px; text-transform: uppercase;
}
.data-table thead th:last-child { text-align: right; }
.data-table tbody tr { border-bottom: 1px solid #F0F1F7; transition: background var(--t); }
.data-table tbody tr:nth-child(even) { background: #FAFBFD; }
.data-table tbody tr:hover           { background: var(--blue-pale); }
.data-table tbody tr:last-child      { border-bottom: none; }
.data-table tbody tr:focus           { outline: 2px solid var(--blue-mid); outline-offset: -2px; }
.data-table tbody td                 { padding: 14px 20px; vertical-align: middle; }

.church-name  { font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.4; }
.klasis-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.klasis-dot   { width: 7px; height: 7px; border-radius: 50%; background: #2a8a6e; flex-shrink: 0; }
.action-cell  { text-align: right; }

/* Button Detail */
.btn-detail {
  font-size: 12.5px; font-weight: 600; color: var(--blue); background: var(--blue-pale);
  border: 1.5px solid rgba(27,69,98,.2); padding: 6px 14px; border-radius: var(--r-sm);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--t); white-space: nowrap;
}
.btn-detail:hover:not(:disabled) {
  background: var(--blue); border-color: var(--blue); color: white;
  transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,69,98,.32);
}
.btn-detail:active:not(:disabled) { transform: translateY(0); }
.btn-detail:disabled { opacity: .5; cursor: not-allowed; }

.btn-spinner {
  width: 11px; height: 11px;
  border: 1.5px solid rgba(27,69,98,.25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Highlight keyword */
mark.hl {
  background: #FFEFC2; color: #92400E;
  border-radius: 3px; padding: 0 2px; font-weight: 700;
}

/* ── Skeleton Loading ── */
.skeleton-row td { padding: 15px 20px; }
.skeleton-bar {
  height: 13px;
  background: linear-gradient(90deg, #F0F1F7 25%, #E4E6EF 50%, #F0F1F7 75%);
  background-size: 200% 100%; border-radius: 6px;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty State ── */
.empty-state { padding: 80px 24px; text-align: center; }
.empty-icon {
  width: 72px; height: 72px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 20px;
  margin: 0 auto 20px; display: flex; align-items: center;
  justify-content: center; color: var(--subtle);
}
.empty-icon--error { color: #EF4444; background: #FEF2F2; border-color: #FECACA; }
.empty-title { font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.empty-desc  { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; padding: 18px; flex-wrap: wrap;
  border-top: 1px solid var(--border-soft);
}
.page-btn {
  font-size: 13.5px; font-weight: 500; min-width: 36px; height: 36px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.page-nav { color: var(--ink-2); }
.page-btn:hover:not(:disabled) { border-color: var(--blue-mid); color: var(--blue-mid); background: var(--blue-pale); }
.page-btn.active { background: var(--blue); border-color: var(--blue); color: white; font-weight: 700; box-shadow: 0 2px 10px rgba(27,69,98,.3); }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }
.page-dots { font-size: 13px; color: var(--subtle); padding: 0 4px; }

/* Row entrance animation */
.fade-in { animation: fadeIn .3s ease forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ FOOTER ══ */
.site-footer { position: relative; background: #0e2535; color: rgba(255,255,255,.85); overflow: hidden; }
.footer-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 110%, rgba(27,69,98,.35) 0%, transparent 65%);
  pointer-events: none;
}
.footer-inner {
  position: relative; max-width: 1140px; margin: 0 auto; padding: 52px 28px 40px;
  display: grid; grid-template-columns: 2fr 1.4fr 1.6fr; gap: 52px; align-items: start;
}
.footer-brand  { display: flex; flex-direction: column; gap: 12px; }
.footer-logo   { font-weight: 600; font-size: 28px; color: white; line-height: 1; }
.footer-mission { font-size: 13.5px; color: rgba(255,255,255,.5); line-height: 1.7; font-weight: 300; max-width: 300px; }
.footer-website {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  padding: 6px 12px; border-radius: 8px; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s; margin-top: 4px;
}
.footer-website:hover { background: rgba(255,255,255,.13); color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.25); }
.footer-copy   { font-size: 12px; color: rgba(255,255,255,.3); margin-top: 8px; }
.footer-links-title { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.35); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 16px; }
.footer-links ul   { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links li   { font-size: 13.5px; color: rgba(255,255,255,.55); display: flex; align-items: center; gap: 8px; }
.footer-links li::before { content: ''; display: block; width: 4px; height: 4px; border-radius: 50%; background: rgba(100,180,220,.7); flex-shrink: 0; }
.footer-quote  { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.quote-icon    { color: rgba(100,180,220,.8); flex-shrink: 0; opacity: .9; }
.quote-text    { font-style: italic; font-size: 15.5px; color: rgba(255,255,255,.75); line-height: 1.7; font-weight: 300; }
.quote-attr    { font-size: 11.5px; font-weight: 500; color: rgba(255,255,255,.3); letter-spacing: .4px; }

/* ══ TOAST ══ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--ink); color: white;
  font-size: 13.5px; font-weight: 500; padding: 11px 18px;
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  z-index: 300; transform: translateY(60px); opacity: 0; pointer-events: none;
  transition: all .32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ══ MODAL DETAIL ══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  max-width: 540px; width: 100%; padding: 36px;
  transform: translateY(16px) scale(.97);
  transition: transform .3s cubic-bezier(0.34, 1.2, .64, 1);
}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); }
.modal-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
  color: var(--blue); background: var(--blue-pale); border: 1px solid rgba(27,69,98,.2);
  border-radius: 20px; padding: 3px 10px; display: inline-block; margin-bottom: 14px;
}
.modal-title    { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 6px; line-height: 1.3; }
.modal-klasis   { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.modal-divider  { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.modal-field    { margin-bottom: 14px; }
.modal-label    { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--subtle); margin-bottom: 4px; }
.modal-value    { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.modal-footer   { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.btn-close {
  font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 500;
  padding: 8px 20px; border-radius: var(--r-sm); cursor: pointer;
  border: 1.5px solid var(--border); background: transparent; color: var(--muted);
  transition: all var(--t);
}
.btn-close:hover { border-color: var(--ink); color: var(--ink); }

/* ══ RESPONSIVE ══ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-content { align-items: center; }
  .search-zone { max-width: 100%; }
  .hero-book-col { order: -1; padding: 0; }
  .hero-book-placeholder, .hero-book-img { width: 180px; }
  .fc { display: none; }
  .hero-ring--1, .hero-ring--2, .hero-ring--3 { left: 50%; }
  .search-stats { justify-content: center; }
}
@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-quote { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .header-nav  { display: none; }
  .header-inner { padding: 0 16px; }
  .hero        { padding: 48px 16px 84px; }
  .hero-title  { font-size: 22px; }
  .hero-streak { display: none; }
  .hero-book-placeholder, .hero-book-img { width: 150px; }
  .hero-book-placeholder { height: 210px; }
  .fc          { display: none; }
  .search-zone { max-width: 100%; }
  .search-card { border-radius: var(--r-lg); }
  .search-card-label { display: none; }
  .search-top  { padding: 4px 4px 4px 16px; }
  .s-stat-num  { font-size: 22px; }
  .s-stat      { padding: 0 14px; }
  .main-content { padding: 20px 16px 60px; }
  .hero-feature-grid { margin-top: 24px; }
  .hfg-inner   { flex-wrap: wrap; border-radius: 12px; }
  .hfg-item    { flex: 0 0 50%; padding: 14px 16px; }
  .hfg-sep     { display: none; }
  .search-sticky { padding: 8px 16px; top: 60px; }
  .stats-bar   { flex-direction: column; align-items: flex-start; }
  .table-card  { background: transparent; border: none; box-shadow: none; overflow: visible; border-radius: 0; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody { display: block; }
  .data-table tbody tr {
    display: flex; flex-direction: column;
    background: var(--surface) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--r) !important;
    margin-bottom: 10px; padding: 16px;
    box-shadow: var(--shadow-sm);
  }
  .data-table tbody tr:hover { background: var(--blue-pale) !important; }
  .data-table tbody td { padding: 3px 0; border: none; }
  .church-name   { font-size: 15px; margin-bottom: 4px; }
  .action-cell   { text-align: left; margin-top: 12px; }
  .pagination    { padding: 10px 0 0; gap: 4px; }
  .footer-inner  { grid-template-columns: 1fr; gap: 28px; padding: 36px 16px 28px; }
  .footer-quote  { grid-column: auto; }
  .sticky-brand  { display: none; }
  .sticky-count  { display: none; }
  .toast         { right: 12px; left: 12px; bottom: 16px; text-align: center; }
}

/* ══════════════════════════════════════
   TAB BAR
══════════════════════════════════════ */
.tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 4px;
}
.tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 20px 11px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all var(--t);
  position: relative; top: 1.5px;
  white-space: nowrap;
}
.tab-btn svg { flex-shrink: 0; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.tab-count {
  font-size: 11px; font-weight: 600;
  background: var(--row-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 1px 7px; border-radius: 99px;
  transition: all var(--t);
}
.tab-btn.active .tab-count {
  background: var(--blue-pale);
  border-color: rgba(27,69,98,.2);
  color: var(--blue);
}

/* ══════════════════════════════════════
   FILTER STATUS CHIPS (Pekerja)
══════════════════════════════════════ */
.filter-status-bar {
  display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-chip {
  display: flex; align-items: center; gap: 5px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12.5px; font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 99px;
  cursor: pointer; transition: all var(--t);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--blue-mid); color: var(--blue-mid); }
.filter-chip.active {
  background: var(--blue-pale);
  border-color: rgba(27,69,98,.25);
  color: var(--blue);
}
.chip-count {
  font-size: 10.5px; font-weight: 600;
  background: rgba(0,0,0,.06);
  padding: 0 5px; border-radius: 99px;
}
.filter-chip.active .chip-count { background: rgba(27,69,98,.12); }

/* ══════════════════════════════════════
   STATUS BADGE (Pekerja)
══════════════════════════════════════ */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500;
  padding: 2px 9px; border-radius: 99px;
  white-space: nowrap;
}
.sb-aktif   { background: #E1F5EE; color: #085041; }
.sb-pensiun { background: #FAEEDA; color: #633806; }
.sb-menikah { background: var(--blue-pale); color: var(--blue); }
.sb-alih    { background: var(--row-alt); color: var(--muted); }
.sb-berhenti{ background: var(--row-alt); color: var(--muted); }
.sb-moral   { background: #FCEBEB; color: #791F1F; }
.sb-wafat   { background: #F1EFE8; color: #5F5E5A; }
.sb-unknown { background: var(--row-alt); color: var(--muted); }

/* No-row indicator pada kolom angkat/berhenti pekerja */
.yr-dash { font-size: 13px; color: var(--subtle); }
