/* ============================================================
   GLOBAL LAYOUT
============================================================ */

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Special Elite', monospace;
  background: url('/images/mainBackground.png') no-repeat center center fixed;
  background-size: cover;
  color: #ffffff;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 80px;
  padding-bottom: 80px;
  display: flex;
  gap: 20px;
}

.sidebar {
  width: 200px;
  background-color: #333;
  padding: 20px;
  position: fixed;
  height: 100%;
  top: 0;
  left: 0;
}

.sidebar h2 {
  margin-top: 0;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.main-content { flex: 1; padding: 20px; }
.side-section { width: 300px; padding: 20px; }

.section-background {
  background-color: rgba(0,0,0,0.7);
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

h1, h2, h3 {
  margin-top: 20px;
  margin-bottom: 15px;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}


/* ============================================================
   AI TRADE PLAN
============================================================ */

.ai-trade-plan {
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.65),
    rgba(0,0,0,0.85)
  );
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.plan-header.no_trade { border-color: #f1c40f; }
.plan-header.open_trade { border-color: #4CAF50; }
.plan-header.close_trade { border-color: #eb4d4b; }

.plan-header h2 { font-size: 1.2rem; margin: 0; }

.decision-type {
  font-weight: bold;
  letter-spacing: 1px;
  margin-left: 6px;
}

.confidence { font-size: 0.9em; opacity: 0.85; }

.plan-section h3 {
  margin-top: 15px;
  font-size: 1.1em;
  border-bottom: none;
}

.reason-list { padding-left: 20px; }
.reason-list li { margin-bottom: 8px; line-height: 1.4; }

.muted { opacity: 0.6; font-style: italic; }

.warning {
  background: rgba(241,196,15,0.1);
  padding: 10px;
  border-radius: 6px;
}


/* ============================================================
   REVIEW CARDS
============================================================ */

.review-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
}

.review-card.approve,
.review-card.approved { border-left: 4px solid #4CAF50; }

.review-card.reject,
.review-card.rejected { border-left: 4px solid #eb4d4b; }

.review-card.downgrade { border-left: 4px solid #f1c40f; }

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
  margin-bottom: 8px;
}

.verdict {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
}

.verdict.approve,
.verdict.approved {
  background: rgba(76,175,80,0.15);
  color: #4CAF50;
}

.verdict.reject,
.verdict.rejected {
  background: rgba(235,77,75,0.15);
  color: #eb4d4b;
}

.verdict.downgrade {
  background: rgba(241,196,15,0.15);
  color: #f1c40f;
}

.review-notes li {
  font-size: 0.85em;
  margin-bottom: 6px;
  opacity: 0.85;
}

.review-warning {
  background: rgba(235,77,75,0.1);
  border-radius: 6px;
  padding: 8px;
  margin-top: 8px;
}


/* ============================================================
   DASHBOARD TABLE
============================================================ */

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  
}

.dashboard-table thead {
  background: rgba(255,255,255,0.08);
}

.dashboard-table thead th {
  position: sticky;
  top: 0;
  background: rgba(15,15,20,0.95);
  z-index: 2;
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dashboard-table td {
  padding: 6px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dashboard-table tr:hover {
  background: rgba(255,255,255,0.04);
}

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

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

.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(3),
.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(4) {
  width: 70px;
  text-align: right;
}

.dashboard-table th:nth-child(5),
.dashboard-table td:nth-child(5) {
  width: 80px;
  text-align: right;
}

.contract-details .ai-box {
  text-align: center;
}



/* ============================================================
   CLOSED PANEL
============================================================ */

.closed-panel {
  background: linear-gradient(
    180deg,
    rgba(10,10,14,0.92),
    rgba(15,15,20,0.96)
  );
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  margin-bottom: 24px;
}

.closed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.closed-header h3 {
  margin: 0;
  font-size: 1.1rem;
  border: none;
}

.closed-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.closed-table-wrapper {
  max-height: 420px;
  overflow-y: auto;
  border-radius: 10px;
  padding: 12px;
}


/* ============================================================
   GRID + METRIC BOXES
============================================================ */

.grid-8 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.ai-box {
  background: rgba(15,15,15,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 18px;
  border-radius: 12px;
  transition: 0.2s ease;
}

.ai-box:hover {
  border-color: rgba(255,215,0,0.4);
  transform: translateY(-2px);
}

.ai-box .label {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-box .value {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.ai-box .sub {
  font-size: 0.85rem;
  color: #bbb;
}


/* ============================================================
   STATUS COLORS
============================================================ */

.side.long, .intent-long, .pnl-positive, .pnl-up,
.regime-risk_on, .risk-low { color: #2ecc71; }

.side.short, .intent-short, .pnl-negative, .pnl-down,
.regime-risk_off, .risk-high { color: #ff4d4d; }

.regime-capitulation, .risk-extreme {
  color: #ff1f1f;
  text-shadow: 0 0 6px rgba(255,0,0,0.6);
}

.regime-distribution, .intent-reduce, .risk-medium {
  color: #f1c40f;
}

.regime-neutral, .intent-hold { color: #bbbbbb; }

@media (max-width: 480px) {

  .container {
    flex-direction: column;
    padding: 10px;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .side-section {
    width: 100%;
    padding: 10px;
  }

  .dashboard-table {
    font-size: 0.75rem;
  }

  .grid-8 {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {

  .container {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .side-section {
    width: 100%;
  }

  .grid-8 {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 1024px) {

  .side-section {
    width: 100%;
  }

  .container {
    flex-direction: column;
  }

  .grid-8 {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (min-width: 1025px) and (max-width: 1440px) {

  .grid-8 {
    grid-template-columns: repeat(3, 1fr);
  }

}

@media (min-width: 1441px) {

  .container {
    max-width: 1400px;
  }

  .grid-8 {
    grid-template-columns: repeat(4, 1fr);
  }

}

.analytics-grid{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:14px;
margin-top:10px;
}

.analytics-box{
background:#10131a;
padding:12px;
border-radius:8px;
text-align:center;
border:1px solid rgba(255,255,255,.06);
}

.analytics-box .label{
font-size:11px;
opacity:.7;
}

.analytics-box .value{
font-size:18px;
font-weight:600;
}

/* ================= WALLET STRIP ================= */

.wallet-strip{
  grid-column: 1 / -1;   /* ⭐ span entire dashboard grid */

  width:100%;
  margin-top:14px;
  padding-top:12px;

  display:flex;
  flex-direction:row;
  flex-wrap:nowrap; /* prevent wrapping */

  gap:12px;

  overflow-x:auto; /* horizontal scroll */
  overflow-y:hidden;

  border-top:1px solid rgba(255,255,255,.08);

  /* smooth scrolling */
  scroll-behavior:smooth;
}

/* hide scrollbar for cleaner UI */

.wallet-strip::-webkit-scrollbar{
  height:6px;
}

.wallet-strip::-webkit-scrollbar-track{
  background:transparent;
}

.wallet-strip::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.15);
  border-radius:4px;
}


/* ================= WALLET CARDS ================= */

.wallet-label{
  grid-column: 1 / -1; /* span full dashboard width */

  margin-top:6px;
  margin-bottom:6px;

  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;

  color:rgba(255,255,255,.55);
}

.wallet-pill{
  flex:0 0 auto; /* prevents shrinking */

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  min-width:120px; /* ⭐ prevents compression */
  height:64px;

  padding:10px 12px;

  border-radius:8px;

  background:#0f131a;
  border:1px solid rgba(255,255,255,.06);

  font-size:12px;
  line-height:1.2;

  transition:all .15s ease;
}

.wallet-pill:hover{
  border-color:#2a2f3a;
  transform:translateY(-1px);
}

/* chain label */

.wallet-chain{
  opacity:.55;
  font-size:10px;
  text-transform:capitalize;
  letter-spacing:.04em;
}

/* asset ticker */

.wallet-asset{
  font-weight:600;
  font-size:13px;
  margin-top:2px;
}

/* wallet value */

.wallet-value{
  font-weight:600;
  font-size:14px;
  margin-top:4px;
}

/* stablecoins */

.wallet-stable .wallet-value{
  color:#6de0a3;
}

/* tokens */

.wallet-token .wallet-value{
  color:#7aa2ff;
}

.wallet-empty{
  opacity:.6;
}