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

:root {
    --bg-primary: #000;
    --bg-secondary: #16181c;
    --bg-hover: #080808;
    --border-color: #2f3336;
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --accent-blue: #1d9bf0;
    --accent-red: #f4212e;
    --accent-green: #00ba7c;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f9f9;
    --bg-hover: #f7f9f9;
    --border-color: #eff3f4;
    --text-primary: #0f1419;
    --text-secondary: #536471;
    --accent-blue: #1d9bf0;
    --accent-red: #f4212e;
    --accent-green: #00ba7c;
}

[data-theme="light"] .sidebar {
    background: var(--bg-primary);
}

[data-theme="light"] .dashboard-header {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] Chart {
    color: var(--text-secondary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

.navbar {
    display: none;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 275px 600px 350px;
    gap: 30px;
    padding: 0 20px;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 2em;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 20px;
    padding: 12px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25em;
    font-weight: 400;
    transition: background 0.2s;
}

.nav-menu a:hover {
    background: var(--bg-hover);
}

.nav-menu a.active {
    font-weight: 700;
}

.nav-icon {
    font-size: 1.6em;
    width: 26px;
    text-align: center;
}

.dashboard-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.dashboard-header h1 {
    font-size: 1.25em;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.date-filter {
    margin-top: 15px;
}

.date-filter select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.95em;
    cursor: pointer;
}

.date-filter select:hover {
    background: var(--bg-hover);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}

.stat-card:hover {
    background: var(--bg-hover);
}

.stat-icon {
    font-size: 1.5em;
    margin-bottom: 8px;
}

.stat-content h3 {
    font-size: 1.8em;
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 0.85em;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 20px 20px;
}

.chart-box {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.chart-box h2 {
    font-size: 1.1em;
    margin-bottom: 16px;
    font-weight: 700;
}

canvas {
    max-height: 250px;
}

.top-posts {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin: 0 20px 20px;
}

.top-posts h2 {
    padding: 20px 20px 12px;
    font-size: 1.1em;
    font-weight: 700;
}

.posts-list {
    display: flex;
    flex-direction: column;
}

.post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
}

.post-item:hover {
    background: var(--bg-hover);
}

.post-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.post-details {
    flex: 1;
    min-width: 0;
}

.post-details h4 {
    font-size: 0.95em;
    font-weight: 400;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.post-details p {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.post-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.right-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 16px;
}

.sidebar-card h3 {
    padding: 16px;
    font-size: 1.25em;
    font-weight: 700;
}

.trending-item {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
}

.trending-item:hover {
    background: var(--bg-hover);
}

.trending-category {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.trending-topic {
    font-weight: 700;
    margin: 4px 0;
}

.trending-count {
    font-size: 0.8em;
    color: var(--text-secondary);
}

@media (max-width: 1280px) {
    .container {
        grid-template-columns: 88px 600px 350px;
    }

    .sidebar {
        padding: 20px 8px;
    }

    .nav-menu a span {
        display: none;
    }

    .nav-menu a {
        padding: 12px;
        justify-content: center;
    }

    .logo {
        padding: 12px;
        text-align: center;
    }
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 88px 1fr;
    }

    .right-sidebar {
        display: none;
    }
}

@media (max-width: 688px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        padding: 8px 0;
        z-index: 100;
    }

    .logo {
        display: none;
    }

    .nav-menu {
        display: flex;
        width: 100%;
        justify-content: space-around;
    }

    .nav-menu li {
        margin: 0;
    }

    .nav-menu a {
        flex-direction: column;
        gap: 4px;
        font-size: 0.7em;
    }

    .nav-icon {
        font-size: 1.4em;
    }
}
