/**
 * Ziermann Machine Inventory Styles
 * Version: 1.0.0
 */

/* Container */
.ziermann-inventory {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Update timestamp */
.inventory-update-time {
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

/* Notice/Empty state */
.inventory-notice {
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.inventory-notice p {
    margin: 0;
    color: #495057;
}

/* Responsive table container */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table base styles */
.machine-inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

/* Header styles */
.machine-inventory-table thead {
    background-color: #1a365d;
    color: #ffffff;
}

.machine-inventory-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* BÖWE brand color */
.bowe-inventory .machine-inventory-table thead {
    background-color: #1a365d; /* Dark blue */
}

/* Sankosha brand color */
.sankosha-inventory .machine-inventory-table thead {
    background-color: #2d5a27; /* Forest green */
}

/* Cell styles */
.machine-inventory-table th,
.machine-inventory-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

/* First column (SAP number) */
.machine-inventory-table td:first-child {
    font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Mono", "Droid Sans Mono", monospace;
    font-size: 13px;
    white-space: nowrap;
}

/* Zebra striping */
.machine-inventory-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Hover effect */
.machine-inventory-table tbody tr:hover {
    background-color: #edf2f7;
}

/* Last row - no border */
.machine-inventory-table tbody tr:last-child td {
    border-bottom: none;
}

/* Options column - allow wrapping */
.machine-inventory-table td:last-child {
    max-width: 300px;
    word-wrap: break-word;
}

/* Mobile responsive - Cards layout */
@media screen and (max-width: 768px) {
    .ziermann-inventory {
        margin: 15px 0;
    }

    .machine-inventory-table {
        font-size: 13px;
        box-shadow: none;
    }

    /* Hide header on mobile */
    .machine-inventory-table thead {
        display: none;
    }

    /* Card layout for rows */
    .machine-inventory-table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .machine-inventory-table tbody tr:nth-child(even) {
        background-color: #fff;
    }

    .machine-inventory-table tbody tr:hover {
        background-color: #fff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    /* Cell as flex row */
    .machine-inventory-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
    }

    .machine-inventory-table tbody td:last-child {
        border-bottom: none;
    }

    /* Label from data attribute */
    .machine-inventory-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #4a5568;
        flex: 0 0 40%;
        padding-right: 10px;
    }

    /* Value styling */
    .machine-inventory-table tbody td {
        text-align: right;
        flex: 1;
    }

    .machine-inventory-table td:first-child {
        font-size: 14px;
        color: #1a365d;
        font-weight: 600;
        border-bottom: 2px solid #e2e8f0;
        background: #f8fafc;
        border-radius: 8px 8px 0 0;
    }

    .sankosha-inventory .machine-inventory-table td:first-child {
        color: #2d5a27;
    }

    .machine-inventory-table td:last-child {
        max-width: none;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .machine-inventory-table th,
    .machine-inventory-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .ziermann-inventory {
        page-break-inside: avoid;
    }

    .machine-inventory-table {
        box-shadow: none;
        font-size: 11px;
    }

    .machine-inventory-table thead {
        background-color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .machine-inventory-table th,
    .machine-inventory-table td {
        padding: 8px 10px;
    }

    .inventory-update-time {
        font-size: 10px;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .machine-inventory-table {
        background: #1a202c;
        color: #e2e8f0;
    }

    .machine-inventory-table tbody tr:nth-child(even) {
        background-color: #2d3748;
    }

    .machine-inventory-table tbody tr:hover {
        background-color: #4a5568;
    }

    .machine-inventory-table th,
    .machine-inventory-table td {
        border-bottom-color: #4a5568;
    }

    .inventory-notice {
        background: #2d3748;
        color: #e2e8f0;
    }
}
