/* =========================================
   PAGE HEADER
========================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
    color: #243b2a;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: #706b61;
}


/* =========================================
   SUMMARY GRID
========================================= */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.summary-card {
    background: #ffffff;
    border: 1px solid #e5e8df;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.summary-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #e6eee2;
    color: #3f6044;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.summary-icon.warning {
    background: #f7edd5;
    color: #9a6f16;
}

.summary-icon.danger {
    background: #f6dfdc;
    color: #a34c3f;
}

.summary-card span {
    display: block;
    font-size: 13px;
    color: #706b61;
    margin-bottom: 4px;
}

.summary-card strong {
    display: block;
    color: #243b2a;
    font-size: 23px;
}


/* =========================================
   CONTENT CARD
========================================= */

.content-card {
    background: #ffffff;
    border: 1px solid #e5e8df;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 22px;
    border-bottom: 1px solid #e8ebe5;
}

.card-header h2 {
    margin: 0 0 5px;
    color: #243b2a;
    font-size: 19px;
}

.card-header p {
    margin: 0;
    color: #706b61;
    font-size: 14px;
}


/* =========================================
   FILTERS
========================================= */

.filter-card {
    padding: 20px;
}

.filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-field label {
    font-size: 13px;
    font-weight: 600;
    color: #243b2a;
}

.filter-field input,
.filter-field select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d9ded5;
    border-radius: 8px;
    background: #ffffff;
    color: #2f352d;
    outline: none;
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: #6f8b6c;
    box-shadow: 0 0 0 3px rgba(111, 139, 108, 0.12);
}

.filter-actions {
    display: flex;
    gap: 8px;
}


/* =========================================
   BUTTONS
========================================= */

.btn {
    height: 42px;
    border: none;
    border-radius: 8px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s ease;
}

.btn-primary {
    background: #3f6044;
    color: #ffffff;
}

.btn-primary:hover {
    background: #243b2a;
}

.btn-secondary {
    background: #eef1eb;
    color: #3f6044;
}

.btn-secondary:hover {
    background: #e1e7de;
}

.btn-small {
    height: 36px;
    padding: 0 11px;
    font-size: 12px;
}


/* =========================================
   TABLE
========================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.admin-table th {
    background: #f7f8f5;
    color: #5d655b;
    text-align: left;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e8df;
}

.admin-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #edf0eb;
    color: #2f352d;
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #fafbf8;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================
   PRODUCT CELL
========================================= */

.product-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-cell strong {
    color: #243b2a;
    font-size: 14px;
}

.product-cell span {
    color: #8a8f86;
    font-size: 12px;
}


/* =========================================
   SKU
========================================= */

.sku {
    background: #f1f4ed;
    color: #3f6044;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}


/* =========================================
   STOCK NUMBER
========================================= */

.stock-number {
    font-size: 16px;
}

.stock-good {
    color: #3f6044;
}

.stock-low {
    color: #a36c16;
}

.stock-out {
    color: #a34c3f;
}


/* =========================================
   STATUS BADGES
========================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.status-in {
    background: #e5efe3;
    color: #3f6044;
}

.status-low {
    background: #f7edd5;
    color: #956b18;
}

.status-out {
    background: #f5dfdc;
    color: #a34c3f;
}


/* =========================================
   EMPTY STATE
========================================= */

.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: #eef2eb;
    color: #6f8b6c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.empty-state h3 {
    margin: 0 0 7px;
    color: #243b2a;
}

.empty-state p {
    margin: 0;
    color: #706b61;
}


/* =========================================
   MODAL
========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(36, 59, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid #e7ebe4;
}

.modal-header h2 {
    margin: 0 0 5px;
    color: #243b2a;
    font-size: 20px;
}

.modal-header p {
    margin: 0;
    color: #706b61;
    font-size: 13px;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 7px;
    background: #f1f3ef;
    color: #596158;
    cursor: pointer;
}

.modal-close:hover {
    background: #e5e9e3;
}

.modal-body {
    padding: 22px;
}

.current-stock-box {
    background: #f1f4ed;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-stock-box span {
    color: #5d655b;
    font-size: 13px;
}

.current-stock-box strong {
    color: #243b2a;
    font-size: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #243b2a;
    font-size: 13px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    border: 1px solid #d9ded5;
    border-radius: 8px;
    outline: none;
    color: #2f352d;
}

.form-group input:focus {
    border-color: #6f8b6c;
    box-shadow: 0 0 0 3px rgba(111, 139, 108, 0.12);
}

.form-group small {
    display: block;
    margin-top: 7px;
    color: #858b82;
    font-size: 12px;
}

.modal-footer {
    padding: 15px 22px;
    background: #fafbf9;
    border-top: 1px solid #e7ebe4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

}


@media (max-width: 700px) {

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        grid-column: auto;
    }

    .filter-actions .btn {
        flex: 1;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .content-card {
        border-radius: 9px;
    }

}


/* =========================================
   MOBILE MODAL
========================================= */

@media (max-width: 500px) {

    .modal-overlay {
        padding: 10px;
    }

    .modal {
        max-height: 95vh;
        overflow-y: auto;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

}
