/* ============================================================
   CALL-SESSIONS.CSS — Outreach > Call Sessions (Phase 1)
   Scoped .cs-* classes built on the Porcelain + Midnight tokens so
   the panel themes automatically in light and dark.
   ============================================================ */

#cs-root { display: block; }

.cs-loading { padding: var(--space-8); text-align: center; color: var(--text-muted); }

/* Header */
.cs-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-4);
}
.cs-h1 { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); }
.cs-sub { font-size: var(--text-base); color: var(--text-secondary); margin-top: 2px; }
.cs-head-actions { display: flex; gap: var(--space-2); }
.cs-section-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: var(--space-5) 0 var(--space-2); }

/* Banner (preview / not-saved) */
.cs-banner {
  background: var(--warning-dim); color: var(--warning);
  border: 1px solid var(--warning); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* Buttons */
.cs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-color); background: var(--bg-surface);
  color: var(--text-primary); border-radius: var(--radius);
  padding: 9px 16px; font-size: var(--text-base); font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .15s var(--ease-ios);
}
.cs-btn:hover { background: var(--bg-highlight); }
.cs-btn-sm { padding: 5px 10px; font-size: var(--text-sm); }
.cs-btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.cs-btn-primary:hover { background: var(--cobalt-bright); }
.cs-btn-secondary { background: var(--midnight); border-color: var(--midnight); color: #fff; }
.cs-btn-secondary:hover { opacity: .92; }
.cs-btn-ghost { background: transparent; }
.cs-btn-call { background: var(--success); border-color: var(--success); color: #fff;
  font-size: var(--text-md); padding: 11px 22px; }
.cs-btn-call:hover { filter: brightness(1.05); }
.cs-btn[disabled], .cs-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Pills + status chips */
.cs-pill { display: inline-block; font-size: var(--text-xs); font-weight: 600;
  background: var(--bg-highlight); color: var(--text-secondary);
  border-radius: var(--radius-full); padding: 2px 9px; margin-left: 6px; }
.cs-pill-warn { background: var(--warning-dim); color: var(--warning); }
.cs-pill-soon { background: var(--cobalt-wash); color: var(--cobalt); }
.cs-pill-demo { background: var(--midnight); color: #fff; letter-spacing: .04em; }

.cs-status { font-size: var(--text-xs); font-weight: 600; border-radius: var(--radius-full); padding: 2px 9px; white-space: nowrap; }
.cs-status-pending     { background: var(--bg-highlight); color: var(--text-secondary); }
.cs-status-called      { background: var(--cobalt-wash); color: var(--cobalt); }
.cs-status-no_answer   { background: var(--warning-dim); color: var(--warning); }
.cs-status-connected   { background: var(--success-dim); color: var(--success); }
.cs-status-skipped     { background: var(--bg-highlight); color: var(--text-muted); }
.cs-status-bad_number  { background: var(--danger-dim); color: var(--danger); }

/* Cards / generic */
.cs-card { background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.cs-muted { color: var(--text-muted); font-size: var(--text-sm); }
.cs-label { display: block; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); margin-bottom: 3px; }
.cs-fineprint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-2); line-height: 1.5; }
.cs-req { color: var(--danger); }

/* Empty state */
.cs-empty { text-align: center; padding: var(--space-8) var(--space-4);
  background: var(--bg-surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.cs-empty-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
.cs-empty-desc { font-size: var(--text-base); color: var(--text-secondary); margin: 6px 0 var(--space-4); }

/* Queue list cards */
.cs-queue-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--space-4);
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: var(--space-4); margin-bottom: var(--space-3); cursor: pointer; transition: box-shadow .15s var(--ease-ios); }
.cs-queue-card:hover { box-shadow: var(--shadow-md); }
.cs-queue-name { font-weight: 700; color: var(--text-primary); font-size: var(--text-md); }
.cs-queue-meta { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }
.cs-queue-progress { min-width: 160px; }
.cs-progress-track { background: var(--bg-highlight); border-radius: var(--radius-full); height: 6px; overflow: hidden; }
.cs-progress-wide { margin-bottom: var(--space-4); }
.cs-progress-fill { background: var(--cobalt); height: 100%; transition: width .3s var(--ease-out); }
.cs-progress-label { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 4px; text-align: right; }

/* Forms */
.cs-field { margin-bottom: var(--space-3); }
.cs-field > label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.cs-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 9px 11px; font-size: var(--text-base); color: var(--text-primary);
  font-family: inherit; }
.cs-input:focus { outline: none; border-color: var(--border-accent); }
.cs-input-sm { width: auto; padding: 5px 9px; font-size: var(--text-sm); }
.cs-check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-base); color: var(--text-secondary); }

/* Wizard: source choice */
.cs-source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.cs-source-card { text-align: left; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: var(--space-5); cursor: pointer; transition: all .15s var(--ease-ios); }
.cs-source-card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-sm); }
.cs-source-title { font-weight: 700; font-size: var(--text-md); color: var(--text-primary); }
.cs-source-desc { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; }

/* Wizard: CRM pick list */
.cs-pick-actions { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.cs-pick-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius); }
.cs-pick-row { display: grid; grid-template-columns: 24px 1.4fr 1fr 1fr; align-items: center; gap: var(--space-2);
  padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); cursor: pointer; }
.cs-pick-row:last-child { border-bottom: none; }
.cs-pick-row:hover { background: var(--bg-highlight); }
.cs-pick-name { font-weight: 600; color: var(--text-primary); }
.cs-pick-co, .cs-pick-phone { color: var(--text-secondary); }

/* Wizard: upload + mapping */
.cs-upload input[type=file] { display: block; margin-bottom: var(--space-2); font-size: var(--text-sm); }
.cs-map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: var(--space-3) 0; }
.cs-preview-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius); margin-top: var(--space-3); }
.cs-preview { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.cs-preview th, .cs-preview td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.cs-preview th { color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.cs-wizard-foot { margin-top: var(--space-4); display: flex; justify-content: flex-end; }

/* Workspace */
.cs-phonelink-note { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: var(--cobalt-wash); color: var(--text-secondary); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 10px 14px; font-size: var(--text-sm); margin-bottom: var(--space-3); }
.cs-phonelink-note code { background: var(--bg-highlight); padding: 1px 5px; border-radius: 4px; }

.cs-work { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-4); align-items: start; }
.cs-rail { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  overflow: hidden; max-height: 70vh; overflow-y: auto; }
.cs-rail-item { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px;
  padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; font-size: var(--text-sm); }
.cs-rail-item:last-child { border-bottom: none; }
.cs-rail-item:hover { background: var(--bg-highlight); }
.cs-rail-item.active { background: var(--cobalt-wash); box-shadow: inset 3px 0 0 var(--cobalt); }
.cs-rail-pos { color: var(--text-muted); font-size: var(--text-xs); }
.cs-rail-name { color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cs-active { display: flex; flex-direction: column; gap: var(--space-4); }
.cs-active-card, .cs-outcome-card, .cs-history {
  background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.cs-active-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.cs-active-name { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); }
.cs-active-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4); }
.cs-active-grid > div { font-size: var(--text-base); color: var(--text-primary); }
.cs-dnc-row { display: flex; align-items: center; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.cs-dnc-row .cs-label { margin-bottom: 0; }
.cs-call-row { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.cs-block-reason { font-size: var(--text-sm); color: var(--warning); }

.cs-outcome-actions { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }

.cs-history .cs-hist-row { padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.cs-history .cs-hist-row:last-child { border-bottom: none; }
.cs-hist-outcome { font-weight: 600; color: var(--text-primary); margin-right: 6px; }
.cs-hist-note { color: var(--text-secondary); margin-top: 4px; }

.cs-nav { display: flex; justify-content: space-between; gap: var(--space-3); }

.cs-missing { margin-top: var(--space-3); padding: var(--space-3); font-size: var(--text-sm); }
.cs-missing summary { cursor: pointer; color: var(--text-secondary); }
.cs-missing-list { margin-top: var(--space-2); color: var(--text-secondary); font-size: var(--text-sm); }

/* Modal (compliance / draft) */
.cs-overlay { position: fixed; inset: 0; background: rgba(20, 32, 58, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 4000; padding: var(--space-4); }
.cs-modal { background: var(--bg-elevated); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 540px; max-height: 88vh; display: flex; flex-direction: column;
  animation: cs-pop .2s var(--ease-spring); }
@keyframes cs-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cs-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle); }
.cs-modal-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
.cs-modal-body { padding: var(--space-5); overflow-y: auto; }
.cs-modal-body p { font-size: var(--text-base); color: var(--text-secondary); line-height: 1.55; }
.cs-modal-foot { display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); }
.cs-x { background: transparent; border: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.cs-x:hover { color: var(--text-primary); }

.cs-attest { display: flex; align-items: flex-start; gap: 10px; background: var(--bg-highlight);
  border: 1px solid var(--border-color); border-radius: var(--radius); padding: var(--space-4);
  font-size: var(--text-base); color: var(--text-primary); margin: var(--space-4) 0 var(--space-3); }
.cs-attest input { margin-top: 3px; }
.cs-scrub-row { display: flex; align-items: center; gap: var(--space-2); }

.cs-draft-subject { font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-3); }
.cs-draft-body { width: 100%; font-family: inherit; font-size: var(--text-base); line-height: 1.5;
  background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: var(--space-3); color: var(--text-primary); resize: vertical; }

@media (max-width: 760px) {
  .cs-work { grid-template-columns: 1fr; }
  .cs-source-grid, .cs-map-grid, .cs-active-grid { grid-template-columns: 1fr; }
  .cs-rail { max-height: 220px; }
}

/* ============================================================
   PHASE 2 — SMART NOTES + KNOWLEDGE CONTINUITY
   ============================================================ */

/* Structured note panel */
.cs-notepanel { margin-top: var(--space-2); }
.cs-field-row { display: grid; grid-template-columns: 1fr 180px; gap: var(--space-3); }
.cs-field-grow { min-width: 0; }

.cs-chip-input { display: flex; gap: var(--space-2); align-items: center; }
.cs-chip-input .cs-input { flex: 1; }

.cs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cs-chips:empty { display: none; }
.cs-chip { display: inline-flex; align-items: center; gap: 4px;
  background: var(--cobalt-wash); color: var(--cobalt); font-size: var(--text-sm); font-weight: 600;
  border-radius: var(--radius-full); padding: 3px 6px 3px 11px; }
.cs-chip-x { background: transparent; border: none; color: inherit; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0 2px; opacity: .7; }
.cs-chip-x:hover { opacity: 1; }
.cs-chip-static { background: var(--bg-highlight); color: var(--text-secondary); padding: 3px 11px; margin: 2px 4px 2px 0; }

/* Cross-queue call history */
.cs-callhist { background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.cs-hist-empty { padding: var(--space-2) 0; line-height: 1.5; }

.cs-hist2-row { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.cs-hist2-row:last-child { border-bottom: none; }
.cs-hist2-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cs-hist2-when { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-right: 4px; }
.cs-hist2-body { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.cs-hist2-body > div { margin-bottom: 6px; }

.cs-mini-label { display: inline-block; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); margin-right: 6px; }
.cs-mini-list { margin: 2px 0 0; padding-left: 18px; }
.cs-mini-list li { margin-bottom: 2px; }

/* AI summary editor */
.cs-summary { background: var(--bg-highlight); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: var(--space-3); }
.cs-summary-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cs-model { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono, monospace); }
.cs-summary-text { width: 100%; resize: vertical; }
.cs-steps { margin: 6px 0; display: flex; flex-direction: column; gap: 5px; }
.cs-step { display: flex; align-items: center; gap: 8px; }
.cs-step input[type=checkbox] { flex: none; }
.cs-step-text { flex: 1; }
.cs-step input[type=checkbox]:checked + .cs-step-text { text-decoration: line-through; color: var(--text-muted); }
.cs-summary-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

@media (max-width: 760px) {
  .cs-field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   BULK UPLOAD → DIAL LIST (session-build wizard)
   ============================================================ */

/* Drop zone on the upload step */
.cs-drop-zone { border: 2px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-4); text-align: center; cursor: pointer;
  background: var(--bg-card); transition: all .15s var(--ease-ios); }
.cs-drop-zone:hover, .cs-drop-zone.over { border-color: var(--border-accent); background: var(--cobalt-wash); }
.cs-drop-title { font-weight: 700; font-size: var(--text-md); color: var(--text-primary); }
.cs-drop-sub { font-size: var(--text-sm); color: var(--text-muted); margin-top: 4px; }

/* AI column-mapping review */
.cs-map-review { border: 1px solid var(--border-subtle); border-radius: var(--radius);
  margin-top: var(--space-3); overflow: hidden; }
.cs-map-line { display: flex; justify-content: space-between; gap: var(--space-3);
  padding: 6px 12px; font-size: var(--text-sm); border-bottom: 1px solid var(--border-subtle); }
.cs-map-line:last-child { border-bottom: none; }
.cs-map-line span:first-child { color: var(--text-primary); font-weight: 600; }
.cs-map-line span:last-child { color: var(--cobalt); }
.cs-map-line.cs-map-skip span:first-child,
.cs-map-line.cs-map-skip span:last-child { color: var(--text-muted); font-weight: 400; }

/* Workspace: backup numbers + sheet notes from a bulk upload */
.cs-alt-phone { display: inline-block; margin-right: 10px; color: var(--text-primary); }
a.cs-alt-phone { color: var(--cobalt); text-decoration: none; }
a.cs-alt-phone:hover { text-decoration: underline; }
.cs-sheet-note { font-size: var(--text-sm); color: var(--text-secondary);
  background: var(--bg-highlight); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-4); }

/* ============================================================
   DIALING SETUP + AUTO-ADVANCE + VERIFIED CHIP
   ============================================================ */

/* Collapsible "Dialing setup" card at the top of the dial workspace */
.cs-setup { background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.cs-setup summary { cursor: pointer; display: flex; align-items: baseline; gap: var(--space-2);
  flex-wrap: wrap; font-size: var(--text-sm); }
.cs-setup-title { font-weight: 700; color: var(--text-primary);
  text-transform: uppercase; letter-spacing: .04em; font-size: var(--text-xs); }
.cs-setup-status { color: var(--text-secondary); }
.cs-setup-steps { margin: var(--space-2) 0 0; padding-left: 20px;
  font-size: var(--text-sm); color: var(--text-secondary); }
.cs-setup-steps li { margin-bottom: 4px; }
.cs-setup code { background: var(--bg-highlight); padding: 1px 5px; border-radius: 4px; }
.cs-setup-reminder { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary);
  background: var(--cobalt-wash); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 6px 10px; }

/* Auto-advance toggle row + countdown banner */
.cs-autodial-row { display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); font-size: var(--text-sm); }
.cs-autodial-banner { display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); background: var(--warning-dim); border: 1px solid var(--warning);
  color: var(--text-primary); border-radius: var(--radius); padding: 10px 14px;
  font-size: var(--text-sm); margin-bottom: var(--space-3); }
.cs-autodial-actions { display: flex; gap: var(--space-2); flex: none; }

/* "Verified" chip — bold phone cell in the uploaded sheet */
.cs-chip-verified { display: inline-block; font-size: var(--text-xs); font-weight: 700;
  background: var(--success-dim); color: var(--success);
  border-radius: var(--radius-full); padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
