/* ============================================================
   Villa Plumbing Field Portal — Bid Tracker / Workflow Layer
   PR after #79: adds checklist, addenda log, version timeline,
   submission log, and win/loss capture into the in-shell RFP
   detail panel rendered by VillaBidTracker.openBid().

   Strictly additive — never replaces existing surfaces. All
   classes use the btwf- prefix so they cannot collide with the
   bidtr-, vbps-, btuz-, btw-, or lbi- namespaces.
   ============================================================ */

.btwf-section{margin-top:14px;background:#fff;border:1px solid #e6ede9;border-radius:12px;padding:12px 14px}
.btwf-section h5{font-family:'Barlow Condensed',sans-serif;font-size:14px;font-weight:700;color:#141310;margin:0 0 8px;letter-spacing:.3px;text-transform:uppercase;display:flex;align-items:center;gap:8px}
.btwf-section .btwf-sub{font-size:11px;color:#4a6b65;margin:0 0 8px;line-height:1.5}

/* Checklist */
.btwf-checklist{display:flex;flex-direction:column;gap:6px}
.btwf-checklist .btwf-row{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border-radius:8px;border:1px solid transparent;background:#f8fbfa}
.btwf-checklist .btwf-row.is-done{background:#dcf5ef;border-color:#a7e0cf}
.btwf-checklist .btwf-row.is-computed{background:#eef4f3;border-color:#d8e8e5;opacity:.85}
.btwf-checklist .btwf-row input[type=checkbox]{margin-top:2px;flex:0 0 auto;width:16px;height:16px;cursor:pointer}
.btwf-checklist .btwf-row .btwf-label{flex:1 1 auto;font-size:12px;color:#141310;line-height:1.45}
.btwf-checklist .btwf-row .btwf-meta{font-size:10px;color:#4a6b65;margin-top:2px}
.btwf-checklist .btwf-row .btwf-pill{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;padding:2px 7px;border-radius:999px;background:#eef4f3;color:#4a6b65;flex:0 0 auto;margin-left:6px}
.btwf-checklist .btwf-row .btwf-pill.auto{background:#e8f4ff;color:#1458a0}
.btwf-checklist .btwf-row .btwf-pill.done{background:#dcf5ef;color:#0a5c48}
.btwf-checklist .btwf-row .btwf-pill.passive{background:#f0f0f0;color:#666}

/* Addenda log */
.btwf-addenda{display:flex;flex-direction:column;gap:8px}
.btwf-addenda .btwf-addn{border:1px solid #e6ede9;border-radius:10px;padding:8px 10px;background:#fff}
.btwf-addenda .btwf-addn .btwf-addn-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;flex-wrap:wrap}
.btwf-addenda .btwf-addn .btwf-addn-title{font-weight:600;font-size:13px;color:#141310}
.btwf-addenda .btwf-addn .btwf-addn-meta{font-size:11px;color:#4a6b65}
.btwf-addenda .btwf-addn .btwf-addn-summary{font-size:12px;color:#141310;margin-top:4px;line-height:1.5}
.btwf-addenda .btwf-addn .btwf-addn-lily{font-size:11px;color:#5a3b0b;background:#fff4dc;border:1px solid #f1d28a;padding:6px 8px;border-radius:8px;margin-top:6px;line-height:1.5}
.btwf-addenda .btwf-empty{font-size:12px;color:#4a6b65;font-style:italic}

/* Version timeline */
.btwf-versions{display:flex;flex-direction:column;gap:6px;border-left:2px solid #d8e8e5;padding-left:12px;margin-left:6px}
.btwf-versions .btwf-version{position:relative;padding:6px 10px;background:#f8fbfa;border:1px solid #e6ede9;border-radius:8px}
.btwf-versions .btwf-version:before{content:"";position:absolute;left:-19px;top:14px;width:10px;height:10px;border-radius:50%;background:#1458a0;border:2px solid #fff;box-shadow:0 0 0 1px #d8e8e5}
.btwf-versions .btwf-version.is-final:before{background:#0a5c48}
.btwf-versions .btwf-version.is-revised:before{background:#8a5c00}
.btwf-versions .btwf-version.is-upload:before{background:#5c3a8a}
.btwf-versions .btwf-version .btwf-vh{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;flex-wrap:wrap}
.btwf-versions .btwf-version .btwf-vtitle{font-weight:600;font-size:12px;color:#141310}
.btwf-versions .btwf-version .btwf-vmeta{font-size:10px;color:#4a6b65}
.btwf-versions .btwf-version .btwf-vnote{font-size:11px;color:#141310;margin-top:4px;line-height:1.5}
.btwf-versions .btwf-version .btwf-vlink{font-size:11px;color:#1458a0;background:transparent;border:1px solid #c0dafc;border-radius:6px;padding:3px 8px;cursor:pointer}
.btwf-versions .btwf-version .btwf-vlink[disabled]{opacity:.55;cursor:not-allowed}
.btwf-versions .btwf-empty{font-size:12px;color:#4a6b65;font-style:italic;padding:6px 0}

/* Submission log */
.btwf-submissions{display:flex;flex-direction:column;gap:6px}
.btwf-submissions .btwf-sub-row{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;flex-wrap:wrap;padding:8px 10px;border:1px solid #e6ede9;border-radius:8px;background:#fff}
.btwf-submissions .btwf-sub-row .btwf-channel{font-weight:600;font-size:12px;color:#141310}
.btwf-submissions .btwf-sub-row .btwf-sub-meta{font-size:11px;color:#4a6b65}
.btwf-submissions .btwf-sub-row .btwf-sub-notes{font-size:11px;color:#141310;margin-top:4px;width:100%;line-height:1.5}
.btwf-submissions .btwf-empty{font-size:12px;color:#4a6b65;font-style:italic}

/* Outcome capture */
.btwf-outcome{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;font-size:12px}
.btwf-outcome label{display:flex;flex-direction:column;gap:3px;color:#141310}
.btwf-outcome label > span{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.3px;color:#4a6b65}
.btwf-outcome select,.btwf-outcome input[type=text],.btwf-outcome textarea{padding:6px 8px;border:1px solid #d8e8e5;border-radius:6px;font-size:12px;font-family:inherit;width:100%;box-sizing:border-box}
.btwf-outcome textarea{min-height:54px;resize:vertical;grid-column:1/-1}
.btwf-outcome .btwf-outcome-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between}
.btwf-outcome .btwf-advisory{font-size:11px;color:#143a78;background:#e8f4ff;border:1px solid #c0dafc;border-radius:8px;padding:6px 8px;line-height:1.5;flex:1 1 240px}
.btwf-outcome .btwf-locked{font-size:11px;color:#0a5c48;background:#dcf5ef;border:1px solid #a7e0cf;padding:6px 8px;border-radius:8px;line-height:1.5}

/* Inline add forms (addendum + submission) */
.btwf-inline-form{display:none;margin-top:8px;padding:10px;border:1px dashed #c0dafc;border-radius:10px;background:#f8fbfa}
.btwf-inline-form.is-open{display:block}
.btwf-inline-form .btwf-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}
.btwf-inline-form label{display:flex;flex-direction:column;gap:3px;font-size:11px;color:#141310}
.btwf-inline-form label > span{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.3px;color:#4a6b65}
.btwf-inline-form input,.btwf-inline-form select,.btwf-inline-form textarea{padding:6px 8px;border:1px solid #d8e8e5;border-radius:6px;font-size:12px;font-family:inherit}
.btwf-inline-form textarea{min-height:48px;resize:vertical;grid-column:1/-1}
.btwf-inline-form .btwf-form-actions{margin-top:8px;display:flex;gap:6px;flex-wrap:wrap}
.btwf-inline-form .btwf-form-actions .btn{padding:6px 10px;font-size:12px}
.btwf-inline-form .btwf-note{font-size:10px;color:#4a6b65;margin-top:6px;font-style:italic}

/* Buttons reused — local inline button */
.btwf-section .btwf-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.btwf-section .btwf-actions .btn{padding:6px 10px;font-size:12px}

@media (max-width:600px){
  .btwf-outcome{grid-template-columns:1fr}
  .btwf-versions{padding-left:10px}
  .btwf-versions .btwf-version:before{left:-17px}
}
