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

body {
  background: #0d0d0f;
  color: #e2e2e2;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* NAV */
.topbar {
  background: #111114;
  border-bottom: 0.5px solid #2a2a2e;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.logo {
  font-size: 16px;
  font-weight: 600;
  color: #f0f0f0;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.logo span { color: #f97316; }
.logo em { color: #444; font-style: normal; font-weight: 400; font-size: 13px; margin-left: 8px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  font-size: 13px;
  color: #666;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: #ccc; background: #1a1a1e; }
.nav-links a.active { background: #1e1e28; color: #f0f0f0; }
.live-badge {
  font-size: 11px;
  color: #22c55e;
  background: #0a1f12;
  border: 0.5px solid #14532d;
  padding: 4px 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.25} }

/* MAIN */
.main { padding: 16px 24px 40px; }

/* STAT CARDS */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: #111114;
  border: 0.5px solid #2a2a2e;
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-label { font-size: 11px; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-val { font-size: 22px; font-weight: 600; }
.stat-val.orange { color: #f97316; }
.stat-val.green  { color: #22c55e; }
.stat-val.red    { color: #ef4444; }
.stat-sub { font-size: 11px; color: #666; margin-top: 3px; }

/* LAYOUT */
.two-col {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 12px;
  align-items: start;
}
.right-col { display: flex; flex-direction: column; gap: 10px; }

/* PANEL */
.panel {
  background: #111114;
  border: 0.5px solid #2a2a2e;
  border-radius: 10px;
  overflow: hidden;
}
.panel-head {
  padding: 10px 14px;
  border-bottom: 0.5px solid #1e1e24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-head-left { display: flex; align-items: center; gap: 12px; }
.panel-title {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.click-hint { font-size: 10px; color: #333; display: flex; align-items: center; gap: 4px; }

/* FILTERS */
.filter-row { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 0.5px solid #2a2a2e;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { color: #ccc; border-color: #3a3a42; }
.filter-btn.active { background: #1e1e28; color: #f0f0f0; border-color: #3a3a46; }

/* FLOW TABLE */
.table-wrap { overflow-x: auto; }
.flow-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.flow-table th {
  font-size: 10px;
  color: #444;
  font-weight: 400;
  padding: 7px 12px;
  text-align: left;
  border-bottom: 0.5px solid #1a1a1e;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.flow-table td {
  font-size: 12px;
  padding: 8px 12px;
  border-bottom: 0.5px solid #171719;
  color: #bbb;
  vertical-align: middle;
}
.flow-row { cursor: pointer; }
.flow-row:hover td { background: #161618; }
.flow-row.selected td { background: #13131c; }

/* EXPAND ROW */
.expand-row td { padding: 0 !important; border-bottom: 0.5px solid #2a2a2e !important; }
.expand-inner { display: none; background: #0d0d14; padding: 14px 14px 14px 44px; }
.expand-inner.open { display: block; }

/* SUMMARY BAR */
.summary-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #111118;
  border: 0.5px solid #1e1e2e;
  border-radius: 6px;
  margin-bottom: 12px;
}
.s-item { font-size: 11px; }
.s-label { color: #444; margin-right: 4px; }
.s-val { font-weight: 600; }

/* TRADE TAPE */
.tape-title { font-size: 10px; color: #777; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.trade-tape { width: 100%; border-collapse: collapse; }
.trade-tape th {
  font-size: 10px; color: #3a3a42; font-weight: 400;
  padding: 4px 8px; text-align: left;
  border-bottom: 0.5px solid #1a1a22;
  text-transform: uppercase; white-space: nowrap;
}
.trade-tape td { font-size: 11px; padding: 5px 8px; border-bottom: 0.5px solid #171720; color: #aaa; white-space: nowrap; }
.trade-tape tr:last-child td { border-bottom: none; }
.trade-tape tr:hover td { background: #14141e; }

/* INTENT BADGES */
.intent-bull { font-size: 10px; font-weight: 500; color: #22c55e; background: #082012; border: 0.5px solid #14532d; padding: 2px 7px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.intent-bear { font-size: 10px; font-weight: 500; color: #ef4444; background: #1a0808; border: 0.5px solid #7f1d1d; padding: 2px 7px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.intent-neutral { font-size: 10px; font-weight: 500; color: #666; background: #161616; border: 0.5px solid #2a2a2e; padding: 2px 7px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

/* SENTIMENT BADGES (flow table) */
.sent-bull { color: #22c55e; font-size: 11px; font-weight: 500; background: #082012; border: 0.5px solid #14532d; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.sent-bear { color: #ef4444; font-size: 11px; font-weight: 500; background: #1a0808; border: 0.5px solid #7f1d1d; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.sent-neutral { color: #888; font-size: 11px; font-weight: 500; background: #161616; border: 0.5px solid #2a2a2e; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }

/* AGGRESSOR */
.agg-ask { color: #22c55e; font-weight: 600; font-size: 11px; }
.agg-bid { color: #ef4444; font-weight: 600; font-size: 11px; }
.agg-mid { color: #666; font-size: 11px; }

/* TAGS */
.t-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; }
.t-tag.sweep { background: #1e1000; color: #f97316; border: 0.5px solid #7c3a00; }
.t-tag.block { background: #120d20; color: #a78bfa; border: 0.5px solid #4c1d95; }
.t-tag.normal { background: #161616; color: #555; border: 0.5px solid #2a2a2e; }

/* VOL BAR */
.vol-wrap { display: flex; align-items: center; gap: 6px; }
.vol-bar-bg { width: 44px; height: 3px; background: #1e1e22; border-radius: 3px; }
.vol-bar-fill { height: 3px; border-radius: 3px; }

/* SYM */
.sym { font-weight: 600; color: #f0f0f0; font-size: 12px; }
.sym-sub { color: #777; font-size: 10px; }

/* CHEVRON */
.chevron { color: #333; font-size: 11px; display: inline-block; transition: transform 0.15s; }
.chevron.open { transform: rotate(90deg); color: #666; }

/* INTENT EXPLAIN */
.intent-explain {
  margin-top: 10px;
  font-size: 11px;
  color: #888;
  padding: 6px 10px;
  background: #0a0a12;
  border-left: 2px solid #2a2a46;
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}

/* LOADING */
.loading-row { padding: 20px 14px; text-align: center; color: #333; font-size: 12px; }

/* RIGHT PANEL ITEMS */
.alert-item {
  padding: 10px 14px;
  border-bottom: 0.5px solid #171719;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert-item:last-child { border-bottom: none; }
.alert-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.alert-sym { font-size: 12px; font-weight: 600; color: #f0f0f0; }
.alert-desc { font-size: 11px; color: #777; margin-top: 2px; line-height: 1.4; }
.alert-time { font-size: 10px; color: #888; white-space: nowrap; }

.oi-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  border-bottom: 0.5px solid #171719;
}
.oi-row:last-child { border-bottom: none; }
.oi-sym { font-size: 11px; font-weight: 600; color: #e0e0e0; }
.oi-sub { font-size: 10px; color: #777; }
.oi-val { font-size: 12px; font-weight: 600; }

.pcr-row {
  display: flex; align-items: center;
  padding: 8px 14px;
  border-bottom: 0.5px solid #171719;
  gap: 8px;
}
.pcr-row:last-child { border-bottom: none; }
.pcr-sym { font-size: 11px; color: #888; min-width: 86px; }
.pcr-bar { flex: 1; height: 3px; background: #1e1e22; border-radius: 3px; }
.pcr-fill { height: 3px; border-radius: 3px; }
.pcr-val { font-size: 12px; font-weight: 600; min-width: 34px; text-align: right; }

/* US ALERTS FLOATING TAB */
.alerts-tab {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #f97316;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  z-index: 100;
  user-select: none;
  box-shadow: 0 4px 20px rgba(249,115,22,0.3);
}
.alerts-badge {
  background: #fff; color: #f97316;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* US ALERTS PANEL */
.us-alerts-panel {
  position: fixed;
  bottom: 72px; right: 24px;
  width: 300px;
  background: #111114;
  border: 0.5px solid #2a2a2e;
  border-radius: 10px;
  overflow: hidden;
  z-index: 100;
  display: none;
}
.us-alerts-panel.open { display: block; }
.us-alerts-head {
  padding: 10px 14px;
  border-bottom: 0.5px solid #1e1e24;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: #ccc;
}
.us-alerts-head button { background: none; border: none; color: #555; cursor: pointer; font-size: 16px; }
.us-alert-item { padding: 10px 14px; border-bottom: 0.5px solid #171719; }
.us-alert-item:last-child { border-bottom: none; }
.us-alert-sym { font-size: 12px; font-weight: 600; color: #f0f0f0; }
.us-alert-desc { font-size: 11px; color: #777; margin-top: 2px; }
.us-alert-time { font-size: 10px; color: #888; margin-top: 3px; }

/* NAV ALERT TABS */
.nav-alerts-usa { color: #f97316 !important; }
.nav-alerts-india { color: #22c55e !important; }

/* DATE PICKER */
.date-wrap { position: relative; display: flex; align-items: center; gap: 2px; }
.date-icon { position: absolute; left: 8px; font-size: 13px; color: #555; pointer-events: none; z-index: 1; }
.date-input {
  background: #1a1a1e;
  border: 0.5px solid #2a2a2e;
  border-radius: 5px;
  color: #f0f0f0;
  font-size: 12px;
  padding: 4px 10px 4px 28px;
  width: 150px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  color-scheme: dark;
}
.date-input:focus { border-color: #f97316; }
.date-input.past { border-color: #f97316; background: #1e1408; color: #f97316; }
.date-clear {
  background: #1a1a1e;
  border: 0.5px solid #2a2a2e;
  border-radius: 5px;
  color: #888;
  font-size: 12px;
  padding: 4px 7px;
  cursor: pointer;
  line-height: 1;
}
.date-clear:hover { color: #f0f0f0; border-color: #3a3a42; }
.past-banner {
  background: #1a1200;
  border-bottom: 0.5px solid #3a2800;
  padding: 7px 14px;
  font-size: 12px;
  color: #f97316;
  display: flex;
  align-items: center;
  gap: 8px;
}
.past-banner.hidden { display: none; }

/* SEARCH */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 8px; font-size: 13px; color: #555; pointer-events: none; }
.stock-search {
  background: #1a1a1e;
  border: 0.5px solid #2a2a2e;
  border-radius: 5px;
  color: #f0f0f0;
  font-size: 12px;
  padding: 4px 10px 4px 28px;
  width: 180px;
  outline: none;
  transition: border-color 0.15s;
}
.stock-search:focus { border-color: #f97316; }
.stock-search::placeholder { color: #444; }

/* PAGE SYSTEM */
.page { display: block; }
.page.hidden { display: none; }

/* USA ALERTS PAGE */
.page-header { padding: 20px 24px 4px; }
.page-title { font-size: 20px; font-weight: 600; color: #f0f0f0; }
.page-sub { font-size: 13px; color: #666; margin-top: 4px; }
.alerts-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 24px 40px;
}
.usa-alert-card {
  background: #111114;
  border: 0.5px solid #2a2a2e;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.usa-alert-card.bull { border-left: 2px solid #166534; }
.usa-alert-card.bear { border-left: 2px solid #7f1d1d; }
.usa-alert-card.neutral { border-left: 2px solid #3a3a46; }
.uac-top { display: flex; align-items: center; gap: 8px; }
.uac-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.uac-badge.bull { background: #082012; color: #22c55e; border: 0.5px solid #166534; }
.uac-badge.bear { background: #1a0808; color: #ef4444; border: 0.5px solid #7f1d1d; }
.uac-badge.neutral { background: #1a1a1e; color: #888; border: 0.5px solid #2a2a2e; }
.uac-type { font-size: 11px; color: #666; display: flex; align-items: center; gap: 4px; }
.uac-time { font-size: 11px; color: #888; margin-left: auto; }
.uac-sym { font-size: 18px; font-weight: 600; color: #f0f0f0; }
.uac-sym span { color: #f97316; }
.uac-expiry { font-size: 11px; color: #666; margin-top: -6px; }
.uac-details { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.uac-stat { font-size: 11px; }
.uac-stat span { color: #555; display: block; }
.uac-stat strong { color: #e0e0e0; font-weight: 600; font-size: 13px; }
.uac-desc { font-size: 11px; color: #777; line-height: 1.5; border-top: 0.5px solid #1e1e24; padding-top: 8px; }

/* PAGE BADGE */
.page-badge { font-size: 11px; font-weight: 500; background: #1e1e28; color: #888; border: 0.5px solid #3a3a46; padding: 2px 8px; border-radius: 4px; margin-left: 10px; vertical-align: middle; }

/* USA SUMMARY STATS BAR */
.usa-summary-stats { display: flex; align-items: center; gap: 0; margin-top: 10px; background: #111114; border: 0.5px solid #2a2a2e; border-radius: 8px; overflow: hidden; width: fit-content; }
.uss-item { padding: 10px 20px; display: flex; flex-direction: column; gap: 3px; }
.uss-label { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.4px; }
.uss-val { font-size: 18px; font-weight: 600; color: #f0f0f0; }
.uss-val.green { color: #22c55e; }
.uss-val.orange { color: #f97316; }
.uss-val.red { color: #ef4444; }
.uss-sep { width: 0.5px; background: #2a2a2e; align-self: stretch; }

/* USA TABS */
.usa-tabs { display: flex; gap: 8px; padding: 0 24px 0; border-bottom: 0.5px solid #1e1e24; margin-bottom: 0; }
.usa-tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: #555; font-size: 13px; padding: 10px 16px; cursor: pointer; display: flex; align-items: center; gap: 7px; margin-bottom: -0.5px; transition: color 0.15s; }
.usa-tab:hover { color: #ccc; }
.usa-tab.active { color: #f0f0f0; border-bottom-color: #f97316; }
.tab-count { font-size: 10px; background: #1e1e24; color: #666; padding: 1px 6px; border-radius: 10px; }
.tab-count.open { background: #082012; color: #22c55e; }
.usa-tab-content { padding: 16px 24px 40px; }
.usa-tab-content.hidden { display: none; }

/* HISTORY TABLE */
.history-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.history-table th { font-size: 10px; color: #555; font-weight: 400; padding: 7px 12px; text-align: left; border-bottom: 0.5px solid #1e1e24; text-transform: uppercase; letter-spacing: 0.4px; background: #0d0d0f; position: sticky; top: 0; }
.history-table td { font-size: 12px; padding: 8px 12px; border-bottom: 0.5px solid #171719; color: #bbb; }
.history-table tr:hover td { background: #161618; }
.pnl-win { color: #22c55e; font-weight: 600; }
.pnl-loss { color: #ef4444; font-weight: 600; }
.dir-call { color: #22c55e; font-size: 11px; font-weight: 600; background: #082012; border: 0.5px solid #166534; padding: 2px 7px; border-radius: 4px; }
.dir-put { color: #ef4444; font-size: 11px; font-weight: 600; background: #1a0808; border: 0.5px solid #7f1d1d; padding: 2px 7px; border-radius: 4px; }
.close-sl { color: #ef4444; font-size: 11px; }
.close-t1 { color: #22c55e; font-size: 11px; }
.close-t2 { color: #a78bfa; font-size: 11px; }
.close-exp { color: #888; font-size: 11px; }

/* COMING SOON PAGE */
.coming-soon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.coming-soon-icon { font-size: 48px; color: #22c55e; margin-bottom: 16px; }
.coming-soon-title { font-size: 22px; font-weight: 600; color: #f0f0f0; margin-bottom: 12px; }
.coming-soon-desc { font-size: 14px; color: #777; line-height: 1.7; margin-bottom: 24px; }
.coming-soon-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; text-align: left; width: 100%; }
.csf-item { font-size: 13px; color: #aaa; display: flex; align-items: center; gap: 8px; }
.csf-item .ti-check { color: #22c55e; font-size: 14px; }
.notify-form { display: flex; gap: 8px; width: 100%; }
.notify-input {
  flex: 1;
  background: #1a1a1e;
  border: 0.5px solid #2a2a2e;
  border-radius: 6px;
  color: #f0f0f0;
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
}
.notify-input:focus { border-color: #22c55e; }
.notify-input::placeholder { color: #444; }
.notify-btn {
  background: #22c55e;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
  white-space: nowrap;
}
.notify-btn:hover { background: #16a34a; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .nav-links { display: none; }
}
