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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e1e1e 0%, #1b1b1b 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.reload-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.reload-btn:hover {
    background: white;
    color: #c62828;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.reload-btn:active {
    transform: translateY(0);
}

.reload-btn.loading .reload-icon {
    animation: spin 1s linear infinite;
}

.loading {
    text-align: center;
    color: white;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: #ff4444;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

main {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.inventory-section,
.totals-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.inventory-section h2,
.totals-section h2 {
    color: #c62828;
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 3px solid #c62828;
    padding-bottom: 10px;
}

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

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

thead {
    background: linear-gradient(135deg, #BF360C 0%, #E64A19 100%);
}

thead th {
    padding: 15px;
    text-align: left;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

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

tbody tr:hover {
    background-color: #ffebee;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 15px;
    font-size: 1rem;
}

tbody td:first-child {
    font-weight: 600;
    color: #c62828;
}

tbody td:last-child {
    font-weight: 600;
    color: #333;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.total-card {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.total-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.4);
}

.total-label {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-value {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

#last-updated {
    font-weight: 600;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .inventory-section,
    .totals-section {
        padding: 20px;
    }

    thead th,
    tbody td {
        padding: 10px;
        font-size: 0.9rem;
    }

    .total-value {
        font-size: 2rem;
    }

    .totals-grid {
        grid-template-columns: 1fr;
    }
}

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

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .reload-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    thead th {
        padding: 8px;
        font-size: 0.75rem;
    }

    tbody td {
        padding: 8px;
        font-size: 0.85rem;
    }
}