:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e6ec;
  --border-strong: #d2d6df;
  --text: #161a23;
  --text-2: #4b5263;
  --muted: #7c8396;
  --primary: #c8102e;
  --primary-hover: #a50d26;
  --primary-soft: #fdecee;
  --accent: #1f2a44;
  --side: #121826;
  --side-2: #1b2334;
  --side-text: #aab3c5;
  --focus: #2563eb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* status */
  --belum-bg: #fbf4d9; --belum-fg: #6f5600; --belum-bd: #eadb9f;
  --bisa-bg: #e0f2fe; --bisa-fg: #075985; --bisa-bd: #b5dcf6;
  --monet-bg: #dcfce7; --monet-fg: #166534; --monet-bd: #a7e8bf;
  --red-bg: #fee2e2; --red-fg: #991b1b; --red-bd: #f8b9b9;
  --gray-bg: #eef0f4; --gray-fg: #555d6e; --gray-bd: #d9dde5;
  --teal-bg: #ccfbf1; --teal-fg: #115e59; --teal-bd: #94e6d6;
  --purple-bg: #ede9fe; --purple-fg: #5b21b6; --purple-bd: #cfc3fb;
  --amber-bg: #fef3c7; --amber-fg: #92400e; --amber-bd: #f5d88a;
  --orange-bg: #ffedd5; --orange-fg: #9a3412; --orange-bd: #fbc89a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.dash { color: #a3a9b7; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .1px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; }
.brand-mark svg { width: 15px; height: 15px; fill: #fff; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--side-text); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b7489; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none;
  color: var(--side-text); font-weight: 500; margin-bottom: 2px;
}
.nav a svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #222b3d; font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot button { margin-top: 8px; background: none; border: 1px solid #2c3549; color: var(--side-text); border-radius: 7px; padding: 5px 10px; cursor: pointer; width: 100%; }
.side-foot button:hover { color: #fff; border-color: #435069; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--side); color: #fff;
  position: sticky; top: 0; z-index: 25;
}
.topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
.topbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.content { padding: 22px 24px 48px; max-width: 1680px; width: 100%; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

svg.ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; vertical-align: -3px; }
.card-head h3 svg.ic { margin-right: 4px; }
.time24 { font-family: var(--mono); letter-spacing: .5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--surface-2); border-color: #c0c5d1; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-dark { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-dark:hover { background: #121a2e; }
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-warn { background: #d97706; border-color: #d97706; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #eceef3; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: #1d4ed8; cursor: pointer; font-weight: 600; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: 3px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: #eceef3; color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.fill-btn {
  border: 1px dashed #b9c0cf; background: #fafbfc; color: #4b5263; border-radius: 6px; padding: 2px 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.fill-btn:hover { border-color: #1d4ed8; color: #1d4ed8; background: #eff5ff; }
.cell-btn { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 5px; cursor: pointer; text-align: inherit; }
.cell-btn:hover { background: #eef2fb; }
.cell-btn[disabled] { cursor: default; background: none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 14.5px; letter-spacing: .1px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; text-align: left;
  cursor: pointer; position: relative; box-shadow: var(--shadow); transition: border-color .12s, transform .12s;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.stat .label { min-height: 30px; align-items: flex-start !important; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 3px; }
.stat.static { cursor: default; }
.stat.static:hover { transform: none; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 240px; position: relative; min-width: 200px; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; }
.toolbar .search input { padding-left: 33px; }
.toolbar select { width: auto; min-width: 130px; flex: 0 1 auto; }
.toolbar .spacer { flex: 1; }

/* ---------- form ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=time], input[type=date], input[type=number], input[type=url], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; background: #fff;
  min-height: 36px; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { min-height: 76px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.field .req { color: var(--primary); }
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.form-error { background: var(--red-bg); color: var(--red-fg); border: 1px solid var(--red-bd); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-weight: 500; }
.chip-info { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 13px; margin-bottom: 14px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 10px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
#channel-table th { min-width: 64px; }
#channel-table .email-cell { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2); padding: 9px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1;
  line-height: 1.25; vertical-align: bottom;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .arrow { display: inline-block; width: 10px; margin-left: 3px; color: var(--muted); }
.tbl th.sorted { color: var(--text); }
.tbl td { padding: 8px 8px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tbody tr.ctx-open td { background: #eef3ff; }
.tbl tbody tr.row-paused td { background: #fffcf3; }
.tbl tbody tr.row-stopped td { background: #fdf6f6; }
.tbl tbody tr.row-stopped .ch-name { color: #6b7280; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .ch-cell { display: flex; align-items: center; gap: 6px; min-width: 170px; }
.tbl .ch-name { font-weight: 600; text-decoration: none; color: var(--text); }
.tbl .ch-name:hover { color: #1d4ed8; text-decoration: underline; }
.tbl .email-link { text-decoration: none; color: #1d4ed8; }
.tbl .email-link:hover { text-decoration: underline; }
.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager select { width: auto; min-height: 30px; padding: 3px 8px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: .015em; border: 1px solid transparent; white-space: nowrap; line-height: 1.6;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.b-belum_monet { background: var(--belum-bg); color: var(--belum-fg); border-color: var(--belum-bd); }
.b-bisa_pengajuan { background: var(--bisa-bg); color: var(--bisa-fg); border-color: var(--bisa-bd); }
.b-monet { background: var(--monet-bg); color: var(--monet-fg); border-color: var(--monet-bd); }
.b-ditolak, .b-dismon, .b-stop_dismon { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-bd); }
.b-belum_live, .b-aktif-neutral { background: var(--gray-bg); color: var(--gray-fg); border-color: var(--gray-bd); }
.b-abadi { background: var(--teal-bg); color: var(--teal-fg); border-color: var(--teal-bd); }
.b-staso { background: var(--purple-bg); color: var(--purple-fg); border-color: var(--purple-bd); }
.b-pause { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.b-stop_gak_perform { background: var(--orange-bg); color: var(--orange-fg); border-color: var(--orange-bd); }
.b-aktif { background: var(--monet-bg); color: var(--monet-fg); border-color: var(--monet-bd); }
.b-auto { font-size: 10px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.badge.sm { font-size: 10.5px; padding: 1px 7px; }
.badge-btn { cursor: pointer; }
.badge-btn:hover { filter: brightness(.96); box-shadow: 0 0 0 2px rgba(31, 42, 68, .12); }
.act-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; border: 0; padding: 0; cursor: pointer; }
.act-dot.aktif { background: #22c55e; }
.act-dot:hover { box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.dot-belum_monet { background: #d4b84a; } .dot-bisa_pengajuan { background: #38bdf8; } .dot-monet { background: #22c55e; }
.dot-red { background: #ef4444; } .dot-gray { background: #9ca3af; } .dot-teal { background: #14b8a6; } .dot-purple { background: #8b5cf6; }
.dot-amber { background: #f59e0b; } .dot-orange { background: #f97316; } .dot-dark { background: var(--accent); }

.days-left { display: block; font-size: 11.5px; color: var(--muted); }
.days-left.warn { color: #b45309; font-weight: 600; }
.days-left.over { color: #b91c1c; font-weight: 600; }

/* ---------- popover / tooltip / context menu ---------- */
.pop {
  position: fixed; z-index: 80; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 12px 14px; min-width: 210px; max-width: 320px; font-size: 13px;
}
.pop.tip { background: #141a29; color: #e8ebf2; border-color: #141a29; pointer-events: none; padding: 10px 12px; }
.pop .t-title { font-weight: 700; margin-bottom: 2px; }
.pop.tip .t-title { color: #fff; }
.pop .t-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pop .t-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 8px; }
.pop.tip .t-label { color: #8f9ab0; }
.pop .t-rel { color: var(--muted); font-size: 12px; }
.pop.tip .t-rel { color: #9aa5ba; }
.pop .pop-form { display: flex; gap: 6px; margin-top: 10px; }
.pop .pop-form input { min-height: 32px; padding: 5px 8px; }
.pop .pop-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.pop .t-note { margin-top: 2px; white-space: pre-wrap; }

.ctx {
  position: fixed; z-index: 90; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 5px; min-width: 210px;
}
.ctx .ctx-title { padding: 6px 10px 6px; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); margin-bottom: 4px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-weight: 500;
}
.ctx button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; color: var(--muted); }
.ctx button:hover:not(:disabled) { background: #f1f3f8; }
.ctx button:disabled { opacity: .4; cursor: not-allowed; }
.ctx button.danger { color: #b91c1c; } .ctx button.danger svg { color: #b91c1c; }
.ctx button.warn { color: #b45309; } .ctx button.warn svg { color: #b45309; }
.ctx button.ok { color: #15803d; } .ctx button.ok svg { color: #15803d; }
.ctx hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 32, .45); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .14s; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 4px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 14px 20px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--border); margin-top: 8px; }
.confirm-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.confirm-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #141a29; color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 360px; animation: rise .15s; }
.toast.err { background: #991b1b; }

/* ---------- detail ---------- */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv a { color: #1d4ed8; }
.metric-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.metric .m-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.metric .m-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.metric .m-unit { font-size: 13px; font-weight: 600; color: var(--muted); }
.metric .m-upd { font-size: 12px; color: var(--text-2); }
.metric .m-rel { font-size: 12px; color: var(--muted); }
.hero { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.secure-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef0f4; }
.secure-row:last-child { border-bottom: 0; }
.secure-row .label { color: var(--muted); font-weight: 500; }
.masked { font-family: var(--mono); letter-spacing: 2px; color: var(--text-2); }
.revealed { font-family: var(--mono); background: #fffbea; border: 1px solid #f3e3a1; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.reveal-timer { font-size: 12px; color: #92400e; margin-top: 10px; }
.notice { display: flex; gap: 10px; background: #f3f6fd; border: 1px solid #d9e3f7; color: #24365e; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.notice svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; }
.notice.warn { background: #fffbeb; border-color: #f6e3a6; color: #77520a; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: #e6e9ef; }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.timeline .tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline .tl-title { font-weight: 600; }
.timeline .tl-meta { font-size: 12.5px; color: var(--muted); }
.timeline .tl-detail { white-space: pre-wrap; font-size: 13px; color: var(--text-2); margin-top: 3px; }
.timeline .tl-note { margin-top: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; font-size: 13px; white-space: pre-wrap; }

.tabs { display: flex; gap: 4px; padding: 3px; background: #eef0f4; border-radius: 9px; width: fit-content; }
.tabs button { background: none; border: 0; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13px; }
.tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.tree { list-style: none; padding: 0; margin: 0; }
.tree > li { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.tree .acc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tree .acc-head a { font-weight: 600; color: #1d4ed8; text-decoration: none; }
.tree .acc-head a:hover { text-decoration: underline; }

.danger-zone { border-color: #f3c2c2; }
.danger-zone .card-head { background: #fff6f6; border-bottom-color: #f3c2c2; border-radius: var(--radius) var(--radius) 0 0; }
.danger-zone h3 { color: #991b1b; }

.key-val { font-family: var(--mono); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; max-width: 220px; }
.key-val span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc { display: inline-flex; flex-direction: column; line-height: 1.25; }
.calc .auto-tag { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.calc .ovr { font-size: 11px; color: #b45309; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #2a1420 0%, transparent 60%), var(--side); }
.auth-card { background: #fff; border-radius: 16px; padding: 30px 28px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }
.auth-card .brand small { color: var(--muted); }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card p { color: var(--muted); margin: 0 0 18px; }
.auth-card .btn { width: 100%; padding: 10px; }

.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (min-width: 901px) and (max-width: 1366px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 18px 8px; }
  .sidebar .nav-text, .nav-label { display: none; }
  .brand { padding: 4px 9px 22px; }
  .nav a { justify-content: center; padding: 10px; }
  .side-foot { padding: 12px 0 0; text-align: center; }
  .side-foot .who, .side-foot > div:not(.who) { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-foot > div:not(.who) { display: none; }
  .side-foot button { padding: 5px 2px; font-size: 11px; }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
  .topbar { display: flex; }
  .content { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 130px 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .toolbar select { flex: 1 1 140px; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 7px 9px; }
  .stat .label { font-size: 9.5px; min-height: 24px; letter-spacing: .02em; }
  .stat .value { font-size: 18px; }
  .secure-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ===================== v2: PIC, referensi, riset niche, monitoring ===================== */
.metric-cell { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.edit-metric { opacity: .35; padding: 2px; }
.edit-metric svg { width: 13px; height: 13px; }
tr:hover .edit-metric, .edit-metric:focus-visible { opacity: 1; }
@media (hover: none) { .edit-metric { opacity: .8; } }
.inline-metric { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; min-width: 132px; }
.inline-metric input { min-height: 30px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; width: 128px; }
.inline-metric input[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.inline-actions { display: flex; gap: 4px; }
.inline-err { color: #b91c1c; font-size: 11.5px; font-weight: 600; max-width: 180px; text-align: right; line-height: 1.3; }
.inline-err:empty { display: none; }

.progress { display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; height: 8px; background: #e9ecf2; border-radius: 999px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); border-radius: 999px; transition: width .3s; }
.progress-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.progress.compact .progress-track { height: 6px; }
.progress.compact .progress-val { font-size: 12.5px; }
.ref-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.ref-counts .rc::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.rc-on::before { background: #22c55e; } .rc-skip::before { background: #f59e0b; } .rc-belum::before { background: #9ca3af; }
.b-ref-on { background: var(--monet-bg); color: var(--monet-fg); border-color: var(--monet-bd); }
.b-ref-skip { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.b-ref-belum { background: var(--gray-bg); color: var(--gray-fg); border-color: var(--gray-bd); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.seg-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: #fff; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.seg-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.seg-btn:hover { background: #f4f6fa; }
.seg-btn.on { background: #dcfce7; color: #166534; }
.seg-btn.on.skip { background: #fef3c7; color: #92400e; }
.btn-ok { background: #16a34a; border-color: #16a34a; color: #fff; } .btn-ok:hover { background: #15803d; }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f1f5ff; border-bottom: 1px solid #d9e3f7; position: sticky; top: 0; z-index: 3; flex-wrap: wrap; }
.bulk-bar span { font-weight: 600; margin-right: 6px; }
.ext-link { color: #1d4ed8; text-decoration: none; overflow-wrap: anywhere; } .ext-link:hover { text-decoration: underline; }
.row-muted td { color: var(--muted); }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

.page-tabs { margin: -4px 0 16px; }
.page-tabs a { text-decoration: none; padding: 6px 14px; border-radius: 7px; font-weight: 600; color: var(--text-2); font-size: 13px; }
.page-tabs a.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.niche-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
.niche-text { min-height: 300px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.method-card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px 10px 34px; cursor: pointer; position: relative; background: #fff; }
.method-card input { position: absolute; left: 11px; top: 12px; width: 16px; height: 16px; }
.method-card:hover { border-color: #aab2c2; }
.method-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #f8f9fc; }
.method-card .m-title { font-weight: 700; }
.method-card .m-desc { font-size: 12px; color: var(--muted); }
.pic-pick { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; max-height: 260px; overflow: auto; margin-top: 8px; }
.pic-pick-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 2px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 6px; position: sticky; top: -8px; background: #fff; }
.pic-opt { margin: 0; padding: 5px 0; display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; font-weight: 500; }
.pic-opt .muted { font-size: 12px; }
.preview-stats { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.preview-card { border-color: #c7d2e8; }
.total-row td { font-weight: 700; background: var(--surface-2); }
.conflict { color: #92400e; }
.confirm-bar { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: #fff; }
.weight-row { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid #eef0f4; }
.weight-row label { font-weight: 500; }
.weight-row input { min-height: 32px; text-align: right; }
.ref-global { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ref-global-nums { display: flex; gap: 22px; flex-wrap: wrap; }
.ref-global-nums > div { display: flex; flex-direction: column; }
.ref-global-nums .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.ref-global-nums .muted { font-size: 12px; }
details > summary { list-style-position: inside; }

@media (max-width: 1100px) { .niche-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .method-grid { grid-template-columns: 1fr; }
  .ref-table .seg-btn { padding: 6px 8px; }
  .niche-text { min-height: 200px; }
  .ref-global-nums { gap: 14px; }
  .confirm-bar { padding-bottom: 6px; }
}
.m-only { display: none; }
@media (max-width: 900px) {
  .m-only { display: inline; }
  .d-only { display: none; }
  .ref-table, .ref-table tbody, .ref-table tr, .ref-table td { display: block; width: 100%; }
  .ref-table thead { display: none; }
  .ref-table tr { position: relative; padding: 12px 14px 12px 14px; border-bottom: 1px solid #eef0f4; }
  .ref-table tr:has(.ref-check input) { padding-left: 42px; }
  .ref-table td { border: 0 !important; padding: 2px 0 !important; background: none !important; }
  .ref-table td.ref-check { position: absolute; left: 14px; top: 14px; width: auto; }
  .ref-table td.ref-check input { width: 18px; height: 18px; }
  .ref-table td.ref-meta { font-size: 12px; color: var(--muted); display: inline-block; width: auto; margin-right: 12px; }
  .ref-table td.ref-pic { font-weight: 600; font-size: 13px; }
  .ref-table td.ref-status { margin: 4px 0; }
  .ref-table td.ref-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
  .ref-table td.ref-actions .seg { flex: 1; }
  .ref-table td.ref-actions .seg-btn { flex: 1; justify-content: center; padding: 8px; font-size: 13px; }
  .ref-table .table-wrap { overflow: visible; }
}
.restore-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }

/* ===================== v3: Email Pool ===================== */
.b-rd-belum_disiapkan { background: var(--gray-bg); color: var(--gray-fg); border-color: var(--gray-bd); }
.b-rd-dalam_persiapan { background: var(--bisa-bg); color: var(--bisa-fg); border-color: var(--bisa-bd); }
.b-rd-siap { background: var(--monet-bg); color: var(--monet-fg); border-color: var(--monet-bd); }
.b-rd-perlu_pemeriksaan { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.b-us-tersedia { background: #f0f9ff; color: #075985; border-color: #c4e3f6; }
.b-us-ditugaskan { background: var(--purple-bg); color: var(--purple-fg); border-color: var(--purple-bd); }
.b-us-terhubung { background: var(--teal-bg); color: var(--teal-fg); border-color: var(--teal-bd); }
.b-us-tidak_aktif { background: var(--gray-bg); color: var(--gray-fg); border-color: var(--gray-bd); }
.b-conf-tinggi { background: var(--monet-bg); color: var(--monet-fg); border-color: var(--monet-bd); }
.b-conf-sedang { background: var(--bisa-bg); color: var(--bisa-fg); border-color: var(--bisa-bd); }
.b-conf-rendah { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.b-conf-kurang { background: var(--gray-bg); color: var(--gray-fg); border-color: var(--gray-bd); }
.cred-flags { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.email-chip { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.email-chip-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-list { max-height: 420px; overflow: auto; padding: 4px 14px 10px; }
.urgent { color: #b91c1c; font-weight: 700; }
.em-table td { vertical-align: top; }
.page-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.page-tabs a { white-space: nowrap; }
