﻿.dashboard-wrapper {
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

/* Header Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.header-text h2 {
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-text p {
    color: var(--text-muted);
    margin: 4px 0 0;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-container {
    position: relative;
    display: flex;
    align-items: center;
}

.select-icon {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 20px;
    pointer-events: none;
}

.custom-select {
    padding: 10px 40px 10px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-side);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.btn-refresh {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: opacity 0.2s, transform 0.1s;
}

    .btn-refresh:hover:not(:disabled) {
        opacity: 0.9;
        transform: translateY(-1px);
    }

/* Stats Cards (3 Columns Layout) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-side);
    padding: 18px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    }

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

    .icon-box.primary {
        background: #10b981;
        color: white;
    }

    .icon-box.success {
        background: #006837;
        color: white;
    }

    .icon-box.warning {
        background: #f59e0b;
        color: white;
    }

    .icon-box.info {
        background: #3b82f6;
        color: white;
    }

    .icon-box.purple {
        background: #8b5cf6;
        color: white;
    }

    .icon-box.dark {
        background: #4b5563;
        color: white;
    }

.stat-info h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-info p {
    margin: 4px 0 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

    .stat-info p small {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
    }

/* Main Analysis Section */
.analysis-section {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 20px;
}

.card-styled {
    background: var(--bg-side);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

    .box-header h4 {
        margin: 0;
        color: var(--text-main);
        font-size: 1rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.badge-status {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
}

.chart-placeholder {
    height: 320px;
    background: var(--bg-app);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
}

.visual-indicator {
    color: var(--text-muted);
    text-align: center;
}

.chart-icon {
    font-size: 42px;
    margin-bottom: 6px;
    opacity: 0.6;
}

/* Top Items List & Progress Bars */
.top-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .top-items-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }

        .top-items-list li:last-child {
            border-bottom: none;
        }

.item-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.item-rank {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 20px;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding-left: 15px;
}

.item-name {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
}

.progress-bar-bg {
    width: 80%;
    height: 5px;
    background: var(--bg-app);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 10px;
}

.item-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.item-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.item-percent {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dashboard-loader, .empty-state-box {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.text-primary {
    color: var(--accent);
}

.text-warning {
    color: #f59e0b;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
