:root {
  --bg: #060a06;
  --bg-panel: #0a120a;
  --green: #33ff66;
  --green-dim: #1a8a3d;
  --green-faint: #0e3d1e;
  --amber: #ffb000;
  --red: #ff3b3b;
  --cyan: #00e5ff;
  --text-muted: #6b9a78;
  --border: #1f4d2c;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--green); color: #000; }

#matrix-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.06;
  pointer-events: none;
}

.scanline-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,20,5,0.12) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: overlay;
}

#boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
#boot-log {
  width: 100%;
  max-width: 640px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}
#boot-log .ok { color: var(--green); }
#boot-log .dim-line { color: var(--text-muted); }

.hidden { display: none !important; }

main#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 60px;
}

.terminal-window {
  width: 100%;
  max-width: 980px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(51,255,102,0.05), 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(51,255,102,0.04);
  overflow: hidden;
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #0d1a0f;
  border-bottom: 1px solid var(--border);
}
.dots { display: flex; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; opacity: 0.85; }
.dot.red { background: #ff5f56; }
.dot.amber { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.title-text { color: var(--text-muted); font-size: 12px; flex: 1; text-align: center; letter-spacing: 0.5px; }
.clock { color: var(--green-dim); font-size: 12px; min-width: 70px; text-align: right; }

.content { padding: 32px 28px 24px; }

.hero { text-align: center; margin-bottom: 28px; }
.eyebrow {
  color: var(--green-dim);
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 10px;
  text-shadow: 0 0 12px rgba(51,255,102,0.35);
}
.hero .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.glitch { position: relative; display: inline-block; }
.glitch::before {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  color: var(--cyan);
  overflow: hidden;
  opacity: 0;
  clip-path: inset(0 0 0 0);
  animation: glitch-flicker 6s infinite;
}
@keyframes glitch-flicker {
  0%, 92%, 100% { opacity: 0; transform: translate(0,0); }
  93% { opacity: 0.5; transform: translate(-2px, 1px); clip-path: inset(10% 0 60% 0); }
  95% { opacity: 0.3; transform: translate(2px, -1px); clip-path: inset(50% 0 10% 0); }
  97% { opacity: 0; }
}

.stats-section { margin-bottom: 26px; }
.stats-heading {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--green-dim);
  margin-bottom: 10px;
}
.stats-heading.table-heading { margin-top: 4px; }

.stats-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.stat {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 8px;
  text-align: center;
  background: rgba(51,255,102,0.02);
}
.stat-label { font-size: 10px; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }
.stat.tp2 .stat-value { color: var(--cyan); }
.stat.tp1 .stat-value { color: var(--green); }
.stat.sl .stat-value { color: var(--red); }
.stat.pending .stat-value { color: var(--amber); }
.stat.winrate .stat-value { color: var(--green); text-shadow: 0 0 10px rgba(51,255,102,0.4); }
.stat.pnl .stat-value { color: var(--cyan); }
.stat.pnl.negative .stat-value { color: var(--red); }

@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 520px) {
  .stats-bar { grid-template-columns: repeat(3, 1fr); }
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
}
.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--green-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-btn:hover { color: var(--green); border-color: var(--green-dim); background: rgba(51,255,102,0.05); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.current-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.current-date {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  min-width: 170px;
  text-align: center;
}
.calendar-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--green-dim);
  border-radius: 5px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.calendar-btn:hover { color: var(--green); border-color: var(--green-dim); background: rgba(51,255,102,0.05); }

.date-picker-input {
  position: absolute;
  right: 0;
  top: 0;
  width: 28px;
  height: 28px;
  opacity: 0;
  cursor: pointer;
  border: none;
}

.pnl-positive { color: var(--cyan); font-weight: 600; }
.pnl-negative { color: var(--red); font-weight: 600; }
.pnl-empty { color: var(--text-muted); }

.admin-link {
  color: var(--green-dim);
  text-decoration: none;
}
.admin-link:hover { color: var(--green); text-decoration: underline; }

.table-wrap{
    display:block;
    width:100%;
    border:1px solid var(--border);
    border-radius:8px;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    min-height:200px;
}

.signal-table {
  width: 100%;
  min-width: 900px;   /* supaya semua kolom tetap ada */
  border-collapse: collapse;
  font-size: 13px;
}
.signal-table{
    width:max-content;
    min-width:900px;
    border-collapse:collapse;
    font-size:13px;
}
.signal-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(31,77,44,0.4);
}
.signal-table tbody tr:hover { background: rgba(51,255,102,0.03); }
.signal-table tbody tr:last-child td { border-bottom: none; }

.dir-buy { color: var(--green); font-weight: 600; }
.dir-sell { color: #ff8a8a; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid currentColor;
}
.badge.PENDING { color: var(--amber); }
.badge.TP1 { color: var(--green); }
.badge.TP2 { color: var(--cyan); }
.badge.SL { color: var(--red); }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.cursor { animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }

.footer {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.dim { color: var(--text-muted); }
.status-ok { color: var(--green); }

button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .cursor { animation: none !important; }
}

/* ===========================
   DAILY PNL
=========================== */

.daily-pnl-section{
    margin-top:35px;
}

.daily-pnl-title{
    color:#33ff66;
    font-size:13px;
    margin-bottom:15px;
    letter-spacing:2px;
}

.daily-pnl-card{
    border:1px solid #1d3f26;
    border-radius:10px;
    padding:18px;
    background:#071008;
    text-align:center;
}

.daily-pnl-image{
    width:100%;
    max-width:900px;
    border-radius:8px;
    border:1px solid #1f4d2c;
    display:block;
    margin:auto;
}

.daily-pnl-empty{
    color:#777;
    padding:50px 20px;
}

.upload-box{
    margin-top:30px;
    border:1px dashed #33ff66;
    border-radius:10px;
    padding:20px;
    background:#071008;
}

.upload-box h3{
    margin-top:0;
    color:#33ff66;
}

.upload-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

.upload-row input[type=file]{
    color:white;
}

.upload-preview{
    margin-top:20px;
    text-align:center;
}

.upload-preview img{
    max-width:100%;
    border-radius:8px;
    border:1px solid #1f4d2c;
}

.upload-btn{
    background:#33ff66;
    color:#000;
    border:none;
    padding:10px 20px;
    border-radius:6px;
    cursor:pointer;
    font-weight:bold;
}

.upload-btn:hover{
    opacity:.85;
}

.delete-btn{
    background:#ff3b3b;
    color:white;
    border:none;
    padding:10px 20px;
    border-radius:6px;
    cursor:pointer;
    margin-left:10px;
}

.delete-btn:hover{
    opacity:.85;
}

.success-text{
    color:#33ff66;
}

.error-text{
    color:#ff5555;
}
/* ===========================
   MOBILE TABLE
=========================== */

@media (max-width:768px){

    .content{
        padding:20px 10px 20px;
    }

    .table-wrap{
        overflow:hidden;
    }

    .signal-table{
        width:100%;
        min-width:100%;
        table-layout:fixed;
        font-size:10px;
    }

    .signal-table th,
    .signal-table td{
        padding:5px 2px;
        font-size:9px;
        text-align:center;
        white-space:nowrap;
    }

    .signal-table th:nth-child(1),
    .signal-table td:nth-child(1){
        width:22px;
    }

    .signal-table th:nth-child(2),
    .signal-table td:nth-child(2){
        width:48px;
    }

    .signal-table th:nth-child(3),
    .signal-table td:nth-child(3){
        width:36px;
    }

    .badge{
        font-size:8px;
        padding:2px 4px;
    }

}
