﻿:root {
    --inv-primary: #2563eb;
    --inv-primary-dark: #1d4ed8;
    --inv-success: #16a34a;
    --inv-warning: #d97706;
    --inv-danger: #dc2626;
    --inv-purple: #7c3aed;
    --inv-cyan: #0891b2;
    --inv-text: #172033;
    --inv-muted: #697386;
    --inv-border: #e5eaf2;
    --inv-soft: #f8fafc;
    --inv-white: #fff;
    --inv-radius: 16px;
    --inv-shadow: 0 8px 25px rgba(15, 23, 42, .06);
}

/* Page shell */
.inventory-page,
.inventory-dashboard,
.inventory-form-page {
    color: var(--inv-text);
}

.inventory-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.inventory-page-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inventory-page-icon {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--inv-primary);
    background: #eaf2ff;
    font-size: 21px;
}

.inventory-page-title {
    margin: 0 0 3px;
    color: var(--inv-text);
    font-size: 25px;
    font-weight: 700;
}

.inventory-page-subtitle {
    margin: 0;
    color: var(--inv-muted);
    font-size: 13px;
}

.inventory-section-heading {
    margin: 0 0 14px;
    color: #8290a7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}

/* Buttons */
.inventory-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: all .2s ease;
}

.inventory-btn-primary {
    border-color: var(--inv-primary);
    color: #fff;
    background: var(--inv-primary);
    box-shadow: 0 7px 15px rgba(37, 99, 235, .18);
}

    .inventory-btn-primary:hover {
        border-color: var(--inv-primary-dark);
        color: #fff;
        background: var(--inv-primary-dark);
        transform: translateY(-1px);
    }

.inventory-btn-light {
    border-color: var(--inv-border);
    color: #526176;
    background: #fff;
}

    .inventory-btn-light:hover {
        border-color: #cbd5e1;
        color: var(--inv-primary);
        background: var(--inv-soft);
    }

.inventory-btn-danger {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff;
}

    .inventory-btn-danger:hover {
        color: #fff;
        background: var(--inv-danger);
    }

/* Dashboard hero */
.inventory-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 30px;
    border-radius: 20px;
    color: #fff;
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 26%), linear-gradient(135deg, #1d4ed8, #2563eb 55%, #0891b2);
    box-shadow: 0 16px 35px rgba(37, 99, 235, .20);
}

.inventory-hero-eyebrow {
    margin-bottom: 8px;
    color: rgba(255,255,255,.76);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.inventory-hero h1,
.inventory-hero h2 {
    margin: 0 0 7px;
    color: #fff;
    font-size: 30px;
    font-weight: 700;
}

.inventory-hero p {
    margin: 0;
    color: rgba(255,255,255,.80);
}

.inventory-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.inventory-hero .inventory-btn-light {
    border-color: rgba(255,255,255,.35);
    color: #fff;
    background: rgba(255,255,255,.13);
    backdrop-filter: blur(8px);
}

    .inventory-hero .inventory-btn-light:hover {
        color: var(--inv-primary-dark);
        background: #fff;
    }

/* KPI cards */
.inventory-metric-card {
    height: 100%;
    min-height: 145px;
    padding: 21px;
    border: 1px solid var(--inv-border);
    border-radius: var(--inv-radius);
    background: #fff;
    box-shadow: var(--inv-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .inventory-metric-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 30px rgba(15, 23, 42, .10);
    }

.inventory-metric-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.inventory-metric-label {
    margin-bottom: 9px;
    color: var(--inv-muted);
    font-size: 14px;
    font-weight: 500;
}

.inventory-metric-value {
    margin: 0;
    color: var(--inv-text);
    font-size: 29px;
    font-weight: 700;
    line-height: 1;
}

.inventory-metric-help {
    margin-top: 13px;
    color: #8a96a9;
    font-size: 12px;
}

.inventory-metric-icon,
.inventory-card-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    color: var(--inv-primary);
    background: #eaf2ff;
    font-size: 19px;
}

.inv-green {
    color: var(--inv-success);
    background: #eaf8ef;
}

.inv-orange {
    color: var(--inv-warning);
    background: #fff5df;
}

.inv-purple {
    color: var(--inv-purple);
    background: #f2ebff;
}

.inv-cyan {
    color: var(--inv-cyan);
    background: #e7f8fb;
}

.inv-red {
    color: var(--inv-danger);
    background: #ffeded;
}

/* Common cards */
.inventory-card {
    overflow: hidden;
    border: 1px solid var(--inv-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--inv-shadow);
}

.inventory-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 70px;
    padding: 17px 21px;
    border-bottom: 1px solid var(--inv-border);
    background: linear-gradient(180deg, #fff, #fbfcff);
}

.inventory-card-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

    .inventory-card-heading h5 {
        margin: 0 0 2px;
        color: var(--inv-text);
        font-size: 17px;
        font-weight: 650;
    }

    .inventory-card-heading p {
        margin: 0;
        color: var(--inv-muted);
        font-size: 12px;
    }

.inventory-card-body {
    padding: 24px;
}

.inventory-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 17px 24px;
    border-top: 1px solid var(--inv-border);
    background: #fbfcfe;
}

/* Forms */
.inventory-form-label {
    margin-bottom: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 600;
}

.inventory-required {
    margin-left: 2px;
    color: var(--inv-danger);
}

.inventory-page .form-control,
.inventory-page .form-select,
.inventory-form-page .form-control,
.inventory-form-page .form-select {
    min-height: 44px;
    border-color: var(--inv-border);
    border-radius: 10px;
    color: #263247;
    font-size: 14px;
    box-shadow: none;
}

    .inventory-page .form-control:focus,
    .inventory-page .form-select:focus,
    .inventory-form-page .form-control:focus,
    .inventory-form-page .form-select:focus {
        border-color: #8ab4ff;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
    }

.inventory-page textarea.form-control,
.inventory-form-page textarea.form-control {
    min-height: 105px;
    padding-top: 11px;
    resize: vertical;
}

.inventory-input-group .input-group-text {
    width: 44px;
    justify-content: center;
    border-color: var(--inv-border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    color: #7c8ba1;
    background: var(--inv-soft);
}

.inventory-input-group .form-control {
    border-left: 0;
    border-radius: 0 10px 10px 0;
}

.inventory-input-group:focus-within .input-group-text {
    border-color: #8ab4ff;
    color: var(--inv-primary);
}

.inventory-field-help {
    display: block;
    margin-top: 5px;
    color: #98a2b3;
    font-size: 11px;
}

.inventory-page .field-validation-error,
.inventory-form-page .field-validation-error {
    display: block;
    margin-top: 5px;
    color: var(--inv-danger);
    font-size: 12px;
}

.inventory-option-box {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--inv-border);
    border-radius: 12px;
    background: var(--inv-soft);
}

    .inventory-option-box .form-check-input {
        width: 18px;
        height: 18px;
        margin: 2px 0 0;
    }

.inventory-option-title {
    display: block;
    margin-bottom: 3px;
    color: #344054;
    font-size: 13px;
    font-weight: 650;
}

.inventory-option-description {
    margin: 0;
    color: var(--inv-muted);
    font-size: 12px;
}

/* Filters and search */
.inventory-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--inv-border);
    background: #fbfcfe;
}

.inventory-search {
    position: relative;
    min-width: 250px;
    flex: 1;
}

    .inventory-search i {
        position: absolute;
        top: 50%;
        left: 14px;
        z-index: 2;
        color: #94a3b8;
        transform: translateY(-50%);
    }

    .inventory-search .form-control {
        padding-left: 40px;
    }

/* Tables */
.inventory-table {
    width: 100%;
    margin: 0;
}

    .inventory-table thead th {
        padding: 13px 18px;
        border-top: 0;
        border-bottom: 1px solid var(--inv-border);
        color: #64748b;
        background: var(--inv-soft);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .5px;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .inventory-table tbody td {
        padding: 15px 18px;
        border-color: #f0f3f8;
        color: #334155;
        font-size: 13px;
        vertical-align: middle;
    }

    .inventory-table tbody tr:hover {
        background: #fbfdff;
    }

.inventory-item-name {
    display: block;
    color: #263247;
    font-weight: 650;
}

.inventory-item-code {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.inventory-empty-state {
    padding: 42px 20px !important;
    text-align: center;
}

    .inventory-empty-state i {
        display: block;
        margin-bottom: 9px;
        color: #b8c2d1;
        font-size: 29px;
    }

    .inventory-empty-state strong {
        display: block;
        color: #536176;
    }

    .inventory-empty-state span {
        display: block;
        margin-top: 4px;
        color: #98a3b5;
        font-size: 12px;
    }

/* Inventory sidebar headings: MASTERS, STOCK, REPORTS */
.main-sidebar
.nav-sidebar
.nav-treeview
.inventory-nav-header {
    display: flex !important;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 13px 8px 5px !important;
    padding: 8px 12px !important;
    color: #cbd5e1 !important;
    background: transparent !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: 1.3px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

    .main-sidebar
    .nav-sidebar
    .nav-treeview
    .inventory-nav-header::after {
        height: 1px;
        margin-left: 10px;
        background: rgba(203, 213, 225, 0.22);
        content: "";
        flex-grow: 1;
    }





/* Badges */
.inventory-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.inventory-badge-primary {
    color: #1d4ed8;
    background: #eaf2ff;
}

.inventory-badge-success {
    color: #15803d;
    background: #eaf8ef;
}

.inventory-badge-warning {
    color: #b45309;
    background: #fff5df;
}

.inventory-badge-danger {
    color: #b91c1c;
    background: #ffeded;
}

.inventory-badge-muted {
    color: #526176;
    background: #f1f5f9;
}

.inventory-badge-purple {
    color: #6d28d9;
    background: #f2ebff;
}

.inventory-quantity-in {
    color: var(--inv-success);
    font-weight: 650;
}

.inventory-quantity-out {
    color: var(--inv-danger);
    font-weight: 650;
}

/* Validation and messages */
.inventory-page .validation-summary-errors,
.inventory-form-page .validation-summary-errors {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    background: #fef2f2;
}

    .inventory-page .validation-summary-errors ul,
    .inventory-form-page .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

/* Responsive */
@media (max-width: 991.98px) {
    .inventory-hero-actions {
        justify-content: flex-start;
        margin-top: 18px;
    }
}

@media (max-width: 767.98px) {
    .inventory-page-header {
        align-items: flex-start;
    }

    .inventory-page-icon {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
    }

    .inventory-page-title {
        font-size: 21px;
    }

    .inventory-hero {
        padding: 23px 20px;
    }

        .inventory-hero h1,
        .inventory-hero h2 {
            font-size: 25px;
        }

    .inventory-card-body {
        padding: 20px 17px;
    }

    .inventory-card-footer {
        padding: 15px 17px;
    }

    .inventory-filter-bar {
        align-items: stretch;
    }

    .inventory-search {
        width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .inventory-page-header {
        flex-direction: column;
    }

        .inventory-page-header > .inventory-btn {
            width: 100%;
        }

    .inventory-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-card-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

        .inventory-card-footer .inventory-btn {
            width: 100%;
        }

    /* =========================================================
   CREATE MATERIAL REQUIREMENT
========================================================= */

    .requirement-readonly-field {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 44px;
        padding: 9px 12px;
        border: 1px solid var(--inv-border);
        border-radius: 10px;
        color: #475569;
        background: var(--inv-soft);
    }

        .requirement-readonly-field > div {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 600;
        }

            .requirement-readonly-field > div i {
                color: var(--inv-primary);
            }

    .requirement-help-card {
        position: sticky;
        top: 88px;
    }

    .requirement-source-detail {
        display: flex;
        align-items: flex-start;
        gap: 13px;
    }

        .requirement-source-detail strong {
            display: block;
            margin-bottom: 4px;
            color: var(--inv-text);
            font-size: 14px;
        }

        .requirement-source-detail p {
            margin: 0;
            color: var(--inv-muted);
            font-size: 12px;
            line-height: 1.6;
        }

    .requirement-source-icon {
        display: grid;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        place-items: center;
        border-radius: 12px;
        font-size: 17px;
    }

    .source-office {
        color: var(--inv-primary);
        background: #eaf2ff;
    }

    .source-local {
        color: var(--inv-warning);
        background: #fff5df;
    }

    .source-client {
        color: var(--inv-success);
        background: #eaf8ef;
    }

    .requirement-workflow {
        padding-left: 5px;
    }

    .requirement-workflow-step {
        display: flex;
        align-items: flex-start;
        gap: 11px;
    }

        .requirement-workflow-step > span {
            display: grid;
            flex: 0 0 28px;
            width: 28px;
            height: 28px;
            place-items: center;
            border-radius: 50%;
            color: #64748b;
            background: #eef2f7;
            font-size: 11px;
            font-weight: 700;
        }

        .requirement-workflow-step.active > span {
            color: #fff;
            background: var(--inv-primary);
            box-shadow: 0 5px 12px rgba(37, 99, 235, .22);
        }

        .requirement-workflow-step strong {
            display: block;
            color: #344054;
            font-size: 13px;
        }

        .requirement-workflow-step small {
            display: block;
            margin-top: 2px;
            color: #98a2b3;
            font-size: 11px;
        }

    .requirement-workflow-line {
        width: 1px;
        height: 22px;
        margin: 3px 0 3px 13px;
        background: var(--inv-border);
    }

    @media (max-width: 1199.98px) {
        .requirement-help-card {
            position: static;
        }
    }
    /* =========================================================
   MULTIPLE MATERIAL REQUIREMENT ROWS
========================================================= */

    .requirement-material-table {
        overflow-x: auto;
        border: 1px solid var(--inv-border);
        border-radius: 12px;
        background: var(--inv-white);
    }

        .requirement-material-table .inventory-table {
            margin-bottom: 0;
        }

            .requirement-material-table .inventory-table thead th {
                padding: 12px 14px;
            }

            .requirement-material-table .inventory-table tbody td {
                padding: 13px 14px;
                vertical-align: top;
            }

        .requirement-material-table .form-control,
        .requirement-material-table .form-select {
            min-height: 42px;
            font-size: 13px;
        }

        .requirement-material-table .input-group-text {
            min-height: 42px;
        }

        .requirement-material-table .material-item {
            min-width: 250px;
        }

        .requirement-material-table .material-source {
            min-width: 190px;
        }

        .requirement-material-table .material-quantity {
            min-width: 110px;
        }

        .requirement-material-table .remove-material {
            width: 42px;
            min-width: 42px;
            min-height: 42px;
            padding: 8px;
        }

        .requirement-material-table .field-validation-error {
            display: block;
            margin-top: 5px;
            font-size: 11px;
        }

    .requirement-material-help {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        border: 1px solid #dbeafe;
        border-radius: 9px;
        color: #526176;
        background: #f0f7ff;
        font-size: 12px;
    }

        .requirement-material-help i {
            flex: 0 0 auto;
            color: var(--inv-primary);
        }

    /* New row animation */
    .material-row {
        animation: requirementRowAppear .18s ease;
    }

    @keyframes requirementRowAppear {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Material source guidance */
    .requirement-source-detail + .requirement-source-detail {
        padding-top: 17px;
        border-top: 1px solid var(--inv-border);
    }

    /* Keep guidance cards visible on desktop */
    @media (min-width: 1200px) {
        .inventory-form-page .col-xl-3 {
            position: relative;
        }

            .inventory-form-page .col-xl-3 > .inventory-card:first-child {
                position: sticky;
                top: 88px;
            }
    }

    /* Tablet */
    @media (max-width: 1199.98px) {
        .requirement-material-table {
            overflow-x: auto;
        }

            .requirement-material-table .inventory-table {
                min-width: 850px;
            }
    }

    /* Mobile */
    @media (max-width: 767.98px) {
        .requirement-material-table {
            border-radius: 10px;
        }

        .requirement-material-help {
            align-items: flex-start;
        }
    }




    /* =========================================================
   COLOURFUL EXPORT BUTTONS
========================================================= */

    .inventory-export-toolbar {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        padding: 13px 20px;
        border-bottom: 1px solid var(--inv-border, #e5eaf2);
        background: linear-gradient(180deg, #ffffff, #f8fafc);
    }

    .inventory-export-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 100px;
        min-height: 40px;
        padding: 9px 17px;
        border: 0 !important;
        border-radius: 10px;
        color: #fff !important;
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        transition: all .2s ease;
    }

        /* Solid green Excel button */
        .inventory-export-btn.export-excel {
            color: #fff !important;
            background: linear-gradient( 135deg, #16a34a, #22c55e ) !important;
            box-shadow: 0 7px 16px rgba(22, 163, 74, .24);
        }

        /* Solid red PDF button */
        .inventory-export-btn.export-pdf {
            color: #fff !important;
            background: linear-gradient( 135deg, #dc2626, #ef4444 ) !important;
            box-shadow: 0 7px 16px rgba(220, 38, 38, .24);
        }

        .inventory-export-btn.export-excel:hover {
            background: linear-gradient( 135deg, #15803d, #16a34a ) !important;
            box-shadow: 0 10px 21px rgba(22, 163, 74, .32);
            transform: translateY(-2px);
        }

        .inventory-export-btn.export-pdf:hover {
            background: linear-gradient( 135deg, #b91c1c, #dc2626 ) !important;
            box-shadow: 0 10px 21px rgba(220, 38, 38, .32);
            transform: translateY(-2px);
        }

        .inventory-export-btn:active {
            box-shadow: none;
            transform: translateY(0);
        }

        .inventory-export-btn i {
            color: #fff !important;
            font-size: 16px;
        }

    @media (max-width: 575.98px) {
        .inventory-export-toolbar {
            padding: 12px 15px;
        }

        .inventory-export-btn {
            flex: 1;
        }
    }

}
