/* ============================================================================
   NevusTools Trading — GAYA PANEL DASHBOARD RISET REAL TIME
   (realtime-panel.css)
   Mandiri: mendefinisikan variabelnya sendiri agar tampil konsisten di halaman
   mana pun, dan tetap mengikuti tema gelap/terang situs.
   ========================================================================== */

.rtwrap {
  --rtp-bg: #111823;
  --rtp-bg2: #161f2d;
  --rtp-line: #22303f;
  --rtp-txt: #e6edf3;
  --rtp-muted: #8b9bb0;
  --rtp-gold: #e0b64a;
  --rtp-up: #2ecc8f;
  --rtp-down: #ff5c6c;
  --rtp-blue: #4aa3e0;

  margin: 8px 0 4px;
  color: var(--rtp-txt);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html[data-theme="light"] .rtwrap {
  --rtp-bg: #ffffff;
  --rtp-bg2: #eef2f7;
  --rtp-line: #d6dde6;
  --rtp-txt: #16202c;
  --rtp-muted: #5c6b7d;
  --rtp-gold: #a9781b;
  --rtp-up: #128a5f;
  --rtp-down: #c62839;
  --rtp-blue: #1f6ea8;
}

/* ---------------- kepala ---------------- */
.rthead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.rttl { display: flex; align-items: center; gap: 10px; margin: 0; }
.rttl h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.rttl .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rtp-gold); flex: none;
}
.rttl .tag {
  background: var(--rtp-bg2); border: 1px solid var(--rtp-line);
  color: var(--rtp-muted); font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.rtactions { margin-left: auto; }

.rtbtn {
  border: 1px solid var(--rtp-line);
  background: var(--rtp-bg2);
  color: var(--rtp-txt);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s ease, color .15s ease;
}
.rtbtn:hover { border-color: var(--rtp-gold); color: var(--rtp-gold); }
.rtbtn:disabled { opacity: .5; cursor: default; }

.rtsub {
  color: var(--rtp-muted);
  font-size: 13px;
  margin: 6px 0 16px;
  max-width: 900px;
}
.rtsub b { color: var(--rtp-txt); }

/* ---------------- kartu status utama ---------------- */
.rtstatus { margin-bottom: 14px; }
.rts {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--rtp-line);
  background: var(--rtp-bg);
  border-radius: 12px;
  padding: 12px 16px;
}
.rts-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--rtp-muted);
}
.rts-txt { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rts-txt b { font-size: 15px; letter-spacing: .3px; }
.rts-txt span { color: var(--rtp-muted); font-size: 12.5px; }

.rts-live   { border-color: #1d5c46; }
.rts-live   .rts-dot { background: var(--rtp-up); box-shadow: 0 0 0 4px rgba(46, 204, 143, .16); }
.rts-live   .rts-txt b { color: var(--rtp-up); }
.rts-partial, .rts-stale { border-color: #5c4a16; }
.rts-partial .rts-dot, .rts-stale .rts-dot { background: var(--rtp-gold); box-shadow: 0 0 0 4px rgba(224, 182, 74, .16); }
.rts-partial .rts-txt b, .rts-stale .rts-txt b { color: var(--rtp-gold); }
.rts-offline { border-color: #6b2534; }
.rts-offline .rts-dot { background: var(--rtp-down); box-shadow: 0 0 0 4px rgba(255, 92, 108, .16); }
.rts-offline .rts-txt b { color: var(--rtp-down); }
.rts-running { border-color: #22536e; }
.rts-running .rts-dot { background: var(--rtp-blue); box-shadow: 0 0 0 4px rgba(74, 163, 224, .18); }
.rts-running .rts-txt b { color: var(--rtp-blue); }
.rts-init .rts-dot { background: var(--rtp-muted); }

/* ---------------- kartu metrik ---------------- */
.rtcards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .rtcards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .rtcards { grid-template-columns: 1fr; } }

.rtcard {
  border: 1px solid var(--rtp-line);
  background: var(--rtp-bg);
  border-radius: 12px;
  padding: 13px 15px;
}
.rtcard .rtl {
  color: var(--rtp-muted); font-size: 11px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
}
.rtcard .rtv {
  font-size: 21px; font-weight: 800; margin-top: 5px;
  font-variant-numeric: tabular-nums; letter-spacing: -.4px;
}
.rtcard .rts2 { color: var(--rtp-muted); font-size: 11.5px; margin-top: 3px; }

/* ---------------- kotak / grid ---------------- */
.rtgrid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .rtgrid { grid-template-columns: 1fr; } }

.rtbox {
  border: 1px solid var(--rtp-line);
  background: var(--rtp-bg);
  border-radius: 12px;
  padding: 15px 16px;
  overflow: hidden;
}
.rtbox h3 {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: -.2px;
}

.rttblwrap { overflow-x: auto; }
table.rttbl {
  width: 100%; border-collapse: collapse; font-size: 13px; min-width: 400px;
}
table.rttbl th {
  background: var(--rtp-bg2); color: var(--rtp-muted);
  text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .6px; padding: 9px 11px; border-bottom: 1px solid var(--rtp-line);
  white-space: nowrap;
}
table.rttbl td {
  padding: 9px 11px; border-bottom: 1px solid var(--rtp-line);
  vertical-align: top;
}
table.rttbl tr:last-child td { border-bottom: none; }
table.rttbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

.pill-up, .pill-down, .pill-gold, .pill-neu {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  background: var(--rtp-bg2); border: 1px solid var(--rtp-line); color: var(--rtp-muted);
}
.pill-up   { background: #12352a; border-color: #1d5c46; color: var(--rtp-up); }
.pill-down { background: #3a1620; border-color: #6b2534; color: var(--rtp-down); }
.pill-gold { background: #3a2a10; border-color: #6b4d1a; color: var(--rtp-gold); }
html[data-theme="light"] .pill-up   { background: #e2f6ee; }
html[data-theme="light"] .pill-down { background: #fdeaed; }
html[data-theme="light"] .pill-gold { background: #fdf4e2; }

/* ---------------- riwayat ---------------- */
ul.rtlog { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
ul.rtlog li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--rtp-line); font-size: 12.5px;
}
ul.rtlog li:last-child { border-bottom: none; }
.rtlog-t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--rtp-txt); }
.rtlog-r { color: var(--rtp-gold); font-size: 11.5px; }
.rtlog-d { color: var(--rtp-muted); flex: 1 1 100%; font-size: 11.5px; }

/* ---------------- perhitungan ulang ---------------- */
.rtassets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .rtassets { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .rtassets { grid-template-columns: 1fr; } }

.rtasset {
  border: 1px solid var(--rtp-line);
  background: var(--rtp-bg2);
  border-radius: 11px;
  padding: 12px 13px;
}
.rtasset .rth {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 9px;
}
.rtasset .rth b { font-size: 14px; }
table.rtt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.rtt td { padding: 5px 0; border-bottom: 1px dashed var(--rtp-line); }
table.rtt tr:last-child td { border-bottom: none; }
table.rtt td:first-child { color: var(--rtp-muted); }
table.rtt td.num {
  text-align: right; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.td.up { color: var(--rtp-up); font-weight: 700; }
.td.down { color: var(--rtp-down); font-weight: 700; }

.rtnote {
  color: var(--rtp-muted);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.5;
}
.rtnote b { color: var(--rtp-txt); }

/* ---------------- pengaturan interval & umur maksimum ---------------- */
.rtcfg {
  border: 1px solid var(--rtp-line);
  background: var(--rtp-bg);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.rtcfg > summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--rtp-txt);
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}
.rtcfg > summary::-webkit-details-marker { display: none; }
.rtcfg > summary::after {
  content: "\25BE";
  margin-left: auto;
  color: var(--rtp-muted);
  font-size: 12px;
  transition: transform .18s ease;
}
.rtcfg[open] > summary::after { transform: rotate(180deg); }
.rtcfg > summary:hover { color: var(--rtp-gold); }
.rtcfg-ic { color: var(--rtp-gold); font-size: 14px; }

.rtcfgbody {
  border-top: 1px solid var(--rtp-line);
  padding: 15px 16px 16px;
}

.rtcfgrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rtcfgrow > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rtp-txt);
}
.rtcfghint {
  color: var(--rtp-muted);
  font-size: 11.5px;
}
.rtcfghint b { color: var(--rtp-txt); }

.rtcfgin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rtp-bg2);
  border: 1px solid var(--rtp-line);
  border-radius: 8px;
  padding: 4px 9px;
}
.rtcfginp {
  width: 78px;
  border: none;
  background: transparent;
  color: var(--rtp-txt);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 3px 0;
  outline: none;
}
.rtcfginp-sm { width: 62px; font-size: 12.5px; }
.rtcfginp:focus { color: var(--rtp-gold); }
.rtcfgu { color: var(--rtp-muted); font-size: 11px; font-weight: 600; }

table.rtcfgtbl { min-width: 460px; }
table.rtcfgtbl td { vertical-align: middle; }

.rtcfgactions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.rtbtn.ghost { background: transparent; }
.rtcfgsaved { font-size: 12px; font-weight: 600; }
.rtcfgsaved.ok { color: var(--rtp-up); }
.rtcfgsaved.err { color: var(--rtp-down); }

@media (max-width: 560px) {
  .rtcfgrow { align-items: flex-start; flex-direction: column; gap: 7px; }
  .rtcfgactions .rtbtn { flex: 1 1 auto; }
}
