/* ==========================================================================
   RFQ Premium Design System
   Shared across all customer-facing RFQ pages (create, history, bids,
   detail views). Palette/typography match the existing account sidebar
   (layout/new-sidebar.blade.php) and the Make-an-Offer premium module
   (mao_premium.css) so RFQ feels native to the rest of the account area.
   ========================================================================== */

:root {
    --rfq-gold: #E0BB7F;
    --rfq-gold-dark: #c9a55c;
    --rfq-gold-light: #f1dfbc;
    --rfq-gold-wash: rgba(224, 187, 127, 0.1);
    --rfq-ink: #2c2417;
    --rfq-muted: #857a68;
    --rfq-cream: #faf8f5;
    --rfq-surface: #ffffff;
    --rfq-border: #ede6db;
    --rfq-shadow: 0 2px 16px rgba(44, 36, 23, 0.07);
    --rfq-shadow-lg: 0 12px 32px rgba(44, 36, 23, 0.12);
    --rfq-radius: 16px;
    --rfq-radius-sm: 10px;
    /* --rfq-font-display: 'Cormorant Garamond', serif; */
    --rfq-font-display: "Work Sans", sans-serif;
}

/* ── Page shell ── */
.rfq-page {
    font-family: inherit;
    color: var(--rfq-ink);
}

.rfq-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--rfq-surface);
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius);
    box-shadow: var(--rfq-shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.rfq-header__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rfq-gold-dark);
    margin-bottom: 6px;
    display: block;
}

.rfq-header__title {
    font-family: var(--rfq-font-display);
    font-size: 32px;
    font-weight: 600;
    color: var(--rfq-ink);
    margin: 0 0 6px;
    line-height: 1.15;
}

.rfq-header__subtitle {
    font-size: 14px;
    color: var(--rfq-muted);
    margin: 0;
    max-width: 520px;
    line-height: 1.5;
}

/* ── Buttons ── */
.rfq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.3;
}

.rfq-btn:hover,
.rfq-btn:focus-visible {
    text-decoration: none;
    box-shadow: none;
}

.rfq-btn-primary {
    background: linear-gradient(135deg, var(--rfq-gold) 0%, var(--rfq-gold-dark) 100%);
    color: #1a1305;
}

.rfq-btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--rfq-gold-dark) 0%, var(--rfq-gold) 100%);
    color: #1a1305;
}

.rfq-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.rfq-btn-outline {
    background: #fff;
    color: var(--rfq-ink);
    border: 1.5px solid var(--rfq-border);
}

.rfq-btn-outline:hover {
    border-color: var(--rfq-gold);
    color: var(--rfq-gold-dark);
    background: var(--rfq-gold-wash);
}

.rfq-btn-success {
    background: #1f8a4c;
    color: #fff;
}

.rfq-btn-success:hover {
    background: #176c3b;
    color: #fff;
    transform: translateY(-1px);
}

.rfq-btn-sm {
    padding: 6px 14px;
    font-size: 11.5px;
}

.rfq-btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .rfq-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ── Cards ── */
.rfq-card {
    background: var(--rfq-surface);
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius);
    box-shadow: var(--rfq-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.rfq-card-title {
    font-family: var(--rfq-font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--rfq-ink);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rfq-card-title i {
    color: var(--rfq-gold-dark);
}

.rfq-section-hint {
    font-size: 12.5px;
    color: var(--rfq-muted);
    margin: 0 0 18px;
}

/* ── Form sections (create page) ── */
.rfq-form-section {
    background: var(--rfq-surface);
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius);
    box-shadow: var(--rfq-shadow);
    padding: 26px 28px;
    margin-bottom: 20px;
}

.rfq-form-section__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rfq-form-section__num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rfq-gold-wash);
    color: var(--rfq-gold-dark);
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfq-form-section__title {
    font-family: var(--rfq-font-display);
    font-size: 19px;
    font-weight: 600;
    color: var(--rfq-ink);
    margin: 0;
}

.rfq-form-section__desc {
    font-size: 12.5px;
    color: var(--rfq-muted);
    margin: 2px 0 0;
}

.rfq-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rfq-ink);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rfq-label .text-danger {
    font-weight: 600;
}

.rfq-help-icon {
    color: #b7ab97;
    font-size: 13px;
    cursor: help;
    transition: color 0.15s ease;
}

.rfq-help-icon:hover {
    color: var(--rfq-gold-dark);
}

.rfq-page .form-control,
.rfq-page .form-select {
    border: 1.5px solid var(--rfq-border);
    border-radius: var(--rfq-radius-sm);
    padding: 9px 14px;
    font-size: 14px;
    color: var(--rfq-ink);
    background-color: #fffefc;
    height: auto;
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rfq-page .form-control:focus,
.rfq-page .form-select:focus {
    border-color: var(--rfq-gold);
    box-shadow: 0 0 0 3px var(--rfq-gold-wash);
    outline: none;
}

.rfq-page .select2-container--default .select2-selection--single {
    position: relative !important;
    border: 1.5px solid var(--rfq-border) !important;
    border-radius: var(--rfq-radius-sm) !important;
    height: 44px !important;
    display: flex;
    align-items: center;
    padding-left: 4px;
}

/* .select2-selection__arrow's own "position:absolute" normally resolves
   against .select2-container (an unstyled, auto-height wrapper), which is
   what pushed it out of alignment. Making .select2-selection--single itself
   the positioned ancestor above pins the arrow to the exact 44px box we
   control, and height:100% off that definite height keeps it exact instead
   of guessing a px value. */
.rfq-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 20px !important;
    right: 2px !important;
    bottom: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.rfq-page .select2-container--default .select2-selection--single .select2-selection__arrow b {
    position: static !important;
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
}

/* ── Image uploader ── */
.rfq-upload-tile {
    border: 1.5px dashed var(--rfq-border);
    border-radius: var(--rfq-radius-sm);
    background: var(--rfq-cream);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rfq-upload-tile:hover {
    border-color: var(--rfq-gold);
    background: var(--rfq-gold-wash);
}

/* ── Status pills ── */
.rfq-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.rfq-pill-open {
    background: rgba(224, 187, 127, 0.18);
    color: #9a7228;
    border: 1px solid rgba(224, 187, 127, 0.4);
}

.rfq-pill-completed {
    background: rgba(31, 138, 76, 0.12);
    color: #1f8a4c;
    border: 1px solid rgba(31, 138, 76, 0.3);
}

.rfq-pill-neutral {
    background: #f1efe9;
    color: var(--rfq-muted);
    border: 1px solid var(--rfq-border);
}

.rfq-pill-approved {
    background: rgba(31, 138, 76, 0.12);
    color: #1f8a4c;
    border: 1px solid rgba(31, 138, 76, 0.3);
}

.rfq-pill-action {
    background: rgba(224, 187, 127, 0.22);
    color: #8a5a12;
    border: 1px solid rgba(224, 187, 127, 0.5);
    cursor: pointer;
}

/* ── Stat tiles (used on the history page) ── */
.rfq-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 991px) {
    .rfq-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.rfq-stat-tile {
    background: #fff;
    border-radius: var(--rfq-radius);
    padding: 18px 20px;
    box-shadow: var(--rfq-shadow);
    border-left: 4px solid var(--rfq-gold);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rfq-stat-tile__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--rfq-muted);
    font-weight: 600;
}

.rfq-stat-tile__value {
    font-size: 26px;
    font-weight: 800;
    color: var(--rfq-ink);
    line-height: 1;
    font-family: var(--rfq-font-display);
}

/* ── Table polish (wraps existing DataTables markup, no structural change) ── */
.rfq-table-wrap table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
}

.rfq-table-wrap table.dataTable thead th {
    border: none !important;
    background: transparent;
    color: var(--rfq-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding-bottom: 10px !important;
    padding-right: 14px !important;
    white-space: nowrap;
}

/* DataTables' default sort arrows pin themselves to the far-right edge of
   the <th> (position:absolute; right:0.5em/1em), which leaves a big gap
   after short header labels. Un-pin them so they render inline, directly
   after the label text instead. */
.rfq-table-wrap table.dataTable > thead .sorting:before,
.rfq-table-wrap table.dataTable > thead .sorting:after,
.rfq-table-wrap table.dataTable > thead .sorting_asc:before,
.rfq-table-wrap table.dataTable > thead .sorting_asc:after,
.rfq-table-wrap table.dataTable > thead .sorting_desc:before,
.rfq-table-wrap table.dataTable > thead .sorting_desc:after {
    position: static !important;
    display: inline-block !important;
    font-size: 9px !important;
    margin-left: 3px !important;
    color: var(--rfq-gold-dark);
}

.rfq-table-wrap table.dataTable tbody tr {
    background: #fff;
    box-shadow: 0 1px 4px rgba(44, 36, 23, 0.05);
}

.rfq-table-wrap table.dataTable tbody td {
    border-top: 1px solid var(--rfq-border) !important;
    border-bottom: 1px solid var(--rfq-border) !important;
    vertical-align: middle !important;
    padding: 14px 12px !important;
}

.rfq-table-wrap table.dataTable tbody td:first-child {
    border-left: 1px solid var(--rfq-border) !important;
    border-top-left-radius: var(--rfq-radius-sm);
    border-bottom-left-radius: var(--rfq-radius-sm);
}

.rfq-table-wrap table.dataTable tbody td:last-child {
    border-right: 1px solid var(--rfq-border) !important;
    border-top-right-radius: var(--rfq-radius-sm);
    border-bottom-right-radius: var(--rfq-radius-sm);
}

.rfq-table-wrap img {
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.rfq-name-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.3;
}

.rfq-name-cell__title {
    font-weight: 600;
    color: var(--rfq-ink);
}

.rfq-name-cell__category {
    font-size: 11px;
    color: var(--rfq-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rfq-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Restyle the plain Bootstrap badges emitted server-side (statusBadgeClasses)
   into the pill look, without needing to touch the controller markup. */
.rfq-table-wrap .badge {
    border-radius: 20px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 13px !important;
}

.rfq-table-wrap .badge.bg-secondary {
    background: #f1efe9 !important;
    color: var(--rfq-muted) !important;
}

.rfq-table-wrap .badge.bg-warning {
    background: rgba(224, 187, 127, 0.22) !important;
    color: #8a5a12 !important;
}

.rfq-table-wrap .badge.bg-primary {
    background: rgba(224, 187, 127, 0.18) !important;
    color: #9a7228 !important;
}

.rfq-table-wrap .badge.bg-success {
    background: rgba(31, 138, 76, 0.12) !important;
    color: #1f8a4c !important;
}

.rfq-empty-note {
    font-size: 12.5px;
    color: var(--rfq-muted);
    background: var(--rfq-gold-wash);
    border: 1px solid rgba(224, 187, 127, 0.3);
    border-radius: var(--rfq-radius-sm);
    padding: 6px 12px;
    display: inline-block;
}

/* ── Filter bar ── */
.rfq-filter-bar {
    background: var(--rfq-surface);
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius);
    box-shadow: var(--rfq-shadow);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.rfq-filter-bar__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rfq-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Spec sheet (detail pages) ── */
.rfq-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.rfq-spec-item {
    background: var(--rfq-cream);
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rfq-spec-item i {
    color: var(--rfq-gold-dark);
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

.rfq-spec-item__label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rfq-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.rfq-spec-item__value {
    font-size: 14px;
    color: var(--rfq-ink);
    /* font-weight: 600; */
    word-break: break-word;
}

.rfq-spec-item__value.price {
    font-family: var(--rfq-font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--rfq-gold-dark);
}

.rfq-carousel-card {
    background: var(--rfq-surface);
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius);
    box-shadow: var(--rfq-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.rfq-carousel-card .carousel-inner {
    border-radius: var(--rfq-radius-sm);
}

/* ── Detail page: image + spec side by side ── */
.rfq-detail-layout {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 20px;
}

.rfq-detail-layout__media {
    flex: 0 0 360px;
    max-width: 360px;
    position: sticky;
    top: 20px;
    margin-bottom: 0;
}

.rfq-detail-layout__info {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .rfq-detail-layout {
        flex-direction: column;
    }

    .rfq-detail-layout__media {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        position: static;
    }
}

/* ── Empty state ── */
.rfq-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--rfq-surface);
    border: 1px dashed var(--rfq-border);
    border-radius: var(--rfq-radius);
}

.rfq-empty-state i {
    font-size: 40px;
    color: var(--rfq-gold);
    margin-bottom: 14px;
    display: block;
}

.rfq-empty-state h5 {
    font-family: var(--rfq-font-display);
    font-size: 20px;
    color: var(--rfq-ink);
    margin-bottom: 8px;
}

.rfq-empty-state p {
    font-size: 13.5px;
    color: var(--rfq-muted);
    margin-bottom: 18px;
}

/* ── Custom Bootstrap tooltip skin ── */
.tooltip.rfq-tooltip .tooltip-inner {
    background: #fff;
    color: var(--rfq-ink);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: left;
    padding: 9px 13px;
    border-radius: 10px;
    max-width: 230px;
    line-height: 1.5;
    border: 1px solid var(--rfq-gold);
    box-shadow: 0 8px 20px rgba(44, 36, 23, 0.12);
}

.tooltip.rfq-tooltip[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: var(--rfq-gold);
}

.tooltip.rfq-tooltip[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: var(--rfq-gold);
}

.tooltip.rfq-tooltip[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: var(--rfq-gold);
}

/* Bootstrap 4 (public marketing pages) uses Popper v1: a ".arrow" element
   plus "x-placement"/".bs-tooltip-*" instead of Bootstrap 5's
   "data-popper-placement"/".tooltip-arrow" — same rules, v4 selectors. */
.tooltip.rfq-tooltip.bs-tooltip-top .arrow::before,
.tooltip.rfq-tooltip[x-placement^="top"] .arrow::before {
    border-top-color: var(--rfq-gold);
}

.tooltip.rfq-tooltip.bs-tooltip-bottom .arrow::before,
.tooltip.rfq-tooltip[x-placement^="bottom"] .arrow::before {
    border-bottom-color: var(--rfq-gold);
}

.tooltip.rfq-tooltip.bs-tooltip-left .arrow::before,
.tooltip.rfq-tooltip[x-placement^="left"] .arrow::before {
    border-left-color: var(--rfq-gold);
}

.tooltip.rfq-tooltip.bs-tooltip-right .arrow::before,
.tooltip.rfq-tooltip[x-placement^="right"] .arrow::before {
    border-right-color: var(--rfq-gold);
}

.tooltip.rfq-tooltip[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: var(--rfq-gold);
}

@media (max-width: 767px) {
    .rfq-header__title { font-size: 26px; }
    .rfq-header { padding: 18px 16px; margin-bottom: 18px; }
    .rfq-form-section { padding: 20px 18px; }
    .rfq-stat-grid { grid-template-columns: 1fr 1fr; }
    .rfq-card { padding: 18px; }
    .rfq-carousel-card { padding: 14px; }
    .rfq-filter-bar { padding: 14px 16px; }
}

@media (max-width: 575px) {
    .rfq-header > a.rfq-btn,
    .rfq-header > button.rfq-btn {
        width: 100%;
    }

    .rfq-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .rfq-action-row > a.rfq-btn,
    .rfq-action-row > div > button.rfq-btn {
        width: 100%;
    }
}
