/* ===== Tema: gelap biru (mengikuti referensi video) ===== */
:root {
  --bg: #03050C;
  --panel-border: #1B2547;
  --line: #151D38;
  --text: #E8ECF8;
  --text-2: #C9D2EA;
  --muted: #8A94B8;
  --blue: #5B8CFF;
  --blue-2: #3D63F0;
  --blue-soft: #111A3C;
  --green: #2EE59D;
  --red: #FF4D6A;
  --orange: #FF9F1C;
  --pink: #FF3D7F;
  --violet: #7C8CFF;
  --field: #070B18;
  --field-border: #222C52;
  --radius: 6px;
  --nav-h: 64px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg) url("/static/bg.svg") center top / cover fixed no-repeat;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
a:hover { color: #8FB0FF; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: "Roboto Mono", ui-monospace, monospace; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ===== Header (desktop) ===== */
.topbar { position: sticky; top: 0; z-index: 30; background: linear-gradient(180deg, #0B0F1E 0%, #070A15 100%); border-bottom: 1px solid #141B33; }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1 1 0; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--blue); background: #0E1838; display: grid; place-items: center; flex: none; }
.brand-mark i { width: 12px; height: 12px; border-radius: 3px; background: var(--blue); display: block; }
.brand b { font-size: 18px; color: #C9D6FF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mainnav { display: flex; gap: 4px; justify-content: center; }
.mainnav a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius); border: 1px solid transparent; color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; }
.mainnav a.on { background: var(--blue-soft); border-color: #24306A; color: #fff; }
.mainnav svg, .bottomnav svg { width: 18px; height: 18px; }
.userbox { flex: 1 1 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: #1E2A55; border: 1px solid #2E3D7A; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #C9D6FF; flex: none; }
.userbox .who { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--panel-border); background: transparent; color: var(--text-2); display: grid; place-items: center; }
.iconbtn svg { width: 18px; height: 18px; }

/* ===== Bottom nav (mobile) ===== */
.bottomnav { display: none; }

/* ===== Layout ===== */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 500; color: #fff; }
.head-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > .grow2 { flex: 2 1 620px; min-width: 0; }
.row > .grow1 { flex: 1 1 320px; min-width: 0; }
.announce { border: 1px solid #2A3A78; background: linear-gradient(90deg, #0B1330, #1A2C6E); border-radius: var(--radius); padding: 12px 16px; color: var(--text-2); }

/* ===== Panel ===== */
.panel { position: relative; background: linear-gradient(115deg, rgba(7,10,22,.97) 0%, rgba(9,14,33,.97) 55%, rgba(20,40,108,.72) 100%); border: 1px solid var(--panel-border); border-radius: var(--radius); box-shadow: inset 0 1px 0 rgba(120,150,255,.07); min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 14px; font-weight: 500; color: #fff; }
.panel-b { padding: 18px 20px; }
.panel-b.tight { padding: 6px 12px 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv span:first-child { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.kpi { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 700; font-family: "Roboto Mono", monospace; letter-spacing: -0.02em; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 7px 12px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--blue); font-size: 14px; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.tabs .on { border-color: #3A4C94; color: #fff; background: var(--blue-soft); }
.subtabs { display: flex; gap: 18px; flex-wrap: wrap; }
.subtabs button { background: transparent; border: 0; padding: 8px 0; min-height: 40px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.subtabs button.on { color: var(--orange); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border-radius: var(--radius); border: 1px solid #2A3A78; background: var(--blue-soft); color: #fff; font-size: 13px; font-weight: 500; text-decoration: none; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: linear-gradient(180deg, #4A70FF, #2B4BD6); border-color: #4A70FF; }
.btn.danger { background: transparent; border-color: #5A2236; color: #FF8FA2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: transparent; border: 0; padding: 8px 4px; min-height: 40px; color: var(--blue); font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link.white { color: #fff; font-weight: 700; }
.link.red { color: #FF8FA2; }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; color: var(--blue); }
.field .help { font-size: 11px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border-radius: 4px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font-size: 13px; min-height: 40px; }
.input:focus { border-color: var(--blue); outline: none; }
.input-unit { display: flex; align-items: stretch; }
.input-unit .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-unit span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--field-border); border-left: 0; border-radius: 0 4px 4px 0; background: #0B1022; color: var(--muted); font-size: 12px; white-space: nowrap; }
.fgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); min-height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { padding: 8px 14px; min-height: 44px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--blue); font-size: 14px; font-weight: 500; }
.seg button.on { border-color: #3A4C94; background: var(--blue-soft); color: #fff; }

/* ===== Section ala "flow" (Buat bot) ===== */
.flow { display: flex; flex-direction: column; gap: 26px; }
.flow-sec { border-left: 2px solid var(--c, var(--blue)); padding-left: 16px; display: flex; flex-direction: column; gap: 10px; }
.flow-sec > .flow-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.flow-sec > .flow-h h2 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--c, var(--blue)); }
.flow-sec > .panel { padding: 16px 18px; }
.strat-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.strat-card { text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--panel-border); background: #070B18; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.strat-card.on { border-color: var(--blue); background: linear-gradient(90deg, #0B1330, #1A2C6E); }
.strat-card b { font-size: 14px; }
.strat-card span { font-size: 12px; color: var(--text-2); }

/* ===== Tables ===== */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
table.t th { text-align: left; color: var(--text-2); font-weight: 500; padding: 11px 8px; white-space: nowrap; }
table.t td { padding: 10px 8px; border-top: 1px solid #10172F; vertical-align: middle; }
table.t td.r, table.t th.r { text-align: right; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.badge.green { color: var(--green); background: rgba(46,229,157,.08); border-color: rgba(46,229,157,.25); }
.badge.blue { color: #9DB8FF; background: rgba(91,140,255,.1); border-color: rgba(91,140,255,.3); }
.badge.orange { color: var(--orange); background: rgba(255,159,28,.08); border-color: rgba(255,159,28,.3); }
.badge.red { color: #FF8FA2; background: rgba(255,77,106,.08); border-color: rgba(255,77,106,.3); }
.badge.gray { color: var(--muted); border-color: #2A3460; }

/* ===== Bot cards ===== */
.botcards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.botcard .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.botcard h3 { margin: 0; font-size: 15px; font-weight: 500; color: #fff; }
.botcard .sub { font-size: 12px; color: var(--muted); }
.botcard .acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.minibot { border: 1px solid #263266; border-radius: 4px; padding: 10px 12px; background: linear-gradient(90deg, rgba(10,16,40,.9), rgba(30,52,130,.5)); display: flex; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit; }

/* ===== Charts ===== */
.bullets { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.bullets div { height: 30px; border-radius: 3px; border: 1px solid #1B2547; background: #080C1A; color: #5E6A92; display: grid; place-items: center; font-size: 11px; font-family: "Roboto Mono", monospace; }
.bullets div.on { background: linear-gradient(180deg, #3D63F0, #2442B8); border-color: #4A6CF5; color: #fff; }
.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 160px; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bars i { width: 100%; max-width: 34px; background: linear-gradient(180deg, #6C8DFF, #2B3FA8); border-radius: 2px; display: block; }
.bars i.negbar { background: linear-gradient(180deg, #FF7A90, #A12A44); }
.bars small { font-size: 11px; }
.chart { display: flex; gap: 8px; }
.chart svg { display: block; width: 100%; }
.chart .yax { width: 64px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11px; color: #7C88B0; font-family: "Roboto Mono", monospace; }
.xax { display: flex; justify-content: space-between; padding-right: 72px; font-size: 11px; color: #7C88B0; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 12px; flex: 1 1 150px; }
.legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; }

/* ===== Auth ===== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .panel { width: 100%; max-width: 420px; }
.auth .brand { justify-content: center; margin-bottom: 18px; }
.auth-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }

/* ===== Toast & loading ===== */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: var(--radius); border: 1px solid #2A3A78; background: #0B1330; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; }
.toast.err { border-color: #5A2236; background: #1A0A12; }
.toast.ok { border-color: #1D5A45; background: #071A14; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.disclaimer { text-align: center; font-size: 12px; color: #4F7BE8; margin: 8px 0 0; }

/* ===== Modal ===== */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(2,4,10,.72); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; overflow-y: auto; }
.modal-back .panel { width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* ===== Mobile ===== */
@media (max-width: 860px) {
  body { font-size: 14px; background-attachment: scroll; }
  .topbar-in { padding: 10px 16px; gap: 10px; }
  .mainnav { display: none; }
  .userbox .who { display: none; }
  .brand b { font-size: 16px; }
  .page { padding: 18px 14px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); gap: 14px; }
  .page-head h1 { font-size: 19px; }
  .head-links { display: none; }
  .grid, .row, .kpis, .botcards { gap: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px 14px; }
  .kpi .v { font-size: 17px; }
  .panel-h { padding: 12px 14px; }
  .panel-b { padding: 14px; }
  .row > .grow2, .row > .grow1 { flex-basis: 100%; }
  .fgrid { grid-template-columns: 1fr; }
  .strat-cards { grid-template-columns: 1fr; }
  .flow { gap: 18px; }
  .flow-sec { padding-left: 12px; }
  .flow-sec > .panel { padding: 14px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { flex: none; }
  .seg { flex-wrap: nowrap; overflow-x: auto; }
  .seg button { flex: none; }
  .chart .yax { width: 48px; }
  .xax { padding-right: 56px; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom); background: linear-gradient(180deg, #0B0F1E, #05070F); border-top: 1px solid #1B2547; }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #7C88B0; text-decoration: none; font-size: 11px; font-weight: 500; border-radius: 10px; min-height: 48px; }
  .bottomnav a.on { color: #fff; }
  .bottomnav a.on svg { color: var(--blue); filter: drop-shadow(0 0 6px rgba(91,140,255,.6)); }
  .toasts { bottom: calc(var(--nav-h) + 16px); left: 16px; right: 16px; max-width: none; }
  .modal-back { padding-top: 6vh; }
}

/* ikon di dalam tombol */
.btn svg, .link svg { width: 16px; height: 16px; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* branding CRPro */
.brand-logo { height: 44px; width: auto; display: block; }
.brand-logo.big { height: auto; width: 100%; max-width: 280px; margin: 0 auto; }
@media (max-width: 860px) { .brand-logo { height: 36px; } }
