:root {
  color-scheme: dark;
  --bg: #090b1a;
  --panel: rgba(19, 24, 49, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --accent: #49c6ff;
  --accent-soft: rgba(73, 198, 255, 0.2);
  --text-primary: #f5f6fa;
  --text-secondary: rgba(245, 246, 250, 0.6);
  --positive: #50fa7b;
  --negative: #ff6b81;
  --font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: radial-gradient(circle at top, rgba(73, 198, 255, 0.2), transparent 55%), var(--bg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: clamp(14px, 0.9vw, 20px);
  height: 100%; width: 100%;
}

/* Force flash effects to override transparency */
#portfolio-table td.flash-up {
  background-color: rgba(0, 255, 0, 0.6) !important;
  color: #fff !important;
  transition: 0.1s;
}
#portfolio-table td.flash-down {
  background-color: rgba(255, 0, 0, 0.6) !important;
  color: #fff !important;
  transition: 0.1s;
}

#portfolio-table td {
  transition: 0.1s;
}



body::before {
  content: "";
  position: fixed; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080"><g fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"><path d="M0 0h1920v1080H0z"/><path d="M0 120h1920M0 240h1920M0 360h1920M0 480h1920M0 600h1920M0 720h1920M0 840h1920M0 960h1920M160 0v1080M320 0v1080M480 0v1080M640 0v1080M800 0v1080M960 0v1080M1120 0v1080M1280 0v1080M1440 0v1080M1600 0v1080"/></g></svg>') center/cover no-repeat;
  pointer-events: none; opacity: 0.4; mix-blend-mode: screen;
}

.app-shell { position: relative; display: flex; flex-direction: column; gap: 1.5rem; padding: 2.5rem; min-height: 100vh; }
.masthead { display: flex; justify-content: flex-end; align-items: center; padding-bottom: 0.5rem; }
.masthead__clock { font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-variant-numeric: tabular-nums; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 0.5rem 1.5rem; box-shadow: var(--panel-shadow); }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(6, minmax(120px, auto)); gap: 1.5rem; }

.panel {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 18px;
  box-shadow: var(--panel-shadow); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel__header { display: flex; justify-content: space-between; align-items: baseline; padding: 1rem 1.25rem; background: linear-gradient(135deg, rgba(73, 198, 255, 0.18), transparent 60%); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.panel__header h2 { margin: 0; font-size: 1.25rem; letter-spacing: 0.08em; text-transform: uppercase; }
.panel__source { font-size: 0.75rem; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.12em; }
.panel__body { flex: 1; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

/* TABLES */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: transparent; }
.table thead { background: transparent !important; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }
.table th, .table td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
}
.table tbody tr,
.table tbody tr:nth-child(odd),
.table tbody tr:nth-child(even),
.table tbody tr:hover {
  background: transparent;
}
.table .positive { color: var(--positive); font-weight: 600; text-shadow: 0 0 4px rgba(80, 250, 123, 0.25); }
.table .negative { color: var(--negative); font-weight: 600; text-shadow: 0 0 4px rgba(255, 107, 129, 0.25); }

/* ALIGNMENT */
#portfolio-table td:nth-child(1),
#portfolio-table td:nth-child(3),
#portfolio-table td:nth-child(4),
#portfolio-table td:nth-child(5),
#portfolio-table td:nth-child(6),
#portfolio-table td:nth-child(7),
#portfolio-table th:nth-child(1),
#portfolio-table th:nth-child(3),
#portfolio-table th:nth-child(4),
#portfolio-table th:nth-child(5),
#portfolio-table th:nth-child(6),
#portfolio-table th:nth-child(7) { text-align: right; }

#portfolio-table td:nth-child(2),
#portfolio-table th:nth-child(2) { text-align: left; }

#portfolio-table td, #portfolio-table th { padding: 0.4rem 0.5rem; }

/* REMOVE ALL UPDATE EFFECTS */
#portfolio-table.updating tbody {
  opacity: 1;
  background: transparent ;
}

/* GRID LAYOUTS */
.panel--alerts { grid-column: 1 / span 3; grid-row: 1 / span 2; }
.panel--news { grid-column: 4 / span 4; grid-row: 1 / span 3; }
.panel--portfolio-graph { grid-column: 8 / span 5; grid-row: 1 / span 3; }
.panel--dow { grid-column: 1 / span 3; grid-row: 3 / span 1; }
.panel--watchlist { grid-column: 4 / span 4; grid-row: 4 / span 2; }
.panel--portfolio { grid-column: 8 / span 5; grid-row: 4 / span 2; }
.panel--headlines { grid-column: 1 / span 3; grid-row: 4 / span 1; }
.panel--forex { grid-column: 1 / span 3; grid-row: 5 / span 1; }
.panel--macro { grid-column: 1 / span 3; grid-row: 6 / span 1; }
.panel--calendar { grid-column: 4 / span 9; grid-row: 6 / span 1; }
