:root {
    --bg-base: #09090b;
    --bg-card: #09090b;
    --border: #27272a;
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    
    --chart-1: #ffffff;
    --chart-2: #a1a1aa;
    --chart-3: #3f3f46;
    --chart-4: #27272a;
    
    --accent: #ffffff;
    --positive: #10b981;
    --negative: #ef4444;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: #18181b;
    border: 1px solid var(--border);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
}

.sidebar-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-actions button:hover {
    color: var(--text-primary);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-base);
}

.content-header {
    display: flex;
    justify-content: flex-end;
    padding: 2rem 2rem 0;
}

.time-toggles {
    display: flex;
    background: #18181b;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border);
}

.time-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-btn.active {
    background: #27272a;
    color: var(--text-primary);
}

.time-btn:hover {
    color: var(--text-primary);
}

.tabs-nav {
    display: flex;
    gap: 1rem;
    padding: 0 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tab-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.tab-pane {
    display: none;
    padding: 2rem;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

.tab-pane.active.bento-grid {
    display: grid;
}

.raw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.raw-table th, .raw-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.raw-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.raw-table tr:hover {
    background: #18181b;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--positive);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--positive);
}
.status-indicator.error .pulse-dot {
    background: var(--negative);
    box-shadow: 0 0 8px var(--negative);
}

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

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.row-span-1 { grid-row: span 1; }
.row-span-2 { grid-row: span 2; }

@media (max-width: 900px) {
    .bento-grid { grid-template-columns: 1fr; }
    .col-span-1, .col-span-2, .col-span-3 { grid-column: span 1; }
    .row-span-2 { grid-row: span 1; min-height: 300px; }
}

/* Cards */
.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* KPI Box */
.kpi-box {
    justify-content: center;
    position: relative;
}

.kpi-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-top: 4px;
}

.kpi-trend {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}
.kpi-trend.positive { color: var(--positive); }
.kpi-trend.negative { color: var(--negative); }
.kpi-trend.neutral { color: var(--text-muted); }

/* Insights */
.insights-card {
    background: linear-gradient(to right, rgba(255,255,255,0.02), transparent);
}
.insights-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.insight-item {
    font-size: 0.95rem;
    color: var(--text-primary);
    padding-left: 12px;
    border-left: 2px solid var(--border);
}
.insight-item strong {
    color: var(--accent);
}

/* Charts Container */
.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 200px;
}
