:root {
  --bg: #0b0f19;
  --surface: #111827;
  --surface-2: #1f2937;
  --border: #263244;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --up: #10b981;
  --down: #ef4444;
  --warn: #f59e0b;
  --gc: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 84px;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.warn { color: var(--warn) !important; }
.hidden { display: none !important; }

/* TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 680px; margin: 0 auto;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-left { display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}
.status-dot.live { background: var(--up); box-shadow: 0 0 8px var(--up); }
.logo { font-weight: 700; font-size: 16px; letter-spacing: 0.5px; }
.logo span { color: var(--accent); }
.market-mini { font-size: 11px; color: var(--text-muted); margin-left: 4px; }

.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.auto-on { color: var(--up); border-color: rgba(16, 185, 129, 0.4); }
.icon-btn.circle { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 16px; }

/* CONTAINER & FILTER */
.container { max-width: 680px; margin: 0 auto; padding: 12px 16px; }
.subbar { margin-bottom: 8px; }
.filter-scroll {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.pill-filter {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.pill-filter.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.data-stamp { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }

/* TAB GUIDE BOX (PANDUAN PEMULA & JADWAL JAM) */
.tab-guide-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--up);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tab-guide-box.guide-green {
  border-left-color: var(--up);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--surface));
}
.tab-guide-box.guide-yellow {
  border-left-color: var(--warn);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--surface));
}
.tab-guide-box.guide-red {
  border-left-color: var(--down);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--surface));
}
.tg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tg-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.tg-time-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.tg-desc {
  font-size: 12px;
  color: #d1d5db;
  line-height: 1.45;
}
.tg-tip {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(11, 15, 25, 0.55);
  padding: 6px 9px;
  border-radius: 7px;
  line-height: 1.4;
}

/* QUICK ADD */
.quick-add-box { display: flex; gap: 8px; margin-bottom: 12px; }
.quick-add-box input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: 10px;
  text-transform: uppercase; font-family: 'JetBrains Mono', monospace;
}
.btn-submit {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}

/* WATCHLIST CARDS */
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-placeholder {
  text-align: center; padding: 36px 16px; color: var(--text-muted);
  background: var(--surface); border-radius: 12px; border: 1px dashed var(--border);
}
.wl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: border-color 0.15s;
}
.wl-card:hover { border-color: var(--accent); }
.wl-card.is-gc { border-left: 3px solid var(--gc); }
.wl-card.is-dc { border-left: 3px solid var(--down); }
.wl-left { display: flex; flex-direction: column; gap: 3px; }
.wl-sym-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.wl-sym { font-weight: 700; font-size: 15px; }
.wl-name { font-size: 12px; color: var(--text-muted); max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-tag {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-muted);
}
.mini-tag.bull { background: rgba(16, 185, 129, 0.15); color: var(--up); }
.mini-tag.gc-badge {
  background: rgba(34, 197, 94, 0.2); color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.45);
}
.mini-tag.dc-badge {
  background: rgba(239, 68, 68, 0.2); color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.mini-tag.ob-badge {
  background: rgba(245, 158, 11, 0.2); color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.wl-right { text-align: right; }
.wl-price { font-weight: 700; font-size: 15px; }
.wl-chg { font-size: 12px; font-weight: 600; }
.wl-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* CHART VIEW (%) */
.chart-header-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 12px;
}
.chart-select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 8px 12px; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.chart-card { gap: 12px; }
.chart-top-meta {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.chart-sym-big { font-size: 20px; font-weight: 700; display: block; }
.chart-name-sub { font-size: 11px; color: var(--text-muted); display: block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-perf-right { text-align: right; }
.chart-price-big { font-size: 17px; font-weight: 700; }
.chart-pct-big { font-size: 14px; font-weight: 700; }

.tf-tabs {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  background: var(--bg); padding: 4px; border-radius: 10px;
  border: 1px solid var(--border);
}
.tf-btn {
  background: transparent; border: none; color: var(--text-muted);
  padding: 6px 2px; border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.tf-btn.active {
  background: var(--accent); color: #fff;
}
.svg-chart-wrap {
  width: 100%; height: 220px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 8px 6px; position: relative; overflow: hidden;
}
.chart-loading {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 12px;
}
.perf-summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.p-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.p-lbl { font-size: 10px; color: var(--text-muted); }
.p-val { font-size: 13px; font-weight: 700; }

/* FORMS & PANELS */
.panel-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.panel-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.tick-hint {
  font-size: 11px; background: var(--surface-2); padding: 8px 10px;
  border-radius: 8px; color: #93c5fd;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.field input, .field select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px; border-radius: 8px; font-size: 14px;
}
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.s-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.s-lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.s-val { font-size: 15px; font-weight: 700; }
.s-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.guard-link { width: 100%; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; }
.btn-pad { padding: 10px 20px; }
.btn-full-h { padding: 10px 14px; }

/* MODAL SHEET */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72);
  display: none; align-items: flex-end; justify-content: center; z-index: 60;
}
.modal-backdrop.open { display: flex; }
.sheet {
  width: 100%; max-width: 680px; background: var(--surface);
  border-top: 1px solid var(--border); border-radius: 18px 18px 0 0;
  padding: 14px 18px 24px;
}
.sheet-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 99px; margin: 0 auto 14px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.sheet-sym-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sheet-sym-title { font-size: 20px; font-weight: 700; }
.sheet-sub-name { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sheet-price-col { text-align: right; }
.sheet-price-val { font-size: 18px; font-weight: 700; }
.sheet-chg-val { font-size: 13px; font-weight: 600; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.sheet-btns-3 { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 8px; }
.btn-chart-go {
  background: rgba(16, 185, 129, 0.18); color: var(--up);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 11px 6px; border-radius: 10px; font-weight: 600; font-size: 12px; cursor: pointer;
}
.btn-plan-go {
  background: var(--accent); color: #fff; border: none;
  padding: 11px 6px; border-radius: 10px; font-weight: 600; font-size: 12px; cursor: pointer;
}
.btn-del-go {
  background: rgba(239, 68, 68, 0.15); color: var(--down);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 11px 6px; border-radius: 10px; font-weight: 600; font-size: 12px; cursor: pointer;
}

/* BOTTOM NAV & DISCLAIMER */
.app-disclaimer {
  margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted); text-align: center;
}
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(17, 24, 39, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 8px 0; z-index: 50;
}
.bnav-item {
  background: none; border: none; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.bnav-item.active { color: var(--accent); }
.b-ico { font-size: 16px; }
.toast {
  position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px; font-size: 12px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 80;
}
.toast.show { opacity: 1; }

/* SEMBUNYIKAN BADGE NETLIFY SECARA PERMANEN */
iframe[src*="netlify"],
div[id*="netlify"],
div[class*="netlify"],
a[href*="netlify.com"][style*="fixed"],
body > div:last-of-type:not(#toast):not(#detailModal):not(.container):not(.topbar) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
