/* DataServer In-House — Financial Terminal Dashboard */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-base: #0B0E14;
    --bg-surface: #111827;
    --bg-card: #151B28;
    --bg-hover: #1E2536;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(37, 99, 235, 0.25);
    --border-panel: rgba(255, 255, 255, 0.08);
    --text-primary: #E8ECF1;
    --text-secondary: #8B95A5;
    --text-muted: #5A6577;
    --accent-blue: #2563EB;
    --accent-cyan: #0EA5E9;
    --accent-purple: #7C3AED;
    --accent-gradient: linear-gradient(135deg, #2563EB, #0EA5E9);
    --positive: #10B981;
    --negative: #EF4444;
    --warning: #D4A843;
    --gold: #D4A843;
    --glass-bg: #151B28;
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 12px rgba(37, 99, 235, 0.1);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 6px;
    --radius-xl: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-base);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 13px;
}

/* ========== Background (no floating blobs) ========== */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, #0B0E14 0%, #0D1018 50%, #0F131D 100%);
}

.bg-gradient::before,
.bg-gradient::after {
    content: '';
    position: absolute;
    opacity: 0;
    display: none;
}

/* ========== Scrollbars (thin, unobtrusive) ========== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ========== Layout ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 52px;
    background: #0A0D12;
    border-right: 1px solid var(--border-subtle);
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    width: 30px;
    height: 30px;
    background: var(--accent-blue);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    padding: 0 6px;
}

.nav-item {
    width: 40px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    position: relative;
    font-size: 1rem;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.08);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 0 2px 2px 0;
}

.nav-tooltip {
    position: absolute;
    left: 52px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    border: 1px solid var(--border-panel);
    z-index: 200;
}

.nav-item:hover .nav-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-left: 52px;
    min-width: 0;
}

/* ========== Header ========== */
.header {
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.6rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    height: 44px;
}

.header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.header h1 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.header .subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-subtle);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    color: var(--positive);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.header-badge .dot {
    width: 5px;
    height: 5px;
    background: var(--positive);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.header-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
}

/* ========== Container ========== */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* ========== KPI Cards ========== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.kpi-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-panel);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.kpi-card:nth-child(1)::before { background: var(--accent-blue); }
.kpi-card:nth-child(2)::before { background: var(--accent-cyan); }
.kpi-card:nth-child(3)::before { background: var(--gold); }
.kpi-card:nth-child(4)::before { background: var(--positive); }

.kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.kpi-card:nth-child(1) .kpi-icon { background: rgba(37, 99, 235, 0.1); color: var(--accent-blue); }
.kpi-card:nth-child(2) .kpi-icon { background: rgba(14, 165, 233, 0.1); color: var(--accent-cyan); }
.kpi-card:nth-child(3) .kpi-icon { background: rgba(212, 168, 67, 0.1); color: var(--gold); }
.kpi-card:nth-child(4) .kpi-icon { background: rgba(16, 185, 129, 0.1); color: var(--positive); }

.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.kpi-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ========== Bento Grid ========== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 0.75rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-md);
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s ease forwards;
    contain: layout style;
}

.card:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.card-wide { grid-column: span 2; }
.card-full { grid-column: span 4; }
.card-feature { grid-column: span 3; }
.card-side { grid-column: span 1; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:nth-child(1) { animation-delay: 0.03s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.09s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.15s; }
.card:nth-child(6) { animation-delay: 0.18s; }

.card-header {
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.015);
}

.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-title .icon {
    font-size: 0.85rem;
    opacity: 0.6;
}

.card-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.card-body {
    padding: 0.9rem;
}

/* ========== Chart Container ========== */
.chart-container {
    position: relative;
    width: 100%;
}

/* ========== Curve Selector ========== */
.curve-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.curve-selector label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.curve-selector select {
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 220px;
    transition: border-color 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%235A6577' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.curve-selector select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.curve-selector select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.curve-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ========== Tables (Bloomberg-style) ========== */
.table-wrapper {
    overflow-x: auto;
    max-height: 450px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
}

.table-wrapper::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    background: #0F131D;
    color: var(--text-muted);
    padding: 0.4rem 0.65rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

thead th.num {
    text-align: right;
}

tbody td {
    padding: 0.3rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.73rem;
}

tbody td.num {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.012);
}

tbody tr:hover td {
    background: rgba(37, 99, 235, 0.04);
}

#curveTable {
    margin-top: 0.75rem;
}

/* ========== Change Cells (DoD) ========== */
.change {
    white-space: nowrap;
}

.change-pct {
    font-size: 0.6rem;
    margin-left: 0.25rem;
    opacity: 0.65;
}

tbody td.positive,
td.positive {
    color: var(--positive) !important;
}

tbody td.negative,
td.negative {
    color: var(--negative) !important;
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    margin-top: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}

/* ========== Section Title ========== */
.section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1.5rem 0 0.75rem;
    padding-left: 0.15rem;
}

.section-title:first-of-type {
    margin-top: 0;
}

/* ========== Upload Zone ========== */
.upload-zone {
    border: 1px dashed var(--border-panel);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: var(--bg-card);
    margin-bottom: 0.75rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.03);
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.upload-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.upload-desc code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.68rem;
    color: var(--accent-cyan);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-btn {
    padding: 0.4rem 1.25rem;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: white;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}

.upload-btn:hover {
    background: #1D4ED8;
}

/* ========== NEW: Section Divider ========== */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-panel), transparent);
    margin: 1.5rem 0;
}

/* ========== NEW: Commodity Grid ========== */
.commodity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* ========== NEW: Commodity Card ========== */
.commodity-card {
    background: var(--bg-card);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
}

.commodity-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ========== NEW: Commodity Badge ========== */
.commodity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    width: fit-content;
}

.commodity-badge[data-category="energy"],
.commodity-badge.energy {
    background: rgba(239, 68, 68, 0.1);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.commodity-badge[data-category="metals"],
.commodity-badge.metals {
    background: rgba(212, 168, 67, 0.1);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 67, 0.15);
}

.commodity-badge[data-category="power"],
.commodity-badge.power {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.commodity-badge[data-category="agriculture"],
.commodity-badge.agriculture {
    background: rgba(16, 185, 129, 0.1);
    color: var(--positive);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ========== NEW: Market Ticker ========== */
.market-ticker {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.35rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.market-ticker::-webkit-scrollbar {
    display: none;
}

.market-ticker .ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.market-ticker .ticker-label {
    color: var(--text-muted);
    font-weight: 500;
}

.market-ticker .ticker-value {
    color: var(--text-primary);
    font-weight: 600;
}

.market-ticker .ticker-change {
    font-size: 0.6rem;
}

/* ========== NEW: Data Highlight ========== */
.data-highlight {
    background: rgba(37, 99, 235, 0.06);
    border-left: 2px solid var(--accent-blue);
    padding: 0.15rem 0.4rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ========== NEW: Category Header ========== */
.category-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.25rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
}

.category-header h3 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.category-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ========== NEW: Heatmap Cells ========== */
.heatmap-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.25rem 0.4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
    border-radius: 2px;
    text-align: center;
}

.heatmap-positive {
    background: rgba(16, 185, 129, 0.12);
    color: var(--positive);
}

.heatmap-negative {
    background: rgba(239, 68, 68, 0.12);
    color: var(--negative);
}

.heatmap-neutral {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

/* ========== NEW: Mini Chart ========== */
.mini-chart {
    width: 100%;
    height: 40px;
    position: relative;
    overflow: hidden;
}

/* ========== NEW: Commodity Selector ========== */
.commodity-selector {
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%235A6577' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.commodity-selector:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* ========== ApexCharts Dark Overrides ========== */
.apexcharts-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-panel) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
}

.apexcharts-tooltip .apexcharts-tooltip-title {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.72rem !important;
}

.apexcharts-tooltip .apexcharts-tooltip-text {
    color: var(--text-secondary) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.7rem !important;
}

.apexcharts-legend-text {
    color: var(--text-secondary) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.7rem !important;
}

.apexcharts-menu {
    background: var(--bg-card) !important;
    border-color: var(--border-panel) !important;
}

.apexcharts-menu-item:hover {
    background: var(--bg-hover) !important;
}

.apexcharts-gridline {
    stroke: rgba(255, 255, 255, 0.03) !important;
}

.apexcharts-xaxis-label,
.apexcharts-yaxis-label {
    fill: var(--text-muted) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.6rem !important;
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-full { grid-column: span 2; }
    .card-feature { grid-column: span 2; }
    .card-side { grid-column: span 1; }
    .commodity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }

    .header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.6rem 1rem;
        height: auto;
    }

    .header-left {
        flex-direction: column;
        gap: 0.2rem;
    }

    .header .subtitle {
        border-left: none;
        padding-left: 0;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .container { padding: 0.75rem; }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

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

    .card-wide, .card-full, .card-feature, .card-side {
        grid-column: span 1;
    }

    .curve-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .curve-selector select {
        width: 100%;
        min-width: unset;
    }

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

    .market-ticker {
        padding: 0.35rem 0.75rem;
        gap: 1rem;
    }
}
