/* =========================================================
   PMR Management Page Style Sheet - Figma Layout (1920x1080)
   ========================================================= */

/* =========================================================
   Layout Overrides for Main Layout Grid
   ========================================================= */

@media (min-width: 769px) {
    .page {
        display: flex;
        flex-direction: row;
        min-height: 100vh;
        background-color: #f5f6f8;
    }

    /* Hide default Blazor top row about link */
    .top-row.px-4 {
        display: none !important;
    }

    article.content {
        padding: 20px !important;
        flex: 1;
        box-sizing: border-box;
    }
}


/* =========================================================
   PMR Management Layout Elements
   ========================================================= */

.pmr-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}


/* =========================================================
   Page Heading
   ========================================================= */

.pmr-header {
    margin-bottom: 4px;
}

    .pmr-header.flex-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

.pmr-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pmr-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.pmr-desc {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    margin: 0;
    line-height: 1.3;
}


/* =========================================================
   PMR Header Buttons
   ========================================================= */

.pmr-btn-email {
    background-color: #151515;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .pmr-btn-email:hover {
        background-color: #000000;
    }

.pmr-btn-create {
    background-color: #ff0000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .pmr-btn-create:hover {
        background-color: #cc0000;
    }

    .pmr-btn-create.hajipur-create-btn {
        background-color: #0405AB;
    }

        .pmr-btn-create.hajipur-create-btn:hover {
            background-color: #03048a;
        }


/* =========================================================
   Filter Row Section - Figma Widths
   ========================================================= */

.pmr-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    background-color: #ffffff;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid #d9e0e7;
    box-sizing: border-box;
    align-items: center;
    height: 65px;
    width: 100%;
}

.filter-item {
    flex: 1;
    min-width: 0;
    position: relative;
    box-sizing: border-box;
}


    /* Balanced Figma widths for each filter item */

    .filter-item:nth-child(1) {
        flex: 1;
        max-width: 250px;
    }

    .filter-item:nth-child(2) {
        flex: 1.1;
        max-width: 260px;
    }

    .filter-item:nth-child(3) {
        flex: 1.1;
        max-width: 260px;
    }

    .filter-item:nth-child(4) {
        flex: 1;
        max-width: 250px;
    }

    .filter-item:nth-child(5) {
        flex: 1;
        max-width: 250px;
    }

    .filter-item:nth-child(6) {
        flex: 1;
        max-width: 250px;
    }

    .filter-item:nth-child(7) {
        flex: 1;
        max-width: 200px;
    }

.filter-select {
    width: 100%;
    height: 36px;
    padding: 0 24px 0 10px;
    font-size: 11px;
    color: #555555;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

    .filter-select:focus {
        outline: none;
        border-color: #cbd5e1;
    }

.filter-chevron {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    color: #999999;
}

    .filter-chevron svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
    }


/* =========================================================
   Radzen Dropdown Filters (Search PMR / Received From /
   Customer Name / Product Name / Colour Name / Status / Region)
   Overridden to visually match .filter-select above.
   ========================================================= */

.filter-select-radzen.rz-dropdown {
    width: 100%;
    height: 36px;
    min-height: 36px;
    font-size: 11px;
    color: #555555;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 4px;
    box-shadow: none;
    box-sizing: border-box;
}

    .filter-select-radzen.rz-dropdown.rz-state-focused,
    .filter-select-radzen.rz-dropdown:focus,
    .filter-select-radzen.rz-dropdown:focus-within {
        outline: none;
        border-color: #cbd5e1;
        box-shadow: none;
    }

    .filter-select-radzen .rz-dropdown-label,
    .filter-select-radzen .rz-inputtext {
        font-size: 11px;
        color: #555555;
        height: 34px;
    }

    .filter-select-radzen .rz-dropdown-trigger {
        color: #999999;
    }

/* Clear-filters icon button, placed after the last dropdown */
.pmr-filter-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #d9e0e7;
    background-color: #ffffff;
    color: #999999;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    box-sizing: border-box;
}

    .pmr-filter-clear-btn:hover {
        background-color: #fee2e2;
        border-color: #f87171;
        color: #ef4444;
    }

    .pmr-filter-clear-btn svg {
        width: 16px;
        height: 16px;
    }


/* =========================================================
   PMR Table Styles - Figma Dimensions
   ========================================================= */

.pmr-table-wrapper {
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e1e5ea;
    overflow-x: auto;
    box-sizing: border-box;
}

.pmr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: center;
}

    .pmr-table th {
        background-color: #f8fafc;
        color: #555555;
        font-weight: 500;
        padding: 10px 12px;
        border-bottom: 1px solid #e1e5ea;
        white-space: nowrap;
        height: 45px;
        box-sizing: border-box;
        text-align: center;
    }

    .pmr-table td {
        padding: 10px 12px;
        border-bottom: 1px solid #f1f5f9;
        color: #333333;
        white-space: nowrap;
        vertical-align: middle;
        height: 50px;
        box-sizing: border-box;
        text-align: center;
    }

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


/* =========================================================
   Product Link
   ========================================================= */

.product-link {
    color: #0f172a;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 2px;
    font-weight: 500;
    cursor: pointer;
}

    .product-link:hover {
        color: #2563eb;
        text-decoration-color: #2563eb;
    }


/* =========================================================
   Figma Status Badges
   ========================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 500;
    min-width: 105px;
    width: 105px;
    height: 26px;
    box-sizing: border-box;
    line-height: 1;
    white-space: nowrap;
}


/* =========================================================
   Custom Status Themes
   ========================================================= */

.status-material-added {
    background-color: #F2F2F2;
    border: 1px solid #999999;
    color: #B3B3B3;
}

.status-submitted {
    background-color: #FEF3E7;
    border: 1px solid #FABB6B;
    color: #F59E0B;
}

.status-costing-done {
    background-color: #F3E8FA;
    border: 1px solid #8E44AD;
    color: #8E44AD;
}

.status-negotiating {
    background-color: #F4EFED;
    border: 1px solid #8D6E63;
    color: #8D6E63;
}

.status-price-approved {
    background-color: #FDE6F1;
    border: 1px solid #E84393;
    color: #E84393;
}

.status-in-production {
    background-color: #FFE3FF;
    border: 1px solid #CC00CF;
    color: #CC00CF;
}

.status-completed {
    background-color: #E8F6ED;
    border: 1px solid #16A34A;
    color: #16A34A;
}

.status-codification {
    background-color: #FFF4ED;
    border: 1px solid #FF7A00;
    color: #FF7A00;
}

.status-lab-revised {
    background-color: #D3E2FF;
    border: 1px solid #3776EA;
    color: #3776EA;
}

.status-prod-revised {
    background-color: #DBF4FF;
    border: 1px solid #00B4E5;
    color: #00B4E5;
}

.status-discarded {
    background-color: #FBE9E9;
    border: 1px solid #E87F7F;
    color: #DC2626;
}

.status-customer-approved {
    background-color: #FCE7F3;
    border: 1px solid #EC4899;
    color: #DB2777;
}

.status-email-sent {
    background-color: #EFF6FF;
    border: 1px solid #60A5FA;
    color: #1D4ED8;
}

/* =========================================================
   Action Button
   ========================================================= */

.action-cell {
    text-align: center;
}

.action-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #EAEAEA;
    background-color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    box-sizing: border-box;
}

    .action-view-btn:hover {
        background-color: #fee2e2;
        border-color: #f87171;
    }

    .action-view-btn svg {
        width: 14px;
        height: 14px;
        fill: none;
        stroke: #ef4444;
        stroke-width: 2;
    }


/* =========================================================
   Pagination
   ========================================================= */

.pmr-pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #ffffff;
    border-top: 1px solid #e1e5ea;
    box-sizing: border-box;
}

.pagination-info {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    background-color: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

    .pagination-btn:hover:not(.active):not(.disabled) {
        background-color: #f8fafc;
        border-color: #cbd5e1;
    }

    .pagination-btn.active {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: #ffffff;
    }

    .pagination-btn.disabled {
        color: #cbd5e1;
        border-color: #e2e8f0;
        cursor: not-allowed;
    }

    .pagination-btn svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.5;
    }
