/**
 * MageB2B_StaffQuoteHyva — frontend styles (plain CSS, loaded via hyva_default.xml).
 * Ports the Luma LESS sources (_status-badge, _list, _view, _form) to the parts that
 * are not already covered by Tailwind utility classes in the Hyva templates.
 *
 * @package MageB2B_StaffQuoteHyva
 * @author SoftwareSilo LLC <info@softwaresilo.io>
 * @copyright SoftwareSilo LLC
 * @license https://softwaresilo.io/en/license-terms
 */

/* ========================================
   Utility
   ======================================== */
.staffquote-hidden {
    display: none !important;
}

/* ========================================
   Status Badges
   ======================================== */
.staffquote-status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
}

.staffquote-status-badge.draft,
.staffquote-status-badge.status-draft {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.staffquote-status-badge.pending_approval,
.staffquote-status-badge.status-pending-approval,
.staffquote-status-badge.status-pending_approval {
    background-color: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffe082;
}

.staffquote-status-badge.approved,
.staffquote-status-badge.status-approved {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.staffquote-status-badge.rejected,
.staffquote-status-badge.status-rejected {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.staffquote-status-badge.sent,
.staffquote-status-badge.status-sent {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.staffquote-status-badge.viewed,
.staffquote-status-badge.status-viewed {
    background-color: #e8eaf6;
    color: #3f51b5;
    border: 1px solid #9fa8da;
}

.staffquote-status-badge.accepted,
.staffquote-status-badge.status-accepted {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.staffquote-status-badge.order-created,
.staffquote-status-badge.status-order-created,
.staffquote-status-badge.status-order_created,
.staffquote-status-badge.order_created {
    background-color: #e0f2f1;
    color: #00695c;
    border: 1px solid #80cbc4;
}

.staffquote-status-badge.feedback,
.staffquote-status-badge.status-feedback {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

.staffquote-status-badge.expired,
.staffquote-status-badge.status-expired {
    background-color: #eceff1;
    color: #78909c;
    border: 1px solid #b0bec5;
}

.staffquote-status-badge.unsent,
.staffquote-status-badge.status-unsent {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.staffquote-status-badge.customer-requested,
.staffquote-status-badge.status-customer-requested,
.staffquote-status-badge.status-customer_requested {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* Status filter pills */
.quote-status-filters .status-pill,
.status-pill {
    padding: 5px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.quote-status-filters .status-pill:hover,
.status-pill:hover {
    border-color: #1979c3;
    color: #1979c3;
}

.quote-status-filters .status-pill.active,
.status-pill.active {
    background: #1979c3;
    color: #fff;
    border-color: #1979c3;
}

/* ========================================
   Tables (staff + customer quote lists)
   ======================================== */
.staffquote-list .quotes-table,
.customer-quote-list .table-quote-list,
.quote-history-modal .staffquote-history-table,
.customer-quote-view .table-quote-items,
.customer-quote-request .table-quote-items {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.staffquote-list .quotes-table thead th,
.customer-quote-list .table-quote-list thead th,
.quote-history-modal .staffquote-history-table thead th,
.customer-quote-view .table-quote-items thead th,
.customer-quote-request .table-quote-items thead th {
    background: #fafafa;
    padding: 10px 8px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    text-align: left;
    white-space: normal;
}

.staffquote-list .quotes-table tbody td,
.customer-quote-list .table-quote-list tbody td,
.customer-quote-view .table-quote-items tbody td,
.customer-quote-request .table-quote-items tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #333;
}

.staffquote-list .quotes-table td.increment-id strong {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.staffquote-list .quotes-table td.customer .customer-email {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staffquote-list .quotes-table tbody tr,
.customer-quote-list .table-quote-list tbody tr,
.quote-history-modal .staffquote-history-table tbody tr,
.customer-quote-view .table-quote-items tbody tr,
.customer-quote-request .table-quote-items tbody tr {
    background: #fff;
}

@media (min-width: 768px) {
    .staffquote-list .quotes-table .col.actions {
        position: sticky;
        right: 0;
        background: inherit;
        box-shadow: -12px 0 12px -12px rgba(0, 0, 0, 0.35);
    }

    .staffquote-list .quotes-table thead .col.actions {
        background: #fafafa;
        z-index: 1;
    }
}

.staffquote-list .quotes-table tbody tr:hover,
.customer-quote-list .table-quote-list tbody tr:hover {
    background: #f8fbff;
}

/* ========================================
   Sortable headers
   ======================================== */
.staffquote-list .quotes-table th.sortable,
.customer-quote-list .table-quote-list th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.staffquote-list .quotes-table th .sort-indicator,
.customer-quote-list .table-quote-list th .sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    min-width: 16px;
    color: #a0a0a0;
    opacity: 0.55;
    vertical-align: middle;
}

.staffquote-list .quotes-table th .sort-indicator::before,
.customer-quote-list .table-quote-list th .sort-indicator::before {
    content: "\25B2\25BC";
    font-size: 8px;
    line-height: 1;
}

.staffquote-list .quotes-table th.asc .sort-indicator,
.customer-quote-list .table-quote-list th.asc .sort-indicator,
.staffquote-list .quotes-table th.desc .sort-indicator,
.customer-quote-list .table-quote-list th.desc .sort-indicator {
    color: #1979c3;
    opacity: 1;
}

.staffquote-list .quotes-table th.asc .sort-indicator::before,
.customer-quote-list .table-quote-list th.asc .sort-indicator::before {
    content: "\25B2";
    font-size: 10px;
}

.staffquote-list .quotes-table th.desc .sort-indicator::before,
.customer-quote-list .table-quote-list th.desc .sort-indicator::before {
    content: "\25BC";
    font-size: 10px;
}

/* ========================================
   Row action icons
   ======================================== */
.actions-wrapper.compact {
    display: inline-flex;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    line-height: 0;
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 4px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1;
    vertical-align: middle;
}

.action-icon:focus {
    outline: 2px solid #1979c3;
    outline-offset: 2px;
}

.action-icon svg {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: auto;
    pointer-events: none;
}

.action-icon.edit {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffe0b2;
}
.action-icon.edit:hover {
    background: #ff9800;
    color: #fff;
    border-color: #ff9800;
}

.action-icon.view {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #bbdefb;
}
.action-icon.view:hover {
    background: #1979c3;
    color: #fff;
    border-color: #1979c3;
}

.action-icon.pdf {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.action-icon.pdf:hover {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.action-icon.send-customer {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #bbdefb;
}
.action-icon.send-customer:hover {
    background: #1979c3;
    color: #fff;
    border-color: #1979c3;
}

.action-icon.history {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #e1bee7;
}
.action-icon.history:hover {
    background: #9c27b0;
    color: #fff;
    border-color: #9c27b0;
}

.action-icon.duplicate {
    background: #ede7f6;
    color: #5e35b1;
    border-color: #d1c4e9;
}
.action-icon.duplicate:hover {
    background: #7e57c2;
    color: #fff;
    border-color: #7e57c2;
}

.action-icon.add-to-cart {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.action-icon.add-to-cart:hover {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.action-icon.order {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffe0b2;
}
.action-icon.order:hover {
    background: #ff9800;
    color: #fff;
    border-color: #ff9800;
}

.action-icon.delete {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}
.action-icon.delete:hover {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
}

/* ========================================
   Autocomplete dropdowns
   ======================================== */
.staffquote-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 260px;
    overflow-y: auto;
}

/* The product dropdown inside the quote editor is position:fixed via JS. */
.staffquote-autocomplete-list.staffquote-product-dropdown {
    position: fixed;
    right: auto;
    top: auto;
}

.staffquote-autocomplete-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.staffquote-autocomplete-item:hover,
.staffquote-autocomplete-item.highlighted {
    background: #f0f7ff;
}

.staffquote-autocomplete-item.disabled {
    cursor: default;
    color: #888;
}

.staffquote-autocomplete-item.disabled:hover {
    background: transparent;
}

.staffquote-autocomplete-main {
    font-weight: 600;
    color: #333;
}

.staffquote-autocomplete-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

/* ========================================
   Quote editor (staffquote-edit-page)
   ======================================== */
.staffquote-edit-page .items-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.staffquote-edit-page .items-table thead th {
    background: #fafafa;
    padding: 10px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    text-align: left;
    white-space: nowrap;
}

.staffquote-edit-page .items-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.staffquote-edit-page .items-table .action-delete {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.staffquote-edit-page .items-table .action-delete:hover,
.attachments-list .action-delete:hover,
.selected-attachments .action-delete:hover {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
}

.attachments-list .action-delete,
.selected-attachments .action-delete {
    background: transparent;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

/* ========================================
   Customer quote view — countdown
   ======================================== */
.expiry-countdown.urgent .countdown-value {
    color: #e65100;
}

.expiry-countdown.expired .countdown-expired,
.countdown-expired {
    color: #c62828;
}

/* ========================================
   Modals
   ======================================== */
.quote-modal .modal-content,
.staffquote-history-table {
    box-sizing: border-box;
}

/* ========================================
   Request form — product search results
   ======================================== */
.customer-quote-request .product-search-wrapper {
    position: relative;
}

/* ========================================
   Responsive table stacking
   ======================================== */
@media (max-width: 767px) {
    .staffquote-list .quotes-table thead,
    .customer-quote-list .table-quote-list thead {
        display: none;
    }

    .staffquote-list .quotes-table tr,
    .customer-quote-list .table-quote-list tr {
        display: block;
        border-bottom: 2px solid #e0e0e0;
        padding: 8px 0;
    }

    .staffquote-list .quotes-table td,
    .customer-quote-list .table-quote-list td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: none;
        padding: 6px 10px;
        text-align: right;
    }

    .staffquote-list .quotes-table td::before,
    .customer-quote-list .table-quote-list td::before {
        content: attr(data-th);
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #888;
        text-align: left;
    }

    .staffquote-list .quotes-table .col.actions {
        position: static;
        box-shadow: none;
    }
}
