/* ==========================================================================
   GLOBAL & BUTTON STYLES (vFinal - Definitive Fix)
   ========================================================================== */

/* General Button Base - Now includes a default background color */
body .rsp-button,
.rsp-button {
    display: inline-block;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important; /* Prevents theme underlines */
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
    color: #ffffff !important; /* Ensure text is always white */
    background-color: #3b82f6; /* Default to primary blue */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
body .rsp-button:hover,
.rsp-button:hover {
    color: #ffffff !important;
    background-color: #2563eb; /* Darker blue on hover */
}

/* Secondary Button (for "View More" and "Quote Now") */
.rsp-button.rsp-button-secondary,
.rsp-button.rsp-quote-btn {
    background-color: #e0e7ff;
    border-color: #c7d2fe;
    color: #4338ca !important; /* Darker text for contrast */
}
.rsp-button.rsp-button-secondary:hover,
.rsp-button.rsp-quote-btn:hover {
    background-color: #c7d2fe;
    border-color: #a5b4fc;
    color: #312e81 !important;
}

/* Small Button Modifier */
.rsp-button.rsp-button-small {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 5px;
}

/* Secondary Button (e.g., "View Quotes") */
.rsp-button-secondary {
    background-color: #e0e7ff; /* Lighter blue/purple */
    border-color: #c7d2fe;
    color: #4338ca; /* Darker text for contrast */
}

.rsp-button-secondary:hover {
    background-color: #c7d2fe; /* Slightly darker on hover */
    border-color: #a5b4fc;
    color: #312e81;
}

/* Common style for smaller buttons used in tables/lists */
.rsp-button-small {
    padding: 8px 16px; /* Reduced padding */
    font-size: 13px; /* Smaller font size */
    font-weight: 500; /* Lighter weight for smaller text */
    border-radius: 5px; /* Slightly smaller radius */
}

/* Specific button for 'View Overall Status' within quote groups */
/* Keeping your existing .rsp-button-small rule, but ensuring it's not overriding the more specific ones now */
/* You might want to review if this specific rule is still needed or if the new .rsp-button-small covers it. */
/* For now, I'm letting it be, but the more specific `rsp-button.rsp-button-small` below will take precedence. */
/* .rsp-button-small {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border-radius: 5px;
    border: 1px solid #3b82f6;
    background-color: #3b82f6;
    color: #ffffff;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
} */
/* .rsp-button-small:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
} */


/* ===================================================================
    MODAL STYLES - FINAL GUARANTEED VERSION
    This code correctly styles the popup form, grid, and all fields.
=================================================================== */

/* The dark overlay behind the modal */
#rsp-quote-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99998;
}

/* The modal container itself */
#rsp-quote-modal-wrapper {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 1.5em; /* Adjusted padding for more breathing room */
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    width: 95%;
    max-width: 600px; /* Slightly wider max-width */
    max-height: 90vh; /* Allow a bit more height */
    overflow-y: auto; /* Allow scrolling for content that exceeds height */
    box-sizing: border-box;
}

#rsp-quote-submission-form .rsp-form-group {
    margin-bottom: 1em; /* Increased spacing */
}

#rsp-quote-submission-form textarea {
    min-height: 60px; /* Slightly taller textarea */
    max-height: 120px; /* Allow more height */
    resize: vertical; /* Allow vertical resizing */
}

#rsp-quote-submission-form input,
#rsp-quote-submission-form select,
#rsp-quote-submission-form textarea {
    padding: 12px; /* Increased padding for inputs */
    font-size: 14px; /* Slightly larger font size */
}


/* Close button in the corner */
#rsp-quote-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s ease;
}

#rsp-quote-modal-close:hover {
    color: #555;
}

/* Modal Title & Subtitle */
#rsp-quote-modal-wrapper h3 {
    text-align: center;
    font-size: 1.8em; /* Slightly larger title */
    color: #111827;
    margin: 0 0 0.8em 0; /* More bottom margin */
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee; /* Added subtle border */
}

#rsp-quote-modal-wrapper p {
    display: none; /* Keep subtitle hidden */
}

/* The form itself */
#rsp-quote-submission-form .rsp-form-group {
    margin-bottom: 1em; /* Consistent spacing */
}

#rsp-quote-submission-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.6em; /* Slightly more margin for labels */
    text-align: left;
    color: #374151;
}

/* THIS IS THE FIX for the two-column layout */
#rsp-quote-submission-form .rsp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Create two equal columns */
    gap: 1.5em; /* Increased space between the columns */
}

/* General style for all form inputs */
#rsp-quote-submission-form input,
#rsp-quote-submission-form select,
#rsp-quote-submission-form textarea {
    width: 100%;
    padding: 12px; /* Consistent padding */
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px; /* Consistent font size */
    color: #111827 !important;
    background-color: #f9fafb !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#rsp-quote-submission-form input:focus,
#rsp-quote-submission-form select:focus,
#rsp-quote-submission-form textarea:focus {
    border-color: #3b82f6; /* Highlight on focus */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* Specific fix for the <select> dropdown text being cut off */
#rsp-quote-submission-form select {
    height: 48px; /* Match height of other inputs */
    padding-right: 2.5rem; /* Make space for the arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Availability Radio Buttons */
#rsp-quote-submission-form .rsp-radio-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5em; /* Increased gap */
    padding-top: 8px; /* Slightly more padding */
    align-items: center;
}

#rsp-quote-submission-form .rsp-radio-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.6em; /* Increased gap for radio buttons */
    cursor: pointer;
    margin-bottom: 0;
    white-space: nowrap;
}

/* Modal Buttons & Error Messages */
.rsp-modal-btn {
    width: 100% !important;
    padding: 16px !important; /* Larger padding */
    font-size: 17px !important; /* Larger font size */
    font-weight: 600 !important;
    border-radius: 6px !important;
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border: none !important;
    transition: background-color 0.2s ease;
}

.rsp-modal-btn:hover {
    background-color: #2563eb !important;
}

#rsp-modal-error-message {
    display: none;
    background: #fef2f2;
    color: #991b1b;
    padding: 1em;
    margin-bottom: 1.5em; /* More margin */
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 14px;
}

/* ===================================================================
    FIX for Invisible Button in "Become a Supplier" Modal
=================================================================== */

#rsp-upgrade-prompt-container .rsp-button {
    background-color: #E67E22 !important;
    border-color: #E67E22 !important;
    color: #ffffff !important;
    display: inline-block !important;
    width: 100% !important;
}

#rsp-upgrade-prompt-container .rsp-button:hover {
    background-color: #D35400 !important;
    border-color: #D35400 !important;
}

/* ===================================================================
    FINAL POLISH: Requester Dashboard Design
=================================================================== */

/* The main box for each part in the request */
.rsp-requester-dashboard .rsp-part-management-box {
    background: #ffffff;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    margin-bottom: 2.5em;
    padding: 2em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.rsp-requester-dashboard .rsp-part-management-box h4 {
    margin: 0 0 1.2em 0;
    padding-bottom: 1em;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.4em;
    color: #333;
}

/* The notice for an accepted part */
.rsp-requester-dashboard .rsp-part-completed-notice {
    background-color: #e9f7ef;
    color: #1d5835;
    padding: 1.2em;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 1.5em;
}

.rsp-requester-dashboard .status-icon-accepted {
    color: #28a745;
    font-weight: bold;
    margin-right: 0.6em;
}

/* The individual quote item card */
.rsp-requester-dashboard .rsp-quote-item {
    border: 1px solid #ddd;
    border-left: 6px solid #0073aa;
    margin-bottom: 2em;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.rsp-requester-dashboard .quote-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2em;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.rsp-requester-dashboard .quote-item-header strong {
    font-size: 1.2em;
}

.rsp-requester-dashboard .quote-price {
    font-size: 1.4em;
    font-weight: bold;
    color: #0056b3;
}

.rsp-requester-dashboard .quote-item-body {
    padding: 1.2em;
}

.rsp-requester-dashboard .quote-item-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rsp-requester-dashboard .quote-item-body li {
    padding: 0.4em 0;
    font-size: 15px;
    color: #555;
}

.rsp-requester-dashboard .quote-item-actions {
    padding: 1.2em;
    background: #fcfcfc;
    border-top: 1px solid #eee;
    text-align: right;
}

.rsp-requester-dashboard .quote-item-actions .rsp-button {
    margin-left: 12px;
    font-size: 14px !important;
    padding: 8px 18px !important;
}

/* Change decline button to a less prominent color */
.rsp-requester-dashboard .decline-quote {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.rsp-requester-dashboard .decline-quote:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
}

/* ===================================================================
    STYLES for Detailed Quote View on Requester Dashboard
=================================================================== */

.rsp-requester-dashboard .rsp-quote-details-table {
    width: 100%;
    margin-bottom: 1.5em;
    font-size: 15px;
}

.rsp-requester-dashboard .rsp-quote-details-table th,
.rsp-requester-dashboard .rsp-quote-details-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px dotted #e0e0e0;
}

.rsp-requester-dashboard .rsp-quote-details-table th {
    font-weight: 600;
    color: #555;
    width: 30%;
}

.rsp-requester-dashboard .rsp-quote-details-table td:first-child {
    font-weight: 600;
}


.rsp-requester-dashboard .quote-message-box {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px dotted #e0e0e0;
}

.rsp-requester-dashboard .quote-message-box p {
    margin: 0.6em 0 0 0;
    font-style: italic;
    color: #444;
    line-height: 1.6;
}

.rsp-part-flex-container {
    display: flex;
    flex-direction: column;
    gap: 3em;
}

.rsp-quote-columns {
    display: flex;
    justify-content: space-between;
    gap: 3em;
    flex-wrap: wrap;
}

.rsp-request-info,
.rsp-quotation-info {
    flex: 1 1 48%;
}

.rsp-quote-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.rsp-quote-details-table th {
    width: 35%;
    text-align: left;
    color: #555;
    font-weight: 600;
    padding: 0.6em 0.8em 0.6em 0;
    vertical-align: top;
}

.rsp-quote-details-table td {
    padding: 0.6em 0.8em;
    vertical-align: top;
    color: #333;
}

.quote-message-box {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #ddd;
    color: #444;
}

/* ===================================================================
    STYLES for the Professional Supplier Quote Status Page
=================================================================== */

.rsp-pro-status-page {
    max-width: 1100px;
    margin: 3em auto;
    font-family: 'Inter', sans-serif;
    color: #333;
    padding: 0 20px;
    box-sizing: border-box;
}

.rsp-info-grid-pro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 3em;
}

.rsp-info-box-pro {
    background-color: #e7f5ff;
    border: 1px solid #cce7ff;
    padding: 2em;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.rsp-info-box-pro h3 {
    margin: 0 0 1.2em 0;
    padding-bottom: 0.8em;
    border-bottom: 1px solid #dbe9fa;
    font-size: 1.3em;
    color: #222;
    font-weight: 600;
}

.rsp-info-box-pro dl {
    margin: 0;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.5em 1em;
}

.rsp-info-box-pro dt,
.rsp-info-box-pro dd {
    display: block;
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
}

.rsp-info-box-pro dt {
    font-weight: 600;
    color: #555;
}

.rsp-info-box-pro dd {
    color: #333;
}

.rsp-table-heading {
    font-size: 1.8em;
    font-weight: 700;
    margin: 3em 0 1.5em 0;
    color: #222;
    text-align: center;
}

.rsp-parts-table-wrapper-pro {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.rsp-professional-parts-table-pro {
    width: 100%;
    border-collapse: collapse;
}

.rsp-professional-parts-table-pro th,
.rsp-professional-parts-table-pro td {
    padding: 15px;
    text-align: left;
    border: 1px solid #e9e9e9;
    font-size: 14px;
    vertical-align: middle;
}

.rsp-professional-parts-table-pro thead th {
    background-color: #f6f9fc;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.05em;
}

.rsp-professional-parts-table-pro tbody tr:nth-child(even) {
    background-color: #fcfdff;
}

.rsp-professional-parts-table-pro tfoot td {
    font-weight: bold;
    text-align: right;
    background-color: #f0f8ff;
    padding-top: 20px;
    padding-bottom: 20px;
}

.rsp-professional-parts-table-pro tfoot tr:first-child td {
    font-size: 1.1em;
    color: #444;
}

.rsp-professional-parts-table-pro .grand-total-row td {
    background-color: #d1e4f3;
    font-size: 1.4em;
    padding: 20px;
    color: #0056b3;
    text-align: right;
}

.rsp-professional-parts-table-pro .grand-total-row span {
    display: inline-block;
    padding: 5px 15px;
    background-color: #007bff;
    color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rsp-info-grid-pro {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .rsp-professional-parts-table-pro th,
    .rsp-professional-parts-table-pro td {
        padding: 10px;
        font-size: 13px;
    }

    .rsp-professional-parts-table-pro tfoot td {
        padding: 15px;
        text-align: right;
    }

    .rsp-professional-parts-table-pro .grand-total-row td {
        padding: 15px;
        font-size: 1.2em;
    }

    /* Important: Revert specific table display properties for smaller screens
        to allow horizontal scrolling if necessary, but keep the table structure */
    .rsp-dashboard-table {
        display: block !important; /* Make the table container block to allow overflow-x */
        overflow-x: auto !important; /* Enable horizontal scrolling */
        -webkit-overflow-scrolling: touch;
    }
    .rsp-dashboard-table thead, .rsp-dashboard-table tbody, .rsp-dashboard-table tr {
        display: table-row !important; /* Keep as table rows for semantic structure */
    }
    .rsp-dashboard-table th, .rsp-dashboard-table td {
        display: table-cell !important; /* Keep as table cells */
        white-space: normal !important; /* Allow text wrapping */
        min-width: 100px !important; /* Ensure minimum width for readability on scroll */
        max-width: 200px !important; /* Prevent excessively wide columns */
        box-sizing: border-box !important;
        /* Reset specific width percentages for smaller screens, let min-width dictate */
        width: auto !important;
    }
    .rsp-dashboard-table th:nth-child(1), .rsp-dashboard-table td:nth-child(1) { min-width: 120px !important; }
    .rsp-dashboard-table th:nth-child(2), .rsp-dashboard-table td:nth-child(2) { min-width: 100px !important; }
    .rsp-dashboard-table th:nth-child(3), .rsp-dashboard-table td:nth-child(3) { min-width: 80px !important; }
    .rsp-dashboard-table th:nth-child(4), .rsp-dashboard-table td:nth-child(4) { min-width: 80px !important; }
    .rsp-dashboard-table th:nth-child(5), .rsp-dashboard-table td:nth-child(5) { min-width: 80px !important; }
    .rsp-dashboard-table th:nth-child(6), .rsp-dashboard-table td:nth-child(6) { min-width: 100px !important; }


    .rsp-quote-status {
        min-width: unset !important;
    }
}

@media (max-width: 576px) {
    .rsp-my-account-dashboard {
        padding: 15px;
    }
    .rsp-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .rsp-dashboard-header h3 {
        font-size: 1.8em;
    }
    .rsp-quote-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 1em;
    }
    .rsp-quote-group-header h4 {
        font-size: 1.2em;
    }
    /* For extremely small screens, you might allow even smaller min-widths */
    .rsp-dashboard-table th, .rsp-dashboard-table td {
        min-width: 80px !important; /* Even smaller min-width for very small screens */
    }
    .rsp-dashboard-table th:nth-child(1), .rsp-dashboard-table td:nth-child(1) { min-width: 100px !important; }
}

/*
==========================================================================
  DEFINITIVE STYLES for "My Alerts" Page (FINAL TABLE LAYOUT)
==========================================================================
*/

/* --- The Table Itself --- */
.woocommerce-MyAccount-content table.my_account_orders {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.woocommerce-MyAccount-content table.my_account_orders th,
.woocommerce-MyAccount-content table.my_account_orders td {
    vertical-align: middle;
}

/* --- Column Widths and Alignment --- */
.alert-col-name { width: 25%; }
.alert-col-criteria { width: 40%; }
.alert-col-matches { width: 15%; text-align: center !important; }
.alert-col-actions { width: 20%; text-align: right !important; }

/* --- "New Match" Indicator Badge --- */
.matches-indicator {
    display: inline-block;
    background-color: #10b981; /* Green */
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

/* --- Action Buttons --- */
.alert-col-actions .button {
    margin-left: 10px !important;
}
.alert-col-actions .button.edit {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
}
.alert-col-actions .button.delete {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}
/* Professional "Offer Accepted" Summary */
.professional-summary .rsp-notice-body { padding: 0; }
.rsp-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.rsp-summary-section { padding: 20px; }
.rsp-summary-section:first-child { border-right: 1px solid #e0e0e0; }
.rsp-summary-section h4 { margin-top: 0; }
.rsp-summary-section p { margin-bottom: 0.8em; line-height: 1.5; }
.rsp-summary-section hr { border: 0; border-top: 1px solid #eee; margin: 15px 0; }
@media (max-width: 768px) {
    .rsp-summary-grid { grid-template-columns: 1fr; }
    .rsp-summary-section:first-child { border-right: 0; border-bottom: 1px solid #e0e0e0; }
}
/* ==========================================================================
   DEFINITIVE & UNIFIED STYLES for All Public Request Cards (vFinal)
   ========================================================================== */

/* --- The main card container --- */
.rsp-request-card {
    background-color: #ffffff;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

/* --- Card Header Styling --- */
.rsp-request-card .rsp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rsp-request-card .rsp-header-left,
.rsp-request-card .rsp-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 14px;
}

.rsp-request-card .rsp-request-id {
    font-weight: 600;
    color: #111827;
}

/* BOLD text for location, status, and date */
.rsp-request-card .rsp-request-location,
.rsp-request-card .rsp-request-meta,
.rsp-request-card .rsp-request-date {
    font-weight: 600;
    color: #4b5563;
}

/* --- Card Body & Parts Table --- */
.rsp-request-card .rsp-card-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* This replaces the old .rsp-part-line with a proper table */
.rsp-request-card .rsp-parts-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

/* LEFT-ALIGNED table headers */
.rsp-request-card .rsp-parts-list-table thead th {
    background-color: #f8f9fa;
    padding: 0.75em;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    border-bottom: 1px solid #e9ecef;
}

.rsp-request-card .rsp-parts-list-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.rsp-request-card .rsp-parts-list-table tbody tr:last-child {
    border-bottom: none;
}

.rsp-request-card .rsp-parts-list-table td {
    padding: 0.75em;
    vertical-align: top;
    font-size: 13px;
    color: #374151;
    text-align: left;
}

/* Column Widths & Specific Alignments (Adjusted for QTY) */
.rsp-request-card .rsp-parts-list-table .part-brand { width: 15%; font-weight: 600; color: #111827; }
.rsp-request-card .rsp-parts-list-table .part-model { width: 14%; }
.rsp-request-card .rsp-parts-list-table .part-no { width: 14%; }
.rsp-request-card .rsp-parts-list-table .part-desc { width: 24%; }
.rsp-request-card .rsp-parts-list-table .part-condition { width: 14%; }
.rsp-request-card .rsp-parts-list-table .part-manufacturer { width: 11%; }
.rsp-request-card .rsp-parts-list-table .part-qty {
    width: 8%;
    text-align: left; /* Qty should be right-aligned */
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

/* --- Card Footer & Buttons --- */
.rsp-request-card .rsp-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    gap: 0.75rem;
}

/* Orange "Quote" button */
.rsp-button.rsp-button-quote {
    background-color: #f59e0b !important; /* The orange color you want */
    border-color: #f59e0b !important;
    color: #ffffff !important;
}
.rsp-button.rsp-button-quote:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
}

/* Light Grey "View more" button */
.rsp-button.rsp-button-tertiary {
    background-color: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    color: #374151 !important;
}
.rsp-button.rsp-button-tertiary:hover {
    background-color: #e5e7eb !important;
    border-color: #d1d5db !important;
}
/* ==========================================================================
   DEFINITIVE STYLES for Public Single Request View (v3.0 - All Fixes)
   ========================================================================== */

/* Main Grid Layout */
.rsp-single-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    max-width: 1200px;
    margin: 2em auto;
}

.rsp-info-box {
    margin-bottom: 3em;
}

.rsp-box-title {
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

/* Request Info Table Styling */
.rsp-info-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rsp-info-table th, .rsp-info-table td { padding: 15px 0; text-align: left; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.rsp-info-table th { font-weight: 600; color: #555; width: 120px; }
.rsp-info-table td { color: #222; }

/* --- List of Spare Parts Styling (FIXED) --- */
.rsp-parts-list-public .rsp-parts-list-header,
.rsp-parts-list-public .rsp-parts-list-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 0.5fr 1.2fr;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
}
/* Header Highlighting (FIXED) */
.rsp-parts-list-public .rsp-parts-list-header {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
/* Table Lines (FIXED) */
.rsp-parts-list-public .rsp-parts-list-row {
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}
.rsp-parts-list-public .part-qty { text-align: center; }
.rsp-parts-list-public .part-action { text-align: right; }

/* --- Similar Requests List Styling (RESTORED) --- */
.rsp-similar-requests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.rsp-similar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border: 1px solid #e9ecef;
    padding: 1rem;
    border-radius: 6px;
}
.rsp-similar-item-info {
    display: flex;
    flex-direction: column;
}
.rsp-similar-item-info strong {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}
.rsp-similar-item-info span {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 4px;
}

/* Sidebar Widget Styling */
.rsp-sidebar-widget { background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; padding: 25px; margin-bottom: 20px; }
.rsp-sidebar-widget .rsp-widget-title { font-size: 1.4em; margin-top: 0; margin-bottom: 0.5em; }
.rsp-sidebar-widget p { margin-top: 0; margin-bottom: 1.5em; color: #6c757d; }
.rsp-sidebar-widget .rsp-button { width: 100%; text-align: center; }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .rsp-single-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    /* Styles for making the parts list scrollable on mobile */
    .rsp-parts-list-public { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .rsp-parts-list-public .rsp-parts-list-header,
    .rsp-parts-list-public .rsp-parts-list-row {
        min-width: 800px; /* Force a minimum width to enable scrolling */
    }
/* ==========================================================================
   NEW STYLES for Professional "Similar Requests" Section
   ========================================================================== */

/* The container for the list of cards */
.rsp-professional-similar-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* The space between each card */
}

/* We can reuse the main card style, but let's ensure it has enough padding */
.rsp-professional-similar-list .rsp-request-card {
    padding: 1.5rem;
}

/* Ensure the part lines inside the similar requests have enough space */
.rsp-professional-similar-list .rsp-part-line {
    padding: 0.6rem 0;
    font-size: 14px;
}

/* We can reuse the tertiary button style we already have.
   This rule just confirms its appearance if needed. */
.rsp-professional-similar-list .rsp-button-tertiary {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151 !important;
}

.rsp-professional-similar-list .rsp-button-tertiary:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}
/* ==========================================================================
   FINAL POLISH: Separator Line for Similar Requests
   ========================================================================== */

.rsp-similar-requests-section {
    border-top: 1px solid #e9ecef;
    margin-top: 3em;
    padding-top: 3em;
}
/* --- Style for the Public Request Note --- */
.rsp-public-note {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px dashed #e0e0e0;
    font-style: italic;
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}
/* Force uppercase text in specific form fields */
.rsp-uppercase-input {
    text-transform: uppercase;
}
/* --- DEFINITIVE Styles for Request Card Table & Header --- */

/* BOLD HEADER TEXT */
.rsp-card-header .rsp-request-location,
.rsp-card-header .rsp-request-date,
.rsp-card-header .rsp-request-meta {
    font-weight: 600;
}

/* PARTS TABLE STYLING */
.rsp-parts-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.rsp-parts-list-table thead th {
    background-color: #f8f9fa;
    padding: 0.75em;
    text-align: left; /* Aligns headers to the left */
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    border-bottom: 1px solid #e9ecef;
}

.rsp-parts-list-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.rsp-parts-list-table tbody tr:last-child {
    border-bottom: none;
}

.rsp-parts-list-table td {
    padding: 0.75em;
    vertical-align: top;
    font-size: 13px; /* Smaller font size for the content */
    color: #374151;
    text-align: left; /* Aligns content to the left */
}

/* Column Widths - Description is now the largest */
.rsp-parts-list-table .part-brand { width: 15%; font-weight: 600; color: #111827; }
.rsp-parts-list-table .part-model { width: 15%; }
.rsp-parts-list-table .part-no { width: 15%; }
.rsp-parts-list-table .part-desc { width: 25%; }
.rsp-parts-list-table .part-condition { width: 15%; }
.rsp-parts-list-table .part-manufacturer { width: 15%; }
.rsp-parts-list-table .part-qty {
    width: 5%;
    text-align: right; /* Qty should be right-aligned */
    font-weight: 600;
    color: #111827;
}
/*
==========================================================================
   FINAL FIX for Unified Quote Modal Checkbox Row (Using CSS Grid)
==========================================================================
*/

#rsp-quote-submission-form .rsp-checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Creates 3 even columns */
    gap: 10px 15px;
    padding-top: 8px;
}

#rsp-quote-submission-form .rsp-checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.6em;
    cursor: pointer;
    margin-bottom: 0;
    white-space: nowrap;
}

#rsp-quote-submission-form .rsp-checkbox-group input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    flex-shrink: 0;
}
/*
==========================================================================
   FINAL OVERRIDE for Requester Quote Card Actions & Pop-up
==========================================================================
*/

/* --- 1. Fix the Verification Link --- */
.rsp-requester-dashboard .quote-item-actions .rsp-verification-link {
    color: #b45309 !important;
    background-color: #fffbeb !important;
    border: 1px solid #fde68a !important;
    padding: 10px 15px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: center !important;
    justify-content: center !important;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
}
.rsp-requester-dashboard .quote-item-actions .rsp-verification-link:hover {
    background-color: #fef3c7 !important;
}

/* --- 2. Fix the Action Buttons --- */
.rsp-requester-dashboard .quote-item-actions > div {
    display: flex;
    gap: 10px;
    width: 100%;
}
.rsp-requester-dashboard .quote-item-actions .rsp-button {
    flex-grow: 1;
    margin-left: 0 !important;
}

/* THIS IS THE FIX for the Decline Button */
.rsp-requester-dashboard .quote-item-actions .decline-quote {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}
.rsp-requester-dashboard .quote-item-actions .decline-quote:hover {
    background-color: #5a6268 !important;
}

/* --- 3. Fix the Pop-up (It was not popping up before) --- */
/* This ensures the JavaScript has a clean target to show/hide */
.rsp-verification-modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}