/* PW Trading Dashboard — Dark Theme */
:root {
    --bg:          #0f1117;
    --surface:     #1a1d27;
    --surface-alt: #222632;
    --border:      #2d3244;
    --text:        #e0e4ef;
    --text-dim:    #8890a4;
    --accent:      #6c8cff;
    --green:       #22c55e;
    --yellow:      #eab308;
    --red:         #ef4444;
    --orange:      #f97316;
}

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

body {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Status Bar */
#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.indicator.connected   { background: var(--green); box-shadow: 0 0 6px var(--green); }
.indicator.connecting  { background: var(--yellow); animation: pulse 1s infinite; }
.indicator.disconnected { background: var(--red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.sep { color: var(--border); }

#server-time { color: var(--text-dim); }

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    max-height: calc(100vh - 44px);
    overflow: hidden;
}

.right-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 44px);
    overflow: hidden;
}

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel h2 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.badge {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
}

tbody td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

tbody tr:hover {
    background: var(--surface-alt);
}

/* Edge color classes */
.edge-hot    { color: var(--green); font-weight: 700; }
.edge-warm   { color: var(--yellow); }
.edge-cold   { color: var(--text-dim); }
.edge-neg    { color: var(--text-dim); opacity: 0.5; }

/* Scroll lists */
.scroll-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Edge window cards */
.window-card {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-card .edge-name {
    color: var(--green);
    font-weight: 600;
}

.window-card .edge-val {
    color: var(--green);
    font-size: 14px;
    font-weight: 700;
}

.window-card .question {
    color: var(--text-dim);
    font-size: 11px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-card .duration {
    color: var(--text-dim);
    font-size: 11px;
}

/* Alert entries */
.alert-entry {
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.alert-entry .alert-time {
    color: var(--text-dim);
    font-size: 10px;
    flex-shrink: 0;
    min-width: 60px;
}

.alert-entry .alert-action {
    font-weight: 600;
    flex-shrink: 0;
    min-width: 44px;
}
.alert-entry .alert-action.open  { color: var(--green); }
.alert-entry .alert-action.close { color: var(--orange); }

.alert-entry .alert-edge {
    color: var(--accent);
    flex-shrink: 0;
}

.alert-entry .alert-question {
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Markets panel fills left column */
#markets-panel {
    max-height: calc(100vh - 44px);
    overflow-y: auto;
}

/* Right column panel sizing */
#edges-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
#windows-panel {
    flex: 0 0 auto;
    max-height: 200px;
}
#alerts-panel {
    flex: 1;
    min-height: 0;
}

/* Empty states */
.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: 1fr;
        max-height: none;
    }
    .right-col {
        max-height: none;
    }
    #markets-panel {
        max-height: 400px;
    }
}
