/* ════════════════════════════════════════════
   VUE 360° CLIENT — CSS
   ════════════════════════════════════════════ */

:root {
  --v-purple:  #7C3AED;
  --v-pu2:    rgba(124,58,237,.1);
  --v-blue:   #2563EB;
  --v-bl2:    rgba(37,99,235,.1);
  --v-green:  #16A34A;
  --v-gr2:    rgba(22,163,74,.1);
  --v-amber:  #D97706;
  --v-am2:    rgba(217,119,6,.1);
  --v-red:    #DC2626;
  --v-re2:    rgba(220,38,38,.1);
  --v-teal:   #0D9488;
  --v-te2:    rgba(13,148,136,.1);
  --v-t0: var(--text);
  --v-t1: var(--text2);
  --v-t2: var(--text3);
  --v-bd: var(--border);
  --v-s0: var(--bg);
  --v-s1: var(--surface);
  --v-s2: var(--surface2);
}

/* ── Sidebar ── */
.v360-sidebar {
  width: 280px; min-width: 280px;
  height: calc(100vh - 60px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 16px; gap: 20px;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
}
.v360-sidebar h3 {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text3); margin-bottom: 7px;
}

/* ── Search tabs ── */
.v360-search-tabs {
  display: flex; gap: 2px; background: var(--surface2);
  border-radius: 7px; padding: 2px; margin-bottom: 4px;
}
.v360-tab {
  flex: 1; padding: 5px 0; border: none; border-radius: 5px;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  cursor: pointer; color: var(--text2); background: none; transition: all .15s;
}
.v360-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ── Identity banner ── */
.v360-identity {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4C1D95 100%);
  padding: 20px 28px; color: #fff; display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}
.v360-id-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0; letter-spacing: -.02em;
}
.v360-id-info { flex: 1; min-width: 0; }
.v360-id-name { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.v360-id-ani  { font-size: 13px; opacity: .7; font-family: var(--mono); margin-top: 2px; }
.v360-id-meta { display: flex; gap: 16px; margin-top: 10px; }
.v360-id-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.12); border-radius: 20px;
  padding: 3px 10px; font-size: 11px; font-weight: 500;
}

/* ── KPI strip ── */
.v360-kpi-strip {
  display: flex; gap: 1px; background: var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.v360-kpi {
  flex: 1; padding: 14px 18px; background: var(--surface);
  display: flex; flex-direction: column; gap: 3px;
}
.v360-kpi-val {
  font-size: 22px; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.v360-kpi-lbl {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text3);
}
.v360-kpi-trend {
  font-size: 10px; font-weight: 600; display: flex; align-items: center; gap: 3px;
}
.v360-kpi--purple .v360-kpi-val { color: var(--v-purple); }
.v360-kpi--blue   .v360-kpi-val { color: var(--v-blue); }
.v360-kpi--green  .v360-kpi-val { color: var(--v-green); }
.v360-kpi--amber  .v360-kpi-val { color: var(--v-amber); }
.v360-kpi--red    .v360-kpi-val { color: var(--v-red); }
.v360-kpi--teal   .v360-kpi-val { color: var(--v-teal); }

/* ── Body layout ── */
.v360-body {
  display: flex; gap: 0; padding: 16px 20px;
  min-height: 0; overflow: hidden; flex: 1;
}

/* ── Charts column ── */
.v360-charts-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; padding-right: 12px;
  border-right: 1px solid var(--border);
}

/* ── Timeline column ── */
.v360-timeline-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding-left: 12px;
}

/* ── Cards ── */
.v360-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.v360-card--fill {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.v360-card-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text3);
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  flex-shrink: 0;
}
.v360-card-title svg { color: var(--text3); }
.v360-count-badge {
  margin-left: auto; background: var(--v-pu2); color: var(--v-purple);
  font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  text-transform: none; letter-spacing: 0;
}

/* ── Timeline interactions ── */
.v360-timeline {
  overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-height: 0;
}
.v360-conv {
  border: 1.5px solid var(--border); border-radius: 9px;
  background: var(--surface2); cursor: pointer; transition: all .15s;
  overflow: hidden; flex-shrink: 0;
}
.v360-conv:hover { border-color: var(--v-purple); background: var(--surface); box-shadow: 0 2px 12px rgba(124,58,237,.08); }
.v360-conv-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.v360-conv-media {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.v360-conv-media--voice     { background: rgba(37,99,235,.1);  color: #2563EB; }
.v360-conv-media--chat      { background: rgba(22,163,74,.1);  color: #16A34A; }
.v360-conv-media--email     { background: rgba(217,119,6,.1);  color: #D97706; }
.v360-conv-media--messaging { background: rgba(13,148,136,.1); color: #0D9488; }
.v360-conv-media--callback  { background: rgba(220,38,38,.1);  color: #DC2626; }

.v360-conv-dt { min-width: 120px; }
.v360-conv-date { font-size: 12px; font-weight: 600; color: var(--text); }
.v360-conv-time { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.v360-conv-info { flex: 1; min-width: 0; }
.v360-conv-queue { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v360-conv-agent { font-size: 10px; color: var(--text3); margin-top: 1px; }
.v360-conv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.v360-conv-dur { font-size: 13px; font-weight: 700; font-family: var(--mono); color: var(--text2); }

/* Status badges */
.v360-badge {
  font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.v360-badge--ok        { background: rgba(22,163,74,.1);  color: #16A34A; }
.v360-badge--abandoned { background: rgba(220,38,38,.1);  color: #DC2626; }
.v360-badge--transfer  { background: rgba(217,119,6,.1);  color: #D97706; }
.v360-badge--reit      { background: rgba(124,58,237,.15);color: #7C3AED; }

/* Mini progress bar inside conv card */
.v360-conv-bar {
  display: flex; height: 3px; border-radius: 2px; overflow: hidden; margin-top: 2px;
  background: var(--surface3); width: 80px;
}
.v360-bar-wait  { background: #F59E0B; }
.v360-bar-talk  { background: #2563EB; }
.v360-bar-acw   { background: #7C3AED; }

/* Reiteration flag */
.v360-reit-flag {
  display: flex; align-items: center; gap: 5px;
  background: var(--v-pu2); border-top: 1px solid rgba(124,58,237,.15);
  padding: 5px 14px; font-size: 10px; font-weight: 600; color: var(--v-purple);
}

/* ── Reuse shared search styles ── */
.ia-searchbox--block { width: 100%; box-sizing: border-box; }
.ia-date-wrap--block { width: 100%; box-sizing: border-box; }
.ia-sb-select { width: 100%; height: 32px; padding: 0 8px; font-size: 12px; margin-top: 2px;
  border: 1.5px solid var(--border); border-radius: 7px; background: var(--surface2);
  font-family: var(--font); color: var(--text); outline: none; cursor: pointer; }
.ia-sb-select:focus { border-color: var(--v-purple); }
.ia-quick-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ia-quick-btn {
  padding: 5px 0; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text2);
  font-family: var(--font); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .12s; text-align: center;
}
.ia-quick-btn:hover { border-color: var(--v-purple); color: var(--v-purple); background: var(--v-pu2); }
.ia-quick-btn.active { border-color: var(--v-purple); color: var(--v-purple); background: var(--v-pu2); }
.ia-date-wrap--fp {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--surface2); transition: border-color .15s; cursor: pointer;
}
.ia-date-wrap--fp:focus-within { border-color: var(--v-purple); }
.ia-fp-input { border: none; background: none; outline: none;
  font-family: var(--font); font-size: 12px; color: var(--text); cursor: pointer; }
.ia-fp-input::placeholder { color: var(--text3); }
.ia-fp-input--range { width: 140px; }
.ia-date-hint { font-size: 10px; color: var(--text3); margin-top: 4px; font-family: var(--mono); min-height: 14px; }
.ia-empty { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:var(--text3); }
.ia-empty-icon { width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.ia-empty-title { font-size:16px; font-weight:600; color:var(--text2); }
.ia-empty-sub { font-size:12px; color:var(--text3); text-align:center; max-width:320px; }
.ia-error { display:flex; flex:1; align-items:center; justify-content:center; gap:10px; color:var(--text); font-size:13px; }

/* ── Flatpickr ── */
.flatpickr-calendar { background:var(--surface); border:1px solid var(--border); border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.15); font-family:var(--font); font-size:13px;
  width:280px; padding:8px; display:none; position:absolute; z-index:99999; }
.flatpickr-calendar.open { display:inline-block; }
.flatpickr-months { display:flex; align-items:center; justify-content:space-between;
  padding:4px 0 8px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.flatpickr-months .flatpickr-month { flex:1; text-align:center; }
.flatpickr-current-month { display:flex; align-items:center; justify-content:center;
  gap:6px; font-weight:600; font-size:13px; color:var(--text); }
.flatpickr-current-month select, .flatpickr-current-month .numInputWrapper input {
  background:transparent; border:none; outline:none; font-family:inherit;
  font-size:13px; font-weight:600; color:var(--text); cursor:pointer; padding:0;
  -webkit-appearance:none; appearance:none; }
.numInputWrapper .arrowUp, .numInputWrapper .arrowDown { display:none; }
.flatpickr-prev-month, .flatpickr-next-month { width:28px; height:28px; border-radius:6px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  color:var(--text2); transition:background .12s; flex-shrink:0; }
.flatpickr-prev-month:hover, .flatpickr-next-month:hover { background:var(--surface2); }
.flatpickr-prev-month svg, .flatpickr-next-month svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:2; }
.flatpickr-weekdays { display:flex; margin-bottom:2px; }
.flatpickr-weekdaycontainer { display:flex; flex:1; }
.flatpickr-weekday { flex:1; text-align:center; font-size:10px; font-weight:700;
  color:var(--text3); text-transform:uppercase; letter-spacing:.05em; padding:4px 0; }
.flatpickr-innerContainer, .flatpickr-rContainer, .flatpickr-days { display:block; width:100%; }
.dayContainer { display:flex; flex-wrap:wrap; width:100%; min-width:100%; max-width:100%; padding:0; gap:1px; }
.flatpickr-day { flex:1 0 calc(14.28% - 2px); max-width:calc(14.28% - 2px); height:34px;
  display:flex; align-items:center; justify-content:center; border-radius:6px;
  cursor:pointer; font-size:12px; font-weight:500; color:var(--text); transition:background .1s; }
.flatpickr-day:hover { background:var(--v-pu2); color:var(--v-purple); }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background:var(--v-purple) !important; color:#fff !important; font-weight:700; }
.flatpickr-day.today { font-weight:700; border:1.5px solid var(--v-purple); }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color:var(--text3); }
.flatpickr-day.flatpickr-disabled { color:var(--text3); cursor:not-allowed; background:none !important; }
.flatpickr-day.inRange { background:var(--v-pu2) !important; color:var(--v-purple) !important; border-radius:0 !important; }
.flatpickr-day.startRange { border-radius:6px 0 0 6px !important; }
.flatpickr-day.endRange   { border-radius:0 6px 6px 0 !important; }

/* ── Chart canvas max height ── */
#v360-chart-volume,
#v360-chart-channels,
#v360-chart-wait {
  max-height: 150px !important;
  height: 150px !important;
}

/* ── Custom contact dropdown ── */
.v360-contact-input {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px; margin-top: 6px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--surface2); cursor: pointer; transition: border-color .15s;
  font-size: 12px; color: var(--text2);
}
.v360-contact-input:hover { border-color: var(--v-purple); }

.v360-contact-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1.5px solid var(--v-purple);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(124,58,237,.15);
  z-index: 9999; flex-direction: column; overflow: hidden;
  max-height: 280px;
}
.v360-contact-search-wrap {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.v360-contact-search-wrap input {
  border: none; background: none; outline: none;
  font-family: var(--font); font-size: 12px; color: var(--text);
  flex: 1;
}
.v360-contact-search-wrap svg { color: var(--text3); flex-shrink: 0; }
.v360-contact-list {
  overflow-y: auto; flex: 1;
}
.v360-contact-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; cursor: pointer; transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.v360-contact-item:last-child { border-bottom: none; }
.v360-contact-item:hover { background: var(--v-pu2); }
.v360-contact-item.selected { background: var(--v-pu2); }
.v360-contact-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--v-purple); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.v360-contact-info { flex: 1; min-width: 0; }
.v360-contact-name  { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v360-contact-company { font-weight: 400; color: var(--text3); }
.v360-contact-sub   { font-size: 10px; color: var(--text3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v360-contact-loading { padding: 12px; font-size: 11px; color: var(--text3); text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ── Bottom strip: top queues/agents/wrapups ── */
.v360-bottom-strip-wrap {
  flex-shrink: 0; border-top: 2px solid var(--border);
  background: var(--surface);
}
.v360-bottom-resize-handle {
  height: 4px; cursor: ns-resize; background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.v360-bottom-resize-handle:hover { background: var(--v-purple); }
.v360-bottom-resize-handle::after {
  content: ''; width: 32px; height: 2px;
  background: var(--border); border-radius: 2px;
}
.v360-bottom-strip {
  display: flex; gap: 1px; background: var(--border);
  overflow-y: auto; height: 160px; min-height: 80px; max-height: 40vh;
}
.v360-mini-card {
  flex: 1; background: var(--surface); padding: 10px 14px;
  overflow-y: auto;
}
.v360-top-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.v360-top-row:last-child { margin-bottom: 0; }
.v360-top-name {
  font-size: 11px; font-weight: 500; color: var(--text);
  min-width: 100px; max-width: 140px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.v360-top-bar-wrap {
  flex: 1; height: 6px; background: var(--surface3);
  border-radius: 3px; overflow: hidden;
}
.v360-top-bar { height: 100%; border-radius: 3px; transition: width .4s; }
.v360-top-bar--purple { background: var(--v-purple); }
.v360-top-bar--blue   { background: var(--v-blue); }
.v360-top-bar--green  { background: var(--v-green); }
.v360-top-count { font-size: 11px; font-weight: 700; font-family: var(--mono); color: var(--text2); min-width: 24px; text-align: right; }

/* Wrapup badge in timeline */
.v360-badge--wrapup { background: rgba(13,148,136,.1); color: #0D9488; }

/* ── Sentiment bar in conv card ── */
.v360-sent-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px; font-size: 10px; font-weight: 500;
  color: var(--text3); border-top: 1px solid var(--border);
  background: var(--surface2); flex-wrap: wrap;
}
.v360-sent-chip {
  font-size: 10px; font-weight: 700; padding: 1px 7px;
  border-radius: 10px; white-space: nowrap;
}
.v360-sent-pos { background: rgba(22,163,74,.1);  color: #16A34A; }
.v360-sent-neu { background: rgba(100,116,139,.1); color: #64748B; }
.v360-sent-neg { background: rgba(220,38,38,.1);  color: #DC2626; }
.v360-sent-empathy {
  margin-left: auto; font-size: 10px; color: var(--text3);
  font-family: var(--mono);
}

/* ── Top stats strip (after KPI) ── */
.v360-top-strip {
  display: flex; align-items: flex-start; gap: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 20px; flex-shrink: 0;
}
.v360-top-sep {
  width: 1px; background: var(--border); align-self: stretch; margin: 0 20px;
}
.v360-top-block {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px;
}
.v360-top-block-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text3);
  display: flex; align-items: center; gap: 5px; margin-bottom: 4px;
}
.v360-top-rows { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.v360-top-row {
  display: flex; align-items: center; gap: 6px;
  min-width: 140px; margin-bottom: 3px;
}
.v360-top-name {
  font-size: 11px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 80px; max-width: 160px; flex-shrink: 0;
}
.v360-top-bar-wrap {
  flex: 1; height: 5px; background: var(--surface3);
  border-radius: 3px; overflow: hidden; min-width: 40px;
}
.v360-top-bar { height: 100%; border-radius: 3px; }
.v360-top-bar--purple { background: var(--v-purple); }
.v360-top-bar--blue   { background: var(--v-blue); }
.v360-top-bar--green  { background: var(--v-green); }
.v360-top-count {
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  color: var(--text2); min-width: 22px; text-align: right; flex-shrink: 0;
}
