/* StratNinja Platform — scanner app shell (sidebar + pages) */
.scanner-app { display: flex; min-height: 100vh; }

/* sidebar (right in RTL) */
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--panel); border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.side-brand .tag { color: var(--muted); font-size: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px;
  color: var(--muted); font-size: 14px; cursor: pointer; user-select: none;
}
.side-nav a:hover { background: var(--panel2); color: var(--ink); }
.side-nav a.active { background: var(--accentbg); color: #cfc7ff; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* main content */
.main { flex: 1; padding: 24px 28px; min-width: 0; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; margin: 0 0 4px; }
.page-head .sub { color: var(--muted); font-size: 14px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); }

/* TF candle badges — TEXT = Strat type (2U/2D/1/3); COLOR = candle direction
   (close vs open), independent of type. A red 2U = "conflict" candle. */
.tf { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px;
  border-radius: 6px; font-size: 12px; font-weight: 700; padding: 0 6px; }
.tf.up { background: rgba(22,184,119,.9); color: #04150e; }    /* close > open */
.tf.down { background: rgba(224,82,79,.92); color: #1a0505; }  /* close < open */
.tf.doji { background: #3a4150; color: #cfd6e2; }             /* close ≈ open */

/* indices table */
.idx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.idx-table th, .idx-table td { padding: 11px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.idx-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.idx-table td.sym { text-align: start; }
.idx-table .tsym { font-weight: 700; }
.idx-table .tname { color: var(--muted); font-size: 11px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 26px; font-weight: 800; margin-top: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--green); } .dot.r { background: var(--red); }
.dot.p { background: #6b5cf0; } .dot.gray { background: #8b93a3; }

/* two-column lists */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lead-row { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.lead-row.up { background: var(--greenbg); } .lead-row.down { background: var(--redbg); }
.lead-row .rank { color: var(--muted); font-size: 12px; }

.stub { text-align: center; color: var(--muted); padding: 60px 20px; }
.stub .big { font-size: 46px; margin-bottom: 12px; }
.stub h2 { color: var(--ink); margin: 0 0 10px; }
.stub ul { display: inline-block; text-align: start; line-height: 1.9; }

.demo-flag { background: rgba(124,108,240,.12); color: #b3a9e8; border: 1px solid rgba(124,108,240,.3);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 16px; }

@media (max-width: 820px) {
  .sidebar { width: 60px; }
  .side-nav a span.lbl, .side-brand div:last-child { display: none; }
  .cols2 { grid-template-columns: 1fr; }
}

/* ===== scanner filters ===== */
.filters .frow { display:flex; flex-wrap:wrap; gap:16px; align-items:flex-start; }
.fgrp { display:flex; flex-direction:column; gap:6px; }
.fgrp label { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
.chips { display:flex; gap:6px; flex-wrap:wrap; }
.chip { background:var(--panel2); color:var(--muted); border:1px solid var(--line); border-radius:8px;
  padding:7px 12px; font-size:13px; cursor:pointer; }
.chip:hover { border-color:#3a4150; color:var(--ink); }
.chip.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.fgrp select, .fgrp input { background:var(--bg); color:var(--ink); border:1px solid var(--line);
  border-radius:8px; padding:8px 10px; font-size:13px; min-width:120px; }

/* ===== tables ===== */
.tablewrap { overflow-x:auto; }
.scan-table { width:100%; border-collapse:collapse; font-size:13px; white-space:nowrap; }
.scan-table th, .scan-table td { padding:9px 10px; text-align:center; border-bottom:1px solid var(--line); }
.scan-table th { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.03em; }
.scan-table td.sym { text-align:start; }
.scan-table tbody tr:hover { background:var(--panel2); }
.badge-ftfc { background:var(--greenbg); color:var(--green); border-radius:6px; padding:2px 7px; font-size:11px; font-weight:700; }
.tvlink { text-decoration:none; font-size:15px; }

/* ===== favorite star ===== */
.starbtn { background:none; border:none; cursor:pointer; font-size:16px; color:var(--muted); padding:2px 4px; line-height:1; }
.starbtn.on { color:#f5c451; }
.starbtn:hover { color:#f5c451; }

/* ===== sectors ===== */
.sector-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:16px; }
.sector-card { cursor:pointer; transition:transform .12s, border-color .12s; margin-bottom:0; }
.sector-card:hover { transform:translateY(-2px); border-color:#3a4150; }
.brow { display:flex; align-items:center; gap:10px; margin-bottom:7px; }
.btf { width:18px; color:var(--muted); font-size:12px; font-weight:700; }
.breadth { flex:1; display:flex; height:14px; border-radius:5px; overflow:hidden; background:var(--panel2); }
.bseg { height:100%; }
.bseg.up { background:var(--green); } .bseg.down { background:var(--red); }
.bseg.one { background:#3a4150; } .bseg.three { background:#6b5cf0; }
.bkey { display:flex; gap:12px; flex-wrap:wrap; margin-top:10px; font-size:11px; color:var(--muted); }
.bkey i { display:inline-block; width:9px; height:9px; border-radius:2px; margin-inline-end:4px; }
.bkey i.up { background:var(--green); } .bkey i.down { background:var(--red); }
.bkey i.one { background:#3a4150; } .bkey i.three { background:#6b5cf0; }

/* ===== wide modal ===== */
.modal.wide { width:min(760px,95vw); }
