/* ==========================================================================
   Request Component Styles
   ========================================================================== */

/* Container & Layout
   ========================================================================== */

.request-container {
    border-radius: 5px;
    margin-top: 5px;
    width: 100%;
    position: relative;
    overflow: auto;
}

.request-panel {
    border: 1px solid black !important;
    width: fit-content !important;
    margin: 0 auto !important;
    max-width: 100vw;
}

@media (max-width: 1024px) {
    .request-panel {
        margin: 0;
    }
}

.request-section {
    border: 1px solid black;
    border-radius: 5px;
    width: 100%;
    padding: 10px;
}

/* Admin & Detail Component Styles
   ========================================================================== */

.admin-container {
    overflow: visible;
}

.admin-instructions-table {
    width: 100%;
}

.admin-instructions-cell {
    align: center;
    valign: bottom;
    width: 100%;
    margin: 0;
    padding: 0;
}

.admin-instructions-text {
    color: black;
    font-weight: 350;
}

.admin-instructions-button-text {
    color: black;
    font-weight: 325;
}

.admin-grid-wrapper {
    width: 100%;
    max-width: 100vw;
    max-height: calc(100vh - 150px);
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

.detail-grid-wrapper {
    width: 100%;
    max-width: 100vw;
    max-height: calc(100vh - 330px);
    overflow: auto;
}

.admin-bottom-instructions {
    width: 100%;
}

.admin-bottom-instructions-cell {
    align: center;
    valign: bottom;
    width: 100%;
    margin: 0;
    padding: 0;
}

.detail-group-panel {
    padding-top: 5px;
}

.detail-group-table {
    background: white;
    border: 1px solid #ddd;
    width: 728px;
}

.detail-group-table-row {
    border: 1px solid #ddd;
}

.detail-group-table-header {
    width: 70px;
    font-weight: bold;
}

.detail-group-input {
    height: 32px;
    width: 100%;
    border-radius: 4px;
}

.detail-group-button-cell {
    width: 128px;
}

.detail-inline-edit-input {
    height: 32px;
    width: 150px;
    border-radius: 4px;
    border: 2px solid lightgrey;
}

.detail-checkbox-cell {
    margin-left: 55px;
}

.detail-bottom-spacer {
    width: 100%;
    height: 2px;
}

/* Section Table
   ========================================================================== */

.request-section-table {
    border-collapse: separate;
    border-spacing: 20px 0;
}

    .request-section-table thead {
        font-weight: bold;
        font-size: 20px;
    }

    .request-section-table input:disabled,
    .request-section-table textarea:disabled,
    .request-section-table select:disabled {
        color: black;
        background-color: #f5f5f5;
    }

/* Material Table
   ========================================================================== */

.request-material-table-container {
    max-height: calc(100vh - 590px) !important;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid lightgrey;
    border-radius: 4px;
    min-width: 256px !important;
    max-width: 100% !important;
    position: relative;
}

.request-material-table {
    min-width: 256px !important;
    max-width: 100% !important;
    width: 100%;
    border-collapse: collapse;
}

    .request-material-table thead {
        position: sticky;
        top: 0;
        background-color: white;
        z-index: 1;
    }

        .request-material-table thead th {
            border-bottom: 2px solid lightgrey;
        }

    .request-material-table tbody tr:nth-child(odd) {
        background-color: #D9E2F3;
    }

    .request-material-table tbody tr:nth-child(even) {
        background-color: #D9E2F3;
    }

    .request-material-table tbody tr:hover {
        background-color: #e6f7ff;
    }

    .request-material-table tfoot {
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 2;
    }

        .request-material-table tfoot td {
            border-top: 2px solid lightgrey;
        }

/* Material Table Buttons & Icons
   ========================================================================== */

.request-material-table-button {
    border: 0;
    background-color: transparent;
    width: 50px;
    cursor: pointer;
}

.request-material-table-add-icon {
    font-size: 20px !important;
    color: green !important;
    font-style: normal !important;
}

.request-material-table-delete-icon {
    font-size: 20px !important;
    color: red !important;
    font-style: normal !important;
}

/* Summary Tables
   ========================================================================== */

.request-summary-material-table,
.request-summary-note-table {
    width: 100%;
}

    .request-summary-material-table thead,
    .request-summary-note-table thead {
        background-color: #B4C6E7;
    }

    .request-summary-material-table tbody tr:nth-child(odd),
    .request-summary-note-table tbody tr:nth-child(odd) {
        background-color: #D9E2F3;
    }

    .request-summary-material-table tbody tr:nth-child(even),
    .request-summary-note-table tbody tr:nth-child(even) {
        background-color: white;
    }

    .request-summary-material-table tbody tr:hover,
    .request-summary-note-table tbody tr:hover {
        background-color: #e6f7ff;
    }

/* Notes Table
   ========================================================================== */

.request-notes-table-wrapper {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

    .request-notes-table-wrapper thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #B4C6E7;
    }

    .request-notes-table-wrapper table tbody tr:nth-child(odd) {
        background-color: #ffffff;
    }

    .request-notes-table-wrapper table tbody tr:nth-child(even) {
        background-color: #D9E2F3;
    }

    .request-notes-table-wrapper table tbody tr:hover {
        background-color: #e6f7ff;
    }

/* Buttons
   ========================================================================== */

.request-button-container {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    gap: 20px;
    width: 100%;
}

.request-button-cancel,
.request-button-submit,
.request-button-view {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.request-button-cancel {
    background-color: #ffe5e5;
    color: #a00000;
    border: 1px solid #a00000;
}

.request-button-submit,
.request-button-view {
    background-color: #e6f2ff;
    color: #0066cc;
    border: 1px solid #0066cc;
}

.request-button-cancel:disabled,
.request-button-submit:disabled,
.request-button-view:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Controls
   ========================================================================== */

.auto-select {
    min-width: 100%;
    border: 1px solid lightgrey;
}

/* Input utility classes for common patterns */
.request-input {
    height: 32px;
    border-radius: 4px;
    border: 1px solid lightgrey;
}

.request-input-sm {
    width: 146px;
}

.request-input-md {
    width: 200px;
}

.request-input-full {
    width: 100%;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select:disabled,
textarea:disabled,
input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

/* Cells & States
   ========================================================================== */

.readonly-cell {
    text-align: left;
    width: 100%;
    height: 30px;
    line-height: 30px;
    background: #f5f5f5;
    border: 1px solid lightgrey;
    border-radius: 4px;
    white-space: nowrap;
    cursor: not-allowed;
    padding: 0 5px;
    font-family: sans-serif;
    font-size: 1rem;
    color: #000;
    font-weight: normal;
}

    .readonly-cell .material-symbols-outlined {
        vertical-align: middle;
        line-height: 1;
        font-size: 16px;
        margin-left: 6px;
        cursor: pointer;
    }

.selected-row {
    background-color: #e2f5e2 !important;
}

    .selected-row td,
    .selected-row td input,
    .selected-row td select,
    .selected-row td textarea {
        background-color: #e2f5e2 !important;
    }

        .selected-row td select:disabled,
        .selected-row td input:disabled {
            opacity: 0.85;
        }

.disabled-row {
    opacity: 0.6;
}

.disabled-section {
    opacity: 0.6;
    position: relative;
}

    .disabled-section::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.1);
        cursor: not-allowed;
    }

/* Validation & Messages
   ========================================================================== */

.required-field {
    color: lightcoral;
    font-weight: bold;
}

.invalid-input {
    background-color: white;
}

.validation-message {
    color: lightcoral;
    font-size: 1rem;
    margin-top: 5px;
    margin-bottom: 5px;
    text-align: left;
    font-weight: bold;
    padding-left: 20px;
}

/* Filter Overlay
   ========================================================================== */

.column-filter-pop-overlay {
    position: fixed;
    z-index: 100000;
    background: #fff;
    padding: .6rem .8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    min-width: 260px;
    width: auto;
    max-width: 420px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    font-size: .85rem;
}

/* Dialog Modal
   ========================================================================== */

.virtual-grid-product-dialog-modal {
    top: 200px;
    left: 50%;
    max-height: calc(100vh - 200px);
    position: fixed;
    transform: translateX(-50%);
}

    .virtual-grid-product-dialog-modal.is-dragging {
        transform: none;
    }

.virtual-grid-draggable-header {
    cursor: move;
    user-select: none;
}

/* ============================================
   RequestView Grid Styles (#RRGrid)
   ============================================ */

#RRGrid {
    position: relative;
    top: 5px;
    max-height: calc(100vh - 110px);
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

#RRGrid .virtual-grid-table-content-wrapper {
    max-height: 100%;
    overflow: auto;
    border: 1px solid lightgrey;
}

#RRGrid .virtual-grid-table {
    width: 100%;
    border-collapse: collapse;
}

#RRGrid .virtual-grid-table-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
}

#RRGrid .virtual-grid-table-header-row th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 3;
}

#RRGrid .virtual-grid-table-row {
    height: 35px;
}

/* RequestView header interactions */
#RRGrid th[data-key]:hover {
    background: #e9ecef;
}

/* Note: Sort column highlighting requires inline style due to dynamic data-key values */