/* Reset e variabili CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #059669;
    --primary-light: #10B981;
    --primary-lighter: #34D399;
    --secondary-color: #6B7280;
    --success-color: #059669;
    --danger-color: #DC2626;
    --warning-color: #F59E0B;
    --background-color: #F9FAFB;
    --card-background: #FFFFFF;
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.75rem;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Layout principale */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
    .header-left h1 {
        font-size: 1.875rem;
    }
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@media (min-width: 640px) {
    .header-subtitle {
        font-size: 1rem;
    }
}

.header-right {
    text-align: left;
}

@media (min-width: 640px) {
    .header-right {
        text-align: right;
    }
}

.update-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.update-time {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Navigation Tabs */
.nav-tabs {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 1rem;
    min-width: max-content;
}

@media (min-width: 640px) {
    .nav-container {
        gap: 2rem;
    }
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.25rem;
    border: none;
    background: none;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .nav-tab {
        font-size: 0.875rem;
        gap: 0.5rem;
        padding: 1rem 0.25rem;
    }
}

.nav-tab:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tab i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 640px) {
    .main-content {
        padding: 1.5rem;
    }
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Content Grid */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .content-grid {
        gap: 1.5rem;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* Stat Cards */
.stat-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    transition: var(--transition);
}

@media (min-width: 640px) {
    .stat-card {
        padding: 1.5rem;
    }
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    min-width: 0;
    flex: 1;
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .stat-title {
        font-size: 0.875rem;
    }
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .stat-value {
        font-size: 1.5rem;
    }
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .stat-change {
        font-size: 0.875rem;
        gap: 0.25rem;
    }
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

.stat-change i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .stat-change i {
        font-size: 1rem;
    }
}

.stat-icon {
    padding: 0.5rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .stat-icon {
        padding: 0.75rem;
    }
}

.stat-icon.positive {
    background-color: #D1FAE5;
    color: var(--success-color);
}

.stat-icon.negative {
    background-color: #FEE2E2;
    color: var(--danger-color);
}

.stat-icon i {
    font-size: 1.25rem;
}

@media (min-width: 640px) {
    .stat-icon i {
        font-size: 1.5rem;
    }
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1280px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Chart Cards */
.chart-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
}

@media (min-width: 640px) {
    .chart-card {
        padding: 1.5rem;
    }
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

@media (min-width: 640px) {
    .chart-title {
        font-size: 1.125rem;
    }
}

.chart-container {
    height: 16rem;
    position: relative;
}

@media (min-width: 640px) {
    .chart-container {
        height: 20rem;
    }
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1280px) {
    .bottom-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* List Cards */
.list-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
}

@media (min-width: 640px) {
    .list-card {
        padding: 1.5rem;
    }
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.list-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

@media (min-width: 640px) {
    .list-title {
        font-size: 1.125rem;
    }
}

.star-icon {
    color: #F59E0B;
    font-size: 1.25rem;
}

.alert-icon {
    color: var(--danger-color);
    font-size: 1.25rem;
}

.list-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    transition: var(--transition);
}

.list-item:hover {
    background-color: #F3F4F6;
}

.list-item.alert {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
}

.item-info {
    min-width: 0;
    flex: 1;
}

.item-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .item-name {
        font-size: 1rem;
    }
}

.item-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

@media (min-width: 640px) {
    .item-detail {
        font-size: 0.875rem;
    }
}

.item-value {
    font-weight: 600;
    color: var(--success-color);
    font-size: 0.875rem;
    margin-left: 0.5rem;
    text-align: right;
}

@media (min-width: 640px) {
    .item-value {
        font-size: 1rem;
    }
}

.item-value.alert {
    color: var(--danger-color);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Product Cards */
.product-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    aspect-ratio: 1;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image i {
    font-size: 2rem;
    color: var(--text-muted);
}

@media (min-width: 640px) {
    .product-image i {
        font-size: 3rem;
    }
}

.product-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .product-name {
        font-size: 1rem;
    }
}

.product-sales {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
    .product-sales {
        font-size: 0.875rem;
    }
}

.product-revenue {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .product-revenue {
        font-size: 0.875rem;
    }
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .product-actions {
        flex-direction: row;
    }
}

/* Buttons */
.btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.btn-primary {
    background-color: #D1FAE5;
    color: var(--success-color);
}

.btn-primary:hover {
    background-color: #A7F3D0;
}

.btn-secondary {
    background-color: #F3F4F6;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #E5E7EB;
}

/* Responsive Design */
@media (max-width: 639px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .chart-container {
        height: 12rem;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
} 