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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.header {
    background: white;
    border-radius: 16px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    padding: 12px;
    border-radius: 12px;
}

.logo-text h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
    font-weight: 700;
}

.tagline {
    color: var(--gray-500);
    font-size: 0.875rem;
}

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

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-weight: 600;
    font-size: 0.875rem;
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.last-updated {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* KPI Cards */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.kpi-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.kpi-icon.revenue {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-icon.orders {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.kpi-icon.customers {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.kpi-icon.conversion {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.kpi-change {
    font-size: 0.875rem;
    font-weight: 600;
}

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

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

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

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

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-wrapper.tall {
    height: 320px;
}

.chart-wrapper.square {
    height: 250px;
    max-width: 300px;
    margin: 0 auto;
}

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

.chart-header h3 {
    font-size: 1.125rem;
    color: var(--gray-800);
    font-weight: 600;
}

.chart-legend {
    display: flex;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.blue {
    background: var(--primary);
}

.dot.gray {
    background: var(--gray-300);
}

.badge {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* Bottom Section */
.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Activity Feed */
.activity-feed {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.activity-icon.sale {
    background: #d1fae5;
}

.activity-icon.customer {
    background: #fef3c7;
}

.activity-icon.order {
    background: #e0e7ff;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Footer */
.footer {
    background: white;
    border-radius: 16px;
    padding: 20px 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.footer p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .bottom-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
    }

    .kpi-section {
        grid-template-columns: 1fr;
    }
}
