/* Meridian Dashboard - Production Dark Theme */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a1f2e;
    --bg-card: #1e2432;
    --border-color: #2d3748;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.logo h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo .subtitle {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-change {
    font-size: 14px;
    color: var(--text-muted);
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

/* Venue Grid */
.venue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.venue-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
}

.venue-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.venue-balance {
    font-size: 28px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 4px;
}

.venue-detail {
    font-size: 13px;
    color: var(--text-muted);
}

.metric-card.highlight {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.08) 100%);
}

.metric-value.positive { color: var(--success); }
.metric-value.negative { color: var(--danger); }

/* Chart Sections */
.chart-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.chart-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--accent-secondary);
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 400px;
}

.chart-container-small {
    position: relative;
    height: 250px;
}

/* Tables */
.table-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.table-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--accent-secondary);
    font-weight: 600;
}

.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.table-controls input,
.table-controls select {
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    flex: 1;
    max-width: 300px;
}

.table-controls input:focus,
.table-controls select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

th.section-header {
    text-align: center;
    background: var(--bg-primary);
    color: var(--accent-secondary);
    font-size: 13px;
}

tr.sub-header th {
    font-size: 11px;
    padding: 10px 16px;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 14px 16px;
    font-size: 14px;
}

td.positive {
    color: var(--success);
    font-weight: 600;
}

td.negative {
    color: var(--danger);
    font-weight: 600;
}

td.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.active {
    background: var(--success);
    color: #000;
}

.badge.inactive {
    background: var(--text-muted);
    color: #fff;
}

/* Correlation Matrix */
.correlation-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.correlation-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--accent-secondary);
    font-weight: 600;
}

.correlation-grid {
    display: grid;
    gap: 8px;
    overflow-x: auto;
}

.correlation-row {
    display: grid;
    gap: 8px;
}

.correlation-cell {
    padding: 12px;
    text-align: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: transform 0.15s;
}

.correlation-cell:hover {
    transform: scale(1.05);
    z-index: 10;
}

.correlation-cell.header {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
}

/* Correlation color scale */
.corr-high-pos { background: rgba(16, 185, 129, 0.3); color: var(--success); }
.corr-mid-pos { background: rgba(16, 185, 129, 0.15); }
.corr-neutral { background: var(--bg-secondary); }
.corr-mid-neg { background: rgba(239, 68, 68, 0.15); }
.corr-high-neg { background: rgba(239, 68, 68, 0.3); color: var(--danger); }

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.portfolio-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.portfolio-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--accent-secondary);
    font-weight: 600;
}

.portfolio-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.metric-row span:first-child {
    color: var(--text-secondary);
    font-size: 14px;
}

.metric-val {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

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

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

    .table-controls {
        flex-direction: column;
    }

    .table-controls input,
    .table-controls select {
        max-width: 100%;
    }

    .chart-container {
        height: 300px;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    animation: fadeInOut 1.5s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}
