/* Tema gelap. Mode terang = CSS asli (tanpa perubahan). Semua aturan di sini hanya berlaku bila <html data-theme="dark">. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1317; --bg2: #0f181d; --panel: #141e25; --line: #222f39; --line2: #2c3c49;
  --text: #e7eff4; --text2: #c5d3dd; --muted: #94a7b5; --dim: #6f8594;
  --forest: #22a161; --forest-d: #1a8a52; --forest-bg: rgba(47, 168, 102, .15); --forest-t: #62d697; --leaf: #3bba78;
  --river: #4aa3e8; --river-bg: rgba(43, 143, 214, .16); --river-t: #7dc2f3;
  --amber: #e7a417; --amber-bg: rgba(231, 164, 23, .15); --amber-t: #f1c45e;
  --red: #e5584f; --red-bg: rgba(217, 65, 65, .17); --red-t: #ff8f87;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .32);
}
[data-theme="dark"] a:hover { color: #a5d6f7; }

/* ---- kerangka: top bar, sidebar, menu ---- */
[data-theme="dark"] .top .brand { background: #0f181d; }
[data-theme="dark"] .top .topbar { background: linear-gradient(rgba(12, 19, 23, .9), rgba(12, 19, 23, .9)), url(landscape.svg) center / cover no-repeat, #0f181d; }
[data-theme="dark"] .search input { border-color: var(--line2); background: rgba(255, 255, 255, .06); }
[data-theme="dark"] .cur-tog { background: rgba(255, 255, 255, .07); }
[data-theme="dark"] .icon-btn { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .icon-btn:hover { background: rgba(255, 255, 255, .16); }
[data-theme="dark"] .avatar { border-color: var(--panel); }
[data-theme="dark"] .menu { box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
[data-theme="dark"] .side { background: #0f181d; }
[data-theme="dark"] .side nav a:hover, [data-theme="dark"] .side nav button:hover { background: rgba(255, 255, 255, .06); }
[data-theme="dark"] .side .art { filter: brightness(.5) saturate(.75); }
[data-theme="dark"] .side .status { background: #0f181d; }

/* ---- komponen umum ---- */
[data-theme="dark"] .pill { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .btn:hover { border-color: #3d5262; background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .btn.soft { background: rgba(255, 255, 255, .07); border-color: transparent; color: var(--text2); }
[data-theme="dark"] .btn.soft:hover { background: rgba(255, 255, 255, .12); }
[data-theme="dark"] .btn.danger { border-color: rgba(229, 88, 79, .45); }
[data-theme="dark"] .tabs { background: rgba(255, 255, 255, .06); }
[data-theme="dark"] table.t th { background: rgba(255, 255, 255, .04); }
[data-theme="dark"] table.t td { border-bottom-color: var(--line); }
[data-theme="dark"] .tier-U, [data-theme="dark"] .chip.mute, [data-theme="dark"] .risk.mute { background: rgba(255, 255, 255, .08); color: var(--muted); }
[data-theme="dark"] .sig.KUAT { border-color: rgba(47, 168, 102, .4); }
[data-theme="dark"] .sig.HINDARI { border-color: rgba(217, 65, 65, .4); }
[data-theme="dark"] .score.PANTAU { background: #5c4410; color: #ffe29a; }
[data-theme="dark"] .sig-stats { border-top-color: var(--line); }
[data-theme="dark"] .box { background: rgba(255, 255, 255, .03); }
[data-theme="dark"] .count-chip, [data-theme="dark"] .ev-type { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .alert-box { border-color: rgba(217, 65, 65, .4); }
[data-theme="dark"] .ai-note { border-color: rgba(43, 143, 214, .4); }
[data-theme="dark"] .bar { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .input::placeholder { color: #66798a; }
[data-theme="dark"] .feed-new { animation-name: flash-dark; }
@keyframes flash-dark { from { background: rgba(47, 168, 102, .22); } to { background: transparent; } }
[data-theme="dark"] .toast { box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
[data-theme="dark"] .login, [data-theme="dark"] .modal { background: rgba(0, 0, 0, .62); }
[data-theme="dark"] .login form, [data-theme="dark"] .modal .panel { box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
[data-theme="dark"] a.chip.info:hover { background: rgba(43, 143, 214, .3); }
[data-theme="dark"] .ev-list li { border-top-color: var(--line); }
[data-theme="dark"] .ag.dead { border-color: rgba(217, 65, 65, .5); background: rgba(217, 65, 65, .12); }

/* ---- ikon judul kartu (kotak lembut mengikuti warna ikon) ---- */
[data-theme="dark"] .bi { background: color-mix(in srgb, var(--bi-c) 20%, transparent); }
[data-theme="dark"] .bi svg { filter: brightness(1.6) saturate(1.1); }

/* ---- posisi & Autopilot ---- */
[data-theme="dark"] .switch { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .pcard.ap { border-color: rgba(47, 168, 102, .5); }
[data-theme="dark"] .pos-stats { border-top-color: var(--line); }
[data-theme="dark"] .psplit { border-color: var(--line); }
[data-theme="dark"] .psplit-row.gross { background: rgba(43, 125, 233, .14); }
[data-theme="dark"] .psplit-row.net { background: rgba(138, 79, 214, .17); }
[data-theme="dark"] .psplit-row.peak { background: rgba(217, 162, 27, .14); }
[data-theme="dark"] .psplit-row.peak .lb { color: #e8be5a; }
[data-theme="dark"] .psplit-row.gross .lb { color: #86b6f4; }
[data-theme="dark"] .psplit-row.net .lb { color: #c6a1f1; }
[data-theme="dark"] .psplit-row.gross.on { background: rgba(43, 125, 233, .3); }
[data-theme="dark"] .psplit-row.net.on { background: rgba(138, 79, 214, .32); }
[data-theme="dark"] .pool-card:hover, [data-theme="dark"] .pool-card:focus-visible { border-color: rgba(47, 168, 102, .6); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }

/* ---- PnL ---- */
[data-theme="dark"] .gain { color: #4fd1a5; }
[data-theme="dark"] .loss { color: #ff9a52; }
[data-theme="dark"] .pnl-chip { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .pnl-chip.gain { background: rgba(27, 158, 119, .22); }
[data-theme="dark"] .pnl-chip.loss { background: rgba(217, 95, 2, .22); }
[data-theme="dark"] .pnl-chart .grid { stroke: #22303a; }
[data-theme="dark"] .pnl-chart .axis0 { stroke: #3a4d5b; }
[data-theme="dark"] .pnl-chart .cross { stroke: #5b7384; }
[data-theme="dark"] .pnl-tip { box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
[data-theme="dark"] .cal-cell { background: rgba(255, 255, 255, .04); }
[data-theme="dark"] .pp-item.on { background: rgba(47, 168, 102, .14); }

/* ---- Kantor AI (bingkai kantor sudah gelap; hanya panel samping yang terang) ---- */
[data-theme="dark"] .times li.now { border-color: rgba(47, 168, 102, .6); }
[data-theme="dark"] .boss-card { background: linear-gradient(180deg, rgba(231, 164, 23, .12), var(--panel) 60%); border-color: rgba(231, 164, 23, .3); }
[data-theme="dark"] .boss-st { color: #e0b277; }
[data-theme="dark"] .ag:hover, [data-theme="dark"] .ag.sel { border-color: rgba(47, 168, 102, .6); background: rgba(47, 168, 102, .1); }
[data-theme="dark"] .st.idle { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .st.off { background: rgba(255, 255, 255, .06); }
[data-theme="dark"] .log li { border-top-color: var(--line); }
[data-theme="dark"] .agent-card .st.idle { background: #1a2a38; color: #c9d6e2; }
