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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 24px 32px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a202c;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.kpi-card.alert {
    border-left: 4px solid #e53e3e;
}

.kpi-header {
    font-size: 13px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.alert-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e53e3e;
    position: absolute;
    top: 24px;
    right: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 20px;
}

.table-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

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

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.table-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 250px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #4299e1;
}

.filter-select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus {
    border-color: #4299e1;
}

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

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

thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th:hover {
    background: #edf2f7;
}

tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: #f7fafc;
}

td {
    padding: 14px 16px;
    font-size: 14px;
    color: #2d3748;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-in-stock {
    background: #c6f6d5;
    color: #22543d;
}

.status-low-stock {
    background: #feebc8;
    color: #744210;
}

.status-out-of-stock {
    background: #fed7d7;
    color: #742a2a;
}

.status-pending {
    background: #e6fffa;
    color: #234e52;
}

.status-processing {
    background: #bee3f8;
    color: #2c5282;
}

.status-in-transit {
    background: #d6bcfa;
    color: #44337a;
}

.status-delivered {
    background: #c6f6d5;
    color: #22543d;
}

.alert-cell {
    color: #e53e3e;
    font-weight: 600;
}

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

    .table-wrapper {
        overflow-x: scroll;
    }

    .table-controls {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }
}
