/* ==========================================================
   CareerPilot Application Pipeline / CRM v1.0
   ========================================================== */

.pipeline-shell{
  max-width:1700px;
  margin:0 auto;
  padding:36px 24px 70px;
}

.pipeline-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:28px;
  padding:36px;
  background:linear-gradient(135deg,#eef5ff,#fff 55%,#effcf5);
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:var(--shadow);
}

.pipeline-hero h1{
  margin:0;
  font-size:clamp(34px,4vw,58px);
  letter-spacing:-.04em;
}

.pipeline-hero p:last-child{
  max-width:830px;
  margin:14px 0 0;
  color:var(--muted);
  line-height:1.7;
}

.pipeline-hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.pipeline-hero-actions button{
  width:auto;
  margin:0;
  cursor:pointer;
  border:none;
}

.pipeline-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-top:22px;
}

.pipeline-summary-grid article{
  padding:22px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 8px 26px rgba(15,23,42,.05);
}

.pipeline-summary-grid small{
  color:var(--muted);
  font-weight:700;
}

.pipeline-summary-grid strong{
  display:block;
  margin-top:7px;
  font-size:32px;
}

.pipeline-toolbar-panel{
  margin-top:22px;
  padding:18px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
}

.pipeline-toolbar{
  display:grid;
  grid-template-columns:minmax(260px,1fr) 190px 190px;
  gap:10px;
}

.pipeline-toolbar input,
.pipeline-toolbar select{
  width:100%;
  padding:12px 14px;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  font:inherit;
}

.pipeline-board{
  display:grid;
  grid-template-columns:repeat(6,minmax(270px,1fr));
  gap:14px;
  margin-top:18px;
  overflow-x:auto;
  padding-bottom:14px;
}

.pipeline-column{
  min-height:560px;
  padding:12px;
  background:#f3f6fb;
  border:1px solid var(--border);
  border-radius:18px;
}

.pipeline-column-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 5px 14px;
}

.pipeline-column-heading>div{
  display:flex;
  align-items:center;
  gap:8px;
}

.pipeline-column-heading strong{
  font-size:14px;
}

.pipeline-count{
  min-width:28px;
  padding:5px 8px;
  text-align:center;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:999px;
  font-size:11px;
  font-weight:800;
}

.pipeline-dropzone{
  min-height:500px;
  display:grid;
  align-content:start;
  gap:10px;
  border-radius:13px;
  transition:.2s;
}

.pipeline-dropzone.is-over{
  background:#eaf2ff;
  box-shadow:inset 0 0 0 2px #93b4ff;
}

.pipeline-card{
  padding:15px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 6px 18px rgba(15,23,42,.05);
  cursor:grab;
  transition:.2s;
}

.pipeline-card:active{
  cursor:grabbing;
}

.pipeline-card.dragging{
  opacity:.45;
  transform:rotate(1deg);
}

.pipeline-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(15,23,42,.08);
}

.pipeline-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.pipeline-card h3{
  margin:0;
  font-size:15px;
  line-height:1.35;
}

.pipeline-card-company{
  margin:5px 0 0;
  color:var(--primary);
  font-size:13px;
  font-weight:800;
}

.pipeline-priority{
  padding:5px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}

.pipeline-priority.high{background:#fee2e2;color:#991b1b}
.pipeline-priority.medium{background:#fef3c7;color:#854d0e}
.pipeline-priority.low{background:#e2e8f0;color:#475569}

.pipeline-card-meta{
  display:grid;
  gap:5px;
  margin-top:13px;
  color:var(--muted);
  font-size:11px;
}

.pipeline-resume{
  margin-top:12px;
  padding:9px;
  background:var(--primary-soft);
  border-radius:9px;
  font-size:11px;
}

.pipeline-resume strong{
  display:block;
  margin-top:3px;
  color:var(--text);
}

.pipeline-card-actions{
  display:flex;
  gap:7px;
  margin-top:12px;
}

.pipeline-card-actions a,
.pipeline-card-actions button{
  width:auto;
  margin:0;
  padding:7px 9px;
  border-radius:8px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}

.pipeline-card-edit{
  color:var(--primary);
  background:var(--primary-soft);
  border:1px solid #c7d8ff;
}

.pipeline-card-resume{
  color:#15803d;
  background:#effdf4;
  border:1px solid #bbf7d0;
}

.pipeline-empty{
  padding:18px 10px;
  text-align:center;
  color:var(--muted);
  border:1px dashed var(--border);
  border-radius:11px;
  font-size:12px;
}

.dark-mode .pipeline-hero{
  background:linear-gradient(135deg,#16233d,#172033 55%,#102a23);
}

.dark-mode .pipeline-column{
  background:#111827;
}

.dark-mode .pipeline-dropzone.is-over{
  background:#14223d;
}

.dark-mode .pipeline-toolbar input,
.dark-mode .pipeline-toolbar select{
  background:#111827;
}

@media(max-width:1000px){
  .pipeline-summary-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:760px){
  .pipeline-shell{padding:22px 14px 50px}
  .pipeline-hero{align-items:flex-start;flex-direction:column}
  .pipeline-summary-grid{grid-template-columns:1fr}
  .pipeline-toolbar{grid-template-columns:1fr}
  .pipeline-board{grid-template-columns:repeat(6,minmax(250px,250px))}
}


/* ==========================================================
   Pipeline v2.0 — reliable drag/drop and status controls
   ========================================================== */
.pipeline-card {
    position: relative;
    user-select: none;
    -webkit-user-drag: element;
    touch-action: manipulation;
}

.pipeline-drag-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -2px;
    opacity: .55;
    transform: translateX(-50%);
    cursor: grab;
}

.pipeline-card.dragging {
    opacity: .38 !important;
    outline: 2px dashed var(--primary);
    outline-offset: 3px;
}

.pipeline-dropzone {
    padding: 4px;
}

.pipeline-dropzone.is-over {
    background: #dbeafe !important;
    box-shadow: inset 0 0 0 3px #3b82f6 !important;
}

.pipeline-dropzone.is-over::before {
    content: "Release to move application";
    display: block;
    padding: 9px;
    border-radius: 9px;
    background: #2563eb;
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.pipeline-status-control {
    display: grid;
    gap: 5px;
    margin-top: 12px;
}

.pipeline-status-control > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pipeline-status-control select {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.pipeline-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 3px;
}

.dark-mode .pipeline-dropzone.is-over {
    background: #16325f !important;
}

@media (pointer: coarse) {
    .pipeline-drag-handle {
        display: none;
    }

    .pipeline-status-control {
        display: grid;
    }
}
