/* PipeStore v200 — Lead operations / Lost lead
   Isolated visual layer. No pipeline/prospecting business rules here. */

.lead-ops-card{
  margin:0 0 18px;
  padding:16px;
  border:1px solid #dfe5ec;
  border-radius:14px;
  background:linear-gradient(180deg,#fbfdff 0%,#f7f9fc 100%);
  box-shadow:0 5px 18px rgba(20,38,63,.05);
}
.lead-ops-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.lead-ops-head h3{margin:2px 0 0!important;font-size:17px!important}
.lead-ops-kicker{font-size:10px;font-weight:800;letter-spacing:.08em;color:#6d7c8f}
.lead-op-status{display:inline-flex;align-items:center;min-height:26px;padding:0 9px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.04em;border:1px solid #c9dfd3;background:#edf8f1;color:#167044}
.lead-op-status.lost{border-color:#f1c7cb;background:#fff1f2;color:#b4232f}
.lead-op-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.lead-op-action{min-width:0;min-height:76px;padding:10px 9px;border:1px solid #dfe5ec;border-radius:11px;background:#fff;color:#26384f;text-decoration:none;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:2px;cursor:pointer;font:inherit;transition:.14s ease}
.lead-op-action:hover{border-color:#9eb8d3;box-shadow:0 5px 14px rgba(31,57,87,.08);transform:translateY(-1px)}
.lead-op-action>span{font-size:17px;line-height:1;color:#2c66a4;margin-bottom:4px}
.lead-op-action>b{font-size:12px}
.lead-op-action>small{max-width:100%;font-size:9px;color:#7b8795;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lead-op-action.is-disabled{opacity:.48;cursor:not-allowed;transform:none!important;box-shadow:none!important}
.lead-next-action{display:grid;grid-template-columns:115px minmax(0,1fr);column-gap:10px;row-gap:2px;align-items:center;padding:10px 12px;border:1px solid #e3e8ee;border-radius:10px;background:#fff;margin-bottom:12px}
.lead-next-action>span{grid-row:1/3;font-size:10px;font-weight:800;color:#6b7788;text-transform:uppercase;letter-spacing:.05em}
.lead-next-action>b{font-size:12px;color:#26384f}
.lead-next-action>small{font-size:10px;color:#7c8795}
.lead-next-action.is-empty>b{color:#697586}
.lead-stage-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.lead-lost-button,.lead-lost-confirm{color:#b4232f!important;border-color:#e6b8bd!important;background:#fff7f7!important}
.lead-lost-button:hover,.lead-lost-confirm:hover{background:#fff0f1!important}
.lead-loss-panel{margin-top:14px;padding:14px;border:1px solid #efc5c9;border-radius:12px;background:#fff8f8}
.lead-loss-panel[hidden]{display:none!important}
.lead-loss-panel-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.lead-loss-panel-head>div{display:flex;flex-direction:column;gap:3px}
.lead-loss-panel-head>b{font-size:13px;color:#9e2631}
.lead-loss-panel-head small{font-size:10px;color:#7d6970}
.lead-loss-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;margin:0 0 12px;padding:11px 12px;border:1px solid #efcdd0;border-radius:10px;background:#fff}
.lead-loss-summary>div{display:flex;flex-direction:column;gap:2px}
.lead-loss-summary span{font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:#8b7177}
.lead-loss-summary b{font-size:12px;color:#8e2730}
.lead-loss-summary p{grid-column:1/-1;margin:2px 0 0;font-size:11px;line-height:1.45;color:#5e5356}
.lead-edit-details{border:1px solid #e5e9ef;border-radius:11px;background:#fff;margin:0 0 16px;padding:0 13px}
.lead-edit-details>summary{cursor:pointer;list-style:none;font-weight:750;font-size:12px;padding:12px 0;color:#3e4d60}
.lead-edit-details>summary::-webkit-details-marker{display:none}
.lead-edit-details>summary:after{content:'+';float:right;color:#6b7788}
.lead-edit-details[open]>summary:after{content:'–'}
.lead-edit-details>form{padding:2px 0 14px}

/* Make the operational drawer slightly more useful on desktop without changing mobile behavior. */
@media (min-width:801px){
  .drawer:has(.lead-ops-card){width:min(720px,94vw)}
}
@media (max-width:700px){
  .lead-op-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lead-next-action{grid-template-columns:1fr}
  .lead-next-action>span{grid-row:auto}
  .lead-loss-summary{grid-template-columns:1fr}
  .lead-loss-summary p{grid-column:auto}
}
.lead-op-status.won{border-color:#b8d8c4;background:#eef9f2;color:#176b43}
.lead-status-pill.won{background:#edf8f1!important;border-color:#c9dfd3!important;color:#167044!important}
.lead-table-stage{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.lead-loss-inline{font-size:9px;color:#8a5b61;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}


/* Restore the original operational interaction: no left/right arrows on cards. */
.pipeline-operational-deal{cursor:pointer;display:block!important;padding:12px!important}
.pipeline-operational-deal .pipeline-deal-center{width:100%;min-width:0}
.pipeline-operational-deal:hover{border-color:#9eb8d3;box-shadow:0 5px 14px rgba(31,57,87,.08);transform:translateY(-1px)}
.pipeline-card-operation-hint{margin-top:8px;padding-top:7px;border-top:1px solid #edf0f4;font-size:9px;font-weight:700;color:#6f7d8d;letter-spacing:.02em}
.lead-op-actions{grid-template-columns:repeat(5,minmax(0,1fr))}
.lead-stage-panel{margin:12px 0 0;padding:13px;border:1px solid #dfe5ec;border-radius:11px;background:#fff}
.lead-stage-panel[hidden]{display:none!important}
.lead-stage-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.lead-stage-panel-head>div{display:flex;flex-direction:column;gap:2px}
.lead-stage-panel-head b{font-size:12px;color:#26384f}
.lead-stage-panel-head small{font-size:10px;color:#748194}
.lead-stage-panel-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.lead-stage-panel-row select{min-width:0;height:38px;border:1px solid #d8e0e9;border-radius:9px;padding:0 10px;background:#fff;color:#26384f}
@media (max-width:700px){
  .lead-op-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lead-stage-panel-row{grid-template-columns:1fr}
}

/* Pipeline card stage selector — restored from the original operational flow. */
.pipeline-card-stage-select{margin-top:8px;padding-top:8px;border-top:1px solid #edf0f4}
.pipeline-card-stage-select select{display:block;width:100%;height:32px;min-width:0;border:1px solid #d8e0e9;border-radius:8px;background:#fff;color:#26384f;padding:0 30px 0 9px;font-size:10px;font-weight:700;cursor:pointer;outline:none}
.pipeline-card-stage-select select:hover{border-color:#aebdcd;background:#fbfcfd}
.pipeline-card-stage-select select:focus{border-color:#6f9ed0;box-shadow:0 0 0 2px rgba(47,111,181,.10)}

/* Prospecting batches occupy a synthetic first lane; real Pipeline stages remain unchanged. */
.pipeline-inbox-column{min-width:300px}
.pipeline-inbox-column>.col-head{align-items:center}
.pipeline-inbox-column>.col-head .col-add{width:auto;min-width:70px;padding:0 9px;font-size:10px}
.pipeline-inbox-deals{gap:9px!important;overflow-y:auto;max-height:calc(100vh - 250px);align-content:start}
.pipeline-inbox-batch{border:1px solid #dfe5ec;border-radius:11px;background:#fff;overflow:hidden}
.pipeline-inbox-batch-toggle{display:flex;width:100%;flex-direction:column;align-items:stretch;gap:7px;padding:11px;border:0;background:transparent;text-align:left;color:#26384f;cursor:pointer}
.pipeline-inbox-batch-toggle:hover{background:#f8fafc}
.pipeline-inbox-batch-title{display:flex;flex-direction:column;gap:3px}
.pipeline-inbox-batch-title b{font-size:12px;line-height:1.35}
.pipeline-inbox-batch-title small,.pipeline-inbox-batch-toggle>small{font-size:10px;color:#748194}
.pipeline-inbox-batch-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;font-size:9px;color:#748194}
.pipeline-inbox-batch-counts span{display:flex;flex-direction:column;gap:2px}
.pipeline-inbox-batch-counts b{font-size:13px;color:#26384f}
.pipeline-inbox-progress{height:5px;border-radius:9px;background:#edf1f5;overflow:hidden}
.pipeline-inbox-progress i{display:block;height:100%;background:#428a68;border-radius:inherit}
.pipeline-inbox-search{display:block;padding:0 9px 8px}
.pipeline-inbox-search input{width:100%;height:34px;border:1px solid #d8e0e9;border-radius:8px;padding:0 9px;font-size:11px}
.pipeline-inbox-members{max-height:360px;overflow:auto;padding:0 8px;overscroll-behavior:contain}
.pipeline-inbox-member{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 2px;border-top:1px solid #edf0f4}
.pipeline-inbox-member-copy{display:flex;min-width:0;flex-direction:column;gap:3px;overflow-wrap:anywhere}
.pipeline-inbox-member-copy b{font-size:10px;color:#26384f}
.pipeline-inbox-member-copy span{font-size:9px;color:#748194}
.pipeline-inbox-member-action{flex:none}
.pipeline-inbox-member-action .btn{padding:6px 8px;font-size:9px;white-space:nowrap}
.pipeline-inbox-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;font-size:9px;color:#748194}
.pipeline-inbox-pagination .btn{padding:6px 8px;font-size:9px}
@media(max-width:700px){.pipeline-inbox-column{min-width:270px}.pipeline-inbox-deals{max-height:60vh}}

/* Pipeline board sizing: fit every lane in a wrapping grid without horizontal scroll. */
#pipeline.page{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-x:hidden!important;
  container-name:pipeline-page;
  container-type:inline-size;
}
#pipeline .pipeline-toolbar{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
#pipeline #pipe.pipeline-simple{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))!important;
  grid-auto-flow:row!important;
  grid-auto-rows:minmax(320px,auto)!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  grid-auto-columns:initial!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:visible!important;
  box-sizing:border-box!important;
}
#pipeline #pipe.pipeline-simple>.simple-col{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  height:auto!important;
  min-width:0!important;
  min-height:320px!important;
  max-width:100%!important;
  max-height:none!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
#pipeline #pipe.pipeline-simple>.pipeline-inbox-column{
  min-width:0!important;
}
#pipeline #pipe.pipeline-simple>.simple-col>.col-head{
  flex:0 0 auto!important;
}
#pipeline #pipe.pipeline-simple>.simple-col>.col-deals{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:min(52dvh,560px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
}
#pipeline .simple-col>.col-head{
  min-width:0!important;
  gap:8px!important;
}
#pipeline .simple-col>.col-head>div{
  flex:1 1 auto!important;
  min-width:0!important;
}
#pipeline .simple-col>.col-head span{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#pipeline .simple-col>.col-head .col-add{
  flex:0 0 auto!important;
  min-width:32px!important;
  white-space:nowrap!important;
}
#pipeline .simple-col .simple-deal,
#pipeline .simple-col .pipeline-inbox-batch{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
#pipeline .simple-col .deal-top,
#pipeline .simple-col .deal-meta{
  min-width:0!important;
  max-width:100%!important;
  flex-wrap:wrap!important;
}
#pipeline .simple-col .deal-top>div:first-child{
  flex:1 1 150px!important;
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
#pipeline .simple-col .deal .name,
#pipeline .simple-col .deal .origin,
#pipeline .pipeline-inbox-batch-title b{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#pipeline .simple-col .pipeline-card-stage-select,
#pipeline .simple-col .pipeline-card-stage-select select,
#pipeline .simple-col .deal-stage select{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
#pipeline .pipeline-inbox-member{
  min-width:0!important;
  max-width:100%!important;
  flex-wrap:wrap!important;
}
#pipeline .pipeline-inbox-member-action{
  max-width:100%!important;
}
#pipeline .pipeline-inbox-member-action .btn{
  max-width:100%!important;
  white-space:normal!important;
}

@container pipeline-page (min-width:1260px){
  #pipeline #pipe.pipeline-simple{
    grid-template-columns:minmax(0,1.12fr) repeat(5,minmax(0,1fr))!important;
  }
  #pipeline #pipe.pipeline-simple>.simple-col,
  #pipeline #pipe.pipeline-simple>.pipeline-inbox-column{
    min-width:0!important;
  }
}

@media(max-width:800px){
  #pipeline #pipe.pipeline-simple{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))!important;
    grid-auto-rows:minmax(280px,auto)!important;
    gap:8px!important;
  }
  #pipeline #pipe.pipeline-simple>.simple-col,
  #pipeline #pipe.pipeline-simple>.pipeline-inbox-column{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:280px!important;
  }
}
