﻿:root {
  --bg: #090b10;
  --surface: #11141d;
  --surface-2: #171b26;
  --border: #232838;
  --border-hover: #343c52;
  --text: #eef1f7;
  --muted: #8b94a8;
  --accent: #f38020;
  --accent-soft: rgba(243, 128, 32, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --info: #3b82f6;
  --radius: 14px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: radial-gradient(circle at top right, rgba(243, 128, 32, 0.06), transparent 38%), var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 22px 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(17, 20, 29, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  border-radius: 9px;
  border: 1px solid var(--border);
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand h1 {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.partner-pill img {
  border-radius: 6px;
  display: block;
}

.clock-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 10px;
}

.clock-box::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  margin-right: 4px;
}

.clock-box .divider {
  margin: 0 4px;
  color: var(--border-hover);
}

.tv-ticker-wrap {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  min-height: 46px;
}

.tab-nav {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 12px;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  color: #090b10;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(243, 128, 32, 0.25);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.bento-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.risk-grid { grid-template-columns: 1.1fr 1fr; }
.sessions-grid { grid-template-columns: repeat(4, 1fr); }
.journal-top { grid-template-columns: repeat(4, 1fr); }
.journal-main { grid-template-columns: 350px 1fr; }
.span-full { grid-column: 1 / -1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

.card h2 {
  font-size: 0.96rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-head-row,
.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.card-head-row h2,
.timeline-head h2 {
  margin-bottom: 0;
}

.preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.45);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select,
.checklist-add-form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.checklist-add-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi,
.kpi-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-mini {
  background: var(--surface);
}

.kpi-label {
  font-size: 0.76rem;
  color: var(--muted);
}

.kpi strong,
.kpi-mini strong {
  font-size: 1.28rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.rr-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 15px;
}

.rr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.rr-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 8px;
}

.rr-risk { background: var(--danger); transition: width 0.2s ease; }
.rr-reward { background: var(--success); transition: width 0.2s ease; }
.muted-note { font-size: 0.8rem; color: var(--muted); }

.checklist-card { grid-column: 1 / -1; }

.check-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.check-badge.valid {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
}

.check-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.45);
}

.checklist-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.check-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  font-size: 0.88rem;
}

.check-item input[type="checkbox"] {
  accent-color: var(--success);
  width: 16px;
  height: 16px;
}

.check-item.checked span {
  text-decoration: line-through;
  color: var(--muted);
}

.checklist-add-form {
  display: flex;
  gap: 10px;
}

.checklist-add-form input {
  flex: 1;
}

.tv-chart-card,
.tv-heatmap-card,
.tv-calendar-card {
  grid-column: 1 / -1;
}

.tv-chart-wrap {
  height: 470px;
  width: 100%;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tv-heatmap-wrap {
  height: 400px;
  width: 100%;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 12px;
}



.session-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.session-head h3 { font-size: 1rem; font-weight: 600; }
.session-time { font-size: 0.85rem; color: var(--text); font-family: ui-monospace, monospace; }
.session-wib { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge.open {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
}

.timeline-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

.timeline-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 10px;
}

.t-label { font-size: 0.8rem; color: var(--muted); }
.t-track {
  position: relative;
  height: 16px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.t-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; opacity: 0.88; }
.bar-sydney { background: #a855f7; }
.bar-tokyo { background: #3b82f6; }
.bar-london { background: #f38020; }
.bar-ny { background: #22c55e; }

.now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  pointer-events: none;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 86px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.propfirm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.pf-bars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.pf-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 6px;
}

.pf-fill-danger { height: 100%; background: var(--danger); transition: width 0.25s ease; }
.pf-fill-success { height: 100%; background: var(--success); transition: width 0.25s ease; }

.btn-primary {
  background: var(--accent);
  color: #090b10;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover { border-color: var(--border-hover); }
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }

canvas { width: 100%; display: block; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.btn-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.btn-del:hover { color: var(--danger); border-color: var(--danger); }

.app-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-logo {
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 860px) {
  .risk-grid,
  .sessions-grid,
  .journal-top,
  .journal-main,
  .propfirm-grid,
  .pf-bars {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-shell { padding: 14px 12px 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .checklist-add-form { flex-direction: column; }
  .tv-chart-wrap { height: 360px; }
  .tv-heatmap-wrap { height: 360px; }
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.logo-link:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

a.partner-pill {
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a.partner-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tv-ticker-wrap iframe {
  background: transparent !important;
  color-scheme: dark;
}

.market-alert-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 14px;
  font-size: 0.83rem;
  font-weight: 500;
}

.alert-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--success);
}

.market-alert-bar.safe {
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--text);
}

.market-alert-bar.warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.market-alert-bar.warn .alert-dot {
  background: #f59e0b;
  animation: alertPulse 1.4s infinite;
}

.market-alert-bar.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.market-alert-bar.danger .alert-dot {
  background: #ef4444;
  animation: alertPulse 1s infinite;
}

.market-alert-bar.closed {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.market-alert-bar.closed .alert-dot {
  background: #3b82f6;
}

.alert-action {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.alert-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@keyframes alertPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
  70% { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.seo-guide-card {
  margin-top: 16px;
}

.seo-acc-list {
  display: grid;
  gap: 10px;
}

.seo-acc {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.seo-acc summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.seo-acc summary::-webkit-details-marker {
  display: none;
}

.seo-acc summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
}

.seo-acc[open] summary::after {
  content: "−";
}

.seo-acc p {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

.seo-acc strong {
  color: var(--text);
}

.tv-calendar-wrap {
  height: 520px;
  width: 100%;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 12px;
  background: #0d1017;
}

.tv-calendar-wrap .tradingview-widget-container,
.tv-calendar-wrap .tradingview-widget-container__widget,
.tv-calendar-wrap iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block;
}

.tv-calendar-wrap iframe {
  border: 0;
}

/* Cegah terpotong horizontal & rapikan widget TradingView */
.app-shell,
.tab-panel,
.bento-grid,
.card {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.app-shell {
  overflow-x: clip;
}

.market-alert-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.alert-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

#market-alert-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-action {
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-ticker-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface) !important;
  border: 1px solid var(--border);
  height: 46px;
}

.tv-ticker-wrap .tradingview-widget-container,
.tv-ticker-wrap .tradingview-widget-container__widget {
  width: 100% !important;
  max-width: 100% !important;
  height: 46px !important;
  overflow: hidden;
  border-radius: 12px;
}

.tv-ticker-wrap iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: 46px !important;
  display: block;
  border: 0;
  background: transparent !important;
  color-scheme: dark;
}

.tv-calendar-wrap {
  min-height: 520px;
  background-color: #0d1017;
}

/* --- TAHAP 1: IDR QUICK PRESETS --- */
.idr-preset-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(243, 128, 32, 0.5);
}

/* --- TAHAP 2: ROLLOVER & NEWS GUARD BADGE --- */
.alert-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  flex-shrink: 0;
}

/* --- TAHAP 3: PIP VALUE & SWAP ESTIMATOR --- */
.swap-warn {
  color: var(--warn);
}

/* --- TAHAP 4: TRADINGVIEW TECHNICAL ANALYSIS WIDGET --- */
.tv-ta-wrap {
  width: 100%;
  height: 430px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1017;
  margin-top: 12px;
}

.tv-ta-wrap iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border: 0;
}

/* --- TAHAP 5: SHAREABLE SETUP & JOURNAL CARD --- */
.share-card-ready {
  border-color: rgba(34, 197, 94, 0.45);
  color: var(--success);
}
