/* ProcumanAI supplier search — same look & feel as the old draft */
:root {
    --primary: #1f6feb;
    --primary-hover: #1858c4;
    --bg: #f7f8fa;
    --card-bg: #ffffff;
    --border: #e2e6ec;
    --text: #1d2330;
    --text-muted: #5b6573;
    --success: #198754;
    --warning: #fd7e14;
    --danger: #dc3545;
    --radius: 10px;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex; align-items: center; gap: 18px;
}
header .logo img { height: 32px; display: block; }
header p { margin: 0; color: var(--text-muted); font-size: 14px; }

main {
    max-width: 880px;
    margin: 32px auto 64px;
    padding: 0 16px;
}

.search-card,
.rfq-form,
.rfq-section,
.results,
.rfq-summary,
.recipients-section,
.attachments-section,
.line-items-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
}
.rfq-form { display: grid; gap: 16px; padding: 0; border: 0; box-shadow: none; background: transparent; }
.rfq-form > .rfq-section { margin-bottom: 0; }
.rfq-form > .actions { margin-top: 8px; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; color: var(--text); }
.field .req { color: var(--danger); }
.field select,
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="file"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="password"],
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field select:focus,
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input[readonly] { background: #f8f9fb; color: var(--text-muted); }

.rfq-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.rfq-section .hint {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}
.rfq-section .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.rfq-section .row .field { min-width: 0; }
@media (max-width: 600px) {
    .rfq-section .row { grid-template-columns: 1fr; }
}

.optional-tag {
    font-size: .55em;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
    vertical-align: middle;
}
.required-mark {
    color: #dc2626;
    font-weight: 700;
    margin-left: 2px;
}
.optional-mark {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
    margin-left: 6px;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    .field-row { grid-template-columns: 1fr; }
}
.success-banner {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    color: #065f46;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}
.role-readout {
    display: inline-block;
    padding: 8px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.readonly-value {
    display: inline-block;
    padding: 9px 12px;
    background: #f8fafc;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
}
.hint {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

/* ----- Upgrade card (quota + tier selection) ----- */

.quota-current {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 22px;
}
.quota-current__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}
.quota-current__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}
.quota-current__plan {
    font-size: 15px;
    color: #0f172a;
}
.quota-current__usage {
    text-align: right;
}
.quota-current__count strong {
    font-size: 26px;
    color: #0f172a;
    font-weight: 700;
}
.quota-current__count span {
    font-size: 18px;
    color: #64748b;
}
.quota-current__period {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.quota-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0 10px;
}
.quota-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}
.quota-bar__fill--ok   { background: linear-gradient(90deg, #34d399, #10b981); }
.quota-bar__fill--high { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.quota-bar__fill--full { background: linear-gradient(90deg, #f87171, #ef4444); }
.quota-current__footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    flex-wrap: wrap;
    gap: 6px;
}
.quota-current__exceeded {
    color: #b91c1c;
    font-weight: 600;
}
.upgrade-heading {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 4px;
    color: #0f172a;
}
.upgrade-sub {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 18px;
}
.tier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 14px;
}
@media (max-width: 860px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tier-grid { grid-template-columns: 1fr; } }
.tier-card {
    background: #fff;
    border: 1.5px solid #e5e9f2;
    border-radius: 10px;
    padding: 18px 16px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.tier-card--current {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.tier-card__badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: #1d4ed8;
    color: #fff;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.tier-card__name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.tier-card__quota {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}
.tier-card__quota-num {
    font-size: 28px;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1;
}
.tier-card__quota-unit {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.tier-card__price {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
    margin-bottom: 10px;
}
.tier-card__tagline {
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
    margin-bottom: 12px;
    min-height: 32px;
}
.tier-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.6;
    flex: 1;
}
.tier-card__features li { padding: 2px 0; }
.tier-card__form { margin: 0; }
.tier-card__btn {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 0;
    transition: background 0.15s;
    text-align: center;
}
.tier-card__btn--choose {
    background: #1d4ed8;
    color: #fff;
}
.tier-card__btn--choose:hover { background: #1e40af; }
.tier-card__btn--current {
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
    border: 1px solid #e2e8f0;
}

/* ----- Quota-exceeded banner on RFQ form ----- */
.quota-exceeded-banner {
    background: #fef2f2;
    border: 1.5px solid #ef4444;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0;
    color: #7f1d1d;
}
.quota-exceeded-banner__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #991b1b;
}
.quota-exceeded-banner__msg {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
}
.quota-exceeded-banner__cta {
    display: inline-block;
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}
.quota-exceeded-banner__cta:hover { background: #1e40af; }

/* ----- Non-exceeded quota status banner on the RFQ form ----- */
.quota-info-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 3px solid #0284c7;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 14px 0;
    font-size: 13.5px;
    color: #0c4a6e;
}
.quota-info-banner__plan { font-weight: 600; }
.quota-info-banner__usage strong { color: #0c4a6e; font-size: 14px; }
.quota-info-banner__remaining { color: #0369a1; font-weight: 500; }
.quota-info-banner__link {
    margin-left: auto;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}
.quota-info-banner__link:hover { text-decoration: underline; }

/* ----- Admin pages ----- */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
.admin-stat {
    background: #fff;
    border: 1.5px solid #e5e9f2;
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.05s;
}
.admin-stat:hover { border-color: #1d4ed8; transform: translateY(-1px); }
.admin-stat--warn { background: #fef2f2; border-color: #fca5a5; }
.admin-stat__num {
    font-size: 26px;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1.1;
}
.admin-stat--warn .admin-stat__num { color: #b91c1c; }
.admin-stat__lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-top: 4px;
    font-weight: 600;
}

.admin-h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 18px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e9f2;
}
.admin-h3 {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin: 16px 0 8px;
}
.admin-meta {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 14px;
}
.admin-block {
    background: #f8fafc;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    padding: 12px 14px;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    margin-bottom: 6px;
}
.admin-empty {
    color: #94a3b8;
    font-style: italic;
    padding: 12px 0;
}
.admin-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.admin-fs-12 { font-size: 12px; }
.admin-fs-13 { font-size: 13px; }
.admin-tar   { text-align: right; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-bottom: 8px;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e9f2;
    vertical-align: top;
}
.admin-table thead th {
    background: #f1f5f9;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    font-weight: 600;
    border-bottom: 2px solid #cbd5e1;
}
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table--compact th, .admin-table--compact td { padding: 5px 8px; }
.admin-row--blocked { background: #fef2f2; }
.admin-row--blocked:hover { background: #fee2e2; }

.admin-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #e2e8f0;
    color: #475569;
}
.admin-pill--open       { background: #dbeafe; color: #1e40af; }
.admin-pill--bidding    { background: #ddd6fe; color: #6d28d9; }
.admin-pill--evaluating { background: #fef3c7; color: #92400e; }
.admin-pill--awarded    { background: #d1fae5; color: #065f46; }
.admin-pill--closed     { background: #e2e8f0; color: #475569; }
.admin-pill--cancelled  { background: #fecaca; color: #991b1b; }
.admin-pill--draft      { background: #f1f5f9; color: #64748b; }
.admin-pill--sending    { background: #cffafe; color: #155e75; }
.admin-pill--pending    { background: #f1f5f9; color: #64748b; }
.admin-pill--sent       { background: #dbeafe; color: #1e40af; }
.admin-pill--admin      { background: #1d4ed8; color: #fff; }
.admin-pill--blocked    { background: #dc2626; color: #fff; }
.admin-pill--tier-free         { background: #f1f5f9; color: #475569; }
.admin-pill--tier-starter      { background: #dbeafe; color: #1e40af; }
.admin-pill--tier-professional { background: #cffafe; color: #155e75; }
.admin-pill--tier-enterprise   { background: #1d4ed8; color: #fff; }

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e9f2;
    font-size: 13px;
}
.admin-toolbar a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}
.admin-toolbar a:hover { text-decoration: underline; }
.admin-toolbar__count {
    margin-left: auto;
    color: #94a3b8;
    font-size: 12px;
}
.admin-pagination {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}
.admin-pagination nav { font-size: 13px; }

.admin-actions { white-space: nowrap; }
.admin-btn {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 0;
    text-decoration: none;
    transition: background 0.15s;
}
.admin-btn--block {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}
.admin-btn--block:hover { background: #fee2e2; }

/* Extra-small admin button (used inline in table rows) */
.admin-btn--xs {
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 4px;
}
.admin-btn--xs summary { display: inline; cursor: pointer; }

/* Inline-block dropdown used on admin/bids and admin/rfq-show rows.
   The <details> element expands below the table cell to show a
   reason field + confirm button. */
.admin-inline-block { display: inline-block; }
.admin-inline-block summary {
    list-style: none;
    display: inline-block;
}
.admin-inline-block summary::-webkit-details-marker { display: none; }
.admin-inline-block form {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    min-width: 240px;
    position: relative;
    z-index: 5;
}
.admin-inline-block textarea {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}
.admin-btn--unblock {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.admin-btn--unblock:hover { background: #a7f3d0; }
.admin-block-form summary { list-style: none; }
.admin-block-form summary::-webkit-details-marker { display: none; }
.admin-block-form[open] summary { display: none; }
.admin-block-form textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e5e9f2;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 4px;
    font-family: inherit;
    resize: vertical;
}

.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.powered-by { color: var(--text-muted); font-size: 13px; }
.powered-by a { font-weight: 600; }

button#searchBtn,
.btn-primary,
button#submitBtn {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, transform 0.05s;
    text-decoration: none;
    font-family: inherit;
}
button#searchBtn:hover:not(:disabled),
.btn-primary:hover,
button#submitBtn:hover:not(:disabled) { background: var(--primary-hover); text-decoration: none; }
button#searchBtn:active:not(:disabled),
button#submitBtn:active:not(:disabled) { transform: translateY(1px); }
button#searchBtn:disabled, button#searchBtn.is-loading,
button#submitBtn:disabled, button#submitBtn.is-loading { opacity: 0.6; cursor: progress; }
button#searchBtn svg,
button#submitBtn svg { width: 16px; height: 16px; }
.btn-primary svg { width: 16px; height: 16px; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: #f8f9fb; border-color: var(--text-muted); text-decoration: none; }

.error-banner {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #fdecea;
    border: 1px solid #f5c2c7;
    color: #842029;
    border-radius: 8px;
}
.info-banner {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #e7f1ff;
    border: 1px solid #b6d4fe;
    color: #084298;
    border-radius: 8px;
}
.info-banner strong { color: inherit; }
.info-banner--success {
    background: #d1e7dd;
    border-color: #a3cfbb;
    color: #0a3622;
}

.results {
    margin-top: 28px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
}
.results-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.results-header h2 { margin: 0; font-size: 22px; }
.results-header svg { width: 22px; height: 22px; color: var(--primary); }
.results-header .badge {
    margin-left: auto;
    background: rgba(31, 111, 235, 0.10);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.results-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
}
.results-meta .meta-label { color: var(--text-muted); margin-right: 4px; }
.results-meta strong { color: var(--text); }

.rfq-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 12px;
}
.rfq-bar button {
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.rfq-bar button:hover { background: var(--primary); color: #fff; }
.rfq-bar .rfq-cta {
    background: var(--success);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
}
.rfq-bar .rfq-cta:hover { background: #157347; text-decoration: none; }

.result-body { line-height: 1.55; }
.result-body h2, .result-body h3, .result-body h4 { margin-top: 1.2em; margin-bottom: 0.4em; }
.result-body ul { margin: 0.4em 0 0.4em 1.4em; }
.result-body p { margin: 0.4em 0; }
.result-body strong { color: var(--text); }

.supplier-record {
    position: relative;
    padding: 10px 12px 10px 12px;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
}
.supplier-record:has(.rfq-toggle:checked) {
    background: rgba(25, 135, 84, 0.07);
    border-color: rgba(25, 135, 84, 0.4);
}
.rfq-toggle { position: absolute; opacity: 0; pointer-events: none; }
.rfq-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rfq-btn svg { width: 12px; height: 12px; display: none; }
.rfq-toggle:checked + .rfq-btn {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.rfq-toggle:checked + .rfq-btn svg { display: inline-block; }
.rfq-toggle:checked + .rfq-btn .rfq-label-default { display: none; }
.rfq-toggle:not(:checked) + .rfq-btn .rfq-label-selected { display: none; }

.sources {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.sources summary { cursor: pointer; font-weight: 600; }
.sources ul { margin: 8px 0 0 0; padding: 0 0 0 16px; }
.sources li { margin: 4px 0; }

/* --- RFQ Attachment list (show page) --- */
.attachments-section ul.attachment-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.attachments-section ul.attachment-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-subtle, #f8f9fb);
    border-radius: 8px;
    font-size: .92em;
}
.attachments-section .att-icon { font-size: 1.3em; line-height: 1; }
.attachments-section .att-size {
    color: var(--text-muted, #888);
    font-size: .85em;
}

/* --- Line items list (show page) --- */
.line-items-section ul.line-items-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.line-items-section ul.line-items-list li {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-subtle, #f8f9fb);
    border-radius: 6px;
    font-size: .95em;
}
.line-items-section .li-bullet { color: var(--text-muted, #aaa); }
.line-items-section .li-title { font-weight: 600; }
.line-items-section .li-qty { color: var(--text-muted, #666); }

/* === RFQ form: supplier cards, line-item cards, add buttons === */
.supplier-card,
.line-item-card {
    position: relative;
    padding: 18px 20px 14px 20px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}
.supplier-card .row,
.line-item-card .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.remove-supplier,
.remove-line-item {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.remove-supplier:hover,
.remove-line-item:hover { background: #fdecea; }

.add-supplier,
.add-line-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 2px dashed var(--border);
    border-radius: 8px;
    color: var(--primary);
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    margin-top: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.add-supplier:hover,
.add-line-item:hover {
    background: rgba(31, 111, 235, 0.05);
    border-color: var(--primary);
}

/* === Show page RFQ summary === */
.rfq-summary h1 {
    margin: 12px 0 8px;
    font-size: 28px;
    color: var(--text);
}
.rfq-summary .meta {
    display: flex; flex-wrap: wrap; gap: 14px;
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 14px;
}
.rfq-summary .description {
    margin: 16px 0;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}
.rfq-meta-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 16px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.rfq-meta-grid dt { color: var(--text-muted); font-weight: 600; }
.rfq-meta-grid dd { margin: 0; color: var(--text); }
.rfq-meta-grid dd code {
    background: #f3f5f8;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(31, 111, 235, 0.10);
    color: var(--primary);
}
.status-pill.status-sm { padding: 2px 8px; font-size: 11px; }
.status-pill.status-open { background: rgba(25, 135, 84, 0.10); color: var(--success); }
.status-pill.status-pending { background: rgba(253, 126, 20, 0.10); color: var(--warning); }
.status-pill.status-draft { background: rgba(91, 101, 115, 0.10); color: var(--text-muted); }

/* === Show page recipients table === */
.recipients-section h2,
.line-items-section h2,
.attachments-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--text);
}
.recipients-section .hint,
.attachments-section .hint {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}
.recipients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.recipients-table th,
.recipients-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.recipients-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #fafbfc;
}
.recipients-table tr:last-child td { border-bottom: 0; }
.recipients-table small { color: var(--text-muted); }
.recipients-table code {
    background: #f3f5f8;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.bid-link {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: #fff;
    cursor: pointer;
}

/* === Attachment drop zone + file list (create form) === */
.attachments-wrap { margin-top: 8px; }
.attachment-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.attachment-drop svg {
    width: 32px;
    height: 32px;
    opacity: 0.55;
    color: var(--text-muted);
}
.attachment-drop:hover,
.attachment-drop.drag-over {
    border-color: var(--primary);
    background: rgba(31, 111, 235, 0.05);
}
.attachment-drop span {
    font-weight: 600;
    color: var(--text);
}
.attachment-drop small {
    color: var(--text-muted);
    font-size: 0.85em;
}
.attachments-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.attachments-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fafbfc;
    border-radius: 8px;
    font-size: 0.92em;
    border: 1px solid var(--border);
}
.file-icon { font-size: 1.3em; line-height: 1; }
.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-size {
    color: var(--text-muted);
    font-size: 0.85em;
    flex-shrink: 0;
}
.remove-file {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: var(--danger);
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.remove-file:hover { color: #a00; }

/* === Buyer email hint (real-time domain check) === */
.email-hint {
    display: block;
    font-size: 0.85em;
    margin-top: 4px;
    color: var(--text-muted);
}
.email-hint--ok { color: var(--success); }
.email-hint--bad {
    color: var(--danger);
    font-weight: 500;
}

/* === Email verification modal (mirrors the legacy index.php) === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    padding: 1.75rem;
    max-width: 440px;
    width: 100%;
    animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}
.modal p.sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}
.modal .form-group { margin-bottom: 1rem; }
.modal .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}
.modal-msg {
    font-size: 0.88rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: none;
}
.modal-msg.success { display: block; background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.modal-msg.error   { display: block; background: #fef2f2; color: var(--danger);  border: 1px solid #fecaca; }
.modal-msg.info    { display: block; background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }
.modal-msg code {
    background: #f3f5f8;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.95em;
}

.modal input[readonly],
.modal input[aria-readonly="true"] {
    background: #f8fafc;
    color: var(--text);
    border-color: #cbd5e1;
    cursor: default;
    caret-color: transparent;
}
.modal input[readonly]:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: none;
}
.modal .form-hint {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.modal .form-hint a {
    color: var(--primary);
    text-decoration: underline;
}
.modal .btn-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.modal .btn-row .btn-secondary,
.modal .btn-row .btn-primary {
    flex: 1;
    justify-content: center;
    margin-top: 0;
}
.step-indicator {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.step-indicator .dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.3s;
}
.step-indicator .dot.active { background: var(--primary); }
.step-indicator .dot.done   { background: var(--success); }

/* === Bid submission page (public) === */
.bid-form-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--text);
}
.bid-form .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.bid-form .row .field { min-width: 0; }
.bid-form .row .field[style*="max-width"] { max-width: 120px; }
.bid-summary {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px 20px;
}

/* ====================================================================
   Procuman auth — small blue login/register buttons + auth pages
   ==================================================================== */

/* Push the auth nav to the right edge of the page header */
.auth-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.auth-nav-greeting {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.auth-nav-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(25,135,84,0.18);
    flex-shrink: 0;
}
.auth-nav-form { margin: 0; padding: 0; display: inline; }

/* Small blue buttons (header) and primary button (forms) */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
    text-decoration: none !important;
    font-family: inherit;
    white-space: nowrap;
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.auth-btn--blue {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 1px 2px rgba(29,78,216,0.20);
}
.auth-btn--blue:hover { background: #1e40af; border-color: #1e40af; }

.auth-btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.auth-btn--ghost:hover { background: #f1f5f9; border-color: #cbd5e1; }

.auth-btn--primary {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(29,78,216,0.20);
}
.auth-btn--primary:hover { background: #1e40af; border-color: #1e40af; }
.auth-btn--primary:disabled { background: #94a3b8; border-color: #94a3b8; cursor: not-allowed; box-shadow: none; }

.auth-btn--block { width: 100%; }
.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ----- Auth pages (login, register, check-email, please-login) ----- */
.auth-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.auth-header .logo img { height: 32px; display: block; }
.auth-header > p { margin: 0; color: var(--text-muted); font-size: 14px; flex: 0 0 auto; }

.auth-main {
    max-width: 520px;
    margin: 40px auto 64px;
    padding: 0 16px;
}
.auth-main--wide {
    max-width: 1100px;
}
.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 28px 32px;
}
.auth-card h1 { margin: 0 0 6px 0; font-size: 24px; }
.auth-sub { color: var(--text-muted); margin: 0 0 18px 0; line-height: 1.5; }
.auth-sub strong { color: var(--text); }
.auth-foot { font-size: 14px; color: var(--text-muted); margin: 18px 0 0 0; text-align: center; }

.auth-card--centered { text-align: center; }
.auth-card--centered .auth-sub { text-align: left; }

.check-mail-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
}

.auth-form { display: grid; gap: 14px; }
.auth-form .field label { font-weight: 600; font-size: 14px; }

.role-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.role-toggle__opt {
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.role-toggle__opt:hover { background: #f1f5f9; }
.role-toggle__opt input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}
.role-toggle__opt:has(input:checked) {
    background: #eff6ff;
    border-color: #1d4ed8;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px #1d4ed8;
}

.optional-tag {
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

.dev-only-box {
    margin-top: 24px;
    background: #fef9c3;
    border: 1px dashed #ca8a04;
    border-radius: 8px;
    padding: 14px 16px;
    color: #713f12;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}
.dev-only-url { margin-top: 6px; }
.dev-only-url a { color: #1d4ed8; word-break: break-all; }
.dev-only-foot { font-size: 12px; color: #92400e; margin-top: 6px; }

/* ----- Dashboards ----- */
.dashboard-main {
    max-width: 1100px;
    margin: 32px auto 64px;
    padding: 0 16px;
    display: grid;
    gap: 20px;
}
.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px 28px;
}
.dashboard-card h1 { margin: 0; font-size: 22px; }
.dashboard-card h2 { margin: 0 0 12px 0; font-size: 16px; }
.dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.dashboard-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.dashboard-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-empty {
    text-align: center;
    padding: 28px 12px;
    color: var(--text-muted);
}
.dashboard-empty p { margin: 0 0 14px 0; }

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.dashboard-table th, .dashboard-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.dashboard-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dashboard-table tr:last-child td { border-bottom: 0; }
.dashboard-table .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dashboard-table .muted { color: var(--text-muted); }
.dashboard-table .good { color: var(--success); font-weight: 600; }
.dashboard-table .link { color: var(--primary); }

.status-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e2e8f0;
    color: #334155;
}
.status-pill.status-open,
.status-pill.status-sent { background: #dbeafe; color: #1e40af; }
.status-pill.status-submitted,
.status-pill.status-bidding { background: #dcfce7; color: #166534; }
.status-pill.status-draft,
.status-pill.status-pending { background: #fef3c7; color: #92400e; }
.status-pill.status-bounced,
.status-pill.status-declined,
.status-pill.status-cancelled,
.status-pill.status-closed { background: #fee2e2; color: #991b1b; }
.status-pill.status-awarded { background: #f3e8ff; color: #6b21a8; }
.status-pill.status-evaluating { background: #ffedd5; color: #9a3412; }
.status-pill.status-sending { background: #cffafe; color: #155e75; }
.status-pill.status-opened { background: #e0e7ff; color: #3730a3; }

/* Email hint styles (used by login + register pages) */
.email-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    min-height: 1.2em;
}
.email-hint--ok { color: var(--success); }
.email-hint--bad { color: var(--danger); }

/* ----- Header layout adjustments (search/rfq/bid pages) ----- */
@media (max-width: 640px) {
    .auth-header { flex-direction: column; align-items: flex-start; }
    .auth-nav { margin-left: 0; width: 100%; justify-content: flex-start; }
    .auth-main { margin: 24px auto 48px; }
    .auth-card { padding: 20px 18px; }
}

/* ====================================================================
   Bid evaluation (RFQ show page) — added 2026-06-14
   ==================================================================== */

.bids-section .bids-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.bids-section h2 { margin: 0; }

.weights-editor {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 18px;
    transition: background 0.15s;
}
.weights-editor[open] { background: #f1f5f9; padding: 14px; }
.weights-editor summary {
    cursor: pointer;
    padding: 12px 0;
    font-weight: 600;
    color: var(--text-muted);
    list-style: none;
    user-select: none;
}
.weights-editor summary::-webkit-details-marker { display: none; }
.weights-editor summary::before {
    content: '⚖️ ';
    margin-right: 4px;
}

.weights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 6px;
}
.weight-cell {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    gap: 8px;
    font-weight: 600;
}
.weight-cell input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    text-align: right;
    font-family: inherit;
}
.weight-cell .weight-unit { color: var(--text-muted); font-size: 13px; }
.weight-label { flex: 1; }

.weights-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* Bids table */
.bids-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 6px;
}
.bids-table th, .bids-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.bids-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
}
.bids-table tr:last-child td { border-bottom: 0; }
.bids-table .num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bids-table .muted { color: var(--text-muted); }

.bid-row--just-evaluated {
    animation: row-flash 1.8s ease-out;
}
@keyframes row-flash {
    0%   { background-color: #fef9c3; }
    100% { background-color: transparent; }
}

/* Score pills (0–10) */
.score-pill {
    display: inline-block;
    min-width: 38px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid transparent;
    font-variant-numeric: tabular-nums;
}
.score-pill--filled {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.score-reason {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 220px;
}

/* Total pill */
.total-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.total-pill small { font-size: 11px; font-weight: 500; opacity: 0.7; }
.total-pill--filled {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(29,78,216,0.20);
}
.total-pill--empty {
    background: #f1f5f9;
    color: #94a3b8;
}

/* Source tag */
.source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.source-tag--ai {
    background: #ede9fe;
    color: #5b21b6;
}
.source-tag--manual {
    background: #d1fae5;
    color: #065f46;
}

/* Bid actions */
.bid-actions {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bid-actions form { margin: 0; }
.bid-actions .ai-eval-btn,
.bid-actions .manual-toggle {
    width: 100%;
    text-align: center;
}

.manual-form {
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}
.manual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}
.manual-grid label {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    gap: 3px;
}
.manual-grid input {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
}
.manual-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.manual-actions .auth-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Bid notes (supplier free text) */
.bid-notes {
    margin-top: 6px;
}
.bid-notes summary {
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
    list-style: none;
}
.bid-notes summary::-webkit-details-marker { display: none; }
.bid-notes summary::before { content: '📝 '; }
.bid-notes-body {
    margin-top: 4px;
    padding: 8px 10px;
    background: #fef9c3;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #78350f;
    white-space: pre-wrap;
}

/* Bid attachments (file uploads the supplier included) */
.bid-attachments {
    margin-top: 6px;
}
.bid-attachments summary {
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
    list-style: none;
}
.bid-attachments summary::-webkit-details-marker { display: none; }
.bid-attachments summary::before { content: '📎 '; }
.bid-attachments-list {
    margin: 4px 0 0 0;
    padding: 6px 10px;
    background: #eff6ff;
    border-left: 3px solid #1d4ed8;
    border-radius: 4px;
    list-style: none;
    font-size: 12px;
    line-height: 1.6;
}
.bid-attachments-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bid-attachments-list a { color: #1d4ed8; text-decoration: none; }
.bid-attachments-list a:hover { text-decoration: underline; }
.bid-attachments-list .att-size { color: #94a3b8; font-size: 11px; margin-left: 4px; }
.bid-attachments-list .att-icon { margin-right: 4px; }

/* Winner banner */
.winner-banner {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    font-size: 15px;
    color: #78350f;
}
.winner-banner strong { color: #92400e; }
.winner-banner .muted { color: #a16207; }

/* Responsive: stack the score columns on narrow viewports */
@media (max-width: 900px) {
    .weights-grid { grid-template-columns: 1fr; }
    .bids-table { font-size: 13px; }
    .bids-table th, .bids-table td { padding: 6px 4px; }
    .bids-table th:nth-child(3),
    .bids-table td:nth-child(3),
    .bids-table th:nth-child(4),
    .bids-table td:nth-child(4) { display: none; }
    .bid-actions { min-width: 140px; }
}

/* ===== RFQ Q&A section ===== */
.qa-section {
    margin-top: 28px;
    padding: 20px 22px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(15,23,42,.06);
}
.qa-section h2 { margin: 0 0 12px 0; font-size: 18px; display: flex; align-items: center; gap: 6px; }

.qa-list { display: flex; flex-direction: column; gap: 14px; }

.qa-card {
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fafbfc;
}

.qa-question { margin-bottom: 10px; }
.qa-asker {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}
.qa-date {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 8px;
}
.qa-question-text {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    white-space: pre-wrap;
}

.qa-answer { padding-left: 14px; border-left: 2px solid #1d4ed8; }
.qa-answer-bubble { }
.qa-answerer {
    font-weight: 600;
    font-size: 13px;
    color: #065f46;
}
.qa-answer-text {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    white-space: pre-wrap;
}
.qa-unanswered {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

.qa-answer-form { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.qa-input {
    width: 100%;
    max-width: 540px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    resize: vertical;
    box-sizing: border-box;
}
.qa-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,.12);
}

.qa-new-details { margin-top: 16px; }
.qa-new-summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #1d4ed8;
    padding: 4px 0;
    user-select: none;
}
.qa-new-summary:hover { color: #1e40af; }

.qa-new-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ===== AI search modal (ProcumanAI is on it) ===== */
/* Shown while the supplier-search POST is in flight. Pure CSS animation
   plus a JS text rotator; no AJAX/polling — the page reload tears it down. */
.ai-search-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    animation: ai-modal-in 240ms ease-out;
}
.ai-search-modal[hidden] { display: none !important; }
.ai-search-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.ai-search-modal__card {
    position: relative;
    width: min(420px, 92vw);
    background: #ffffff;
    border-radius: 14px;
    padding: 28px 28px 22px 28px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    text-align: center;
}
.ai-search-modal__title {
    margin: 14px 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.ai-search-modal__text {
    margin: 0 0 18px 0;
    min-height: 20px;
    font-size: 14px;
    color: #475569;
    transition: opacity 220ms ease;
}
.ai-search-modal__text.is-fading { opacity: 0; }
.ai-search-modal__bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.ai-search-modal__bar-fill {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 40%;
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 50%, #1d4ed8 100%);
    border-radius: 999px;
    animation: ai-bar-slide 1.6s ease-in-out infinite;
}
.ai-search-modal__hint {
    margin: 14px 0 0 0;
    font-size: 12px;
    color: #94a3b8;
}

/* Three-pulse orb icon */
.ai-search-modal__orb {
    position: relative;
    width: 56px; height: 56px;
    margin: 0 auto;
}
.ai-search-modal__orb span {
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: #1d4ed8;
    opacity: 0.8;
    animation: ai-orb-pulse 1.4s ease-in-out infinite;
}
.ai-search-modal__orb span:nth-child(2) { animation-delay: 0.2s; background: #3b82f6; }
.ai-search-modal__orb span:nth-child(3) { animation-delay: 0.4s; background: #60a5fa; }

@keyframes ai-bar-slide {
    0%   { left: -40%; }
    100% { left: 100%; }
}
@keyframes ai-orb-pulse {
    0%, 100% { transform: scale(0.6); opacity: 0.3; }
    50%      { transform: scale(1.2); opacity: 0.95; }
}
@keyframes ai-modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}



/* ============================================================================
   AI RFQ 3-step breadcrumb / progress indicator
   Added 2026-06-18 per Tim — guides users through the 3-step RFQ flow.
   ============================================================================ */

.rfq-stepper {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 24px;
    margin: 0 0 16px 0;
}

.rfq-stepper__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
}

.rfq-step {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Connector line between steps (drawn on the left of each step except first) */
.rfq-step + .rfq-step::before {
    content: "";
    flex: 1 1 auto;
    height: 2px;
    background: var(--border);
    margin: 0 12px;
    min-width: 24px;
    border-radius: 2px;
}

.rfq-step.is-done + .rfq-step::before,
.rfq-step.is-current + .rfq-step::before {
    background: var(--primary);
}

.rfq-step__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 8px;
    min-width: 0;
}

a.rfq-step__inner:hover {
    text-decoration: none;
    background: rgba(31, 111, 235, 0.06);
    color: var(--primary);
}

.rfq-step__num {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
}

.rfq-step__label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Done state (steps before the current one) */
.rfq-step.is-done .rfq-step__num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.rfq-step.is-done .rfq-step__label {
    color: var(--text);
}
a.rfq-step__inner .rfq-step__num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Current step */
.rfq-step.is-current .rfq-step__inner {
    color: var(--text);
    cursor: default;
}
.rfq-step.is-current .rfq-step__num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.18);
}
.rfq-step.is-current .rfq-step__label {
    color: var(--text);
    font-weight: 700;
}

/* Upcoming steps (no special class — just default) */

/* Responsive: drop to a vertical stack on narrow screens */
@media (max-width: 640px) {
    .rfq-stepper__list { flex-direction: column; align-items: stretch; gap: 0; }
    .rfq-step { flex-direction: column; align-items: stretch; padding: 8px 0; }
    .rfq-step + .rfq-step::before {
        width: 2px;
        height: 18px;
        margin: 0 auto;
    }
    .rfq-step__inner { justify-content: flex-start; }
    .rfq-step__label { white-space: normal; }
}

/* ============================================================================
   AI RFQ step-help — short instructions panel shown under the stepper
   ============================================================================ */

.rfq-step-help {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(180deg, #eef4ff 0%, #f6f9ff 100%);
    border: 1px solid #cdd9f3;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 0 0 20px 0;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rfq-step-help__icon {
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1.2;
    margin-top: 1px;
}

.rfq-step-help__body { min-width: 0; flex: 1 1 auto; }

.rfq-step-help__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.rfq-step-help__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3a55;
}


/* ============================================================================
   AI RFQ feedback modal — opened from the buyer/supplier dashboard
   Added 2026-06-18 per Tim.
   ============================================================================ */

.feedback-modal {
    /* Use explicit properties (not `inset`) for maximum browser
       compatibility, and add `margin: auto` as a second-line
       centering fallback. Centers the card both horizontally and
       vertically inside the viewport. */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    animation: ai-modal-in 200ms ease-out;
}
.feedback-modal[hidden] { display: none !important; }

.feedback-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.feedback-modal__card {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 28px 28px 22px 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

.feedback-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: 0;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
}
.feedback-modal__close:hover { background: rgba(15, 23, 42, 0.06); color: var(--text); }

.feedback-modal__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text);
}

.feedback-modal__sub {
    margin: 0 0 18px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.feedback-modal__form .field { display: grid; gap: 6px; }

.feedback-modal__form textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: #ffffff;
    resize: vertical;
    box-sizing: border-box;
}
.feedback-modal__form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.feedback-modal__counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2px;
}
.feedback-modal__counter.is-near { color: var(--warning); font-weight: 600; }

.feedback-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.feedback-modal__actions .auth-btn[disabled] {
    opacity: 0.7;
    cursor: wait;
}
