:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7785;
  --line: #e2e8f0;
  --brand: #b3261e;        /* Indonesian red */
  --brand-dark: #8e1e18;
  --ok: #1b873f;
  --warn: #b76e00;
  --accent: #2563eb;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: var(--brand); color: #fff; padding: 0 20px; display: flex;
  align-items: center; height: 54px; gap: 22px;
}
header.topbar .brand { font-weight: 700; font-size: 16px; color: #fff; }
header.topbar nav { display: flex; gap: 16px; flex: 1; }
header.topbar nav a { color: #ffe8e6; font-weight: 500; }
header.topbar nav a:hover { color: #fff; text-decoration: none; }
header.topbar .user { font-size: 13px; color: #ffe8e6; }
.badge-role {
  background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-left: 6px;
}

main { max-width: 1120px; margin: 22px auto; padding: 0 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.subtitle { color: var(--muted); margin: 0 0 18px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 13px; }
input[type=text], input[type=password], input[type=date], input[type=number],
textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }

.btn {
  display: inline-block; background: var(--brand); color: #fff; border: none;
  padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #f1f5f9; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.danger:hover { background: var(--brand); color: #fff; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:hover td { background: #fbfcfe; }

.pill { padding: 2px 9px; border-radius: 11px; font-size: 11px; font-weight: 600;
  display: inline-block; }
.pill.unreviewed { background: #fee; color: var(--brand); }
.pill.reviewed { background: #e6f4ea; color: var(--ok); }
.pill.corrected { background: #fff3df; color: var(--warn); }
.pill.draft { background: #eef; color: var(--accent); }
.pill.running, .pill.queued { background: #fff3df; color: var(--warn); }
.pill.complete { background: #e6f4ea; color: var(--ok); }
.pill.failed { background: #fee; color: var(--brand); }
.pill.stopped { background: #eee; color: #555; }
.pill.paused { background: #e3edff; color: #1d4ed8; }
.pill.gov { background:#e3edff;color:#1d4ed8;} .pill.priv{background:#fdeede;color:#b76e00;}
.pill.cit{background:#e7f6ec;color:#1b873f;} .pill.exp{background:#efe6ff;color:#7c3aed;}
.pill.ngo{background:#defaf3;color:#0f766e;}
.pill.media{background:#e0f2fe;color:#0369a1;}
.pill.bizassoc{background:#fef7c3;color:#854d0e;} .pill.other{background:#eceef1;color:#475467;}
.chart-wrap{display:flex;gap:18px;align-items:center;flex-wrap:wrap;}
.pie{width:170px;height:170px;border-radius:50%;flex:0 0 auto;
  background:#eee;box-shadow:0 0 0 1px var(--line) inset;}
.legend{flex:1 1 180px;min-width:170px;}
.legend-row{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:13px;}
.legend-row span:nth-child(2){flex:1;}
.legend .swatch{width:12px;height:12px;border-radius:3px;flex:0 0 auto;}
.pill.relevant{background:#e6f4ea;color:#1b873f;} .pill.irrelevant{background:#fdecec;color:#b42318;}
.pill.geomatch{background:#e6f4ea;color:#1b873f;} .pill.geooff{background:#fdecec;color:#b42318;} .pill.geounknown{background:#eef1f5;color:#475467;}
.pill.positif{background:#e6f4ea;color:#1b873f;} .pill.netral{background:#eef1f5;color:#475467;} .pill.negatif{background:#fdecec;color:#b42318;}
.source-row.excluded{opacity:.45;background:#fafafa;border-style:dashed;}
tr.row-irrelevant{opacity:.55;}
.source-row .exclude-toggle{color:var(--brand);}

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-weight: 500; }
.flash.success { background: #e6f4ea; color: var(--ok); }
.flash.error { background: #fdecea; color: var(--brand); }

.progress { background: var(--line); border-radius: 6px; height: 14px; overflow: hidden; }
.progress > div { background: var(--ok); height: 100%; width: 0; transition: width .4s; }

.kpi { text-align: center; }
.kpi .num { font-size: 28px; font-weight: 700; }
.kpi .lbl { color: var(--muted); font-size: 12px; }

.query-box { background: #0f172a; color: #d1fae5; padding: 10px 12px; border-radius: 6px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px;
  word-break: break-all; }
.muted { color: var(--muted); }
.right { text-align: right; }
.inline { display: inline; }
.tag { font-size: 11px; background:#eef2f7; color:var(--muted); padding:1px 6px; border-radius:4px;}

.chat-log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { padding: 10px 14px; border-radius: 10px; max-width: 80%; }
.msg.user { background: #e3edff; align-self: flex-end; }
.msg.assistant { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg .cite { font-size: 12px; color: var(--muted); margin-top: 6px; }
.checkbox-list { max-height: 230px; overflow:auto; border:1px solid var(--line);
  border-radius:6px; padding:8px; }
.checkbox-list label { font-weight: 400; margin: 2px 0; display:flex; gap:8px; align-items:center;}
