/* =========================================================
   TIMPA DETEKTOR — token system (v2: light dashboard theme)
   Warna : biru primer di atas putih/abu muda, gaya dashboard/card
   Tipe  : Poppins (judul) / Inter (body) / JetBrains Mono (data OCR)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #2f6fed;
  --primary-dark: #1f56c9;
  --primary-light: #eaf1fe;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --border: #e3e8f0;
  --text: #1f2937;
  --text-muted: #6b7789;
  --green: #1a9e6b;
  --green-light: #e6f8f0;
  --red: #d8483a;
  --red-light: #fceceb;
  --amber: #c8860a;
  --amber-light: #fbf1de;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(18, 38, 63, 0.06), 0 1px 2px rgba(18, 38, 63, 0.08);
  --topbar-height: 60px;
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
}

a { color: inherit; }

/* ---- Topbar universal (semua ukuran layar) ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-dark);
  color: #fff;
  height: var(--topbar-height);
  padding: 0 18px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-toggle {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-toggle:hover { background: rgba(255,255,255,0.25); }
.topbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-brand .logo-mark {
  background: #fff;
  color: var(--primary-dark);
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.7rem;
}

/* ---- Sidebar kiri (collapsible, tanpa ikon) ---- */
.app-shell { display: flex; min-height: calc(100vh - var(--topbar-height)); }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
  overflow: hidden;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
}
.sidebar.collapsed { width: 0; }
.sidebar nav { flex: 1; padding: 14px 12px; overflow-y: auto; overflow-x: hidden; }
.sidebar .group-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  padding: 14px 10px 6px;
  white-space: nowrap;
}
.sidebar .group-label:first-child { padding-top: 2px; }
.sidebar a.menu-item {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.89rem;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
}
.sidebar a.menu-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar a.menu-item.active { background: #fff; color: var(--primary-dark); }
.sidebar .bottom {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}

.main-content { flex: 1; min-width: 0; }

/* ---- Overlay khusus mobile (menutup sidebar saat area luar diketuk) ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 39;
  opacity: 0;
  transition: opacity .2s ease;
}
.sidebar-overlay.visible { display: block; opacity: 1; }

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 250px !important;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 40;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: 250px !important; } /* state collapse desktop diabaikan di mobile */

  .main-content { width: 100%; }
  .page, .page.wide { padding: 24px 16px 60px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.45rem; }
  .panel { padding: 18px; }
  .stat-row { grid-template-columns: 1fr; }
  table.db-table { font-size: 0.8rem; }
}


.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.page.wide { max-width: 1180px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 500;
}

h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 12px;
  color: #16223b;
}
h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: #16223b;
}

p.lede {
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 30px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.flash {
  background: var(--amber-light);
  border: 1px solid var(--amber);
  color: #8a5f06;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.flash.success { background: var(--green-light); border-color: var(--green); color: #0e6b48; }

/* ---- Upload dropzone ---- */
.dropzone {
  position: relative;
  overflow: hidden;
  border: 1.5px dashed #c7d3e8;
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  display: block;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.dropzone .label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.95rem;
}
.dropzone .sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}
.dropzone .filename {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary-dark);
  font-weight: 500;
}

.scan-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.scan-preview img { display: block; width: 100%; }
.scan-preview.scanning::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 12px 2px var(--primary);
  animation: scan 2.6s linear infinite;
}
@keyframes scan {
  0%   { top: 0%; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

button.btn, a.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 9px;
  padding: 12px 22px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  margin-top: 20px;
  transition: background .15s;
}
button.btn:hover, a.btn:hover { background: var(--primary-dark); }
button.btn.ghost, a.btn.ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
button.btn.ghost:hover, a.btn.ghost:hover { background: var(--primary-light); }
button.btn.danger { background: var(--red); }
button.btn.danger:hover { background: #b83a2e; }
button.btn.small { padding: 8px 14px; font-size: 0.82rem; margin-top: 0; }

/* ---- Verdict banner ---- */
.verdict {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 26px;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 14px;
}
.verdict .icon-badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.verdict .label { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.verdict .status { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.verdict.hoaks       { background: var(--red-light); border-color: #f0c4bd; color: var(--red); }
.verdict.hoaks .icon-badge { background: var(--red); color: white; }
.verdict.fakta        { background: var(--green-light); border-color: #b9e6d3; color: var(--green); }
.verdict.fakta .icon-badge { background: var(--green); color: white; }
.verdict.verifikasi   { background: var(--amber-light); border-color: #ecd49b; color: var(--amber); }
.verdict.verifikasi .icon-badge { background: var(--amber); color: white; }
.verdict.none         { background: #f1f3f8; border-color: var(--border); color: var(--text-muted); }
.verdict.none .icon-badge { background: #cfd6e4; color: white; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: #16223b;
  margin: 30px 0 12px;
}

.ocr-readout {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #364152;
}

.confidence-bar { height: 6px; border-radius: 3px; background: var(--border); margin-top: 8px; overflow: hidden; }
.confidence-bar .fill { height: 100%; background: var(--primary); }

.match-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fbfcfe;
}
.match-card .top-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.badge {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge.hoaks { background: var(--red-light); color: var(--red); }
.badge.fakta { background: var(--green-light); color: var(--green); }
.badge.perlu_verifikasi { background: var(--amber-light); color: var(--amber); }
.badge.pending { background: var(--amber-light); color: var(--amber); }
.badge.approved { background: var(--green-light); color: var(--green); }
.badge.rejected { background: var(--red-light); color: var(--red); }
.score { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.match-card .claim { font-weight: 500; margin-bottom: 4px; }
.match-card .explain { color: var(--text-muted); font-size: 0.88rem; }
.match-card .source { color: var(--text-muted); font-size: 0.78rem; margin-top: 6px; font-style: italic; }

table.db-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table.db-table { min-width: 480px; }
table.db-table th, table.db-table td {
  text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top;
}
table.db-table th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  background: #f7f9fc;
}
table.db-table tr:hover td { background: #fafbfd; }

.form-grid { display: grid; gap: 14px; margin-top: 4px; }
.form-grid label {
  font-size: 0.8rem; font-weight: 600; color: #374357; display: block; margin-bottom: 5px;
}
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%; background: #fbfcfe; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-family: var(--font-body); font-size: 0.9rem;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  outline: none; border-color: var(--primary);
}
.form-grid textarea { min-height: 70px; resize: vertical; }

footer.disclaimer {
  margin-top: 40px; font-size: 0.78rem; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 16px;
}

/* ---- Gallery (kontribusi komunitas) ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 10px;
}
.gallery-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery-card img { width: 100%; height: 160px; object-fit: cover; display: block; background: #eef1f7; }
.gallery-card .body { padding: 12px 14px; }
.gallery-card .meta { font-size: 0.76rem; color: var(--text-muted); margin-top: 6px; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 2rem; margin-bottom: 10px; }

.admin-page-content { padding: 32px; max-width: 1080px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-card .num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--primary-dark); }
.stat-card .lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.verify-card-v2 {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.verify-card-v2 .actions { display: flex; gap: 8px; margin-top: 12px; }
.image-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374357;
  margin-bottom: 8px;
}
.verify-photo {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 10px;
  background: #eef1f7;
  border: 1px solid var(--border);
  display: block;
  cursor: zoom-in;
}
.verify-photo-empty {
  width: 100%;
  min-height: 200px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-wrap {
  max-width: 380px;
  margin: 90px auto;
}
.login-wrap .panel { text-align: left; }
