/**
 * Inventory Management Styles
 * 
 * Provides comprehensive styling for inventory management interface including:
 * - Dashboard layout and tabs
 * - Search and filter functionality
 * - Modals and forms
 * - Batch management interface
 * 
 * Table of Contents:
 * 1. CSS Variables & Defaults
 * 2. Dashboard Layout
 * 3. Tab Navigation
 * 4. Search & Filter Bar
 * 5. Buttons
 * 6. Modals & Forms
 * 7. Inventory Item Forms
 * 8. Batch Management Forms
 * 9. Batch Details Display
 * 10. Messages & States
 * 11. Responsive Design
 */

/* ============================================================
   1. CSS VARIABLES & DEFAULTS
   ============================================================ */
:root {
    --primary-color: #1EC677;
    --primary-dark: #189060;
    --primary-light: #4dd99c;
    --text-color: #23282d;
    --la-field-border-color: #e5e5e5;
    --bg-light: #f8f9fa;
    --shadow: 0 2px 8px rgba(30, 198, 119, 0.15);
}

* {
    box-sizing: border-box;
}

/* ============================================================
   2. DASHBOARD LAYOUT
   ============================================================ */
.inventory-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.inventory-dashboard h2 {
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

.inventory-dashboard .button {
    margin: 0;
}

/* ============================================================
   3. TAB NAVIGATION
   ============================================================ */
.dashboard-tabs {
    display: flex;
    gap: 12px;
    background: #fff;
    border-bottom: 2px solid var(--la-field-border-color);
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow);
}

.dashboard-tabs .tab-button {
    padding: 15px 25px;
    background: #fff;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.dashboard-tabs .tab-button:hover {
    color: var(--primary-color);
    background: rgba(30, 198, 119, 0.05);
}

.dashboard-tabs .tab-button.active {
    color: var(--primary-color);
    background: rgba(30, 198, 119, 0.1);
}

.dashboard-tabs .tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Tab Content Container */
.dashboard-content {
    background: #fff;
    border: 1px solid var(--la-field-border-color);
    border-radius: 0 8px 8px 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-pane {
    display: none !important;
    padding: 25px;
}

.tab-pane.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

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

/* Hide filtered rows */
table tbody tr.hidden {
    display: none;
}

/* ============================================================
   4. SEARCH & FILTER BAR
   ============================================================ */
.search-filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-group {
    flex: 1;
    min-width: 250px;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    padding: 0 12px;
    transition: all 0.3s ease;
}

.search-input-group span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: var(--text-color);
}

.search-input-group .filter-select {
    
    border-radius: 0;
    padding: 8px 10px;
    background:none;
    font-size: 13px;
    flex-shrink: 0;
    margin: 0;
    margin-right: 5px;
    cursor: pointer;
    min-width: 0 !important;
    max-width: 75px;
    border:none;
    border-left: 1px solid var(--la-field-border-color);

}

.search-input-group .filter-select:hover {
    border-color: var(--primary-color);
}

.search-input-group .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 198, 119, 0.1);
}

.search-input-group input[type="text"] {
    border: none !important;
}

.search-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.1);
}

.search-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
    color: var(--text-color);
    min-width: 150px;
}

.search-input-group input::placeholder {
    color: #999;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    min-width: 150px;
    transition: all 0.3s ease;
    max-width: 300px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.1);
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.button {
    display: inline-block;
    padding: 10px 18px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 198, 119, 0.3);
}

.button:active {
    transform: translateY(0);
}

.button.button-secondary {
    background-color: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 16px;
}

.button.button-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.button.button-danger {
    background-color: #d9534f;
    color: #fff;
}

.button.button-danger:hover {
    background-color: #c9302c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 83, 79, 0.3);
}

.button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Button Loading Spinner - Inline spinner within button */
.button-loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: button-spinner 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes button-spinner {
    to { transform: rotate(360deg); }
}

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

/* ============================================================
   6. MODALS & FORMS
   ============================================================ */

/* Modal Overlay */
.inventory-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

/* Modal Container */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--la-field-border-color);
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Unified Modal Header */
.modal-header {
    margin: 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.modal-header .close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    border: none;
    background: none;
}

.modal-header .close:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

/* Form Structure */
.modal-content form {
    padding: 25px;
}

.form-table {
    width: 100%;
    margin-bottom: 20px;
}

.form-table th {
    text-align: left;
    padding: 10px 0;
    font-weight: 600;
    color: var(--text-color);
    width: 150px;
}

.form-table td {
    padding: 10px 0;
}

.form-table input[type="text"],
.form-table input[type="email"],
.form-table input[type="number"],
.form-table select,
.form-table textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-table input:focus,
.form-table select:focus,
.form-table textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.1);
}

.form-table textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================================
   7. INVENTORY ITEM FORMS
   ============================================================ */

/* Item Modal */
#inventory-item-modal .modal-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 520px;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

/* Item Form */
#inventory-item-form {
    padding: 20px;
}

#inventory-item-form .form-table {
    width: 100%;
    border-collapse: collapse;
}

#inventory-item-form .form-table tr {
    display: block;
    margin-bottom: 16px;
}

#inventory-item-form .form-table th,
#inventory-item-form .form-table td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
}

#inventory-item-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

#inventory-item-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--la-field-border-color);
    background: var(--bg-light);
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s ease;
}

#inventory-item-form input[type="text"]::placeholder {
    color: #9aa0a6;
}

#inventory-item-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.15);
}

#inventory-item-form .button-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 10px;
}

#inventory-item-form .button-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

#inventory-item-form .button-primary:active {
    transform: translateY(1px);
}

#inventory-item-form .form-group {
    margin-bottom: 16px;
}

.form-actions .btn-primary {
    border: none !important;
}

/* ============================================================
   8. BATCH MANAGEMENT FORMS
   ============================================================ */

/* Batch Form Container */
#inventory-batch-form {
    padding: 20px;
    color: var(--text-color);
}

/* Batch Name Input */
#inventory-batch-form .form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

#inventory-batch-form .form-table tr {
    display: block;
}

#inventory-batch-form .form-table th,
#inventory-batch-form .form-table td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
}

#inventory-batch-form .form-table th {
    margin-bottom: 6px;
}

#inventory-batch-form label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

#inventory-batch-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--la-field-border-color);
    background: var(--bg-light);
    font-size: 14px;
    transition: all 0.2s ease;
}

#inventory-batch-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.15);
}

#inventory-batch-form > .form-table th,
#inventory-batch-form > .form-table tr {
    background: none !important;
}

/* Batch Items Section Header */
#batch-items-section {
    margin-top: 10px;
}

#batch-items-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-color);
}

/* Batch Items Table */
#batch-items-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--la-field-border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

#batch-items-table thead th {
    background: var(--bg-light);
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border-bottom: 1px solid var(--la-field-border-color);
    text-align: left;
}

#batch-items-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--la-field-border-color);
    vertical-align: middle;
}

#batch-items-table tbody tr:last-child td {
    border-bottom: none;
}

#batch-items-table input,
#batch-items-table select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--la-field-border-color);
    background: var(--bg-light);
}

#batch-items-table input:focus,
#batch-items-table select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

/* Add Item Button */
#add-batch-item-row {
    margin-top: 8px;
    background: transparent;
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#add-batch-item-row:hover {
    background: rgba(30, 198, 119, 0.08);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

/* Remove Item Button */
#inventory-batch-form .remove-batch-item-row {
    background: transparent;
    border: 1px solid #e55353;
    color: #e55353;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#inventory-batch-form .remove-batch-item-row:hover {
    background: rgba(229, 83, 83, 0.1);
    border-color: #cc3d3d;
    color: #cc3d3d;
}

#inventory-batch-form .remove-batch-item-row:active {
    transform: scale(0.96);
}

#inventory-batch-form .remove-batch-item-row:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 83, 83, 0.25);
}

#inventory-batch-form .remove-batch-item-row:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Submit Button */
#inventory-batch-form .button-primary {
    margin-top: 20px;
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.1s ease;
}

#inventory-batch-form .button-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

#inventory-batch-form .button-primary:active {
    transform: translateY(1px);
}

/* ============================================================
   9. BATCH DETAILS DISPLAY
   ============================================================ */

/* View Batch Table Container */
#view-batch-content .widefat {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#view-batch-content .widefat tr {
    border-bottom: 1px solid var(--la-field-border-color);
}

#view-batch-content .widefat tr:last-child {
    border-bottom: none;
}

#view-batch-content .widefat th {
    width: 180px;
    padding: 14px 16px;
    background: var(--bg-light);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    vertical-align: top;
    border-right: 1px solid var(--la-field-border-color);
    white-space: nowrap;
}

#view-batch-content .widefat td {
    padding: 14px 16px;
    font-size: 14px;
    color: #444;
    vertical-align: top;
}

#view-batch-content .widefat ul {
    margin: 0;
    padding-left: 18px;
}

#view-batch-content .widefat li {
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

#view-batch-content .widefat li:last-child {
    margin-bottom: 0;
}

#view-batch-content .widefat td:first-letter {
    text-transform: none;
}

/* Batch Details Modal */
#batch-details-modal .modal-content {
    max-width: 700px;
}

.batch-details-table,
.inventory-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.batch-details-table tr {
    border-bottom: 1px solid var(--la-field-border-color);
}

.batch-details-table th {
    padding: 12px 0;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--bg-light);
    width: 40%;
}

.batch-details-table td {
    padding: 12px 0;
    color: var(--text-color);
    padding-left: 15px;
}

.inventory-items-table thead {
    background-color: var(--bg-light);
}

.inventory-items-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--la-field-border-color);
}

.inventory-items-table td {
    padding: 12px 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--la-field-border-color);
}

.inventory-items-table tbody tr:hover {
    background-color: var(--bg-light);
}

#batch-details-modal h4 {
    color: var(--text-color);
    margin: 20px 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

#batch-details-content .error-message {
    background-color: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c33;
}

/* View Batch Modal */
#view-batch-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

#view-batch-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--la-field-border-color);
    background-color: #fff;
}

#view-batch-modal .modal-body {
    padding: 25px;
}

.batch-details-container {
    padding: 0;
}

.batch-details-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.batch-details-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

.batch-details-info {
    margin-bottom: 30px;
}

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

.details-table tr {
    border-bottom: 1px solid var(--la-field-border-color);
}

.details-table tr:last-child {
    border-bottom: none;
}

.details-table .label {
    font-weight: 600;
    color: var(--text-color);
    padding: 12px 0;
    width: 30%;
    vertical-align: top;
}

.details-table .value {
    padding: 12px 15px;
    color: var(--text-color);
}

.batch-items-section {
    margin-top: 25px;
}

.batch-items-section h5 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.items-details-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.items-details-table thead {
    background-color: var(--bg-light);
}

.items-details-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--la-field-border-color);
}

.items-details-table td {
    padding: 12px 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--la-field-border-color);
}

.items-details-table tbody tr:hover {
    background-color: var(--bg-light);
}

.items-details-table tr.mismatch td {
    background-color: #ffeaa7;
    font-weight: 500;
}

/* ============================================================
   10. MESSAGES & STATES
   ============================================================ */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 30px 20px;
    color: var(--primary-color);
    font-weight: 500;
}

/* Error Message */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #ffcdd2;
    border-left: 4px solid #c62828;
}

/* Success Message */
.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #2e7d32;
}

/* ============================================================
   11. RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
    .inventory-dashboard {
        padding: 15px;
    }

    .dashboard-tabs {
        flex-wrap: wrap;
        border-bottom: 1px solid var(--la-field-border-color);
    }

    .dashboard-tabs .tab-button {
        flex: 1;
        min-width: 150px;
        padding: 12px 15px;
        font-size: 13px;
    }

    .search-filter-bar {
        flex-direction: column;
    }

    .search-input-group,
    .filter-select {
        width: 100%;
        min-width: auto;
    }

    .inventory-table {
        font-size: 12px;
    }

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

    .modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .form-table th {
        width: 100px;
        font-size: 13px;
    }

    .table-actions {
        flex-direction: column !important;
    }

    .table-actions .button {
        width: 100%;
    }

    .batch-item .batch-meta {
        flex-direction: column;
        gap: 5px;
    }

    .batch-item .batch-actions {
        flex-direction: column;
    }

    .batch-item .batch-actions .button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    #batch-items-table thead {
        display: none;
    }

    #batch-items-table tbody tr {
        display: block;
        border-bottom: 1px solid var(--la-field-border-color);
        padding: 8px 0;
    }

    #batch-items-table tbody td {
        display: block;
        width: 100%;
        padding: 6px 10px;
    }

    #view-batch-content .widefat,
    #view-batch-content .widefat tr,
    #view-batch-content .widefat th,
    #view-batch-content .widefat td {
        display: block;
        width: 100%;
    }

    #view-batch-content .widefat th {
        border-right: none;
        border-bottom: 1px solid var(--la-field-border-color);
        background: var(--bg-light);
    }

    #view-batch-content .widefat td {
        padding-top: 10px;
    }
}

@media (max-width: 480px) {
    #inventory-item-modal .modal-content {
        margin: 0 12px;
    }
}

/* Warehouse Actions (Batch List) */
.warehouse-actions {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.warehouse-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--la-field-border-color);
    /* border-radius: 8px; */
    box-shadow: var(--shadow);
}

.warehouse-selector label {
    font-weight: 600;
    margin-right: 10px;
    color: var(--text-color);
}

.warehouse-selector select {
    padding: 10px 12px;
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    min-width: 200px;
    font-size: 14px;
}

.assigned-batches {
    background: #fff;
    border: 1px solid var(--la-field-border-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.batch-item {
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: var(--bg-light);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.batch-item:hover {
    box-shadow: var(--shadow);
}

.batch-item h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 15px;
}

.batch-item .batch-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 13px;
    flex-wrap: wrap;
}

.batch-item .batch-meta span {
    color: #666;
}

.batch-item .batch-actions {
    display: flex;
    gap: 10px;
}

.inventory-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.inventory-dashboard h2 {
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Tab Navigation */
.dashboard-tabs {
    display: flex;
    gap: 12px;
    background: #fff;
    border-bottom: 2px solid var(--la-field-border-color);
    /* margin-bottom: 30px; */
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow);
}

.dashboard-tabs .tab-button {
    padding: 15px 25px;
    background: #fff;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.dashboard-tabs .tab-button:hover {
    color: var(--primary-color);
    background: rgba(30, 198, 119, 0.05);
}

.dashboard-tabs .tab-button.active {
    color: var(--primary-color);
    background: rgba(30, 198, 119, 0.1);
}

.dashboard-tabs .tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Tab Content */
.dashboard-content {
    background: #fff;
    border: 1px solid var(--la-field-border-color);
    border-radius: 0 8px 8px 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-pane {
    display: none !important;
    padding: 25px;
}

.tab-pane.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

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

/* Hidden rows during filtering */
table tbody tr.hidden {
    display: none;
}

/* Search and Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-group {
    flex: 1;
    min-width: 250px;
    max-width: 25%;
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    padding: 0 12px;
    transition: all 0.3s ease;
}
.search-input-group input[type="text"] {
   border:none !important
}

.search-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.1);
}

.search-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
    color: var(--text-color);
}

.search-input-group input::placeholder {
    color: #999;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    min-width: 150px;
    transition: all 0.3s ease;
    max-width: 300px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.1);
}

/* Table Styling - Now in shared-tables.css for consistency
   Kept for reference: .inventory-table { width, border-collapse, etc }
   Individual table styling removed - see shared-tables.css
*/

/* Pagination - Now in shared-tables.css for consistency */

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 18px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 198, 119, 0.3);
}

.button:active {
    transform: translateY(0);
}

.button.button-secondary {
    background-color: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 16px;
}

.button.button-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Modal */
.inventory-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--la-field-border-color);
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Unified Modal Header Styling */
.modal-header {
    margin: 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.modal-header .close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    border: none;
    background: none;
}

.modal-header .close:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.modal-content form {
    padding: 25px;
}

.form-table {
    width: 100%;
    margin-bottom: 20px;
}

.form-table th {
    text-align: left;
    padding: 10px 0;
    font-weight: 600;
    color: var(--text-color);
    width: 150px;
}

.form-table td {
    padding: 10px 0;
}

.form-table input[type="text"],
.form-table input[type="email"],
.form-table input[type="number"],
.form-table select,
.form-table textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-table input:focus,
.form-table select:focus,
.form-table textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.1);
}

.form-table textarea {
    resize: vertical;
    min-height: 100px;
}

/* Status Badge - Now in shared-tables.css for consistency */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Warehouse Actions */
.warehouse-actions {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.warehouse-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--la-field-border-color);
    /* border-radius: 8px; */
    box-shadow: var(--shadow);
}

.warehouse-selector label {
    font-weight: 600;
    margin-right: 10px;
    color: var(--text-color);
}

.warehouse-selector select {
    padding: 10px 12px;
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    min-width: 200px;
    font-size: 14px;
}

.assigned-batches {
    background: #fff;
    border: 1px solid var(--la-field-border-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.batch-item {
    border: 1px solid var(--la-field-border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: var(--bg-light);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.batch-item:hover {
    box-shadow: var(--shadow);
}

.batch-item h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 15px;
}

.batch-item .batch-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 13px;
    flex-wrap: wrap;
}

.batch-item .batch-meta span {
    color: #666;
}

.batch-item .batch-actions {
    display: flex;
    gap: 10px;
}

/* Loading and Messages */
.loading {
    text-align: center;
    padding: 30px 20px;
    color: var(--primary-color);
    font-weight: 500;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #ffcdd2;
    border-left: 4px solid #c62828;
}

.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #2e7d32;
}

/* Responsive Design */
@media (max-width: 768px) {
    .inventory-dashboard,
    .warehouse-actions {
        padding: 15px;
    }

    .dashboard-tabs {
        flex-wrap: wrap;
        border-bottom: 1px solid var(--la-field-border-color);
    }

    .dashboard-tabs .tab-button {
        flex: 1;
        min-width: 150px;
        padding: 12px 15px;
        font-size: 13px;
    }

    .search-filter-bar {
        flex-direction: column;
    }

    .search-input-group,
    .filter-select {
        width: 100%;
        min-width: auto;
    }

    .inventory-table {
        font-size: 12px;
    }

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

    .modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .form-table th {
        width: 100px;
        font-size: 13px;
    }

    .table-actions {
        flex-direction: column !important;
    }

    .table-actions .button {
        width: 100%;
    }

    .batch-item .batch-meta {
        flex-direction: column;
        gap: 5px;
    }

    .batch-item .batch-actions {
        flex-direction: column;
    }

    .batch-item .batch-actions .button {
        width: 100%;
    }
}


/* Modal content base */
#inventory-item-modal .modal-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 520px;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

/* All modal headers use unified styling (see .modal-header above) */

/* Form wrapper */
#inventory-item-form {
    padding: 20px;
}

/* Remove table look */
#inventory-item-form .form-table {
    width: 100%;
    border-collapse: collapse;
}

#inventory-item-form .form-table tr {
    display: block;
    margin-bottom: 16px;
}

#inventory-item-form .form-table th,
#inventory-item-form .form-table td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
}

/* Labels */
#inventory-item-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

/* Inputs */
#inventory-item-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--la-field-border-color);
    background: var(--bg-light);
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s ease;
}

#inventory-item-form input[type="text"]::placeholder {
    color: #9aa0a6;
}

/* Focus state */
#inventory-item-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.15);
}

/* Submit button */
#inventory-item-form .button-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

/* Button hover */
#inventory-item-form .button-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Button active */
#inventory-item-form .button-primary:active {
    transform: translateY(1px);
}

/* Button alignment */
#inventory-item-form .button-primary {
    margin-top: 10px;
}
#inventory-item-form .form-group {
    margin-bottom: 16px;
}

/* Responsive safety */
@media (max-width: 480px) {
    #inventory-item-modal .modal-content {
        margin: 0 12px;
    }
}

.form-actions .btn-primary{
    border:none !important;
}

/* ===============================
   Inventory Batch Form – Base
================================ */
#inventory-batch-form {
    padding: 20px;
    color: var(--text-color);
}

/* ===============================
   Batch Name (Top Form Table)
================================ */
#inventory-batch-form .form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

#inventory-batch-form .form-table tr {
    display: block;
}

#inventory-batch-form .form-table th,
#inventory-batch-form .form-table td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
}

#inventory-batch-form .form-table th {
    margin-bottom: 6px;
}

#inventory-batch-form label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

/* Input field */
#inventory-batch-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--la-field-border-color);
    background: var(--bg-light);
    font-size: 14px;
    transition: all 0.2s ease;
}

#inventory-batch-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 198, 119, 0.15);
}

/* ===============================
   Add Items Section
================================ */
#batch-items-section {
    margin-top: 10px;
}

#batch-items-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-color);
}

/* ===============================
   Items Table
================================ */
#batch-items-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--la-field-border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Header */
#batch-items-table thead th {
    background: var(--bg-light);
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border-bottom: 1px solid var(--la-field-border-color);
    text-align: left;
}

/* Body cells */
#batch-items-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--la-field-border-color);
    vertical-align: middle;
}

#batch-items-table tbody tr:last-child td {
    border-bottom: none;
}

/* Inputs inside table */
#batch-items-table input,
#batch-items-table select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--la-field-border-color);
    background: var(--bg-light);
}

#batch-items-table input:focus,
#batch-items-table select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

/* ===============================
   Add Item Button
================================ */
#add-batch-item-row {
    margin-top: 8px;
    background: transparent;
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#add-batch-item-row:hover {
    background: rgba(30, 198, 119, 0.08);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

/* ===============================
   Submit Button (Create Batch)
================================ */
#inventory-batch-form .button-primary {
    margin-top: 20px;
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.1s ease;
}

#inventory-batch-form .button-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

#inventory-batch-form .button-primary:active {
    transform: translateY(1px);
}

/* ===============================
   Responsive Safety
================================ */
@media (max-width: 600px) {
    #batch-items-table thead {
        display: none;
    }

    #batch-items-table tbody tr {
        display: block;
        border-bottom: 1px solid var(--la-field-border-color);
        padding: 8px 0;
    }

    #batch-items-table tbody td {
        display: block;
        width: 100%;
        padding: 6px 10px;
    }
}

#inventory-batch-form > .form-table th, #inventory-batch-form > .form-table tr {
    background: none !important;
}

/* ===============================
   Remove Batch Item Button
================================ */
#inventory-batch-form .remove-batch-item-row {
    background: transparent;
    border: 1px solid #e55353;
    color: #e55353;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Hover */
#inventory-batch-form .remove-batch-item-row:hover {
    background: rgba(229, 83, 83, 0.1);
    border-color: #cc3d3d;
    color: #cc3d3d;
}

/* Active */
#inventory-batch-form .remove-batch-item-row:active {
    transform: scale(0.96);
}

/* Focus (accessibility) */
#inventory-batch-form .remove-batch-item-row:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 83, 83, 0.25);
}

/* Disabled state (optional, if JS applies disabled attr) */
#inventory-batch-form .remove-batch-item-row:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===============================
   View Batch Table – Base
================================ */
#view-batch-content .widefat {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ===============================
   Table Rows
================================ */
#view-batch-content .widefat tr {
    border-bottom: 1px solid var(--la-field-border-color);
}

#view-batch-content .widefat tr:last-child {
    border-bottom: none;
}

/* ===============================
   Table Headers (Left Column)
================================ */
#view-batch-content .widefat th {
    width: 180px;
    padding: 14px 16px;
    background: var(--bg-light);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    vertical-align: top;
    border-right: 1px solid var(--la-field-border-color);
    white-space: nowrap;
}

/* ===============================
   Table Data (Right Column)
================================ */
#view-batch-content .widefat td {
    padding: 14px 16px;
    font-size: 14px;
    color: #444;
    vertical-align: top;
}

/* ===============================
   Items List Styling
================================ */
#view-batch-content .widefat ul {
    margin: 0;
    padding-left: 18px;
}

#view-batch-content .widefat li {
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

#view-batch-content .widefat li:last-child {
    margin-bottom: 0;
}

/* ===============================
   Highlight Important Values
================================ */
#view-batch-content .widefat td:first-letter {
    text-transform: none;
}

/* ===============================
   Responsive Handling
================================ */
@media (max-width: 600px) {
    #view-batch-content .widefat,
    #view-batch-content .widefat tr,
    #view-batch-content .widefat th,
    #view-batch-content .widefat td {
        display: block;
        width: 100%;
    }

    #view-batch-content .widefat th {
        border-right: none;
        border-bottom: 1px solid var(--la-field-border-color);
        background: var(--bg-light);
    }

    #view-batch-content .widefat td {
        padding-top: 10px;
    }
}
/* Batch Details Modal Styles */
#batch-details-modal .modal-content {
    max-width: 700px;
}

.batch-details-table,
.inventory-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.batch-details-table tr {
    border-bottom: 1px solid var(--la-field-border-color);
}

.batch-details-table th {
    padding: 12px 0;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--bg-light);
    width: 40%;
}

.batch-details-table td {
    padding: 12px 0;
    color: var(--text-color);
    padding-left: 15px;
}

.inventory-items-table thead {
    background-color: var(--bg-light);
}

.inventory-items-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--la-field-border-color);
}

.inventory-items-table td {
    padding: 12px 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--la-field-border-color);
}

.inventory-items-table tbody tr:hover {
    background-color: var(--bg-light);
}

#batch-details-modal h4 {
    color: var(--text-color);
    margin: 20px 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

#batch-details-content .error-message {
    background-color: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c33;
}

/* View Batch Details Modal Styles */
#view-batch-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

#view-batch-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--la-field-border-color);
    background-color: #fff;
}

/* view-batch-modal uses unified modal-header styling */

#view-batch-modal .modal-body {
    padding: 25px;
}

.batch-details-container {
    padding: 0;
}

.batch-details-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.batch-details-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

.batch-details-info {
    margin-bottom: 30px;
}

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

.details-table tr {
    border-bottom: 1px solid var(--la-field-border-color);
}

.details-table tr:last-child {
    border-bottom: none;
}

.details-table .label {
    font-weight: 600;
    color: var(--text-color);
    padding: 12px 0;
    width: 30%;
    vertical-align: top;
}

.details-table .value {
    padding: 12px 15px;
    color: var(--text-color);
}

.batch-items-section {
    margin-top: 25px;
}

.batch-items-section h5 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.items-details-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.items-details-table thead {
    background-color: var(--bg-light);
}

.items-details-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--la-field-border-color);
}

.items-details-table td {
    padding: 12px 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--la-field-border-color);
}

.items-details-table tbody tr:hover {
    background-color: var(--bg-light);
}

.items-details-table tr.mismatch td {
    background-color: #ffeaa7;
    font-weight: 500;
}