/* =============================================================
   PRIORITAS 6 — FINAL VISUAL POLISH v7
   Arah: premium, compact, data-first, mockup approved.
   ============================================================= */

:root {
  --outer-bg: #081426;
  --bg-gradient: linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
  --card-bg: #f5f7fb;
  --card-border: rgba(100, 116, 139, 0.18);
  --card-shadow: 0 26px 70px -34px rgba(15, 23, 42, 0.48);
  --text-title: #111827;
  --text-main: #334155;
  --text-muted: #718096;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --tab-bg: rgba(226, 232, 240, 0.66);
  --tab-active-bg: #ffffff;
  --item-bg: rgba(255,255,255,.92);
  --item-border: rgba(148,163,184,.22);
  --donate-bg: rgba(255,255,255,.78);
  --donate-border: rgba(148,163,184,.22);
}

body.dark-mode {
  --outer-bg: #071426;
  --bg-gradient: linear-gradient(180deg, #0e1c31 0%, #0a172a 100%);
  --card-bg: #0d1b30;
  --card-border: rgba(148, 163, 184, 0.20);
  --card-shadow: 0 36px 90px -38px rgba(0, 0, 0, .88);
  --text-title: #f7f9fc;
  --text-main: #c9d4e5;
  --text-muted: #8696ad;
  --tab-bg: rgba(3, 11, 24, .20);
  --tab-active-bg: rgba(15, 29, 51, .92);
  --tab-active-text: #7386ff;
  --input-bg: rgba(8, 20, 37, .72);
  --input-border: rgba(126, 145, 174, .28);
  --input-focus: #6f7ff7;
  --item-bg: rgba(13, 29, 52, .82);
  --item-border: rgba(126, 145, 174, .18);
  --donate-bg: #f8f6f1;
  --donate-border: rgba(255,255,255,.10);
}

html {
  font-size: 15px;
}

body {
  background:
    radial-gradient(circle at 50% -20%, rgba(62, 91, 150, .18), transparent 40%),
    var(--outer-bg);
}

.container {
  width: min(100%, 680px);
  max-width: 680px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 20px 22px;
  gap: 12px;
  border-radius: 22px;
  background: var(--bg-gradient);
  box-shadow: var(--card-shadow);
  overflow: visible;
}

.header-area {
  min-height: 46px;
  padding-bottom: 12px;
  border-bottom-color: rgba(148,163,184,.14);
}

.home-title-button {
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: -.015em;
}

.header-actions {
  gap: 8px;
}

.btn-header-admin,
.btn-theme {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: .68rem;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.status-bar-container {
  gap: 8px;
}

.status-bar,
.data-counter {
  min-height: 34px;
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 560;
}

.status-bar {
  padding: 7px 12px;
}

body[data-connection-state="online"] .status-bar {
  color: #15803d;
}

body[data-connection-state="online"] .status-bar::first-letter {
  color: #15803d;
}

body.dark-mode[data-connection-state="online"] .status-bar {
  color: #4ade80;
}

body.dark-mode[data-connection-state="online"] .status-bar::first-letter {
  color: #4ade80;
}

.data-counter {
  min-width: 84px;
  justify-content: center;
  color: var(--text-title);
  font-weight: 700;
}

.tabs {
  position: relative;
  padding: 0;
  gap: 0;
  background: transparent;
  border-bottom: 1px solid rgba(148,163,184,.16);
  border-radius: 0;
}

.tab-btn {
  min-height: 42px;
  padding: 9px 12px 11px;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 670;
  letter-spacing: .02em;
  position: relative;
}

.tab-btn.active {
  color: var(--tab-active-text);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7180ff, #6778f5);
}

.search-box {
  position: relative;
}

.search-box::before {
  content: "⌕";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-53%) rotate(-20deg);
  z-index: 2;
  color: var(--text-muted);
  font-size: 1.16rem;
  pointer-events: none;
  opacity: .9;
}

.search-box input {
  min-height: 43px;
  padding: 9px 13px 9px 37px;
  border-radius: 9px;
  font-size: .78rem;
  box-shadow: none;
}

.search-box input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.10);
}

.result-panel {
  flex: 0 0 auto;
  height: clamp(280px, 52dvh, 520px);
  min-height: 280px;
  overflow: hidden;
}

.result-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 0;
  gap: 0;
  border: 1px solid var(--item-border);
  border-radius: 10px;
  background: rgba(2, 10, 23, .04);
}

.result-item {
  display: grid;
  grid-template-columns: minmax(150px, 1.18fr) minmax(0, 1.82fr);
  align-items: center;
  min-height: 54px; 
  padding: 9px 12px;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--item-border);
  border-radius: 0;
  background: var(--item-bg);
  box-shadow: none;
}

.result-item:first-child {
  border-radius: 9px 9px 0 0;
}

.result-item:last-child {
  border-bottom: 0;
  border-radius: 0 0 9px 9px;
}

.result-item:only-child {
  border-radius: 9px;
}

.record-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-item .number {
  font-size: .91rem;
  font-weight: 720;
  letter-spacing: .018em;
  color: var(--text-title);
  font-variant-numeric: tabular-nums;
}

.right-content {
  width: 100%;
  min-width: 0;
  display: grid;
  align-items: center;
  justify-content: stretch;
  gap: 10px;
}

.right-content-rekening {
  grid-template-columns: minmax(88px, 1fr) 82px minmax(112px, auto);
}

.right-content-genshin {
  grid-template-columns: minmax(82px, 1fr) minmax(124px, auto);
}

.badge-meta,
.badge-date {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .70rem;
  line-height: 1.2;
}

.badge-meta.payment-brand {
  max-width: 120px;
  gap: 6px;
  color: var(--text-main);
  font-weight: 650;
}

.payment-brand-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 5px;
  box-shadow: 0 1px 5px rgba(0,0,0,.12);
}

.payment-brand-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.badge-date {
  color: var(--text-muted);
  font-weight: 540;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge-date::before {
  content: none;
}

.badge-provenance {
  justify-self: end;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .63rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid currentColor;
}

.badge-status-admin_verified,
.badge-status-reverified {
  color: #7ee2a2;
  background: rgba(16, 107, 58, .18);
  border-color: rgba(74, 222, 128, .22);
}

.badge-status-admin_verified::before,
.badge-status-reverified::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-right: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .52rem;
  vertical-align: 1px;
}

.badge-status-report_recorded {
  color: #f6bd55;
  background: rgba(146,64,14,.16);
  border-color: rgba(245,158,11,.22);
}

.badge-status-evidence_reviewed {
  color: #f5c36a;
  background: rgba(161,98,7,.16);
  border-color: rgba(245,158,11,.23);
}

.badge-status-multi_report {
  color: #d2b7ff;
  background: rgba(91,33,182,.17);
  border-color: rgba(167,139,250,.24);
}

.record-actions {
  margin-left: 8px;
}

.trust-note {
  max-width: 590px;
  margin: 2px auto 0;
  padding: 0 10px;
  font-size: .68rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.donation-section {
  margin-top: 2px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--donate-bg);
  border-color: var(--donate-border);
}

body.dark-mode .donation-section {
  color: #1f2937;
}

.donation-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.donation-title {
  font-size: .75rem;
  font-weight: 720;
  color: inherit;
}

.donation-subtitle {
  display: block;
  font-size: .61rem;
  line-height: 1.3;
  color: #64748b;
}

.qris-img {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.btn-donate-link {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .69rem;
  font-weight: 700;
}

/* Light theme keeps the same hierarchy without copying the dark palette. */
body:not(.dark-mode) .badge-status-admin_verified,
body:not(.dark-mode) .badge-status-reverified {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

body:not(.dark-mode) .badge-status-report_recorded,
body:not(.dark-mode) .badge-status-evidence_reviewed {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

body:not(.dark-mode) .badge-status-multi_report {
  color: #5b21b6;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .container {
    width: min(100%, 620px);
    padding: 16px;
    border-radius: 18px;
  }

  .result-item {
    grid-template-columns: minmax(130px, .95fr) minmax(0, 1.7fr);
    gap: 10px;
  }

  .right-content-rekening {
    grid-template-columns: minmax(72px, 1fr) 74px minmax(102px, auto);
    gap: 7px;
  }

  .right-content-genshin {
    grid-template-columns: 76px minmax(114px, auto);
    gap: 8px;
  }
}

@media (max-width: 520px) {
  body {
    align-items: flex-start;
    padding:
      max(6px, env(safe-area-inset-top))
      max(6px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
  }

  .container {
    width: 100%;
    padding: 12px;
    gap: 9px;
    border-radius: 15px;
  }

  .header-area {
    min-height: 40px;
    padding-bottom: 9px;
  }

  .home-title-button {
    font-size: .83rem;
  }

  .btn-header-admin,
  .btn-theme {
    min-height: 30px;
    padding: 5px 7px;
    font-size: .58rem;
  }

  .status-bar,
  .data-counter {
    min-height: 31px;
    font-size: .64rem;
  }

  .data-counter {
    min-width: 72px;
  }

  .tab-btn {
    min-height: 38px;
    padding: 8px 5px 10px;
    font-size: .66rem;
  }

  .search-box input {
    min-height: 40px;
    font-size: .73rem;
  }

  .result-list {
    border-radius: 9px;
  }

  .result-item {
    grid-template-columns: minmax(108px, .9fr) minmax(0, 1.65fr);
    min-height: 48px;
    padding: 8px 9px;
    gap: 8px;
  }

  .result-item .number {
    font-size: clamp(.73rem, 3.5vw, .82rem);
  }

  .right-content-rekening {
    grid-template-columns: minmax(54px, 1fr) 60px minmax(88px, auto);
    gap: 5px;
  }

  .right-content-genshin {
    grid-template-columns: 62px minmax(92px, auto);
    gap: 5px;
  }

  .badge-meta,
  .badge-date {
    font-size: .57rem;
  }

  .payment-brand-icon {
    width: 15px;
    height: 15px;
    min-width: 15px;
    border-radius: 4px;
  }

  .badge-provenance {
    min-height: 21px;
    padding: 3px 5px;
    font-size: .54rem;
  }

  .trust-note {
    padding: 0 3px;
    font-size: .59rem;
    line-height: 1.38;
  }

  .donation-section {
    min-height: 55px;
    padding: 8px 9px;
  }

  .donation-title {
    font-size: .66rem;
  }

  .donation-subtitle {
    display: none;
  }

  .qris-img {
    width: 32px;
    height: 32px;
  }

  .btn-donate-link {
    min-height: 31px;
    padding: 5px 9px;
    font-size: .62rem;
  }
}

@media (max-width: 390px) {
  .result-item {
    grid-template-columns: minmax(98px, .85fr) minmax(0, 1.7fr);
    padding-inline: 7px;
  }

  .right-content-rekening {
    grid-template-columns: minmax(42px, 1fr) 54px minmax(82px, auto);
    gap: 4px;
  }

  .payment-brand-name {
    max-width: 40px;
  }

  .badge-status-admin_verified::before,
  .badge-status-reverified::before {
    display: none;
  }
}

/* ============================================================
   PRIORITAS 6 v7.1 — FIXED RESULT COLUMNS
   Keep number / bank / date / status anchored to their own column
   even when optional metadata is missing.
============================================================ */

