/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.metric-title {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.metric-icon.users {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.metric-icon.keywords {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.metric-icon.crm {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.metric-icon.automation {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

.metric-change-icon {
    font-size: 12px;
}

.metric-description {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-top: 5px;
}

/* Charts Container */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.chart-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.chart-options {
    display: flex;
    gap: 10px;
}

.chart-option {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-option:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.chart-option.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.chart-container {
    position: relative;
    min-height: 300px;
    height: 300px;
    max-height: none;
    overflow: auto;
}


/* Activity Timeline */
.activity-timeline {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.timeline-filter {
    padding: 8px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-list {
    max-height: 400px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.timeline-icon.user {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.timeline-icon.keyword {
    background: rgba(240, 147, 251, 0.1);
    color: #f093fb;
}

.timeline-icon.crm {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.timeline-icon.automation {
    background: rgba(67, 233, 123, 0.1);
    color: #43e97b;
}

.timeline-content {
    flex: 1;
}

.timeline-action {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 5px;
}

.timeline-time {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Progress Bars */
.progress-section {
    margin-top: 25px;
    /* padding-top: 20px; */
    /* border-top: 1px solid var(--border-color); */
}

.progress-item {
    margin-bottom: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.progress-value {
    color: var(--text-secondary);
    font-size: 13px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 1s ease;
    animation: progressAnimation 1.5s ease;
}

@keyframes progressAnimation {
    from {
        width: 0%;
    }
}

/* Quick Actions */
.quick-actions {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.quick-actions-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.quick-actions-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-button {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.action-button:hover {
    background: var(--hover-bg);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.action-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.action-label {
    font-size: 13px;
    font-weight: 600;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }
}

/* Loading animation for charts */
.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.chart-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-description {
    font-size: 14px;
}

.metric-extra {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========== GLASSMORPHISM SUTIL - DARK MODE ========== */

/* Metric cards com glassmorphism */
[data-theme="dark"] .metric-card {
    background: rgba(44, 47, 56, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .metric-card:hover {
    background: rgba(44, 47, 56, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Metric icons elegantes */
[data-theme="dark"] .metric-icon.users {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .metric-icon.keywords {
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

[data-theme="dark"] .metric-icon.crm {
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

[data-theme="dark"] .metric-icon.automation {
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
}

[data-theme="dark"] .metric-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .metric-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .metric-value {
    color: var(--text-primary);
}

[data-theme="dark"] .metric-detail {
    color: var(--text-secondary);
}

[data-theme="dark"] .metric-extra {
    color: var(--text-secondary);
}

[data-theme="dark"] .metric-change.positive {
    color: #6ee7b7;
}

[data-theme="dark"] .metric-change.negative {
    color: #fca5a5;
}

/* Chart cards com glassmorphism */
[data-theme="dark"] .chart-card {
    background: rgba(44, 47, 56, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .chart-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .chart-option {
    background: rgba(26, 29, 35, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chart-option:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .chart-option.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    box-shadow:
        0 4px 12px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Activity timeline com glassmorphism */
[data-theme="dark"] .activity-timeline {
    background: rgba(44, 47, 56, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .timeline-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .timeline-filter {
    background: rgba(26, 29, 35, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .timeline-filter:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .timeline-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .timeline-icon.user {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

[data-theme="dark"] .timeline-icon.keyword {
    background: rgba(245, 87, 108, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .timeline-icon.crm {
    background: rgba(79, 172, 254, 0.15);
    color: #7dd3fc;
}

[data-theme="dark"] .timeline-icon.automation {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

/* Progress bars elegantes */
[data-theme="dark"] .progress-bar {
    background: rgba(26, 29, 35, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .progress-fill {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Quick actions com glassmorphism */
[data-theme="dark"] .quick-actions {
    background: rgba(44, 47, 56, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .quick-actions-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .action-button {
    background: rgba(26, 29, 35, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .action-button:hover {
    background: rgba(44, 47, 56, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2);
}

/* Chart spinner elegante */
[data-theme="dark"] .chart-spinner {
    border-color: rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
}