/* ============================================================
   CRM · Gerencia General de Ventas — Fiat Venezuela
   vista-ficha.css · Estilos exclusivos de la vista «Ficha del prospecto»
   Todas las reglas van prefijadas con .v-ficha
   ============================================================ */

.v-ficha { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------------- Migas y navegación entre fichas ---------------- */
.v-ficha__migas { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.v-ficha__migas-espacio { flex: 1 1 auto; }
.v-ficha__migas-pos { white-space: nowrap; }

/* ---------------- Encabezado ---------------- */
.v-ficha__cab { overflow: hidden; }
.v-ficha__cab-fila {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px;
  padding: 16px; min-width: 0;
}
.v-ficha__ident { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 320px; min-width: 0; }
.v-ficha__ident-txt { min-width: 0; }
.v-ficha__nombre { font-size: 19px; font-weight: 700; letter-spacing: -.25px; line-height: 1.25; }
.v-ficha__sub { font-size: 12.5px; color: var(--suave); margin-top: 2px; overflow-wrap: anywhere; }
.v-ficha__chips { margin-top: 8px; }

.v-ficha__puntaje { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.v-ficha__donut { width: 58px; height: 58px; flex: 0 0 58px; }
.v-ficha__puntaje-txt { display: flex; flex-direction: column; line-height: 1.3; }
.v-ficha__puntaje-rot {
  font-size: 10.5px; font-weight: 600; letter-spacing: .7px;
  text-transform: uppercase; color: var(--suave);
}
.v-ficha__puntaje-nota { font-size: 12px; color: var(--texto); font-weight: 600; text-transform: capitalize; }

.v-ficha__controles { display: flex; gap: 10px; flex: 1 1 320px; min-width: 0; }
.v-ficha__controles .campo { flex: 1 1 150px; min-width: 0; }

/* ---------------- Barra del flujo de venta ---------------- */
.v-ficha__flujo {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--linea); background: #FBFCFD;
}
.v-ficha__pasos { display: flex; gap: 6px; flex: 1 1 260px; min-width: 0; }
.v-ficha__paso { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.v-ficha__paso-barra { display: block; height: 6px; border-radius: 999px; background: #E4EAF1; }
.v-ficha__paso-txt {
  font-size: 10.5px; color: var(--suave); letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v-ficha__paso.es-actual .v-ficha__paso-txt { color: var(--texto); font-weight: 700; }
.v-ficha__flujo-fin { flex: 0 0 auto; }
.v-ficha__motivo {
  padding: 0 16px 14px; font-size: 12.5px; color: var(--suave);
}
.v-ficha__motivo strong { color: var(--peligro); }

/* ---------------- Rejilla de tres columnas ---------------- */
.v-ficha__grid {
  display: grid; gap: 14px; align-items: start; min-width: 0;
  grid-template-columns: 264px minmax(0, 1fr) 292px;
  grid-template-areas: "izq centro der";
}
.v-ficha__zona { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.v-ficha__zona--izq { grid-area: izq; }
.v-ficha__zona--centro { grid-area: centro; }
.v-ficha__zona--der { grid-area: der; }

/* ---------------- Fichas de datos (columna izquierda) ---------------- */
.v-ficha__datos { padding: 10px 16px 14px; }
.v-ficha__dato {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 8px;
  padding: 9px 0; border-bottom: 1px dashed var(--linea);
}
.v-ficha__dato:last-child { border-bottom: 0; padding-bottom: 0; }
.v-ficha__dato-ic { grid-row: 1 / 3; color: var(--cyan); padding-top: 2px; }
.v-ficha__dato-ic svg { width: 17px; height: 17px; }
.v-ficha__dato-rot {
  font-size: 10px; font-weight: 600; letter-spacing: .7px;
  text-transform: uppercase; color: var(--suave);
}
.v-ficha__dato-val { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.v-ficha__val-fuerte { font-weight: 600; color: var(--texto); }
.v-ficha__correo { overflow-wrap: anywhere; }
.v-ficha__mini { margin-left: auto; }

.v-ficha__valor {
  margin-top: 12px; padding: 11px 12px; border-radius: var(--radio-sm);
  background: rgba(0, 54, 95, .05); display: flex; flex-direction: column; gap: 2px;
}
.v-ficha__valor-rot {
  font-size: 10px; font-weight: 600; letter-spacing: .7px;
  text-transform: uppercase; color: var(--suave);
}
.v-ficha__valor-num {
  font-size: 20px; font-weight: 700; color: var(--marca);
  letter-spacing: -.4px; font-variant-numeric: tabular-nums;
}
.v-ficha__valor-nota { font-size: 11px; color: var(--suave); }

/* ---------------- Compositor ---------------- */
.v-ficha__cab-ic { color: var(--cyan); flex: 0 0 18px; }
.v-ficha__cab-ic svg { width: 18px; height: 18px; }

.v-ficha__form { display: flex; flex-direction: column; gap: 12px; }
.v-ficha__form-fila { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.v-ficha__asunto[hidden] { display: none; }
.v-ficha__mensaje { min-height: 132px; font-size: 12.5px; line-height: 1.55; }
.v-ficha__form-pie { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.v-ficha__aviso-cerrado {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radio-sm);
  background: rgba(224, 140, 27, .12); color: #96600D; font-size: 12px;
}
.v-ficha__aviso-cerrado svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }

/* ---------------- Línea de tiempo ---------------- */
.v-ficha__linea { position: relative; display: flex; flex-direction: column; gap: 4px; }
.v-ficha__linea::before {
  content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px;
  width: 2px; background: var(--linea); border-radius: 2px;
}
.v-ficha__dia {
  position: relative; z-index: 1; margin: 10px 0 6px 44px;
}
.v-ficha__dia:first-child { margin-top: 0; }
.v-ficha__dia span {
  display: inline-block; background: #EEF2F7; color: #41546A;
  font-size: 10.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 10px; border-radius: 999px;
}
.v-ficha__ev { position: relative; display: flex; gap: 12px; padding: 4px 0 12px; min-width: 0; }
.v-ficha__ev:last-child { padding-bottom: 0; }
.v-ficha__ev:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

.v-ficha__ev-ic {
  position: relative; z-index: 1; flex: 0 0 32px; width: 32px; height: 32px;
  border-radius: 50%; background: var(--panel); border: 1px solid var(--linea);
  color: var(--marca); display: inline-flex; align-items: center; justify-content: center;
}
.v-ficha__ev-ic svg { width: 16px; height: 16px; }
.v-ficha__ev--recibido .v-ficha__ev-ic { color: var(--cyan); border-color: rgba(0, 141, 212, .4); background: rgba(0, 141, 212, .07); }
.v-ficha__ev-flecha {
  position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--marca); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.v-ficha__ev-flecha svg { width: 10px; height: 10px; }
.v-ficha__ev--recibido .v-ficha__ev-flecha { background: var(--cyan); }

.v-ficha__ev-cuerpo {
  flex: 1 1 auto; min-width: 0; padding: 8px 12px 10px;
  border: 1px solid var(--linea); border-radius: var(--radio-sm); background: var(--panel);
}
.v-ficha__ev--recibido .v-ficha__ev-cuerpo { background: #F7FBFE; border-color: #D8E9F5; }
.v-ficha__ev--nuevo .v-ficha__ev-cuerpo { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(47, 158, 91, .14); }

.v-ficha__ev-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.v-ficha__ev-titulo { font-size: 12.5px; font-weight: 700; color: var(--texto); }
.v-ficha__ev-fecha { margin-left: auto; font-size: 11px; color: var(--suave); white-space: nowrap; }
.v-ficha__ev-nota { margin-top: 5px; font-size: 12.5px; color: var(--texto); overflow-wrap: anywhere; }
.v-ficha__ev-pie {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px;
  font-size: 11px; color: var(--suave); min-width: 0;
}
.v-ficha__ev-sep { color: #C2CDDA; }

.v-ficha__msj { margin-top: 8px; }
.v-ficha__msj > summary {
  cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--cyan);
  list-style: none; display: inline-flex; align-items: center; gap: 5px;
}
.v-ficha__msj > summary::-webkit-details-marker { display: none; }
.v-ficha__msj > summary::before {
  content: ""; width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .14s ease;
}
.v-ficha__msj[open] > summary::before { transform: rotate(90deg); }
.v-ficha__msj > summary:hover { text-decoration: underline; }
.v-ficha__msj-txt {
  margin-top: 7px; padding: 10px 12px; border-radius: var(--radio-sm);
  background: #F6F8FB; border: 1px solid var(--linea);
  font-size: 12px; line-height: 1.6; color: #33445A;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.v-ficha__msj-asunto { font-weight: 700; color: var(--texto); margin-bottom: 6px; }

/* ---------------- Próxima acción ---------------- */
.v-ficha__proxima-cab { display: flex; align-items: center; gap: 10px; }
.v-ficha__proxima-ic {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: var(--radio-sm);
  background: rgba(0, 54, 95, .07); color: var(--marca);
  display: inline-flex; align-items: center; justify-content: center;
}
.v-ficha__proxima-ic svg { width: 18px; height: 18px; }
.v-ficha__proxima-canal { font-size: 13px; font-weight: 700; }
.v-ficha__proxima-fecha { font-size: 11.5px; color: var(--suave); }
.v-ficha__proxima-aviso {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 11.5px; font-weight: 600; color: var(--suave);
}
.v-ficha__proxima-aviso svg { width: 15px; height: 15px; flex: 0 0 15px; }
.v-ficha__proxima-nota { margin-top: 8px; font-size: 12.5px; color: var(--texto); overflow-wrap: anywhere; }

.v-ficha__proxima--vencida { border-color: rgba(192, 57, 43, .45); }
.v-ficha__proxima--vencida .v-ficha__proxima-ic { background: rgba(192, 57, 43, .1); color: var(--peligro); }
.v-ficha__proxima--vencida .v-ficha__proxima-aviso { color: var(--peligro); }
.v-ficha__proxima--hoy .v-ficha__proxima-ic { background: rgba(224, 140, 27, .14); color: #96600D; }
.v-ficha__proxima--hoy .v-ficha__proxima-aviso { color: #96600D; }

.v-ficha__sin-accion {
  display: flex; align-items: center; gap: 10px; color: var(--suave); font-size: 12.5px;
}
.v-ficha__sin-accion svg { width: 22px; height: 22px; flex: 0 0 22px; color: #B6C3D2; }
.v-ficha__pie-botones { display: flex; flex-wrap: wrap; gap: 8px; }
.v-ficha__pie-botones .btn { flex: 1 1 auto; }

/* ---------------- Cierre ---------------- */
.v-ficha__cierre-ayuda { font-size: 12.5px; color: var(--suave); }
.v-ficha__cierre-valor { margin-top: 10px; font-size: 12.5px; }
.v-ficha__cierre-valor strong { color: var(--marca); font-variant-numeric: tabular-nums; }
.v-ficha__cierre-res { display: flex; align-items: flex-start; gap: 10px; }
.v-ficha__cierre-res svg { width: 26px; height: 26px; flex: 0 0 26px; }
.v-ficha__cierre-res--ok svg { color: var(--ok); }
.v-ficha__cierre-res--mal svg { color: var(--peligro); }
.v-ficha__cierre-tit { font-size: 13.5px; font-weight: 700; }
.v-ficha__cierre-txt { font-size: 12.5px; color: var(--suave); margin-top: 2px; overflow-wrap: anywhere; }
.v-ficha__btn-ganar { background: var(--ok); color: #fff; }
.v-ficha__btn-ganar:hover { background: #26824A; }

/* ---------------- Actividad por canal ---------------- */
.v-ficha__barras { width: 100%; height: auto; }
.v-ficha__leyenda {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px;
  font-size: 11px; color: var(--suave);
}
.v-ficha__leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.v-ficha__leyenda i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------------- Formularios dentro de las ventanas ---------------- */
.v-ficha__form-modal { display: flex; flex-direction: column; gap: 12px; }
.v-ficha__resumen-cierre {
  padding: 11px 12px; border-radius: var(--radio-sm);
  background: #F6F8FB; border: 1px solid var(--linea);
}
.v-ficha__resumen-tit { font-size: 13.5px; font-weight: 700; }
.v-ficha__resumen-txt { font-size: 12px; color: var(--suave); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------------- Adaptación ---------------- */
@media (max-width: 1180px) {
  .v-ficha__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "centro centro" "izq der";
  }
}
@media (max-width: 900px) {
  .v-ficha__controles { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  .v-ficha__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "centro" "der" "izq";
  }
  .v-ficha__cab-fila { padding: 14px; gap: 12px; }
  .v-ficha__puntaje { order: -1; }
  .v-ficha__paso-txt { display: none; }
  .v-ficha__ev-fecha { margin-left: 0; }
  .v-ficha__mini { margin-left: 0; }
}
@media (max-width: 420px) {
  .v-ficha__nombre { font-size: 17px; }
  .v-ficha__ident { gap: 10px; }
  .v-ficha__ev { gap: 8px; }
  .v-ficha__ev-cuerpo { padding: 8px 10px 10px; }
  .v-ficha__migas .btn { flex: 1 1 auto; }
}
