/* =========================================================
   INVENTORY MANAGEMENT
   ========================================================= */

.inventory-page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.inventory-breadcrumb {
    margin-bottom: 8px;
    font-size: 13px;
    color: #7b8794;
}

.inventory-breadcrumb span {
    color: #1f7a4d;
    font-weight: 600;
}

.inventory-page-intro h2 {
    margin: 0;
    font-size: 26px;
    color: #172b22;
    font-weight: 700;
}

.inventory-page-intro p {
    margin: 7px 0 0;
    color: #7b8794;
    font-size: 14px;
}


/* =========================================================
   PRIMARY BUTTON
   ========================================================= */

.inventory-primary-button {
    border: none;
    background: #1f7a4d;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    white-space: nowrap;
}

.inventory-primary-button:hover {
    background: #17623d;
    transform: translateY(-1px);
}


/* =========================================================
   STATISTICS
   ========================================================= */

.inventory-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.inventory-stat-card {
    background: #ffffff;
    border: 1px solid #e7ece9;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.inventory-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf6ef;
    color: #1f7a4d;
    font-size: 20px;
    flex-shrink: 0;
}

.inventory-stat-content {
    min-width: 0;
}

.inventory-stat-content span {
    display: block;
    font-size: 12px;
    color: #7b8794;
    margin-bottom: 5px;
}

.inventory-stat-content strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    color: #172b22;
}


/* =========================================================
   RECORDS CARD
   ========================================================= */

.inventory-records-card {
    background: #ffffff;
    border: 1px solid #e7ece9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.inventory-records-header {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #edf0ee;
}

.inventory-section-label {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #172b22;
}

.inventory-export-button {
    border: 1px solid #d7e1db;
    background: #ffffff;
    color: #1f7a4d;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.inventory-export-button:hover {
    background: #f0f8f3;
}


/* =========================================================
   FILTERS
   ========================================================= */

.inventory-filters {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #edf0ee;
    background: #fbfcfb;
}

.inventory-search {
    position: relative;
    flex: 1;
}

.inventory-search input {
    width: 100%;
    height: 42px;
    border: 1px solid #dce4df;
    border-radius: 8px;
    padding: 0 14px;
    outline: none;
    font-size: 13px;
    color: #26352e;
    background: #ffffff;
}

.inventory-search input:focus {
    border-color: #1f7a4d;
    box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.08);
}

.inventory-filters select {
    height: 42px;
    min-width: 160px;
    border: 1px solid #dce4df;
    border-radius: 8px;
    padding: 0 12px;
    background: #ffffff;
    color: #34423a;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.inventory-filters select:focus {
    border-color: #1f7a4d;
}


/* =========================================================
   TABLE
   ========================================================= */

.inventory-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.inventory-table th {
    padding: 13px 18px;
    background: #f7f9f8;
    border-bottom: 1px solid #e5ebe7;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #68766e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.inventory-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #edf1ee;
    font-size: 13px;
    color: #3d4b44;
    vertical-align: middle;
}

.inventory-table tbody tr:hover {
    background: #fbfdfc;
}

.inventory-table tbody tr:last-child td {
    border-bottom: none;
}


/* Item name */

.inventory-table td:first-child {
    font-weight: 700;
    color: #1f7a4d;
}


/* =========================================================
   STATUS BADGES
   ========================================================= */

.inventory-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.inventory-status.available {
    background: #e8f6ee;
    color: #187044;
}

.inventory-status.low {
    background: #fff4df;
    color: #a56a00;
}

.inventory-status.out {
    background: #fdeaea;
    color: #b33a3a;
}


/* =========================================================
   ACTION BUTTONS
   ========================================================= */

.inventory-action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inventory-action-buttons button {
    width: 32px;
    height: 32px;
    border: 1px solid #dfe6e2;
    border-radius: 7px;
    background: #ffffff;
    color: #53635a;
    cursor: pointer;
    transition: 0.2s ease;
}

.inventory-action-buttons button:hover {
    border-color: #1f7a4d;
    color: #1f7a4d;
    background: #f3faf6;
}

.inventory-action-buttons .delete-button:hover {
    border-color: #d9534f;
    color: #d9534f;
    background: #fff5f5;
}


/* =========================================================
   EMPTY TABLE
   ========================================================= */

.inventory-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #7b8794;
}

.inventory-empty-state strong {
    display: block;
    margin-bottom: 6px;
    color: #425149;
}


/* =========================================================
   TABLE FOOTER / PAGINATION
   ========================================================= */

.inventory-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-top: 1px solid #edf0ee;
}

.inventory-record-count {
    font-size: 12px;
    color: #7b8794;
}

.inventory-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inventory-pagination button {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #dce4df;
    background: #ffffff;
    border-radius: 6px;
    color: #56645c;
    cursor: pointer;
    font-size: 12px;
}

.inventory-pagination button.active {
    background: #1f7a4d;
    border-color: #1f7a4d;
    color: #ffffff;
}


/* =========================================================
   MODAL
   ========================================================= */

.inventory-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 31, 24, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
}

.inventory-modal-overlay.active {
    display: flex;
}

.inventory-modal {
    width: min(620px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.inventory-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid #edf0ee;
}

.inventory-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #172b22;
}

.inventory-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    background: #f2f5f3;
    color: #53635a;
    border-radius: 7px;
    font-size: 20px;
    cursor: pointer;
}

.inventory-modal-close:hover {
    background: #e8eeea;
}


/* =========================================================
   FORM
   ========================================================= */

#inventoryForm {
    padding: 22px;
}

.inventory-form-group {
    margin-bottom: 16px;
}

.inventory-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.inventory-form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #425149;
}

.inventory-form-group input,
.inventory-form-group select,
.inventory-form-group textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dce4df;
    border-radius: 8px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 13px;
    color: #26352e;
    background: #ffffff;
    outline: none;
}

.inventory-form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.inventory-form-group input:focus,
.inventory-form-group select:focus,
.inventory-form-group textarea:focus {
    border-color: #1f7a4d;
    box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.08);
}


/* =========================================================
   MODAL ACTIONS
   ========================================================= */

.inventory-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.inventory-modal-actions button {
    padding: 10px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.inventory-cancel-button {
    border: 1px solid #dce4df;
    background: #ffffff;
    color: #56645c;
}

.inventory-save-button {
    border: none;
    background: #1f7a4d;
    color: #ffffff;
}

.inventory-save-button:hover {
    background: #17623d;
}


/* =========================================================
   VIEW MODAL
   ========================================================= */

.inventory-view-details {
    padding: 22px;
}

.inventory-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.inventory-detail-item {
    padding: 13px 14px;
    background: #f8faf9;
    border-radius: 8px;
}

.inventory-detail-item.full-width {
    grid-column: 1 / -1;
}

.inventory-detail-item span {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: #7b8794;
}

.inventory-detail-item strong {
    display: block;
    color: #27372f;
    font-size: 13px;
}

.inventory-view-footer {
    padding: 16px 22px;
    border-top: 1px solid #edf0ee;
    display: flex;
    justify-content: flex-end;
}

.inventory-view-footer button {
    border: 1px solid #dce4df;
    background: #ffffff;
    color: #53635a;
    padding: 9px 16px;
    border-radius: 7px;
    cursor: pointer;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .inventory-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 768px) {

    .inventory-page-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-primary-button {
        width: 100%;
    }

    .inventory-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .inventory-search {
        width: 100%;
    }

    .inventory-filters select {
        width: 100%;
    }

    .inventory-records-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-export-button {
        width: 100%;
    }

    .inventory-table-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

}


@media (max-width: 560px) {

    .inventory-stats-grid {
        grid-template-columns: 1fr;
    }

    .inventory-form-row {
        grid-template-columns: 1fr;
    }

    .inventory-detail-grid {
        grid-template-columns: 1fr;
    }

    .inventory-detail-item.full-width {
        grid-column: auto;
    }

    .inventory-modal {
        border-radius: 10px;
    }

}