/* Styles for the Today's Inventory Shopping List */
.codicts-todays-inventory-list-container {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    font-family: sans-serif;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.codicts-todays-inventory-list-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.codicts-todays-inventory-list-container p {
    color: #777;
    text-align: center;
    padding: 20px;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.inventory-table th,
.inventory-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.inventory-table thead th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    font-size: 12px;
}

/* Right-align numeric columns for better readability */
.inventory-table th:nth-child(2), /* Quantity */
.inventory-table th:nth-child(5), /* Our Price */
.inventory-table th:nth-child(6), /* Total Price */
.inventory-table td[data-label="Quantity"],
.inventory-table td[data-label="Our Price"],
.inventory-table td[data-label="Total Price"] {
    text-align: right;
}

.inventory-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Style for rows that have been ordered */
.inventory-table tbody tr.item-ordered {
    background-color: #f8f8f8;
    color: #999;
}

.inventory-table tbody tr.item-ordered td {
    text-decoration: line-through;
}

.inventory-table td a {
    color: #0073e6;
    text-decoration: none;
    font-weight: 500;
}

.inventory-table td a:hover {
    text-decoration: underline;
}

.inventory-table td[data-label="Total Price"] {
    font-weight: bold;
    color: #28a745;
}

/* Styles for the status badge */
.inventory-table td[data-label="Status"] {
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important; /* Remove strikethrough from badge */
}

.status-badge.status-pending {
    background-color: #ffebee;
    color: #d32f2f;
}

.status-badge.status-ordered {
    background-color: #e8f5e9;
    color: #4caf50;
}


/* Styles for the table footer (Grand Total) */
.inventory-table tfoot .totals-container-cell {
    padding: 0;
}

.totals-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 40px;
    padding: 15px;
    background-color: #f5f5f5;
}

.total-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.total-label {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.total-amount {
    font-size: 18px;
    font-weight: bold;
}

.spent-amount {
    color: #4caf50; /* Green for money spent */
}

.pending-amount {
    color: #d32f2f; /* Red for money pending */
}

.grand-total-amount {
    color: #333;
}


/* Responsive Styles for Mobile */
@media screen and (max-width: 768px) {
    .inventory-table thead {
        /* Hide the table header on small screens */
        display: none;
    }

    .inventory-table tr {
        /* Make each row a block-level card */
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .inventory-table tfoot tr {
       display: block;
       border: none;
       box-shadow: none;
       margin-bottom: 0;
    }
    
    .totals-wrapper {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        background: none;
        padding: 0;
    }
    
    .total-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        background-color: #f9f9f9;
    }
    
    .total-item.grand-total-item {
        background-color: #f0f0f0;
    }
    
    .total-label {
        font-size: 14px;
    }
    
    .total-amount {
        font-size: 16px;
    }


    .inventory-table td {
        /* Make each cell a full-width block */
        display: block;
        text-align: right; /* Align value to the right */
        padding-left: 50%; /* Make space for the label */
        position: relative;
        border-bottom: 1px solid #f0f0f0;
    }

    .inventory-table tr:last-of-type td:last-of-type,
    .inventory-table tfoot tr td {
        border-bottom: none;
    }

    .inventory-table td::before {
        /* Use the data-label attribute as the cell's label */
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #555;
    }

    .inventory-table td[data-label="Status"] {
        text-align: right; /* Re-align status badge content on mobile */
    }
}
