/* Agent tab: Conversations (UI 6B), in the agent screens' look. Prefix cv-. */

/* ---------- search and filters ---------- */
.cv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.cv-search {
  position: relative;
  flex: 0 1 320px;
  min-width: 0;
}
.cv-search__icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--ag-muted);
  pointer-events: none;
}
.ap .cv-search__input {
  width: 100%;
  padding-inline-start: 36px;
}
.cv-search__input::-webkit-search-cancel-button {
  cursor: pointer;
}
.cv-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ap .cv-filter {
  width: auto;
  gap: 8px;
}
.cv-filter .select-trigger__value {
  gap: 5px;
}
.cv-filter__prefix {
  color: var(--ag-muted);
}

/* ---------- the list ---------- */
/* the frame reaches 12px past the section's edge on each side, so the cells keep
   their padding and the text still lines up with the search above */
.cv-frame {
  position: relative;
  overflow-x: auto;
  margin: 16px -12px 0;
}
.cv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  color: var(--ag-ink);
}
.cv-table th {
  padding: 0 12px 10px;
  text-align: start;
  font-size: 13px;
  font-weight: 500;
  color: var(--ag-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--ag-line);
}
.cv-table td {
  padding: 14px 12px;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--ag-line);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.cv-row:last-child td {
  border-bottom-color: transparent;
}

/* hover: a flat full-width highlight (no radius, 3 Oct 2026); the hairlines above and below it step aside */
.cv-row {
  cursor: pointer;
}
.cv-row:hover td {
  background: var(--ag-hover);
  border-bottom-color: transparent;
}
.cv-row:has(+ .cv-row:hover) td {
  border-bottom-color: transparent;
}
/* the open arrow shows on hover and on keyboard focus */
.cv-go-col,
.cv-table td.cv-go {
  width: 1%;
  padding-inline: 4px 12px;
}
.cv-go svg {
  display: block;
  color: var(--ag-faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, color 0.12s ease;
}
.cv-row:hover .cv-go svg,
.cv-row:focus-within .cv-go svg {
  opacity: 1;
  transform: none;
  color: var(--ag-ink);
}
/* Arabic: the chevron points left and slides in from the right */
[dir="rtl"] .cv-go svg {
  transform: scaleX(-1) translateX(-4px);
}
[dir="rtl"] .cv-row:hover .cv-go svg,
[dir="rtl"] .cv-row:focus-within .cv-go svg {
  transform: scaleX(-1);
}
.cv-row:focus-within td {
  background: var(--ag-hover);
}
.cv-open {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border-radius: 4px;
  text-underline-offset: 4px;
}
.cv-open:hover {
  text-decoration: underline;
}
.cv-mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cv-num {
  font-variant-numeric: tabular-nums;
}
.cv-table td.cv-reason {
  min-width: 160px;
  white-space: normal;
}
.cv-none td {
  height: 112px;
  text-align: center;
  color: var(--ag-muted);
  white-space: normal;
}
.cv-foot {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ag-muted);
}

/* channel: the coloured disc (as in Basics) and its word */
.cv-channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.cv-dot {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.cv-dot svg {
  width: 11px;
  height: 11px;
}
.cv-dot--phone {
  background: var(--ag-phone-bg);
  color: var(--ag-phone-ink);
}
.cv-dot--whatsapp {
  background: var(--ag-whatsapp-bg);
  color: var(--ag-whatsapp-ink);
}
.cv-dot__cut {
  fill: var(--ag-whatsapp-cut);
}

/* rules passed, and a quiet tag when one failed (colour on the dot only) */
.cv-rules {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cv-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--ag-line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ag-ink);
}
.cv-tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}
.cv-tag__dot--warning {
  background: var(--ag-test);
}
.cv-tag__dot--flagged {
  background: var(--ag-red);
}

/* ---------- no conversations yet ---------- */
.cv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 48px 24px;
  text-align: center;
  border-radius: 12px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
}
.cv-empty__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--ag-hover);
  color: var(--ag-ink-2);
}
.cv-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ag-ink);
}
.cv-empty__text {
  max-width: 380px;
  font-size: 14px;
  color: var(--ag-muted);
}

/* ---------- one conversation (drawer) ---------- */
.cv-drawer .drawer__body {
  gap: 0;
}
.cv-d {
  display: flex;
  flex-direction: column;
}
.cv-d__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.cv-d__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
  font-size: 14px;
}
.cv-d__meta > div {
  display: flex;
  gap: 4px;
}
.cv-d__meta dt {
  color: var(--ag-muted);
}
.cv-d__meta dd {
  font-weight: 500;
}
.cv-d__block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--ag-line);
}
.cv-d__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cv-d__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ag-ink);
}
.cv-d__count {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.cv-d__text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ag-ink-2);
}

/* Insights: question, then the answer at the end */
.cv-insights {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding: 4px 14px;
  border-radius: 12px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
}
.cv-insights__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 14px;
}
.cv-insights__row + .cv-insights__row {
  border-top: 1px solid var(--ag-line);
}
.cv-insights dt {
  color: var(--ag-muted);
}
.cv-insights dd {
  flex: none;
  max-width: 50%;
  text-align: end;
  font-weight: 500;
}

/* rules */
.cv-rulelist {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.cv-rule {
  display: flex;
  gap: 10px;
  padding: 10px 0;
}
.cv-rule + .cv-rule {
  border-top: 1px solid var(--ag-line);
}
.cv-rule__icon,
.cv-event__icon {
  flex: none;
  width: 16px;
  height: 16px;
}
.cv-rule__icon {
  margin-top: 2px;
}
.cv-rule__icon--ok,
.cv-event__icon--ok {
  color: var(--ag-live);
}
.cv-rule__icon--fail,
.cv-event__icon--fail {
  color: var(--ag-red);
}
.cv-rule__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cv-rule__name {
  font-size: 14px;
  font-weight: 500;
}
.cv-rule__note {
  font-size: 13px;
  color: var(--ag-muted);
}
.cv-rule__sev {
  margin-top: 2px;
}

/* transcript */
.ap-skin .cv-download {
  height: 34px;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
}
.cv-download svg {
  width: 15px;
  height: 15px;
}
.cv-transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.cv-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 85%;
}
.cv-msg--caller {
  align-self: flex-end;
  align-items: flex-end;
}
.cv-msg__who {
  display: flex;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ag-ink-2);
}
.cv-msg__timing {
  font-weight: 400;
  color: var(--ag-muted);
  font-variant-numeric: tabular-nums;
}
.cv-msg__bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
  color: var(--ag-ink);
}
.cv-msg--caller .cv-msg__bubble {
  background: var(--ag-dark);
  border-color: var(--ag-dark);
  color: var(--ag-dark-ink);
}
.cv-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px dashed var(--ag-btn-line);
  border-radius: 10px;
  font-size: 14px;
}
.cv-event__name {
  font-weight: 500;
}
.cv-event__detail {
  color: var(--ag-muted);
}

@media (max-width: 767px) {
  .cv-search {
    flex-basis: 100%;
  }
}
