:root {
    --primary-color: #0052d9;
    --primary-hover: #003bb5;
    --success-color: #00a870;
    --warning-color: #e37318;
    --danger-color: #f53f3f;
    --info-color: #0052d9;
    --text-primary: #242929;
    --text-secondary: #5e6c84;
    --text-disabled: #bbbec4;
    --border-color: #e8e8e8;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --sidebar-bg: #001529;
    --sidebar-text: rgba(255, 255, 255, 0.85);
    --sidebar-active: #0052d9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.logo i {
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-list {
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: #fff;
    background: var(--sidebar-active);
}

.nav-item i {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-item span {
    font-size: 14px;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

.content-header {
    background: var(--card-bg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.date-select:hover {
    border-color: var(--primary-color);
}

.current-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.content-body {
    padding: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-extra {
    font-size: 12px;
    color: var(--text-secondary);
}

.grid-cards {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.stat-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
}

.stat-card-icon.blue {
    background: rgba(0, 82, 217, 0.1);
    color: var(--primary-color);
}

.stat-card-icon.green {
    background: rgba(0, 168, 112, 0.1);
    color: var(--success-color);
}

.stat-card-icon.orange {
    background: rgba(227, 115, 24, 0.1);
    color: var(--warning-color);
}

.stat-card-icon.red {
    background: rgba(245, 63, 63, 0.1);
    color: var(--danger-color);
}

.stat-card-icon.purple {
    background: rgba(114, 50, 221, 0.1);
    color: #7232dd;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-card-sub.up {
    color: var(--success-color);
}

.stat-card-sub.down {
    color: var(--danger-color);
}

.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.chart-wrapper {
    width: 100%;
    height: 300px;
}

.chart-wrapper.small {
    height: 200px;
}

.chart-wrapper.large {
    height: 400px;
}

.row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.row-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.col {
    flex: 1;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.data-table td {
    color: var(--text-primary);
    font-size: 14px;
}

.data-table tr:hover td {
    background: var(--bg-color);
}

.data-table .number {
    font-family: 'Monaco', 'Menlo', monospace;
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 10px;
    font-weight: 500;
}

.badge.blue {
    background: rgba(0, 82, 217, 0.1);
    color: var(--primary-color);
}

.badge.green {
    background: rgba(0, 168, 112, 0.1);
    color: var(--success-color);
}

.badge.orange {
    background: rgba(227, 115, 24, 0.1);
    color: var(--warning-color);
}

.badge.red {
    background: rgba(245, 63, 63, 0.1);
    color: var(--danger-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

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

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 2px;
}

.trend-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.trend-btn {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.trend-btn:hover {
    background: var(--border-color);
}

.trend-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.progress-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mt-20 {
    margin-top: 20px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.font-12 {
    font-size: 12px;
}

.font-13 {
    font-size: 13px;
}

.font-14 {
    font-size: 14px;
}

.font-16 {
    font-size: 16px;
}

.font-18 {
    font-size: 18px;
}

.font-20 {
    font-size: 20px;
}

.font-bold {
    font-weight: 600;
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header {
        padding: 12px;
    }
    .logo span {
        display: none;
    }
    .nav-section-title {
        display: none;
    }
    .nav-item span {
        display: none;
    }
    .nav-item {
        padding: 12px;
        justify-content: center;
    }
    .main-content {
        margin-left: 60px;
    }
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5,
    .grid-6 {
        grid-template-columns: 1fr;
    }
    .row-equal {
        grid-template-columns: 1fr;
    }
}
