/* ============================================================
   AI SMART MONEY TRADING SYSTEM — AE Shohib
   Tema terminal trading: gelap, presisi, aksen emas (XAUUSD).
   ============================================================ */
:root {
  --bg: #060a13;
  --bg-2: #0a1120;
  --panel: #0d1626;
  --panel-2: #111c30;
  --panel-3: #16233a;
  --line: #1d2b45;
  --line-2: #26385a;
  --text: #e8eefb;
  --muted: #93a2bd;
  --muted-2: #6b7b98;
  --gold: #f5c542;
  --gold-2: #ffd970;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.14);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.14);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.14);
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --cyan: #22d3ee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 82% -12%, rgba(245, 197, 66, 0.09), transparent 60%),
    radial-gradient(900px 520px at 8% 8%, rgba(59, 130, 246, 0.10), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
small { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.up { color: var(--green); }
.down { color: var(--red); }
.nowrap { white-space: nowrap; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex: 0 0 244px; background: linear-gradient(180deg, #0a1322, #070d18);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #b98b12); color: #14100a; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 18px rgba(245, 197, 66, 0.28);
}
.brand-txt strong { display: block; font-size: 12px; letter-spacing: 0.14em; color: var(--gold); text-transform: uppercase; }
.brand-txt span { font-size: 11px; color: var(--muted); }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #b9c6dd; font-size: 13px; transition: background 0.16s, color 0.16s;
}
.nav a i { width: 18px; display: inline-grid; place-items: center; font-style: normal; opacity: 0.9; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(245, 197, 66, 0.16), rgba(245, 197, 66, 0.03)); color: var(--gold-2); box-shadow: inset 2px 0 0 var(--gold); }
.sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted-2); }
.sidebar-foot .who { color: var(--text); font-size: 12.5px; margin-bottom: 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 22px; border-bottom: 1px solid var(--line);
  background: rgba(7, 13, 24, 0.86); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 15px; }
.topbar .crumb { color: var(--muted); font-size: 12px; }
.status-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 11.5px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.pill.ok { color: #9df3b9; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); }
.pill.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill.err { color: #ffb4b4; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); }
.pill.err .dot { background: var(--red); }
.pill.warn { color: #ffd9a0; border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.1); }
.pill.warn .dot { background: var(--amber); }
.pill.gold { color: var(--gold-2); border-color: rgba(245, 197, 66, 0.45); background: rgba(245, 197, 66, 0.1); }
.pill.gold .dot { background: var(--gold); }
.page { padding: 22px; max-width: 1580px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 20px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- cards / grid ---------------- */
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr); align-items: start; }
.card {
  background: linear-gradient(180deg, rgba(20, 32, 52, 0.92), rgba(11, 19, 33, 0.94));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: #cdd9ee; }
.card-head .hint { font-size: 11.5px; color: var(--muted-2); }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 11px 16px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: linear-gradient(160deg, rgba(22, 35, 58, 0.95), rgba(11, 19, 33, 0.95));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent 70%); opacity: 0.65; }
.kpi .k-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 23px; font-weight: 650; margin-top: 6px; font-family: var(--mono); letter-spacing: -0.02em; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi.gold .k-value { color: var(--gold-2); }
.kpi.green .k-value { color: #6ee7a0; }
.kpi.red .k-value { color: #fca5a5; }
.kpi.blue .k-value { color: #93c5fd; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: transform 0.1s, background 0.16s, border-color 0.16s; font-family: inherit;
}
.btn:hover { background: var(--panel-3); border-color: #35507a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #1f4ea8, #1a3d84); border-color: #2b5fb8; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #2459bd, #1d4590); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #cf9f1c); border-color: #e3b32d; color: #1a1405; font-weight: 650; }
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-2), #e0ac1f); }
.btn-green { background: linear-gradient(135deg, #15803d, #166534); border-color: #22c55e55; color: #eafff1; }
.btn-danger { background: linear-gradient(135deg, #b91c1c, #7f1d1d); border-color: #ef444455; color: #ffecec; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------------- badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; border: 1px solid transparent; }
.badge.buy, .badge.ok { background: var(--green-dim); color: #7ff0a8; border-color: rgba(34, 197, 94, 0.35); }
.badge.sell, .badge.err { background: var(--red-dim); color: #ffb3b3; border-color: rgba(239, 68, 68, 0.35); }
.badge.hold, .badge.warn { background: rgba(245, 158, 11, 0.12); color: #ffd28a; border-color: rgba(245, 158, 11, 0.35); }
.badge.info { background: var(--blue-dim); color: #a7c8ff; border-color: rgba(59, 130, 246, 0.35); }
.badge.gold { background: rgba(245, 197, 66, 0.12); color: var(--gold-2); border-color: rgba(245, 197, 66, 0.35); }
.badge.muted { background: rgba(147, 162, 189, 0.1); color: var(--muted); border-color: var(--line-2); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; padding: 10px 14px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-2); background: rgba(255, 255, 255, 0.02); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid rgba(29, 43, 69, 0.65); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.data .num { text-align: right; font-family: var(--mono); }
.empty { padding: 32px 18px; text-align: center; color: var(--muted-2); font-size: 12.5px; }

/* ---------------- forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.field .help { font-size: 11px; color: var(--muted-2); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-2);
  background: #0a1424; color: var(--text); font-family: inherit; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #3f6ea8; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
input::placeholder { color: #55637d; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: #22314c; border: 1px solid var(--line-2); position: relative; transition: background 0.2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #8fa1bd; transition: transform 0.2s, background 0.2s; }
.switch input:checked + .track { background: rgba(34, 197, 94, 0.35); border-color: rgba(34, 197, 94, 0.6); }
.switch input:checked + .track::after { transform: translateX(18px); background: #6ef2a0; }
.seg { display: inline-flex; padding: 3px; background: #0a1424; border: 1px solid var(--line-2); border-radius: 10px; gap: 3px; }
.seg button, .seg a {
  border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.seg button.active, .seg a.active { background: var(--panel-3); color: #fff; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 12.5px; border: 1px solid; margin-bottom: 14px; }
.alert.info { background: var(--blue-dim); border-color: rgba(59, 130, 246, 0.35); color: #bcd7ff; }
.alert.warn { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); color: #ffd9a0; }
.alert.err { background: var(--red-dim); border-color: rgba(239, 68, 68, 0.35); color: #ffc0c0; }
.alert.ok { background: var(--green-dim); border-color: rgba(34, 197, 94, 0.35); color: #b6f7cd; }

/* ---------------- chart ---------------- */
.chart-shell { position: relative; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 9px 13px; border-bottom: 1px solid #2a2e39; background: #131722; flex-wrap: wrap; }
.chart-toolbar .left { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.sym { display: flex; align-items: baseline; gap: 9px; flex-wrap: nowrap; }
.sym .name { font-size: 15px; font-weight: 650; letter-spacing: 0.02em; }
.sym .px { font-family: var(--mono); font-size: 16px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.sym .chg { font-size: 12px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.chart-toolbar .pill.tiny { font-size: 10.5px; padding: 4px 9px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-tabs { display: inline-flex; gap: 3px; background: #0a1424; border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; }
.tf-tabs button { border: 0; background: transparent; color: var(--muted); font-size: 11.5px; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-family: inherit; }
.tf-tabs button.active { background: var(--panel-3); color: var(--gold-2); }
/* area chart: latar & border mengikuti tema TradingView dark */
.chart-area { position: relative; background: #131722; min-height: 430px; }
#chart { display: block; width: 100%; height: 430px; cursor: crosshair; }
#chart-tv { width: 100%; height: 430px; }

/* mode widget TradingView resmi (iframe) */
.chart-tvo { position: absolute; inset: 0; display: flex; flex-direction: column; background: #131722; }
.chart-tvo[hidden] { display: none !important; }
.chart-tvo .tvo-note {
  flex: 0 0 auto; padding: 6px 11px; font-size: 10.5px; color: #b2b5be;
  background: #0f1626; border-bottom: 1px solid #2a2e39;
}
.chart-tvo .tvo-note a { color: #2962ff; text-decoration: underline; }
.chart-tvo .tvo-frame-wrap { flex: 1 1 auto; min-height: 0; position: relative; }
.chart-tvo iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #131722; }
.chart-tvo iframe[hidden] { display: none; }
.chart-tvo .tvo-fallback {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  max-width: 420px; text-align: center; font-size: 12px; color: #ffd28a;
  background: rgba(19, 23, 34, 0.96); border: 1px solid #4a4f5c; border-radius: 10px; padding: 14px 16px;
}
.chart-tvo .tvo-fallback[hidden] { display: none; }

/* tombol layar penuh di dalam area widget OANDA */
.chart-tvo .tvo-fs-btn {
  position: absolute; right: 10px; top: 50px; z-index: 6;
  background: rgba(19, 23, 34, 0.92); color: #d1d4dc; border: 1px solid #2a2e39;
  border-radius: 8px; padding: 6px 11px; font-size: 11.5px; font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.chart-tvo .tvo-fs-btn:hover { background: #2962ff; border-color: #2962ff; color: #fff; }
.chart-tvo .tvo-fs-btn[hidden] { display: none; }
.chart-tvo .tvo-exit-btn {
  position: fixed; right: 14px; top: 14px; z-index: 1000;
  background: rgba(19, 23, 34, 0.94); color: #ffd28a; border: 1px solid #4a4f5c;
  border-radius: 8px; padding: 7px 13px; font-size: 12px; font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.chart-tvo .tvo-exit-btn:hover { background: #b91c1c; border-color: #ef4444; color: #fff; }
.chart-tvo .tvo-exit-btn[hidden] { display: none; }

/* ===== MODE SATU LAYAR PENUH (widget OANDA) ===== */
.chart-shell.tvo-immersive .chart-toolbar,
.chart-shell.tvo-immersive .chart-zones,
.chart-shell.tvo-immersive .chart-plan,
.chart-shell.tvo-immersive .chart-legend { display: none !important; }
.chart-shell.tvo-immersive { padding: 0 !important; }
.chart-shell.tvo-immersive .chart-area { flex: 1 1 auto; min-height: 0; height: 100vh; }
.chart-shell.tvo-immersive .chart-tvo { position: fixed; inset: 0; z-index: 950; width: 100vw; height: 100vh; }
.chart-shell.tvo-immersive .tvo-note { display: none; }
.chart-shell.tvo-immersive .tvo-frame-wrap { position: absolute; inset: 0; }
.chart-shell.tvo-immersive #tvo-frame { width: 100vw; height: 100vh; }
html.tvo-lock, html.tvo-lock body { overflow: hidden; }
.chart-tvo .tvo-fallback a { color: #2962ff; }
.chart-zoom button.inactive { opacity: 0.4; cursor: not-allowed; }
.chart-zones.disabled-bar { opacity: 0.55; }
.chart-shell.chart-full .chart-tvo, .chart-shell:fullscreen .chart-tvo { position: absolute; }
.chart-shell.chart-full .chart-area, .chart-shell:fullscreen .chart-area { position: relative; }
#chart-tv[hidden], #chart[hidden], .chart-legend[hidden] { display: none !important; }
.chart-tv-badge {
  position: absolute; left: 10px; top: 8px; z-index: 4; pointer-events: none;
  font-size: 9.5px; letter-spacing: 0.04em; color: #d1d4dc;
  background: rgba(30, 34, 45, 0.92); border: 1px solid #2a2e39; border-radius: 5px; padding: 3px 7px;
}
.chart-mode-seg { font-size: 11px; }
.chart-mode-seg button { padding: 5px 9px; font-size: 11px; }
.chart-mode-seg button.active { background: #2a2e39; color: #2962ff; }

/* kontrol zoom + layar penuh (tema TradingView) */
.chart-zoom { display: inline-flex; align-items: center; gap: 2px; background: #0d1220; border: 1px solid #2a2e39; border-radius: 8px; padding: 2px; }
.chart-zoom button {
  min-width: 26px; height: 24px; border: 0; background: transparent; color: #d1d4dc;
  font-size: 13px; line-height: 1; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.chart-zoom button:hover { background: #2a2e39; color: #fff; }
.chart-zoom button[data-chart-full] { font-size: 14px; color: #2962ff; }
.chart-zoom button[data-chart-full]:hover { background: rgba(41, 98, 255, 0.18); }
.chart-zoom button[data-chart-pan] { color: #b2b5be; font-size: 14px; }
.chart-zoom button[data-chart-pan="latest"] { color: #26a69a; }
.chart-zoom button[data-chart-pan="latest"].active { background: rgba(41, 98, 255, 0.22); color: #93b4ff; }
.chart-zoom .cz-sep { width: 1px; height: 16px; background: #2a2e39; margin: 0 3px; }
.chart-zoom button[data-chart-center] { color: #b2b5be; font-size: 13px; }
.chart-zoom button[data-chart-center].active { background: rgba(41, 98, 255, 0.22); color: #93b4ff; }
/* kursor grabbable di area chart (bisa digeser) */
#chart { cursor: grab; }
#chart:active { cursor: grabbing; }

/* baris toggle zona overlay */
.chart-zones {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 7px 13px; background: #131722; border-bottom: 1px solid #2a2e39;
  font-size: 10.5px; color: #787b86;
}
.chart-zones .cz-label { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #5d606b; }
.chart-zones .cz { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; color: #b2b5be; }
.chart-zones .cz input { appearance: none; width: 13px; height: 13px; border-radius: 3px; border: 1px solid #4a4f5c; background: #1e222d; cursor: pointer; position: relative; margin: 0; }
.chart-zones .cz input:checked { background: #2962ff; border-color: #2962ff; }
.chart-zones .cz input:checked::after { content: "✓"; position: absolute; inset: -2px 0 0 1px; font-size: 10px; color: #fff; line-height: 14px; }
.chart-zones .cz i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.chart-zones .cz-hint { margin-left: auto; font-size: 10px; color: #5d606b; }

/* mode layar penuh: chart mengisi layar, panel zona & toolbar tetap terlihat */
.chart-shell.chart-full,
.chart-shell:fullscreen {
  position: fixed; inset: 0; z-index: 900; margin: 0; border: 0; border-radius: 0;
  background: #131722; display: flex; flex-direction: column; box-shadow: none;
}
.chart-shell:fullscreen { width: 100%; height: 100%; }
.chart-shell.chart-full .chart-area,
.chart-shell:fullscreen .chart-area { flex: 1 1 auto; min-height: 0; height: auto; }
.chart-shell.chart-full #chart,
.chart-shell.chart-full #chart-tv,
.chart-shell:fullscreen #chart,
.chart-shell:fullscreen #chart-tv { height: 100%; }
.chart-shell.chart-full .chart-legend,
.chart-shell:fullscreen .chart-legend { flex: 0 0 auto; }
html.fs-lock, html.fs-lock body { overflow: hidden; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 8px 14px; border-top: 1px solid #2a2e39; background: #131722; font-size: 10.5px; color: #787b86; line-height: 1.5; }
.chart-legend b { color: #d1d4dc; font-weight: 600; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-hover {
  position: absolute; pointer-events: none; background: rgba(6, 12, 22, 0.95); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 7px 10px; font-size: 11px; color: var(--text); font-family: var(--mono);
  display: none; z-index: 5; white-space: pre; box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}
.price-flash { animation: flash 0.7s ease; }
@keyframes flash { from { background: rgba(245, 197, 66, 0.22); } to { background: transparent; } }

/* ---------------- analysis panels ---------------- */
.cond { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(29, 43, 69, 0.8); font-size: 12.5px; }
.cond:last-child { border-bottom: 0; }
.cond .mark { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.cond .mark.pass { background: rgba(34, 197, 94, 0.18); color: #6ef2a0; border: 1px solid rgba(34, 197, 94, 0.45); }
.cond .mark.fail { background: rgba(239, 68, 68, 0.15); color: #ffa8a8; border: 1px solid rgba(239, 68, 68, 0.4); }
.cond .txt { min-width: 0; }
.cond .txt b { font-weight: 600; display: block; }
.cond .txt span { color: var(--muted); font-size: 11.5px; }
.decision-box { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(10, 20, 36, 0.75); }
.decision-box .dir { font-size: 26px; font-weight: 750; letter-spacing: 0.04em; }
.decision-box .dir.buy { color: #63e795; }
.decision-box .dir.sell { color: #ff8a8a; }
.decision-box .dir.hold { color: var(--gold-2); }
.meter { height: 7px; border-radius: 999px; background: #16233a; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #22c55e); }
.lvl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lvl { background: rgba(10, 20, 36, 0.7); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.lvl .l { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.lvl .v { font-family: var(--mono); font-size: 15px; margin-top: 2px; }
.lvl.entry .v { color: #fff; } .lvl.sl .v { color: #ff9b9b; } .lvl.tp .v { color: #7df0aa; }
.reason-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: #c6d3e8; }
.reason-list li { margin-bottom: 5px; }
.reason-list.bad { color: #ffc2c2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); color: #c3d0e5; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(29, 43, 69, 0.7); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--mono); }

/* ---------------- misc ---------------- */
.log-list { max-height: 380px; overflow-y: auto; }
.log-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(29, 43, 69, 0.6); font-size: 12.5px; }
.log-item:last-child { border-bottom: 0; }
.log-item .ic { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 24px; font-size: 12px; background: rgba(59, 130, 246, 0.15); color: #9dc4ff; }
.log-item.success .ic { background: rgba(34, 197, 94, 0.15); color: #7df0aa; }
.log-item.error .ic { background: rgba(239, 68, 68, 0.15); color: #ffa8a8; }
.log-item.warning .ic { background: rgba(245, 158, 11, 0.15); color: #ffd28a; }
.log-item .t { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.log-item .ttl { font-weight: 600; margin: 1px 0; }
.log-item .msg { color: var(--muted); font-size: 11.5px; }
.code { font-family: var(--mono); font-size: 12px; background: #08101d; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; white-space: pre; color: #b7e1ff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap; }
.tabs button.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast { min-width: 240px; max-width: 360px; background: #0e1a2d; border: 1px solid var(--line-2); border-left: 3px solid var(--blue); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; box-shadow: var(--shadow); animation: slidein 0.22s ease; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-bg { position: fixed; inset: 0; background: rgba(3, 7, 14, 0.78); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 300; padding: 18px; }
.modal-bg.open { display: grid; }
.modal { width: 100%; max-width: 520px; background: #0d1626; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.mobile-nav { display: none; }

/* ---------------- login ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: 100%; max-width: 400px; background: linear-gradient(180deg, rgba(20, 32, 52, 0.96), rgba(10, 17, 30, 0.98)); border: 1px solid var(--line-2); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.login-card .brand { border: 0; padding: 0 0 18px; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* status pills: satu baris horizontal yang bisa digeser, hemat tinggi layar */
  .status-pills { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .status-pills::-webkit-scrollbar { display: none; }
  .status-pills .pill { flex: 0 0 auto; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar > div:first-child { min-width: 0; }
  .topbar h2 { font-size: 14px; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.22s; }
  .sidebar.open { transform: none; }
  .main { width: 100%; }
  .mobile-nav { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #08111f; overflow-x: auto; }
  .mobile-nav a { font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
  .mobile-nav a.active { color: var(--gold-2); border-color: rgba(245, 197, 66, 0.5); background: rgba(245, 197, 66, 0.08); }
  .page { padding: 14px; }
  .grid-3, .grid-2, .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .chart-area { min-height: 320px; }
  .chart-tvo .tvo-note { font-size: 10px; padding: 5px 9px; }
  #chart, #chart-tv { height: 320px; }
  .chart-shell.chart-full #chart, .chart-shell.chart-full #chart-tv,
  .chart-shell:fullscreen #chart, .chart-shell:fullscreen #chart-tv { height: 100%; }
  .chart-plan { gap: 4px 10px; padding: 6px 9px; font-size: 10.5px; }
  .chart-plan .cp-note { display: none; }
  .chart-zones { gap: 4px 8px; padding: 5px 9px; font-size: 10px; }
  .chart-zones .cz-label { font-size: 9px; }
  .chart-zones .cz { gap: 4px; }
  .chart-zones .cz i { width: 8px; height: 8px; }
  .chart-zones .cz input { width: 12px; height: 12px; }
  .chart-zones .cz-hint { display: none; }
  .chart-zoom button { min-width: 24px; height: 22px; }
  .chart-toolbar { padding: 9px 11px; }
  .chart-toolbar .left { gap: 8px 10px; }
  .sym .name { font-size: 14px; }
  .sym .px { font-size: 15px; }
  .chart-legend { font-size: 10px; gap: 6px 10px; padding: 7px 11px; }
  .topbar { padding: 10px 14px; }
  .kpi .k-value { font-size: 19px; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .decision-box { flex-direction: column; align-items: flex-start; gap: 8px; }
  .lvl-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-txt strong { font-size: 11px; }
}
