/**
 * Inventory & Assessment Tracking Styles
 */

/* Statistics Cards */
.inventory-stats {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #ddd;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
}

.stat-card span {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

/* Status-specific colors */
.stat-card.complete {
    background: #e8f5e9;
    border-color: #4caf50;
}

.stat-card.complete span {
    color: #2e7d32;
}

.stat-card.in-progress {
    background: #fff3e0;
    border-color: #ff9800;
}

.stat-card.in-progress span {
    color: #e65100;
}

.stat-card.needs-attention {
    background: #ffebee;
    border-color: #f44336;
}

.stat-card.needs-attention span {
    color: #c62828;
}

.stat-card.review-due {
    background: #e3f2fd;
    border-color: #2196f3;
}

.stat-card.review-due span {
    color: #1565c0;
}

/* Inventory Table */
#inventoryTable {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: 0.9em;
}

#inventoryTable th {
    background: #2c3e50;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#inventoryTable td {
    padding: 10px 8px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

#inventoryTable tr:hover {
    background: #f8f9fa;
}

#inventoryTable tbody tr {
    transition: background-color 0.2s;
}

/* Hazard Badges */
.hazard-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ff9800;
    color: white;
    border-radius: 3px;
    font-size: 0.85em;
    margin-right: 4px;
    margin-bottom: 2px;
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.status-complete {
    background: #4caf50;
    color: white;
}

.status-in-progress {
    background: #ff9800;
    color: white;
}

.status-needs {
    background: #f44336;
    color: white;
}

.status-not-required {
    background: #9e9e9e;
    color: white;
}

.status-review-due {
    background: #2196f3;
    color: white;
}

/* Small action buttons for table */
button.small {
    padding: 4px 8px;
    font-size: 0.85em;
    margin: 2px;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .inventory-stats {
        flex-direction: row;
    }

    .stat-card {
        min-width: 120px;
    }

    #inventoryTable {
        font-size: 0.85em;
    }

    #inventoryTable th,
    #inventoryTable td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .inventory-stats {
        flex-direction: column;
    }

    .stat-card {
        min-width: 100%;
    }

    /* Stack table cells on mobile */
    #inventoryTable thead {
        display: none;
    }

    #inventoryTable tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }

    #inventoryTable td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
    }

    #inventoryTable td::before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 120px;
    }
}

/* Loading state */
#inventoryTableBody tr td {
    text-align: left;
}

#inventoryTableBody tr:first-child td[colspan] {
    text-align: center;
}

/* Scrollable table container */
#inventoryTableContainer {
    overflow-x: auto;
    margin-top: 20px;
}
